« Back to channel list

#ruby - 12 August 2015

« Back 1 day Forward 1 day »
[00:00:47] senoralastair: BraddPitt: ahh. that looks like it's what I'm after
[00:01:23] senoralastair: shevy: is that Object#send you're talking about? I've just pulled up the docs on it. I've read about it briefly before, but have not yet had a chance to use & learn it
[00:01:59] shevy: senoralastair if there is an attr-method for it yes
[00:02:11] dorei: Aeyrix: how about using an ensure block ?
[00:02:27] shevy: >> class Foo; attr :foo; def initialize; @foo = 42; end; end; foo = Foo.new; foo.send :foo
[00:02:28] ruboto: shevy # => 42 (https://eval.in/415504)
[00:02:32] Aeyrix: dorei: I believe trying that caused the application to hang. I'll give it a shot.
[00:02:49] shevy: senoralastair note that in the last case, the foo.send :foo could become: foo.send your_variable_here.to_sym
[00:03:13] shevy: in your case what you had stored in the array = [ 'name', 'age' ]
[00:03:25] shevy: btw you can write it shorter as: array = %w( name age )
[00:03:28] senoralastair: shevy: ahhhh. that's really cool.
[00:03:45] shevy: you can also use .instance_variable_get() I think
[00:03:49] shevy: but I love .send
[00:04:48] senoralastair: shevy: Yeah, both options look like they'll fit the bill. I'll document both in my notes and I'm sure they'll both be really handy to know. I think I've come across 2 instances in the last 2 days where I could use one of these two. :-)
[00:06:30] Burgestr_: Aeyrix: you found yourself a nice little problem there.
[00:06:41] chipotle: has joined #ruby
[00:06:46] Aeyrix: Burgestr_: yeah
[00:06:54] Burgestr_: Aeyrix: if I've read everything correct you cannot unlink the file in your response block at all, because the file is not really read before your block finishes.
[00:07:19] shevy: senoralastair \o/ it may become much cooler lateron when you generate some methods dynamically
[00:07:38] drbrain: Burgestrand: I think only on windows
[00:07:44] northfurr: has joined #ruby
[00:08:33] burgestrand: drbrain: I haven't seen anything platform-specific in either Sinatra::Base#send_file or Rack::File
[00:08:40] Aeyrix: It's not platform-specific.
[00:08:42] Aeyrix: This happens on Unix.
[00:08:51] Aeyrix: I run it on Debian, and test it on OS X.
[00:08:53] bluOxigen: has joined #ruby
[00:08:55] drbrain: Aeyrix: this should use Tempfile with a block to avoid leaving file descriptors around if there are exceptions
[00:10:37] RegulationD: has joined #ruby
[00:10:56] burgestrand: To me it looks like Rack::File simply responds to #each, and opens the file once the underlying rack handler starts reading the response (which could happen at some arbitrary time later).
[00:11:00] drbrain: Aeyrix: yeah, use Tempfile with a block to get #42 to execute
[00:11:01] senoralastair: shevy: Yeah. I'm at the beginning of my ruby journey, but really enjoying how cool it is. Now that you've reminded me, I think it was in dynamic methods that I had read about send()
[00:11:10] drbrain: it calls #unlink for you in an ensure
[00:11:13] Aeyrix: drbrain: Rewrote
[00:11:24] Aeyrix: drbrain, Burgestrand: https://gist.github.com/Aeyrix/4445db5773226a3e3f36
[00:12:07] shevy: senoralastair yeah, just keep things simple until you really got the simple parts all right, moving to more complex things will be much easier then
[00:13:03] shevy: typically for dynamic methods, one uses things such as self.instance_eval {} or .class_eval {}, and even more importantly so, define_method() {}
[00:13:18] drbrain: Aeyrix: I would write `Tempfile.open(???) do |temp_file| ??? send_file ??? end`, but adding the ensure is the same
[00:13:29] shevy: I don't use it in many of my projects... perhaps only ~4%
[00:13:31] Aeyrix: good point
[00:16:51] Ropeney: has joined #ruby
[00:17:32] drbrain: too bad send_file doesn't accept an fd
[00:17:55] kies: has joined #ruby
[00:18:08] burgestrand: Aeyrix: keep in mind that Tempfile.open will only unlink the tempfile after ruby garbage collects the Tempfile object, which may or may not happen reasonably soon.
[00:19:02] burgestrand: i.e. File.exist?(Tempfile.open("some-prefix") { |io| io.path }) # => true
[00:19:39] northfurr: has joined #ruby
[00:19:58] NeverDie: has joined #ruby
[00:20:48] burgestrand: Aeyrix: there's http://www.rubydoc.info/github/rack/rack/Rack/TempfileReaper middleware available with Rack in case you want to make sure files are removed from the filesystem as soon as Rack are done with them.
[00:21:02] dr3w: has joined #ruby
[00:21:33] Aeyrix: Ah yeah, I forgot while I did that
[00:21:36] burgestrand: drbrain: I still haven't found any windows-specific thing in here, would you happen to know where that code would reside? Is it inside Rack?
[00:21:37] Aeyrix: Burgestrand: Basically
[00:21:42] Aeyrix: I'm writing to a temp-file
[00:21:44] Aeyrix: on the fly
[00:21:45] Aeyrix: as you can see
[00:21:51] Aeyrix: which means I need to call @temp_file.close
[00:21:54] Aeyrix: in order to flush that to disk
[00:21:57] Aeyrix: BEFORE I send_file
[00:22:05] burgestrand: Aeyrix: yeah, that's OK.
[00:22:09] Aeyrix: I can do that in-block?
[00:22:09] drbrain: Aeyrix: call @temp_file.flush
[00:22:14] drbrain: then close! in ensure
[00:22:18] Musashi007: has joined #ruby
[00:22:20] Aeyrix: why don't I find this shit
[00:22:36] drbrain: it's over on IO/File (because delegate)
[00:24:12] Aeyrix: drbrain: Still not clearing. :\
[00:24:25] advorak: has joined #ruby
[00:24:30] Aeyrix: https://gist.github.com/Aeyrix/4445db5773226a3e3f36
[00:24:45] Aeyrix: Ignore line 16, I used that to get the folder dir to check clearing on OS X
[00:25:14] burgestrand: Aeyrix: this is because of what I just wrote, it won't unlink the file, it will only close it.
[00:25:26] drbrain: Aeyrix: as Burgestrand pointed out, you'll want to close! in an ensure after send_file
[00:25:39] burgestrand: drbrain: ??? :(
[00:25:39] Aeyrix: Burgestrand: But terminating the process would call garbage collection, right?
[00:25:44] sdwrage: has joined #ruby
[00:25:54] burgestrand: Aeyrix: terminating it cleanly, sure.
[00:25:59] Aeyrix: Burgestrand: SIGQUIT, not SIGKILL
[00:26:01] Aeyrix: Burgestrand: It doesn't.
[00:26:06] Aeyrix: Those files are still there after being terminated.
[00:26:31] drbrain: (I prefer libraries that let me hand an fd over since I can unlink from the start)
[00:26:41] Aeyrix: Sorry, SIGINT, not SIGQUIT.
[00:26:53] failshell: has joined #ruby
[00:27:13] Aeyrix: Yep, confirmed still there.
[00:27:16] burgestrand: I feel like half of what I'm saying is gone out the window.
[00:27:26] Aeyrix: Your recommendation is the Reaper middleware then?
[00:27:45] Aeyrix: I was hoping I wouldn't need to fit forty parts together to get a simple file drop working with Sinatra tbh.
[00:28:03] burgestrand: Aeyrix: from what I can read in the sinatra/rack source, it's the *only* solution because you're using send_file, unless you want to hand-roll it.
[00:28:24] burgestrand: I'll verify it, give me a minute or two.
[00:29:34] Inside: has left #ruby: ("Leaving")
[00:30:45] drbrain: Tempfile.open(???) do |temp_file| begin ??? send_file ??? ensure temp_file.close! end end
[00:30:51] Aeyrix: drbrain: That was my original code.
[00:31:00] Aeyrix: It won't work because of the way Sinatra is delegating responses.
[00:31:38] drbrain: Sinatra can't skip an ensure
[00:31:49] drbrain: https://gitlab.com/Aeyrix/Crate/blob/master/app/crate.rb#L42 doesn't show the ensure
[00:31:51] alfajor: has joined #ruby
[00:31:53] darix: drbrain: wouldnt the block close tempfile anyway?
[00:32:05] Aeyrix: It closes it, but doesn't unlink it.
[00:32:13] Aeyrix: Unless you do temp_file.close(true)
[00:32:13] drbrain: darix: no, Burgestrand pointed out that it only unlinks during GC
[00:32:26] hashrocket: has joined #ruby
[00:32:29] Aeyrix: But I confirmed that the GC isn't clearing these tempfiles.
[00:32:34] Aeyrix: w e i r d
[00:33:00] burgestrand: Tempfile.open() {} will close the file, but won't unlink it. Once the object is garbage collected, the finalizer will unlink it. I'm not positive that it will be GCd on process exit.
[00:33:03] darix: drbrain: seems weird
[00:33:39] drbrain: darix: yeah, which is why it would be nice if you could hand send_file an opened IO
[00:34:04] Aeyrix: That's what I wanted to try instead.
[00:34:12] Aeyrix: It's a base64 encoded file unless it's text.
[00:34:15] Aeyrix: Then it's, well, just text.
[00:34:31] Aeyrix: Oh wait I changed that, it's always b64.
[00:34:32] drbrain: then you could Tempfile.open do |temp_file| temp_file.unlink; ???; send_file temp_file end
[00:34:35] allcentury: has joined #ruby
[00:34:37] darix: lighty has x-send-tempfile
[00:34:49] darix: then you could leave it to the webserver
[00:35:01] Aeyrix: People still use that in good conscience?
[00:35:02] jenrzzz: has joined #ruby
[00:35:08] luckyme: has joined #ruby
[00:35:18] darix: Aeyrix: we even still develop it!
[00:35:50] darix: because we can
[00:35:59] Aeyrix: Fair enough I guess.
[00:36:23] darix: and lighty 2 has a few really nice features
[00:36:28] darix: like vhost map
[00:36:52] bronson: has joined #ruby
[00:37:11] shakes: has joined #ruby
[00:37:48] lampshades: has joined #ruby
[00:37:51] monoprotic: has joined #ruby
[00:38:00] hotpancakes: has joined #ruby
[00:38:54] Oog: has joined #ruby
[00:38:59] burgestrand: Aeyrix: alright, I've verified it, at least on my machine (Mac OS), if you unlink the file *anywhere* in your response handler block, the downloaded file will be empty.
[00:39:26] burgestrand: Aeyrix: in short, you cannot unlink the file right then and there, you must use the Reaper.
[00:39:30] omegamike: has joined #ruby
[00:39:40] darix: Burgestrand: is send_file using the x-sendfile feature ?
[00:40:10] lampshade: has joined #ruby
[00:40:10] nofxx: has joined #ruby
[00:40:10] nofxx: has joined #ruby
[00:40:13] lady_valenz: has joined #ruby
[00:40:25] darix: X-Accel* in nginx
[00:40:55] rehat: has joined #ruby
[00:41:03] Rixius: has joined #ruby
[00:41:06] burgestrand: Aeyrix: the Reaper sounds scarier than what it is. The rack specification says that if the response body responds to #close, it will be called. The reaper exploits this by sending a "fake" body, that delegates to the real body, except when #close is called on this fake body it will unlink all tempfiles it knows about. This happens once the client has downloaded the response.
[00:41:46] burgestrand: darix: I haven't seen anything related to it in the quick view of the source I took just now. I recall there's a special middleware for using X-Sendfile though.
[00:41:55] michael_mbp: has joined #ruby
[00:42:18] darix: Burgestrand: in that case the close might be called too early
[00:43:03] burgestrand: Yeah, assuming the underlying webserver supports X-Sendfile, I wonder if #close is still called.
[00:43:04] darix: nginx seems not support x-send-tempfile
[00:43:11] snockerton: has joined #ruby
[00:43:28] burgestrand: darix: here's the relevant code comment: https://github.com/rack/rack/blob/master/lib/rack/sendfile.rb#L8
[00:44:40] yxhuvud: has joined #ruby
[00:45:24] darix: just a quick shot suggestion
[00:46:04] darix: register a clean up job for the file into a sidekiq (or your favorite queue handler of choice) and cleanup like 5 minutes later?
[00:46:56] Aeyrix: i just got it working out of memory
[00:46:57] Aeyrix: no temp files
[00:47:28] burgestrand: Since it's a tempfile, it should be fairly safe with just best-effort since it'll be cleaned up by the OS eventually
[00:47:49] darix: Burgestrand: as long as we dont get cleaned up too early
[00:47:56] Aeyrix: It'll never be cleaned up too early.
[00:48:11] Aeyrix: But I actually just got it working without writing to disk at all.
[00:48:12] darix: and yes using x-sendfile is preferred over piping it through the fastcgi/http connection
[00:48:20] Aeyrix: darix: It's stored in redis.
[00:48:21] ght: ayyy lmao
[00:48:24] Aeyrix: In base64
[00:48:27] Aeyrix: because there's a file size limit
[00:48:31] darix: Aeyrix: using nginx?
[00:48:35] Aeyrix: (i know, "dude storing files in the db lmao")
[00:48:38] Aeyrix: nginx + puma
[00:48:54] Aeyrix: it's mostly for my shitty screenshots
[00:48:57] darix: there is http://wiki.nginx.org/HttpRedis
[00:49:09] Aeyrix: darix: But that won't handle uploads + authentication
[00:49:18] Aeyrix: well, i could do it all with nginx actually
[00:49:27] darix: but you can check redis before hitting the app for GET
[00:50:24] Aeyrix: fucking hell
[00:50:28] Aeyrix: DigitalOcean have changed their UI again
[00:52:56] mleung: has joined #ruby
[00:53:47] zanloy: has joined #ruby
[00:54:41] Muhannad: has joined #ruby
[00:55:54] B1n4r10: has joined #ruby
[00:56:18] towski__: anyone here use carrierwave
[00:56:30] towski__: I am have a dickens of a time getting carrierwave + fog to upload a simple file to s3
[00:56:47] towski__: in fact the first suggestion for an alternate gem will probably win
[00:57:50] towski__: chuck it i'll use Aws::S3::Client
[00:58:06] towski__: stunt asp libraries
[00:59:27] Aeyrix: yo what was that wolf called in Norse mythology?
[00:59:39] Aeyrix: Well, and Skoll
[01:00:01] towski__: did you thank yourself
[01:00:14] Aeyrix: I also high fived myself and told me I owe me a coffee.
[01:00:21] towski__: the life of a programmer
[01:01:02] shevy: I t hought it was Fenris
[01:01:25] shevy: wikipedia disagrees with me :(
[01:01:27] Aeyrix: Fenrir and Skoll.
[01:01:34] shevy: skol isn't that a beer?
[01:03:43] burgestrand: towski__ an alternative to carrierwave is refile, but if all you need is a simple upload perhaps the aws-sdk is indeed a better fit. :)
[01:03:51] phutchins1: has joined #ruby
[01:05:18] towski__: I've already made more progress in 5 minutes with AWS than an hour with carrierwave
[01:05:23] _lovehandle_: has joined #ruby
[01:05:30] towski__: some libraries just get down and dirty
[01:05:56] Me: has joined #ruby
[01:06:26] Aria: Hehe, I did MUD occasionally, shevy, but never FaerieMUD
[01:06:55] MatthewsFace: has joined #ruby
[01:08:15] ivanf: has joined #ruby
[01:08:46] qubitz: has joined #ruby
[01:09:29] dr3w: has joined #ruby
[01:09:38] hotpancakes: has joined #ruby
[01:09:55] christiandsg: has joined #ruby
[01:11:17] swgillespie: has joined #ruby
[01:11:56] devoldmx: has joined #ruby
[01:15:13] michaeldeol: has joined #ruby
[01:15:32] Muhannad: has joined #ruby
[01:16:48] shevy: >> x = StringIO.new; x.instance_variables
[01:16:49] ruboto: shevy # => uninitialized constant StringIO (NameError) ...check link for more (https://eval.in/415505)
[01:16:54] shevy: >> require 'stringio';x = StringIO.new; x.instance_variables
[01:16:55] ruboto: shevy # => [] (https://eval.in/415506)
[01:17:01] shevy: ok no instance variables but...
[01:17:07] shevy: x.string works and stores stuff
[01:17:20] shevy: how do they do that? do they have a variable called @string?
[01:18:57] yh_: has joined #ruby
[01:20:01] lannonbr: has joined #ruby
[01:20:25] j4cknewt: has joined #ruby
[01:21:08] shred45: has joined #ruby
[01:23:01] shevy: ghost instance variables!
[01:23:12] poguez_: has joined #ruby
[01:31:35] swgillespie: has joined #ruby
[01:31:40] drbrain: shevy: it's not even an instance variable, just a field in a C struct: https://github.com/ruby/ruby/blob/trunk/ext/stringio/stringio.c#L24
[01:35:28] cibs: has joined #ruby
[01:41:27] NeverDie: has joined #ruby
[01:42:19] olivierrr: has joined #ruby
[01:45:30] shevy: stringio is pretty cool
[01:46:20] tkuchiki: has joined #ruby
[01:48:59] shevy: here you have output from puts
[01:49:02] shevy: and now you don't!
[01:49:07] shevy: it's like a toggle!
[01:49:30] saddad: has joined #ruby
[01:50:49] pocketprotector: has joined #ruby
[01:51:12] symm-: has joined #ruby
[01:51:16] NeverDie: has joined #ruby
[01:51:51] Oog: has joined #ruby
[01:53:25] tokik: has joined #ruby
[01:55:49] hotpancakes: has joined #ruby
[01:55:59] NeverDie: has joined #ruby
[01:57:15] Vile`: has joined #ruby
[01:57:40] willywos: has joined #ruby
[01:58:00] tkuchiki: has joined #ruby
[02:00:24] rbennacer: has joined #ruby
[02:01:21] advorak: has joined #ruby
[02:01:23] NeverDie: has joined #ruby
[02:01:48] tokik: has joined #ruby
[02:02:31] Musashi007: has joined #ruby
[02:05:31] devbug: has joined #ruby
[02:06:59] ramfjord: has joined #ruby
[02:07:55] northfurr: has joined #ruby
[02:08:53] arooni-mobile: has joined #ruby
[02:12:18] bricker: has joined #ruby
[02:12:48] devoldmx: has joined #ruby
[02:13:03] ValicekB: has joined #ruby
[02:14:26] hotpancakes: has joined #ruby
[02:14:39] bruno-: has joined #ruby
[02:18:24] Musashi007: has joined #ruby
[02:18:52] bronson: has joined #ruby
[02:19:25] auzty: has joined #ruby
[02:20:16] einarj: has joined #ruby
[02:20:21] mleung: has joined #ruby
[02:23:36] cscheib: has joined #ruby
[02:24:26] B1n4r10: has joined #ruby
[02:26:01] rickmasta: has joined #ruby
[02:26:26] dr3w: has joined #ruby
[02:27:20] omegamike: has joined #ruby
[02:31:32] Me: has joined #ruby
[02:32:08] Oog: has joined #ruby
[02:34:42] tubuliferous_: has joined #ruby
[02:37:11] dh64: has joined #ruby
[02:37:23] govg: has joined #ruby
[02:38:01] willywos: has joined #ruby
[02:38:26] michael_mbp: has joined #ruby
[02:39:13] blue_deref: has joined #ruby
[02:39:21] Quandl: has joined #ruby
[02:39:47] casadei: has joined #ruby
[02:41:42] autofsckk: has joined #ruby
[02:42:35] dr3w: has joined #ruby
[02:45:07] yfeldblum: has joined #ruby
[02:45:55] dented42: has joined #ruby
[02:47:23] VeganGreg: has left #ruby: ("WeeChat 1.2")
[02:49:09] iamninja: has joined #ruby
[02:51:50] nullwarp: has joined #ruby
[02:51:54] Seich: has joined #ruby
[02:53:34] josh3: has joined #ruby
[02:53:36] Me1: has joined #ruby
[02:54:07] kappy: has joined #ruby
[02:54:21] kalzz: has joined #ruby
[02:55:01] hotpancakes: has joined #ruby
[02:56:39] SuMo_D: has joined #ruby
[02:59:42] xaxisx_: has joined #ruby
[02:59:51] mleung: has joined #ruby
[02:59:53] nofxx: has joined #ruby
[03:03:53] choke: has joined #ruby
[03:05:11] baweaver: has joined #ruby
[03:07:30] northfurr: has joined #ruby
[03:09:05] dopie: has joined #ruby
[03:09:25] Oog: has joined #ruby
[03:09:40] pawnbox: has joined #ruby
[03:10:37] charliesome: has joined #ruby
[03:11:09] braincrash: has joined #ruby
[03:17:54] benlieb: has joined #ruby
[03:17:55] dented42: has joined #ruby
[03:18:56] bronson: has joined #ruby
[03:19:19] Me1: has joined #ruby
[03:20:06] darkf: has joined #ruby
[03:20:39] ramfjord: has joined #ruby
[03:21:30] n_blownapart: has joined #ruby
[03:21:43] Scripore: has joined #ruby
[03:22:36] havenwood: has joined #ruby
[03:22:43] saddad: has joined #ruby
[03:23:17] Rinzlit1: has joined #ruby
[03:23:39] postmodern: has joined #ruby
[03:24:08] jenrzzz: has joined #ruby
[03:27:19] Me1: has joined #ruby
[03:27:38] j4cknewt: has joined #ruby
[03:28:02] dimasg: has joined #ruby
[03:28:12] mclee: has joined #ruby
[03:29:24] ctalr: has joined #ruby
[03:29:42] Rubie: has joined #ruby
[03:30:24] Rubie: hi all: is anyone good with regular expressions and willing to help out?
[03:30:59] Rubie: i need everything after the first equal sign in a link like this: https://www.youtube.com/watch?v=WgcovIu3k9o&index=2&list=PL2E2889396A970B02
[03:31:23] Rubie: "WgcovIu3k9o&index=2&list=PL2E2889396A970B02"
[03:32:11] mary5030: has joined #ruby
[03:33:33] baweaver: has joined #ruby
[03:34:34] havenn: has joined #ruby
[03:34:52] RobertBirnie: has joined #ruby
[03:35:16] Oog: has joined #ruby
[03:37:16] Aeyrix: >no sevenseacat
[03:37:17] Aeyrix: what is today
[03:38:08] havenn: >> 'https://www.youtube.com/watch?v=WgcovIu3k9o&index=2&list=PL2E2889396A970B02'[/(?<==).*/]
[03:38:09] ruboto: havenn # => "WgcovIu3k9o&index=2&list=PL2E2889396A970B02" (https://eval.in/415536)
[03:38:21] NeverDie: has joined #ruby
[03:39:19] havenn: rubie: partition('=').last
[03:40:33] fedexo: has joined #ruby
[03:41:17] Rubie: havenn: im not sure i understand your solution
[03:41:29] tmtwd: has joined #ruby
[03:41:52] avahey: has joined #ruby
[03:42:00] havenn: rubie: The positive lookbehind Regexp or String#partition?
[03:42:08] hotpancakes: has joined #ruby
[03:42:18] deepu: has joined #ruby
[03:42:36] havenn: rubie: Or both?
[03:42:48] Me1: has joined #ruby
[03:43:11] kies: has joined #ruby
[03:43:15] havenn: >> '12=34=56'.partition '='
[03:43:16] ruboto: havenn # => ["12", "=", "34=56"] (https://eval.in/415537)
[03:43:22] havenn: >> '12=34=56'.rpartition '='
[03:43:23] ruboto: havenn # => ["12=34", "=", "56"] (https://eval.in/415538)
[03:43:27] havenn: ruboto: ^
[03:43:34] devoldmx: has joined #ruby
[03:44:01] havenn: rubie: From Regexp docs: (?<=pat) - Positive lookbehind assertion: ensures that the preceding characters match pat, but doesn't include those characters in the matched text
[03:44:07] Rubie: that should work thanks
[03:44:35] NeverDie: has joined #ruby
[03:44:56] havenn: >> 'https://www.youtube.com/watch?v=WgcovIu3k9o&index=2&list=PL2E2889396A970B02'[/=(.*)/, 1]
[03:44:57] ruboto: havenn # => "WgcovIu3k9o&index=2&list=PL2E2889396A970B02" (https://eval.in/415539)
[03:45:42] Me: has joined #ruby
[03:45:42] havenn: rubie: Or capture group. ^
[03:46:08] tubulife-: has joined #ruby
[03:46:21] Rubie: havenn: you're the worlds greatest
[03:47:30] havenn: >> s = 'https://www.youtube.com/watch?v=WgcovIu3k9o&index=2&list=PL2E2889396A970B02'; s[s.index('=').next..-1]
[03:47:31] ruboto: havenn # => "WgcovIu3k9o&index=2&list=PL2E2889396A970B02" (https://eval.in/415540)
[03:49:20] josh3: has joined #ruby
[03:50:36] hal_9000_: has joined #ruby
[03:51:12] hal_9000_: ANN: Hal Fulton and Johnny Winn are crowdfunding a book, _Elixir for the Functional Rubyist_
[03:51:16] hal_9000_: Please feel free to support this project! htp://igg.me/at/elixir4rubyists
[03:51:26] havenn: >> 'https://www.youtube.com/watch?v=WgcovIu3k9o&index=2&list=PL2E2889396A970B02'.sub /[^=]*./, ''
[03:51:26] ruboto: havenn # => "WgcovIu3k9o&index=2&list=PL2E2889396A970B02" (https://eval.in/415542)
[03:51:30] NeverDie: has joined #ruby
[03:52:02] rehat: has joined #ruby
[03:52:20] havenn: Hal_9000_: Front of your link got cut off.
[03:52:58] havenn: https://www.indiegogo.com/projects/elixir-for-the-functional-rubyist
[03:53:04] havenn: Hal_9000_: One of the t's rather.
[03:53:16] hal_9000_: well, darn. left off a t? http://igg.me/at/elixir4rubyists
[03:53:23] hal_9000_: yes, thanks
[03:53:37] havenn: Hal_9000_: <3 Elixir :)
[03:53:50] lxsameer: has joined #ruby
[03:53:50] lxsameer: has joined #ruby
[03:53:56] rehat: Having trouble reading ruby docs. I am using a method open(some_url, 'wb') but I don't know where this 'wb' is? I think the method is from open-uri but I don't see that param in the docs
[03:54:07] rehat: reading this http://ruby-doc.org/stdlib-2.1.5/libdoc/open-uri/rdoc/OpenURI.html
[03:54:25] hal_9000_: i think that???s ???write binary????
[03:54:34] hal_9000_: no, that doesn???t make sense
[03:54:44] rehat: well the url is a video file
[03:55:04] rehat: but I don't know how to find the list of modes I can use
[03:55:12] hal_9000_: well, i think it is something like modes yes
[03:55:18] hal_9000_: let me look
[03:56:19] hotpancakes: has joined #ruby
[03:56:29] baweaver_: has joined #ruby
[03:56:39] ruby-lang122: has joined #ruby
[03:56:56] hal_9000_: this may be the key phrase - look under Kernel - ???Otherwise, the original #open is called.???
[03:57:02] baweaver_: has joined #ruby
[03:57:59] shred45: has joined #ruby
[03:58:16] devbug: has joined #ruby
[03:59:00] ruby-lang122: Quick question, I am calling a method and I have a loop inside the method but it is not running, The method exits after one iteration. Is there some kinda rule that when you call a method it has to be called inside a loop? It should just loop inside itself until it's done I would think
[03:59:22] ruby-lang122: Where would I post the code so you could look at it?
[03:59:23] Radar: ruby-lang122: Show us the code please.
[03:59:28] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[03:59:56] ruby-lang122: do you need the entire code or just the method that I'm trying to loop?
[04:01:23] ruby-lang122: https://gist.github.com/anonymous/d0daad30cf794ebcbe20
[04:02:44] havenn: ruby-lang122: You explicitly `return` early.
[04:02:47] havenn: ruby-lang122: https://gist.github.com/anonymous/d0daad30cf794ebcbe20#file-gistfile1-txt-L30
[04:03:26] gix: has joined #ruby
[04:03:38] ruby-lang122: but only if they enter "n'
[04:03:42] havenn: ruby-lang122: Are you wanting to map to the new values? You're using #each not #map.
[04:04:25] havenn: ruby-lang122: There are other returns.
[04:04:27] ruby-lang122: I'm just using each of the element's in the array to name the next card that's drawed
[04:04:37] havenn: ruby-lang122: Take out the early returns and it won't return early.
[04:04:55] RegulationD: has joined #ruby
[04:05:30] ruby-lang122: but I need them, they have purpose. This code runs perfect if it's inside the exsiting method but I took it out to clean things up and put it in it's own method
[04:05:49] coban2k: has joined #ruby
[04:08:20] havenn: ruby-lang122: Hard to say from what you've shown.
[04:08:36] mary5030: has joined #ruby
[04:10:41] baweaver_: has joined #ruby
[04:10:53] ruby-lang122: I understand, But just to clear thing's up, The method should run until 1 of 3 are met, 1. They bust (go over 21) 2. Their total is equal to 21 and 3. They enter "n" to exit
[04:13:06] ruby-lang122: Also I can take all of the code directly out of that method and place it back inside the method that is calling it and it works perfect. It's the fact that i put it inside it's own method and calling it that is messing things up
[04:13:28] rehat: Trying to understand this script https://gist.github.com/rehat/99b74b1e62cc91a8aa20 is the open on line 1 and 4 using open-uri and the open on line 3 is just a File open?
[04:14:16] tmtwd: has joined #ruby
[04:15:25] fantazo: has joined #ruby
[04:15:27] omegamike: has joined #ruby
[04:16:12] Aeyrix_: has joined #ruby
[04:17:35] ruby-lang122: do you have the open-uri gem installed?
[04:18:03] arescorpio: has joined #ruby
[04:18:04] sameerynho: has joined #ruby
[04:18:39] rehat: just trying to understand how to read that and know which class open is being called
[04:19:30] psye: has joined #ruby
[04:20:20] ruby-lang122: so as long as you have require 'open-uri' in your controller or where ever you're using this then 'open' should work as an http request
[04:20:35] psye: has joined #ruby
[04:21:03] einarj: has joined #ruby
[04:21:46] fowl: has left #ruby: ()
[04:23:10] NeverDie: has joined #ruby
[04:23:31] astrobun_: has joined #ruby
[04:23:43] nahtnam: has joined #ruby
[04:27:28] chuy: has joined #ruby
[04:28:18] casadei: has joined #ruby
[04:29:36] lxsameer_: has joined #ruby
[04:31:01] ledestin: has joined #ruby
[04:40:32] qiukun: has joined #ruby
[04:41:08] RobertBirnie: has joined #ruby
[04:41:46] sameerynho: has joined #ruby
[04:42:28] dimasg: has joined #ruby
[04:45:14] bricker: has joined #ruby
[04:46:30] dseitz: has joined #ruby
[04:49:03] Channel6: has joined #ruby
[04:50:05] iamninja: has joined #ruby
[04:51:11] n_blownapart: has joined #ruby
[04:52:46] solars: has joined #ruby
[04:52:56] Meow-J: has joined #ruby
[04:53:16] j4cknewt: has joined #ruby
[04:53:40] NeverDie: has joined #ruby
[04:53:51] pawnbox: has joined #ruby
[04:54:39] radgeRayden: has joined #ruby
[04:54:58] weemsledeux: has joined #ruby
[04:57:14] hotpancakes: has joined #ruby
[05:00:42] casadei: has joined #ruby
[05:01:14] hololeap: has joined #ruby
[05:02:11] northfurr: has joined #ruby
[05:03:16] modern: has joined #ruby
[05:03:16] modern: has joined #ruby
[05:04:48] AlexRussia: has joined #ruby
[05:07:26] jtdoncas: has joined #ruby
[05:11:08] NeverDie: has joined #ruby
[05:11:08] yardenbar: has joined #ruby
[05:16:32] dopie: has joined #ruby
[05:16:33] dhjondoh: has joined #ruby
[05:18:52] riotjones: has joined #ruby
[05:19:41] riotjones: has joined #ruby
[05:19:43] sbhatore: has joined #ruby
[05:20:39] sameerynho: has joined #ruby
[05:25:09] Feyn: has joined #ruby
[05:25:59] coban2k: has joined #ruby
[05:26:57] techsethi: has joined #ruby
[05:27:48] jacyzon: has joined #ruby
[05:32:08] NeverDie: has joined #ruby
[05:34:42] tubulife-: has joined #ruby
[05:37:18] chrissonar: has joined #ruby
[05:41:51] aganov: has joined #ruby
[05:42:30] khebbie: has joined #ruby
[05:43:12] AnoHito: has joined #ruby
[05:43:36] ezioa: has joined #ruby
[05:44:21] devoldmx: has joined #ruby
[05:45:30] khebbie: has joined #ruby
[05:46:54] Timba-as: has joined #ruby
[05:47:26] jenrzzz: has joined #ruby
[05:48:24] vdamewood: has joined #ruby
[05:50:11] howdoico1: has joined #ruby
[05:51:04] ezioa: has left #ruby: ()
[05:53:49] TomyLobo: has joined #ruby
[05:53:58] hotpancakes: has joined #ruby
[05:54:23] ferhaty: has joined #ruby
[05:57:44] vdamewood: has joined #ruby
[06:00:59] rht: has joined #ruby
[06:04:56] qiukun: has joined #ruby
[06:06:13] ddv: has joined #ruby
[06:06:34] lxsameer_: has joined #ruby
[06:08:42] TvL2386: has joined #ruby
[06:08:53] pabs: has joined #ruby
[06:09:17] riotjones: has joined #ruby
[06:09:52] roolo: has joined #ruby
[06:09:56] hotpancakes: has joined #ruby
[06:12:42] Oog: has joined #ruby
[06:15:54] bruno-: has joined #ruby
[06:16:10] codecop: has joined #ruby
[06:18:25] advorak: has joined #ruby
[06:18:53] eGGsha: has joined #ruby
[06:19:04] yfeldblum: has joined #ruby
[06:19:37] howdoi: has joined #ruby
[06:19:52] TTilus: has joined #ruby
[06:21:59] einarj: has joined #ruby
[06:22:15] banister: has joined #ruby
[06:22:45] tubuliferous_: has joined #ruby
[06:24:36] sdwrage: has joined #ruby
[06:24:36] ItSANgo: has joined #ruby
[06:24:53] xcesariox: has joined #ruby
[06:25:19] ironcamel: is rubygems down?
[06:25:32] ironcamel: i'm getting: Unable to download data from https://rubygems.org/ - Errno::EHOSTUNREACH: No route to host - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8.gz)
[06:25:44] miah: https://status.rubygems.org/
[06:25:46] miah: looks fine
[06:25:48] jackjackdripper: has joined #ruby
[06:25:50] ironcamel: when i gem install bundler
[06:26:22] miah: gem update works for me too
[06:27:16] TvL2386: has joined #ruby
[06:30:17] ironcamel: gem update gives me the same error :/
[06:33:53] miah: seems like your network is fubar in some way
[06:34:53] dhjondoh: has joined #ruby
[06:36:21] troulouliou_div2: has joined #ruby
[06:36:50] DanielI: has joined #ruby
[06:38:36] leat: has joined #ruby
[06:39:19] krz: has joined #ruby
[06:39:27] Radar: ironcamel: how did you install Ruby?
[06:39:56] Radar: Is it possible to return the parent+child in these ElasticSearch queries? https://gist.github.com/radar/9f0c2c2c5c3e1d620207 For instance, I want to see both the info for "Bont Vaypor Road Cycling Shoe" as well as the variant that matched the query.
[06:39:57] Igor2__: has joined #ruby
[06:40:14] Rubie: has joined #ruby
[06:40:21] Radar: I can of course make two queries (one for product and one for variant) but I was hoping someone knew the way to do only one query.
[06:43:25] sinkensabe: has joined #ruby
[06:44:02] sbhatore: has joined #ruby
[06:45:52] skade: has joined #ruby
[06:50:58] iamninja: has joined #ruby
[06:52:04] charliesome: has joined #ruby
[06:54:12] k3asd`: has joined #ruby
[06:54:47] charliesome: has joined #ruby
[06:55:09] ironcamel: Radar: i'm using rvm. everything all of a sudden started working now
[06:55:14] ironcamel: i probably was having a network hiccup
[06:55:33] baweaver_: it fears Radar, and rightly so
[06:57:55] hotpancakes: has joined #ruby
[06:59:06] davedev24: has joined #ruby
[06:59:25] skade: has joined #ruby
[07:00:16] Philipp__: has joined #ruby
[07:00:47] greenarrow: has joined #ruby
[07:02:22] Maletor: has joined #ruby
[07:04:05] niemcu: has joined #ruby
[07:04:26] leat: has joined #ruby
[07:06:28] RegulationD: has joined #ruby
[07:08:17] Rubie: has joined #ruby
[07:08:35] roolo: has joined #ruby
[07:09:15] Ropeney: radar: Was that ES stuff before for spree?
[07:09:31] charliesome_: has joined #ruby
[07:10:16] charliesome_: has joined #ruby
[07:10:35] duncannz: has joined #ruby
[07:11:30] charliesome: has joined #ruby
[07:11:33] ta: has joined #ruby
[07:11:53] djbkd: has joined #ruby
[07:12:00] duncannz: has joined #ruby
[07:14:19] Cust0sLim3n: has joined #ruby
[07:14:32] krz: has joined #ruby
[07:16:06] dcarmich: has joined #ruby
[07:17:00] certainty: moin hackers :)
[07:17:04] Juanchito: has joined #ruby
[07:17:27] eGGsha: has joined #ruby
[07:18:26] Oog: has joined #ruby
[07:19:49] ecksit: has joined #ruby
[07:20:48] TvL2386: has joined #ruby
[07:20:59] miah: almost bed time for me though =)
[07:21:58] ndrei: has joined #ruby
[07:23:22] jtdoncas: has joined #ruby
[07:23:23] tubuliferous_: has joined #ruby
[07:23:45] sameerynho: has joined #ruby
[07:25:52] robbyoconnor: has joined #ruby
[07:26:26] Oog_: has joined #ruby
[07:29:09] hotpancakes: has joined #ruby
[07:29:28] Iskarlar: has joined #ruby
[07:29:48] DoubleMalt: has joined #ruby
[07:29:53] arup_r: has joined #ruby
[07:30:04] baweaver: has joined #ruby
[07:30:23] robbyoconnor: has joined #ruby
[07:30:59] arup_r: Hi. I am using whenevr gem to run some rake tasks every 1 hour. But it is not running in the server.. Any idea what is wrong here ? https://gist.github.com/aruprakshit/f5c9238d939a2b756b91
[07:31:02] Iskarlar: has joined #ruby
[07:33:09] akjf: has joined #ruby
[07:34:01] advorak: https://gist.github.com/advorak/99d8067df501626c05d8 - on line 13-15, when I click an a.clickable_run_number link, the first click doesn't register (it registers an error "data = undefined") and the second and subsequent times I click a.clickable_run_number it works. Maybe I need a good night's sleep in order to troubleshoot this, but any suggestions are appreciated :-)
[07:34:12] akjf: can anyone define method in elegent way?
[07:34:30] ljarvis: advorak: this is the Ruby channel
[07:34:42] advorak: sorry .. wrong tab :-)
[07:34:51] adaedra: akjf: what do you mean
[07:34:55] advorak: that's definitely confirmation i should sleep :-)
[07:35:08] adaedra: ACTION throws advorak a pillow
[07:35:20] advorak: thanks, adaedra ! :-)
[07:35:36] arup_r: and me ? :)
[07:35:51] Hanmac: ping shevy
[07:36:31] adaedra: arup_r: sorry, that was my last one
[07:36:34] akjf: define method in appropirate way?
[07:36:54] adaedra: def method(param, param2)
[07:36:59] arup_r: any way.. I am also in the incorrect channel posted it seems
[07:37:16] adaedra: that's how you define a method, akjf
[07:37:27] adaedra: If you have a problem, state it clearly
[07:37:34] ljarvis: arup_r: I don't personally think this has anything to do with Ruby or whenever
[07:37:46] ljarvis: arup_r: whenevr just writes your cron, if they're not running it's because of something else
[07:38:16] thiagovsk: has joined #ruby
[07:39:00] arup_r: Yes.. I am trying to figure out what is the reason..
[07:39:03] anisha: has joined #ruby
[07:39:14] alphaatom: has joined #ruby
[07:40:37] ndrei: has joined #ruby
[07:41:33] stardiviner: has joined #ruby
[07:42:57] Violentr: has joined #ruby
[07:43:49] baroquebobcat: has joined #ruby
[07:44:23] mikecmpbll: has joined #ruby
[07:45:04] devoldmx: has joined #ruby
[07:45:59] devoldmx: has joined #ruby
[07:46:55] sameerynho: has joined #ruby
[07:50:02] Tempesta: has joined #ruby
[07:51:41] omegamike: has joined #ruby
[07:52:40] jenrzzz: has joined #ruby
[07:53:03] tomphp_: has joined #ruby
[07:54:38] eGGsha: has joined #ruby
[07:54:47] mikecmpbll: has joined #ruby
[07:55:30] hotpancakes: has joined #ruby
[07:55:43] jackjackdripper: has joined #ruby
[07:56:49] eGGsha: has joined #ruby
[07:58:20] Igor2__: [spoiler]: ping
[07:58:22] conor_: has joined #ruby
[07:58:34] [spoiler]: Igor2__: yo :)
[08:00:37] Igor2__: this morning I spent some time experimenting with mruby
[08:00:47] Igor2__: it was a gerat idea, tahnks again!
[08:00:59] Igor2__: took like half an hour to hack up a workign prototype of the main featuers i'll need
[08:01:19] Igor2__: getting the function name in the dispatcher is not clean, tho:
[08:01:28] Igor2__: there's a self object on the argument list of the c function
[08:01:44] Igor2__: but that points to the object that initiated the call, so it's the caller's object, not the callee's
[08:01:54] Igor2__: I didn't find any clean way to extract callee info
[08:02:19] Igor2__: but I've found a hackish path through the mrb state to a stack where i could extrac my symbol ID
[08:02:25] troulouliou_div2: has joined #ruby
[08:02:48] [spoiler]: the self is the receiver of the method (function) call
[08:02:49] Igor2__: so it would work, although it's a bit ugly at that part
[08:03:00] Igor2__: yeah, it's called recv in vm.c
[08:03:10] Igor2__: (i have no idea what a receiver is, i'm not an OOP guy)
[08:03:53] joonty: has joined #ruby
[08:03:54] [spoiler]: object.method() object receives a method call (function call) method
[08:03:54] apeiros: Igor2__: in my_array.first(4), my_array is the receiver (you call the method on that object)
[08:04:17] Igor2__: for the reference, this is my current test code: http://igor2.repo.hu/tmp/mruby/
[08:04:21] [spoiler]: ok sorry for the weird naming, let me reiterate
[08:04:40] [spoiler]: foo.bar() object foo receives a method call (function call) bar
[08:04:47] Igor2__: clear now, thanks
[08:04:59] Igor2__: i've grepped the API for callee but didn't find anything
[08:05:17] [spoiler]: in C, that is like passing a pointer in the first aparameter (which is what mruby API does, except that it's the second parameter since the first one is the mrb state)
[08:05:20] Igor2__: checked vm.c but i think it doesn't pass on any argument that gives me the callee name/ID cleanly
[08:05:46] [spoiler]: Igor2__: actually, there's nothing that will pass that information *but* let me test something real quick
[08:06:39] [spoiler]: Ah I don't have mruby installed at work, drat. Gimme a few minutes then to download it
[08:06:52] Igor2__: ok, thanks in advance
[08:07:24] bodgix: has joined #ruby
[08:07:32] ferhaty: has joined #ruby
[08:09:28] rdark: has joined #ruby
[08:10:16] mandarinkin: has joined #ruby
[08:11:28] clocKwize: has joined #ruby
[08:11:48] shredding: has joined #ruby
[08:15:52] [spoiler]: ok just to see ifi got it right, you need the name of the current method being called, or the method which called the method?
[08:16:35] tkuchiki: has joined #ruby
[08:17:58] tkuchiki: has joined #ruby
[08:18:11] ruby-lang447: has joined #ruby
[08:18:53] code1o6: has joined #ruby
[08:19:04] ruby-lang447: How would you change two duplicate item's in an array into to separate values, here is an example https://gist.github.com/anonymous/6f863d3f24d847a46e29
[08:19:13] tomphp_: has joined #ruby
[08:20:01] ruby-lang447: This way assigns both the same value obviously, but how would I change one and then change the other one
[08:20:17] Igor2__: [spoiler]: the name of the method being called
[08:20:45] Igor2__: so i register ruby symbol foo and foo2, both calling cfunc() and in cfunc() i want to see if it was foo or foo2 that mtriggered the call
[08:20:48] [spoiler]: Igor2__: in that case, you can use `mrb_value mrb_f_method(mrb_state *mrb, mrb_value self)`
[08:21:06] stardiviner1: has joined #ruby
[08:21:38] Igor2__: thanx, will try
[08:21:44] Thermatix: has joined #ruby
[08:22:21] Macaveli: has joined #ruby
[08:22:28] einarj: has joined #ruby
[08:22:54] [spoiler]: Igor2__: vim +16 mrbgems/mruby-kernel-ext/src/kernel.c # inside mruby-1.1.0
[08:22:55] bronson: has joined #ruby
[08:23:04] Macaveli: has joined #ruby
[08:23:57] ruby-lang447: How would you change two duplicate item's in an array into to separate values, here is an example https://gist.github.com/anonymous/6f863d3f24d847a46e29 this way save's both with the same value obviously, how can I change each one?
[08:24:04] [spoiler]: ruby-lang447: I am not sure what you want to do
[08:24:08] nuttermb: has joined #ruby
[08:24:16] Igor2__: hmm, is this a public call?
[08:24:21] [spoiler]: Do you want the result to be [1, 11]?
[08:24:26] Igor2__: can't seem to find it in any of the system installed headers
[08:24:39] ruby-lang447: I would like to change one "A" to 1 and one "A" to 11 or both to 11 or both to 1
[08:24:43] charliesome: has joined #ruby
[08:25:05] [spoiler]: Igor2__: Huh? It's part of the Kernel module (Kerbel#__method__)
[08:25:07] Iskarlar: has joined #ruby
[08:25:18] [spoiler]: so it'll likely be inside mrbgems
[08:25:28] marr: has joined #ruby
[08:25:54] ruby-lang447: basically the user has two choices 1 or 11 and they get to pick which value to use for the "A"'s
[08:26:01] [spoiler]: ruby-lang447: ah. Just move your gets inside the map block
[08:26:19] [spoiler]: and your puts, probably
[08:26:40] [spoiler]: and put them inside the if body, too
[08:26:45] shredding: My ubuntu crashes once in a while with Aug 10 21:54:03 tools kernel: [63481.188427] schedule[11674]: segfault at 7ffef72980e0 ip 00007f3296ed2e2f sp 00007ffef72980e0 error 6 in libruby-2.2.so.2.2.0[7f3296d3b000+263000]
[08:27:06] apeiros: shredding: update to ruby 2.2.2
[08:27:07] shredding: what's this libruby-2.2.so.2.2.0?
[08:27:16] apeiros: that's ruby
[08:27:21] cheeti: has joined #ruby
[08:27:45] shredding: apeiros: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux-gnu]
[08:27:48] bumbar_: has joined #ruby
[08:27:49] shredding: I have that ruby.
[08:27:51] Igor2__: on debian i have mruby 1.0.0
[08:28:02] apfeluser: has joined #ruby
[08:28:08] [spoiler]: Igor2__: did you install it from the repo?
[08:28:18] Igor2__: in 1.0.0, it's a static function
[08:28:22] Igor2__: from debian testing
[08:28:38] startupality: has joined #ruby
[08:28:41] [spoiler]: yes it should be a function
[08:29:15] Igor2__: i mean it's a static function so i won't be able to call it from my project
[08:29:21] [spoiler]: later it should be deined as a method: ` mrb_define_method(mrb, krn, "__method__", mrb_f_method, MRB_ARGS_NONE());`
[08:29:22] shredding: apeiros: How would i update that? I thought it's the latest (the server got setup a few days ago)
[08:29:43] [spoiler]: Why not? :o
[08:29:52] apeiros: 2.2.2 is the latest. but libruby-2.2.so.2.2.0 sounds like it was 2.2.0. wondering whether they use the ABI version number there.
[08:30:18] apeiros: but can't find the .dylibs or .bundle's rvm creates. so can't compare.
[08:31:10] Igor2__: [spoiler]: if that "Why not? :o" was for me: well, i'm not developing mruby, i'm developing an application that's using mruby through the public API, so i can't call any hidden internal stuff (and a static function is a hidden internal)
[08:31:38] sdwrage: has joined #ruby
[08:32:53] shredding: apeiros: "ruby2.2 is already the newest version."
[08:33:10] [spoiler]: Igor2__: oh okay
[08:33:17] shredding: i don't use rvm.
[08:34:03] Igor2__: I think my current hack sort of works
[08:34:04] [spoiler]: then do `mrb_load_string(mrb, "__method__");`
[08:34:14] Igor2__: hmm, checking
[08:35:38] sideshowcoder: has joined #ruby
[08:36:13] Igor2__: i get empty string for that
[08:36:49] [spoiler]: Igor2__: it should return a symbol
[08:36:52] Igor2__: and the symbol ID i got differs from the function symbols i registered
[08:37:04] [spoiler]: bizarre; what did you get?
[08:37:15] Igor2__: i got a symbol, 361
[08:37:24] Igor2__: foo and foo2 are 622 and 623
[08:37:32] Igor2__: i guess 361 is the caller's ID
[08:37:37] [spoiler]: symbols are all integers, you need to resolve it
[08:37:51] pawnbox: has joined #ruby
[08:37:52] Igor2__: but i'd expect i'd see the same value
[08:37:56] mikecmpbll: /join #reactjs
[08:37:57] Igor2__: i mean the same ID for the same sym
[08:38:14] mikecmpbll: rouge spaces :'(
[08:39:05] casadei: has joined #ruby
[08:39:15] Igor2__: <interrupt, brb>
[08:40:30] TTilus: mikecmpbll: i've got them, only trailing are rouge though ;)
[08:41:12] [spoiler]: Igor2__: (for later) can you put up the mrb specific code so I can take a look at it? I have a few ideas, but I won't be sure until I can see what's happening
[08:42:27] zitar: has joined #ruby
[08:43:37] pawnbox: has joined #ruby
[08:43:52] TTilus: mikecmpbll: right there http://www.tilus.net/tero/tmp/rouge-spaces.png
[08:43:54] [spoiler]: hi, yorickpeterse <3></3>
[08:44:05] ndrei: has joined #ruby
[08:44:13] TTilus: humhum, back to work
[08:45:36] yorickpeterse: ACTION slaps [spoiler] around with a crushing student debt
[08:46:09] Igor2__: [spoiler]: the minimal, gpmi-independent test project is http://igor2.repo.hu/tmp/mruby/
[08:46:47] devoldmx: has joined #ruby
[08:46:47] eGGsha: has joined #ruby
[08:47:01] Igor2__: I have to go AFK for some time now, soldering a serial link onto an embedded board, brb
[08:47:34] irctc311: has joined #ruby
[08:47:45] ta: has joined #ruby
[08:48:00] nobitanobi: has joined #ruby
[08:48:35] bodgix: Does anyone know of something like http://search.cpan.org/~mschilli/YAML-Logic-0.03/Logic.pm for ruby? I'm looking for a library / DSL to express logical conditions in config files
[08:49:00] ishahnaz: has joined #ruby
[08:49:38] yardenbar: has joined #ruby
[08:50:42] _blizzy_: has joined #ruby
[08:51:22] xcesariox: has joined #ruby
[08:51:57] iamninja: has joined #ruby
[08:51:59] Hanmac: bodgix not that i know, but it looks interesting and more or less easy to build in ruby ... the only problem would be the usage of eval should avoided if possible
[08:52:04] gregf_: has joined #ruby
[08:52:21] hmnhf: has joined #ruby
[08:52:45] bodgix: hanmac: that's exactly my concern. I wouldn't want to eval a user-supplied config
[08:52:58] Stan: has joined #ruby
[08:53:19] pawnbox: has joined #ruby
[08:54:03] irctc311: hello i had cocoa pods installed and something was going wrong so i totally uninstalled it. anyway i was wondering what i should do if all my ruby is installed in the folder where Applications, Desktop folders are on Mac
[08:54:20] shevy: I wanna sneak in a rm
[08:54:29] irctc311: should i install cocoapods there too? if so how can i
[08:55:11] quimrstorres: has joined #ruby
[08:56:06] Radar: Ropeney: No, it's for my own thing
[08:58:05] hotpancakes: has joined #ruby
[08:58:17] yh: has joined #ruby
[08:58:51] _blizzy_: has joined #ruby
[08:59:43] iamninja: has joined #ruby
[09:00:28] Coldblackice: has joined #ruby
[09:01:09] quimrstorres: has joined #ruby
[09:01:24] MarcWeber: has joined #ruby
[09:01:53] coban2k: has joined #ruby
[09:02:07] MarcWeber: Is tehre a simple dag (directed acyclic graph) library supporting multiple roots which already can create a simple text tree representation ?
[09:03:32] stardiviner1: has joined #ruby
[09:03:53] TTilus: bodgix: tried https://github.com/rubysolo/dentaku ?
[09:05:11] bodgix: TTilus: I haven't tried it but it looks like what I'm looking for
[09:05:37] Trynemjoel: has joined #ruby
[09:05:51] bodgix: TTilus: many thanks. I'll see if I can use it in my problem but looks promising
[09:05:54] TTilus: bodgix: there's also https://github.com/cucumber/bool
[09:06:36] irctc311: anyone can help me?
[09:06:57] shevy: not me, I don't use mac
[09:06:58] TTilus: bodgix: the later looks more credible
[09:08:48] nobitanobi: I'm using HTTParty to do POST requests - Right now I am catching HTTParty::Error, but I am concerned on other types of errors that can happen during the http connection, such as layer 4 errors. Anybody knows which exception classes should I be looking for here?
[09:08:51] TTilus: bodgix: no, wait! the other way round (looked at wrong project)
[09:10:35] Rubie: has joined #ruby
[09:10:35] bodgix: TTilus: cucumber/bool seems more difficult to install. I think it a C library with ruby bindings
[09:11:33] tubuliferous_: has joined #ruby
[09:11:35] irctc311: hello i had cocoa pods installed and something was going wrong so i totally uninstalled it. anyway i was wondering what i should do if all my ruby is installed in the folder where Applications, Desktop folders are on Mac
[09:12:19] zitar: has joined #ruby
[09:12:47] zitar: has joined #ruby
[09:12:50] conor_: has joined #ruby
[09:19:31] Kalov: has joined #ruby
[09:20:30] slackbotgz: has joined #ruby
[09:20:31] leafybasil: has joined #ruby
[09:21:23] rdark: has joined #ruby
[09:22:23] djbkd: has joined #ruby
[09:23:14] einarj: has joined #ruby
[09:23:53] youngbaks: has joined #ruby
[09:24:24] pawnbox: has joined #ruby
[09:25:29] matcouto: has joined #ruby
[09:25:42] hoolio_: has joined #ruby
[09:26:26] symm-: has joined #ruby
[09:26:40] hoolio_: hey guys, i was wondering if i could get a hand with something. im really new too ruby :)
[09:26:45] TheHodge: has joined #ruby
[09:27:18] AlexRussia: has joined #ruby
[09:27:20] jhass: ?ask hoolio_
[09:27:20] ruboto: hoolio_, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[09:27:57] mandarinkin: does string class have "shift" method ?
[09:28:02] sectionme: has joined #ruby
[09:28:04] jhass: ?try mandarinkin
[09:28:04] ruboto: mandarinkin, Why don't you try it and see for yourself?
[09:28:04] hoolio_: http://pastebin.com/G3bN2evH its saying somethign about an unexpected identifier :)
[09:28:05] ruboto: hoolio_, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ff018abb92dddd36ff86
[09:28:05] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[09:28:23] shevy: >>> "abc".shift
[09:28:24] ruboto: shevy # => /tmp/execpad-30595ab21d94/source-30595ab21d94:2: syntax error, unexpected '>' ...check link for more (https://eval.in/415660)
[09:28:26] Pupeno: has joined #ruby
[09:28:28] shevy: oops I failed
[09:28:42] shevy: mandarinkin String does not have .shift() method by default
[09:28:46] jhass: hoolio_: let's read the error message together
[09:28:53] jhass: so first, what's the exact error message
[09:29:01] hoolio_: the error is : ex3-1.rb:3: syntax error, unexpected tIDENTIFIER, expecting end-of-input puts 43 x 7
[09:29:05] zenguy_pc: has joined #ruby
[09:29:32] jhass: hoolio_: so, which character in that expression would you think could be the cause for that?
[09:29:41] yh_: has joined #ruby
[09:29:42] mandarinkin: i want find simpe way transform string from '1234567' to '123567' without 4
[09:29:59] hoolio_: maybe the x ?
[09:30:04] jhass: hoolio_: exactly!
[09:30:18] jhass: multiplication is *, x is just a variable or method name
[09:30:36] hoolio_: oh ok , so x isnt the multiplication symbol ?
[09:30:51] hoolio_: ohhh, i feel like a douche hahah
[09:30:52] jhass: mandarinkin: .delete("4") ?
[09:30:53] shevy: yeah it is not
[09:30:54] adaedra: no, it's a x
[09:31:22] jhass: hoolio_: and that's what ruby means with identifier, variable or method name
[09:32:18] mandarinkin: jhass, i want move substring
[09:32:44] BTRE: has joined #ruby
[09:32:49] jhass: mandarinkin: provide an example that shows that then?
[09:32:49] hoolio_: well thank you guys ^.^
[09:32:53] jhass: ?guys hoolio_
[09:32:53] ruboto: hoolio_, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
[09:33:11] mandarinkin: '5678' move to left on 2 position , resalt should be '125678'
[09:33:33] jhass: ?fake mandarinkin
[09:33:33] ruboto: mandarinkin, Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
[09:33:52] startupality: has joined #ruby
[09:34:30] Igor2__: [spoiler]: haha, this is nice, the __method__ in mrb_load_string is always "__printstr__"
[09:34:57] [spoiler]: it makes sense though
[09:36:10] startupality: has joined #ruby
[09:36:11] Igor2__: (resolving the ID i found in mrb state ->c->ci->mid brings up the right function name,tho)
[09:36:28] arup_r: has joined #ruby
[09:36:45] Vile`: has joined #ruby
[09:36:57] mandarinkin: ruboto, i have string ss='22221111000' i want delete from string ss[2..3] and get new string '221111000'
[09:37:29] ljarvis: ss[2..3] = ''
[09:37:29] djbkd: has joined #ruby
[09:37:47] [spoiler]: Igor2__: https://gist.github.com/omninonsense/8e59e8e20f90e45c6664
[09:37:52] [spoiler]: this should work
[09:38:00] jhass: ?ruboto mandarinkin
[09:38:00] ruboto: mandarinkin, I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[09:38:04] [spoiler]: Sorry I also got distracted a bit at wok
[09:38:13] [spoiler]: asdfghjkl; work"
[09:38:21] [spoiler]: omg I can't even get punctuation right
[09:38:39] joonty: has joined #ruby
[09:38:45] jhass: mandarinkin: "#{s[0..1]}#{s[3..-1]}"
[09:38:52] Igor2__: working at a wok restaurant? lol
[09:39:15] [spoiler]: But I wouldn't mind. I love wok food
[09:39:16] Motoservo: has joined #ruby
[09:39:26] yorickpeterse: you'll think otherwise when you smell it 9 hours a day
[09:39:32] yorickpeterse: or when standing in the heat 9 hours a day
[09:39:55] [spoiler]: yorickpeterse: point taken
[09:40:08] ta: has joined #ruby
[09:40:19] mandarinkin: jhass, ss[2..3] = '' is good
[09:40:51] sheldonh: has joined #ruby
[09:41:23] sheldonh: is there something i can do to get rdoc to automatically include a list of contained classes in the documentation of a module?
[09:41:30] omegamike: has joined #ruby
[09:42:05] curses: has joined #ruby
[09:42:44] SOLDIERz: has joined #ruby
[09:44:33] sheldonh: or alternatively, a way to get the module to stop showing up in the "Classes and modules" list. # :nodoc: doesn't exclude the module name from that list
[09:45:25] startupality: has joined #ruby
[09:46:41] Igor2__: [spoiler]: cool, this works, thanks!
[09:47:03] jenrzzz: has joined #ruby
[09:47:17] sepp2k: has joined #ruby
[09:47:20] bruno-: has joined #ruby
[09:48:20] [spoiler]: Igor2__: woo! :)
[09:48:26] [spoiler]: Igor2__: no problem
[09:48:44] [spoiler]: Igor2__: I wrote it from the top of my head, so there might be a shorter approach or a macro
[09:50:48] thang: has joined #ruby
[09:51:29] Igor2__: actually I don't need anything short, rather something that won't break as versions change
[09:51:33] sameerynho: has joined #ruby
[09:51:51] [spoiler]: Igor2__: btw, there's #mruby but it is a bit dead (or was). It was me and one other person who were answering questions in there
[09:51:53] Igor2__: your solution looks much more stable than my other one depending on struct internal
[09:52:10] [spoiler]: and most of the time we were answering eachother's questions LOL
[09:52:16] [spoiler]: or trying to figure stuff out
[09:52:20] ta: has joined #ruby
[09:52:31] Igor2__: I think the rest will be easy
[09:52:41] Igor2__: maybe i won't even have further questions
[09:52:42] [spoiler]: It's always better to use the API, yeah
[09:52:44] shibly: has joined #ruby
[09:53:04] Igor2__: i just need to extend the example with some args and return alues and stuff
[09:53:10] Igor2__: btw, i like the api of mruby
[09:53:24] Igor2__: in some aspects it's very similar to my libmawk API
[09:53:49] Igor2__: (and it will really work with multiple script instances)
[09:53:51] [spoiler]: Igor2__: for args, I warmly recommend using mrb_get_args()
[09:54:01] nfk: has joined #ruby
[09:54:06] [spoiler]: if they'e being called from ruby
[09:54:07] Igor2__: i think i will keep the old module too, maybe rename it to ruby18
[09:54:15] [spoiler]: allows much more control and safety
[09:55:07] [spoiler]: this one is actually documented nicely: https://github.com/mruby/mruby/blob/69a2c5cc73c0f8c6943403161eca46665c5dc893/doc/api/mruby.h.md
[09:55:16] Darkwater: has joined #ruby
[09:56:02] [spoiler]: mruby needs better documentation; I started working on it for myself, but the project kinda got pushed aside and so did the documentation I was writingm, but I see someone people have started addings really good docs
[09:56:33] Igor2__: to be honest i can't really judge
[09:56:44] Igor2__: i'm not into ruby that much to read detailed docs
[09:56:48] Igor2__: i'm sort of a turist
[09:57:00] Igor2__: want something simple and go into just enough details to get it solved
[09:57:13] Igor2__: in mruby, there are some example code for simple things in doc/
[09:57:15] Igor2__: that helped a lot
[09:57:25] Igor2__: and the header is nice too
[09:57:58] Igor2__: if you want to get ruby easy for turists like me, a set of smallish examples, one per feature is probably the best way
[09:58:01] chipotle: has joined #ruby
[09:58:28] Igor2__: now OTL, brb
[09:58:50] Pisuke: has joined #ruby
[10:02:30] devoldmx: has joined #ruby
[10:03:20] DoubleMalt: has joined #ruby
[10:04:35] Chau: has joined #ruby
[10:04:50] symm-: has joined #ruby
[10:05:23] ndrei: has joined #ruby
[10:06:16] khebbie: has joined #ruby
[10:07:03] tonios57: has joined #ruby
[10:07:10] otisZart: has joined #ruby
[10:08:46] closer: has joined #ruby
[10:10:45] einarj: has joined #ruby
[10:10:56] dionysus69: has joined #ruby
[10:11:31] dumdedum: has joined #ruby
[10:11:48] kraljev11: has joined #ruby
[10:14:26] pafin: has joined #ruby
[10:16:47] [k-: has joined #ruby
[10:20:26] rickmasta: has joined #ruby
[10:20:37] conor_: has joined #ruby
[10:20:45] olivierrr: has joined #ruby
[10:22:42] sameerynho: has joined #ruby
[10:23:23] alex88: has joined #ruby
[10:24:33] techsethi: has joined #ruby
[10:26:07] hotpancakes: has joined #ruby
[10:26:14] blackmesa: has joined #ruby
[10:26:32] Oog: has joined #ruby
[10:26:49] mandarinkin: whats the best way to do something like ss[2,3,4]='*'
[10:27:38] pawnbox: has joined #ruby
[10:28:00] ljarvis: mandarinkin: you need to do it separately
[10:28:05] casadei: has joined #ruby
[10:28:26] mandarinkin: so [2,3,4].each{|ind| ss[ind]='*'}
[10:30:56] Oog: has joined #ruby
[10:33:02] [spoiler]: mandarinkin: what is the desired result?
[10:33:42] [spoiler]: >> ss = "hello world"; ss[6..10] = '*'; ss
[10:33:43] ruboto: [spoiler] # => "hello *" (https://eval.in/415706)
[10:34:01] [spoiler]: >> ss = "hello world"; ss[6..10] = '*'; ss # mandarinkin
[10:34:02] ruboto: [spoiler] # => "hello *" (https://eval.in/415707)
[10:34:29] [k-: you could just point :/
[10:36:02] sdothum: has joined #ruby
[10:36:09] mandarinkin: i have array of indexes and want assign char
[10:37:34] pawnbox: has joined #ruby
[10:38:19] skade: has joined #ruby
[10:39:53] ljarvis: mandarinkin: yes what you did is fine
[10:41:34] [spoiler]: then yeah, iterate over the indexes, and use them to reassing the character like you did
[10:41:44] mhib: has joined #ruby
[10:46:18] Macaveli: has joined #ruby
[10:50:42] Trynemjoel: has joined #ruby
[10:51:27] stef204: has joined #ruby
[10:52:35] ta: has joined #ruby
[10:57:54] suchness: has joined #ruby
[10:59:19] quimrstorres: has joined #ruby
[10:59:43] Trynemjoel: has joined #ruby
[10:59:43] tubuliferous_: has joined #ruby
[10:59:46] rodfersou: has joined #ruby
[11:00:20] bruno-: has joined #ruby
[11:00:45] Iskarlar: has joined #ruby
[11:03:45] nemesit|znc: has joined #ruby
[11:04:09] cornerma1: has joined #ruby
[11:06:05] basmoura: has joined #ruby
[11:07:10] joelataylor: has joined #ruby
[11:07:27] hotpancakes: has joined #ruby
[11:07:29] mrtg9970: has joined #ruby
[11:07:39] symm-: has joined #ruby
[11:10:33] tkuchiki: has joined #ruby
[11:10:38] flou: has joined #ruby
[11:11:34] bruno-_: has joined #ruby
[11:11:56] rickmasta: has joined #ruby
[11:12:00] ta: has joined #ruby
[11:12:56] dented42: has joined #ruby
[11:13:02] ferhaty: has joined #ruby
[11:13:45] mrtg9970: has joined #ruby
[11:14:29] ndrei: has joined #ruby
[11:21:17] camonz: has joined #ruby
[11:22:45] Quandl: has joined #ruby
[11:24:19] iamninja: has joined #ruby
[11:26:15] apeiros: shush, alphabet is now owned by google. stop infringing!
[11:26:20] jbw: has joined #ruby
[11:28:16] Askilada: has joined #ruby
[11:28:31] ta: has joined #ruby
[11:29:12] dimasg: has joined #ruby
[11:30:00] Hanmac: apeiros: like in the sesame-street like "G stays for Google"? ;P
[11:30:55] Me: has joined #ruby
[11:32:42] conor_: has joined #ruby
[11:36:30] Scripore: has joined #ruby
[11:36:32] Igor2__: kernel oops
[11:37:12] c7n: has joined #ruby
[11:38:57] ldnunes: has joined #ruby
[11:40:45] Chau: has joined #ruby
[11:40:50] ta: has joined #ruby
[11:41:52] Oog: has joined #ruby
[11:43:27] greenarrow: has joined #ruby
[11:43:45] [spoiler]: Kernel#oops!
[11:44:26] [spoiler]: Documentation: formats fs the script is on, prints "oops!" and reboots
[11:45:05] VeganGreg: I'd be curious to know whether the people in this channel are mostly professional developers or amateurs
[11:45:15] sdothum: has joined #ruby
[11:46:19] joejohn1919: has joined #ruby
[11:46:21] sheldonh: probably lots of both
[11:46:40] apeiros: VeganGreg: you'd be curious? so you aren't?
[11:46:57] apeiros: ACTION is a professional pedant
[11:46:58] carlosoliveira: has joined #ruby
[11:47:13] VeganGreg: apeiros: :-)
[11:47:33] Igor2__: >VeganGreg> I'm both
[11:47:35] suchness: I would wager that most of the people here regularly are the professional type.
[11:48:20] suchness: VeganGreg: I am the lead developer of a financial investment company.
[11:48:20] Igor2__: VeganGreg: lately I do embedded programming and electronics for living, do programming, electronics and mech engineering for hobby
[11:48:24] olivierrr: has joined #ruby
[11:49:30] linuxboytoo: has joined #ruby
[11:49:34] VeganGreg: I'm an amateur, but am looking to jump into development soon
[11:49:36] samu: has left #ruby: ()
[11:49:57] suchness: VeganGreg: Well, as you can see we have 12 year olds, professionals, and amateurs here.
[11:50:22] adaedra: I'm a meat popsicle
[11:50:35] suchness: VeganGreg: And one meat popsicle.
[11:50:50] conor_: has joined #ruby
[11:50:54] Thermatix: wrong username >_<
[11:51:21] VeganGreg: suchness: I imagined that it would be a mix---I just was interested to see if one group was significantly more represented
[11:51:22] apeiros: I'm nobody
[11:51:29] ruboto: apeiros is nobody
[11:51:32] [k-: do a poll!
[11:51:33] apeiros: we're very diverse
[11:51:59] suchness: VeganGreg: Couldn't speak to that. I can say that for any given question, providing the right person has the time, it can be answered.
[11:52:08] [k-: you have to wait a year for all 1000+ people here to answer
[11:52:09] ta: has joined #ruby
[11:52:27] Askilada: has joined #ruby
[11:52:33] adaedra: we need everybody
[11:52:36] adaedra: ?everybody
[11:52:36] ruboto: I don't know anything about everybody
[11:53:38] VeganGreg: [k- : or perhaps some people who are in here a lot whould be able to say with some confidence
[11:53:52] yorickpeterse: nobody is really good at moderating this channel
[11:54:04] yorickpeterse: (I swear if nobody gets that reference...)
[11:54:10] hotpancakes: has joined #ruby
[11:54:37] quimrstorres: has joined #ruby
[11:54:47] adaedra: joke &the_joke;
[11:55:59] yorickpeterse: VeganGreg: either way, I suppose I have to officially label myself as a professional too
[11:56:13] yorickpeterse: at least my title being "Developer" would indicate so
[11:56:47] [k-: he works on rubinius
[11:56:50] [k-: good enough for me
[11:56:53] yorickpeterse: bougyman: que?
[11:57:33] VeganGreg: Is it generally acceptable to be in an irc channel like #ruby at the office when you're working as a developer?
[11:57:40] allcentury: has joined #ruby
[11:57:41] yorickpeterse: VeganGreg: varies from place to place
[11:57:48] yorickpeterse: some places are fine with it as long as you're productive
[11:57:55] yorickpeterse: some others have a zero-tolerance policy
[11:58:16] [k-: get off Reddit!
[11:58:23] Trynemjoel: has joined #ruby
[11:58:27] basmoura: has joined #ruby
[11:58:30] [k-: shevy: you too
[11:58:35] yorickpeterse: I don't even have Reddit open atm :<
[11:58:37] ytti: if someone thinks people can be productive 8 back-to-back, they are confused
[11:59:02] [k-: s/confused/misguided
[11:59:18] workmad3: s/misguided/wrong
[11:59:25] [k-: so harsh
[11:59:25] but3k4: has joined #ruby
[11:59:49] suchness: I wouldn't mind any of my developers being on IRC.
[12:00:25] basmoura_: has joined #ruby
[12:00:26] suchness: I like people to be get their work done, how they get there is their own prerogative.
[12:01:15] bougyman: hrm. I encourage my teams to be on irc (freenode).
[12:01:18] yorickpeterse: I usually get the most done at 23:00 when I'm about to fall asleep
[12:01:27] yorickpeterse: which is really annoying
[12:02:22] Quandl: has joined #ruby
[12:02:41] ta: has joined #ruby
[12:02:53] ishahnaz: has joined #ruby
[12:02:54] gamename: has joined #ruby
[12:03:17] devoldmx: has joined #ruby
[12:03:54] skade: has joined #ruby
[12:04:08] [k-_: has joined #ruby
[12:06:32] suchness: has joined #ruby
[12:06:57] cantaberry: has joined #ruby
[12:07:04] linuxboytoo: has joined #ruby
[12:08:48] blueOxigen: has joined #ruby
[12:10:46] khebbie: has joined #ruby
[12:11:09] Rixius: has joined #ruby
[12:11:31] joonty: has joined #ruby
[12:11:37] unver: has joined #ruby
[12:12:56] lannonbr: has joined #ruby
[12:14:00] linuxboytoo: has joined #ruby
[12:14:07] Scripore: has joined #ruby
[12:14:08] skade: has joined #ruby
[12:14:36] omegamike: has joined #ruby
[12:14:51] arturhoo: has joined #ruby
[12:15:03] apeiros: VeganGreg: our company takes so much from OSS, I find it easily justifiable to spend time here on company time to help people.
[12:15:25] apeiros: it's a way to give back
[12:15:56] workmad3: apeiros: I got (virtual) cheers for starting to contribute some bug-fixes back upstream for an OSS library we're using @ work!
[12:17:03] Hanmac: for all who does care: there is a new RPGMaker http://www.rpgmakerweb.com/products/programs/rpg-maker-mv but i dont know 100% yet if in the new one ruby does got replaced with javascript or if it still does have ruby
[12:18:08] tkuchiki: has joined #ruby
[12:18:20] apeiros: "MV's screen resolution is now 816x624 pixels." o0
[12:18:23] apeiros: for realsies?
[12:18:39] v0n: has joined #ruby
[12:19:22] apeiros: that's like 1/30 of my screen???
[12:19:28] Hanmac: hm its more than before ;P (and its designed to work in mobile devices too)
[12:19:41] workmad3: hanmac: I wonder if opal will work in it :D
[12:20:24] Hanmac: hm i do not care about that one and i am still developing on my own one (or more concret on one of the dependencies of it)
[12:20:36] apeiros: well, it's 1/2 of my iphone's screen size???
[12:23:28] startupality: has joined #ruby
[12:24:36] krz: has joined #ruby
[12:25:43] tkuchiki: has joined #ruby
[12:25:57] Hanmac: still working on my rwx thing (a binding for wxwidgets) ... trying to make it fail proof ... (that it doesnt crash / segfault) unnecessary what the user does input
[12:26:17] yh_: has joined #ruby
[12:27:43] sdwrage: has joined #ruby
[12:28:33] rbennacer: has joined #ruby
[12:28:59] xcesariox: has joined #ruby
[12:29:10] Hanmac: yorickpeterse: yeah, you seems to know about it?
[12:30:41] jokke: has joined #ruby
[12:31:07] jokke: is it possible to write a threadpool with _real_ processes as workers?
[12:31:28] yorickpeterse: hanmac: I've dabbled with it in the past
[12:31:34] jhass: wouldn't that be a process pool then?
[12:31:41] yorickpeterse: that's called a process pool :P
[12:31:51] jokke: so a process pool
[12:32:08] jhass: but sure, just use some sort of IPC instead of Queue or whatever to distribute the workloads
[12:32:38] yorickpeterse: Hm, surprised concurrent-ruby doesn't have a process pool
[12:32:39] apeiros: somebody probably already wrote one
[12:32:55] jokke: the gem Parallel can't do this, right?
[12:33:00] yorickpeterse: jhass: you can't share a Queue between processes
[12:33:04] apeiros: and if not, I suggest to take a look at https://github.com/apeiros/fork - it provides forks as objects, including IPC
[12:33:15] jhass: yorickpeterse: that's what I said, read again ;)
[12:33:26] Ropeney: has joined #ruby
[12:33:29] jokke: i guess it can't be helped
[12:33:30] yorickpeterse: I read "or Queue"
[12:33:32] darix: you could probably borrow a lot of code from things like unicorn/rainbow for it
[12:34:02] prestorium: has joined #ruby
[12:34:26] jokke: since the workload comes from a lazy enumerator and the items yielded contain a lot of data
[12:34:43] jokke: (which is why i made the iterator lazy)
[12:34:55] jokke: or enumerator
[12:34:59] yorickpeterse: jokke: can you not just use a thread pool?
[12:35:03] joelataylor: has joined #ruby
[12:35:09] jokke: yorickpeterse: i'm doing image processing
[12:35:17] yorickpeterse: you can still do that using threads
[12:35:23] jokke: but they spawn own processe
[12:35:33] yorickpeterse: That shouldn't be a problem
[12:35:56] jokke: except that i'm doing a shasum in pure ruby..
[12:36:07] yorickpeterse: you can still do that using threads
[12:36:23] jokke: i sure can, but it won't be multiprocessed, right?
[12:36:36] jokke: (is that a word?)
[12:36:41] yorickpeterse: The workers themselves would be multi-threaded, but they can still spawn processes for whatever they need
[12:36:42] banister: has joined #ruby
[12:37:01] jokke: yorickpeterse: sure, but they don't spawn a process for getting the shasum
[12:37:19] jokke: and shasums are pretty expensive to compute
[12:37:28] jokke: especially for big files
[12:37:48] jokke: threads can only work concurrently when they're waiting for io or so
[12:38:08] jhass: which you will do a lot when reading big files
[12:38:14] joonty: has joined #ruby
[12:38:16] yorickpeterse: jokke: bullshit
[12:38:23] yorickpeterse: On MRI there's the GIL yes, but it's not bound by just IO
[12:38:26] paulcsmith: has joined #ruby
[12:38:31] yorickpeterse: And there's also Rubinius/JRuby
[12:38:43] jokke: i'm not switching over to jruby for this :D
[12:38:55] michael_mbp: has joined #ruby
[12:39:13] yorickpeterse: MRI can interrupt threads whenever C code calls certain functions (rb_thread_check_ints() IIRC), not just when it does something with IO
[12:40:04] yorickpeterse: Granted it requires code to explicitly opt-in
[12:40:11] yorickpeterse: jokke: if you're dealing with C and what not, try Rubinius
[12:40:22] terlar: has joined #ruby
[12:40:27] yorickpeterse: But even on MRI nothing prevents you from mixing threads and processes
[12:40:40] Azure: has joined #ruby
[12:41:23] phutchins1: has joined #ruby
[12:42:31] Philipp__: has joined #ruby
[12:43:56] dimasg: has joined #ruby
[12:45:08] linuxboytoo: has joined #ruby
[12:45:09] bmurt: has joined #ruby
[12:48:15] tubuliferous_: has joined #ruby
[12:49:14] jeremy04: has joined #ruby
[12:50:04] rodferso1: has joined #ruby
[12:50:15] khebbie: has joined #ruby
[12:51:05] blackmesa: has joined #ruby
[12:51:08] jokke: if i want to create a thread safe enumerator is it enough to synchronize a mutex around yielder << item ?
[12:51:21] hotpancakes: has joined #ruby
[12:51:45] tkuchiki: has joined #ruby
[12:51:56] jokke: so that multiple threads can use enumerator.next
[12:52:13] jokke: probably not..
[12:52:26] vt102: has joined #ruby
[12:52:32] Iskarlar: has joined #ruby
[12:53:12] matcouto: has joined #ruby
[12:53:29] pawnbox: has joined #ruby
[12:54:34] senayar: has joined #ruby
[12:54:38] VeganGreg: has joined #ruby
[12:55:22] victortyau: has joined #ruby
[12:55:23] davedev24: has joined #ruby
[12:55:28] sgambino: has joined #ruby
[12:55:49] Scripore: has joined #ruby
[12:56:34] linuxboytoo: has joined #ruby
[12:57:02] OrbitalKitten: has joined #ruby
[12:57:18] hotpancakes: has joined #ruby
[12:57:49] fmcgeough: has joined #ruby
[12:59:51] malconis: has joined #ruby
[13:00:01] tkuchiki: has joined #ruby
[13:00:03] shredding: has joined #ruby
[13:00:28] yorickpeterse: http://downloads.yorickpeterse.com/images/pick_ruby.png here's how to pick your Rubies
[13:00:35] yorickpeterse: A slightly biased flowchart by Dr. Y. Peterse
[13:00:49] Ropeney: has joined #ruby
[13:01:11] yorickpeterse: I hate how Graphviz doesn't let you add spacing around labels
[13:01:30] symm-: has joined #ruby
[13:01:40] iamninja: has joined #ruby
[13:03:14] yorickpeterse: oh I should probably dump this as SVG
[13:03:31] yorickpeterse: http://downloads.yorickpeterse.com/images/pick_ruby.svg there, SVG
[13:03:50] ljarvis: yorickpeterse: pretty sure there's a margin attribute you can use for the node, what lib are you using? I remember having to do this ages ago
[13:03:50] dEPy: has joined #ruby
[13:03:57] yorickpeterse: just graphviz directly
[13:04:01] yorickpeterse: That is, /usr/bin/dot basically
[13:04:40] jenrzzz: has joined #ruby
[13:05:10] livcd: how should i call functions X,Y,Z,W on each element in ARRAY ? Can anyone post an example of map with composed functions ?
[13:05:32] yorickpeterse: livcd: what have you tried?
[13:06:34] yh: has joined #ruby
[13:06:57] timanema: has joined #ruby
[13:07:13] livcd: yorickpeterse: iterating through array and calling the functions
[13:07:27] jzigmund: has joined #ruby
[13:08:26] sdothum: has joined #ruby
[13:09:16] ta: has joined #ruby
[13:10:11] whippythellama: has joined #ruby
[13:13:06] conor_: has joined #ruby
[13:13:07] jhass: ?code livcd
[13:13:07] ruboto: livcd, We can't help you without your code, please post it to https://gist.github.com
[13:13:09] lucianosousa: has joined #ruby
[13:13:12] jhass: ?fake livcd
[13:13:12] ruboto: livcd, Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
[13:13:16] Iskarlar: has joined #ruby
[13:14:38] casadei: has joined #ruby
[13:14:54] apeiros: yorickpeterse: sadist? not masochist?
[13:15:10] livcd: jhass: i have no code i am just asking
[13:15:31] ponga: has joined #ruby
[13:15:36] jhass: why would you ask if you have no real problem?
[13:16:53] livcd: i am curious
[13:17:27] jhass: then my answer is that it'll become obvious once you actually encounter a real need for it
[13:17:29] jerius: has joined #ruby
[13:18:53] sdothum: has joined #ruby
[13:19:59] skade: has joined #ruby
[13:21:32] allcentury: has joined #ruby
[13:21:59] ferhaty: has joined #ruby
[13:23:13] jeremy04: has joined #ruby
[13:24:04] mrtg9970: has joined #ruby
[13:24:21] phutchins: has joined #ruby
[13:24:43] Zggb: has joined #ruby
[13:24:43] joonty: has joined #ruby
[13:25:07] bronson: has joined #ruby
[13:25:26] dblessing: has joined #ruby
[13:26:10] jbw: has joined #ruby
[13:28:21] dented42: has joined #ruby
[13:28:59] Quandl: has joined #ruby
[13:30:49] User458764: has joined #ruby
[13:31:31] sdothum: has joined #ruby
[13:31:37] sbhatore: has joined #ruby
[13:32:02] jeremy04_: has joined #ruby
[13:33:04] yorickpeterse: apeiros: hmmm, maybe both
[13:33:08] yorickpeterse: also I should add Opal to it
[13:34:07] tmtwd: has joined #ruby
[13:34:49] kies: has joined #ruby
[13:35:29] devdazed: has joined #ruby
[13:35:45] gamename: has joined #ruby
[13:37:33] gamename: has joined #ruby
[13:37:36] hj2007: has joined #ruby
[13:37:54] mistnim: has joined #ruby
[13:38:33] Kallis: has joined #ruby
[13:38:34] govg: has joined #ruby
[13:38:45] gamename: has joined #ruby
[13:39:00] mistnim: can you explain why when returning a private variable from a class method there is no = function?
[13:39:31] apeiros: mistnim: there's no such thing as a "private variable"
[13:39:44] apeiros: hence - please explain what you mean, best with a code example.
[13:39:55] malconis: has joined #ruby
[13:39:55] mistnim: apeiros: I mean a variable like @variable
[13:40:03] apeiros: (also = is not a function, assignment is syntax)
[13:40:20] apeiros: mistnim: ok, that's called instance variable.
[13:40:32] gamename: has joined #ruby
[13:40:32] apeiros: so you return an instance variable from a class method, and what's your problem now?
[13:40:50] mistnim: apeiros: you can't use =
[13:41:09] apeiros: show me what you do and why you say you can't.
[13:41:26] gamename: has joined #ruby
[13:41:34] presto: has joined #ruby
[13:41:42] olivierrr: has joined #ruby
[13:41:58] apeiros: >> class X; @ivar = 123; def self.ivar; @ivar; end; end; value = X.ivar; value
[13:41:59] ruboto: apeiros # => 123 (https://eval.in/415842)
[13:42:10] apeiros: ^ that's how I understood your problem so far btw.
[13:42:13] jokke: what's wrong with this enumerator method? https://p.jreinert.com/OA4Xr/ruby
[13:42:26] momomomomo: has joined #ruby
[13:42:32] apeiros: jokke: you tell us?
[13:42:37] apeiros: jokke: or is this a riddle?
[13:42:55] jokke: well, the block is never run
[13:43:48] jokke: i'm calling it like this: iterator = AttachmentsIterator.new(args[:tenant] => { args[:app] => [args[:version]] }) iterator.each do |attachment| ...
[13:44:12] hj2007: has joined #ruby
[13:45:13] _blizzy_: has joined #ruby
[13:45:25] sdothum: has joined #ruby
[13:45:39] apeiros: jokke: you don't call yielder.yield ?
[13:45:55] apeiros: not in the code you pasted
[13:45:58] jokke: it's a very nested enumerator
[13:46:04] apeiros: and if you're hiding code, we can't help you.
[13:46:10] mistnim: apeiros https://gist.github.com/mistnim/1230352653ce31d3c4bd
[13:46:17] arturhoo: has joined #ruby
[13:46:26] jokke: the point is
[13:46:34] DanielI: has joined #ruby
[13:46:35] apeiros: mistnim: ok, assigning to an ivar does not create methods along with it
[13:46:46] apeiros: mistnim: you want `class C; attr_accessor :a`
[13:46:49] jokke: here: https://p.jreinert.com/vDRvaz/ruby
[13:47:09] jokke: none of those puts are run
[13:47:16] apeiros: mistnim: `attr_accessor :a` essentially defines two methods for you: `def a=(value); @a = value; end` and `def a; return @a; end`
[13:47:24] jokke: except for the "setting iteration plan" one
[13:47:45] Kallis: has joined #ruby
[13:48:26] michael_mbp: has joined #ruby
[13:48:27] apeiros: jokke: so debug your call chain
[13:48:34] apeiros: figure out why it never hits yielder <<
[13:48:34] vt102: has joined #ruby
[13:48:48] jokke: yeah i tried
[13:48:52] jokke: with the puts at least
[13:48:59] jokke: but none are called
[13:49:03] jokke: i wonder why..
[13:49:10] apeiros: can't do that as all I have is your code and nothing to reproduce (though, I'd be out of that anyway, too much)
[13:49:20] mistnim: apeiros: ok, but why can't you use normal assignment syntax to it?
[13:49:35] apeiros: mistnim: because `c.a=` is not assignment. it's a method call.
[13:49:53] adaedra: c.a = foo is the same as c.a=(foo)
[13:50:07] apeiros: mistnim: the normal assignment is `@a =`, and in order to use that, you have to be in the context of the object to which the ivar belongs. e.g. in an instance method.
[13:50:31] joonty: has joined #ruby
[13:50:34] apeiros: mistnim: in other words: you can't write or read instance variables from outside without going through a method call.
[13:51:33] Azure: has joined #ruby
[13:51:34] mistnim: apeiros: ok ok, but I don't get why you wouldn't allow that
[13:52:01] adaedra: because it's internal
[13:52:15] adaedra: you don't want bad objects outside of yours to access your internals
[13:52:52] adaedra: But there's attr_reader, attr_writer and attr_accessor to write quickly accessors
[13:52:53] apeiros: mistnim: the concept is called "encapsulation"
[13:53:14] apeiros: internal state must be explicitly made public, otherwise it remains internal.
[13:53:21] apeiros: it's a design decision
[13:53:28] apeiros: JS e.g. does it the opposite way
[13:54:04] apeiros: the result of this decision is that it forces you, the programmer, to plan what you reveal and what not.
[13:54:18] jokke: or do i...
[13:54:23] apeiros: as a user, you can always bypass those limits, though. see instance_variable_get, _set
[13:54:32] apeiros: also see instance_eval and _exec
[13:55:19] quimrstorres: has joined #ruby
[13:55:29] casadei: has joined #ruby
[13:55:45] hotpancakes: has joined #ruby
[13:55:48] govg: has joined #ruby
[13:55:53] jokke: Class.new { def each; Enumerator.new { |y| y << 'hello }; end }.new.each { |foo| puts(foo) }
[13:55:53] adaedra: that's cheating!
[13:55:57] jokke: this doesn't work
[13:56:03] jokke: it returns an enumerator
[13:56:19] rbennacer: has joined #ruby
[13:56:36] mistnim: apeirons: ok I guess I understand, thanks
[13:58:17] apeiros: ?tabnick MisterRusty
[13:58:18] ruboto: MisterRusty, pro-tip - use tab completion for nicks. avoids typos in nicks.
[13:58:22] apeiros: tabfail :D
[13:58:33] apeiros: ?tabnick mistnim
[13:58:33] ruboto: mistnim, pro-tip - use tab completion for nicks. avoids typos in nicks.
[13:58:41] hj2007: has joined #ruby
[13:58:50] apeiros: damn you limechat, why do you autocomplete so bad?!
[13:59:25] sdothum: has joined #ruby
[13:59:36] apeiros: way to kill the point of suggesting people to use tabcomplete :D
[14:00:22] cpruitt: has joined #ruby
[14:00:33] silkfox: has joined #ruby
[14:00:59] juanpaucar: has joined #ruby
[14:01:22] joonty: has joined #ruby
[14:02:40] qubitz: has joined #ruby
[14:04:02] devoldmx: has joined #ruby
[14:04:18] segy: has joined #ruby
[14:05:40] x0c0d3: has joined #ruby
[14:06:10] jenrzzz: has joined #ruby
[14:06:22] deepu: has joined #ruby
[14:08:57] Zeroe: has joined #ruby
[14:09:27] RegulationD: has joined #ruby
[14:10:42] jpfuentes2: has joined #ruby
[14:11:20] dented42: has joined #ruby
[14:12:14] Rubie: has joined #ruby
[14:14:20] khebbie: has joined #ruby
[14:14:39] umgrosscol: has joined #ruby
[14:17:58] dopie: has joined #ruby
[14:18:07] hal_9000: Announcement repeated for later timezones??? :)
[14:18:12] sanguisdex: has joined #ruby
[14:18:13] hal_9000: ANN: Johnny Winn and Hal Fulton are crowdfunding a book, _Elixir for the Functional Rubyist_.
[14:18:14] hal_9000: Feel free to support this project! http://igg.me/at/elixir4rubyists
[14:18:25] dopamean_: has joined #ruby
[14:18:29] mistnim: ok so you use a attr_reader because you don't want your ivar to be changed externally, but isn't it pointless when there are some ivar methods, like map!, that can actually change its value?
[14:18:32] sarkyniin: has joined #ruby
[14:19:06] haylon: has joined #ruby
[14:19:13] adaedra: attr_reader is just a quick way of creating accessors
[14:19:18] adaedra: 'ivar methods' means nothing
[14:19:30] porfa: has joined #ruby
[14:19:46] adaedra: access and modification to internal state (ivars) is done by methods on the object
[14:20:09] jordanm: has joined #ruby
[14:21:31] hinbody: has joined #ruby
[14:21:37] dopamean_: has joined #ruby
[14:22:05] dopamean_: has joined #ruby
[14:24:57] msnyon: has joined #ruby
[14:24:58] Torrieri: has joined #ruby
[14:25:01] centrx: has joined #ruby
[14:25:26] f4cl3y: has joined #ruby
[14:25:26] f4cl3y: has joined #ruby
[14:25:48] coban2k: has joined #ruby
[14:26:04] shock_one: has joined #ruby
[14:26:27] apeiros: mistnim: map! does not change an ivar. it changes an object.
[14:26:39] apeiros: the concepts of object and variables are quite different.
[14:26:50] skade: has joined #ruby
[14:27:13] haxrbyte: has joined #ruby
[14:27:16] linuxboytoo: has joined #ruby
[14:27:24] apeiros: and to answer your question: no, the existence of mutating methods does not make it pointless.
[14:27:32] freerobby: has joined #ruby
[14:29:23] mago0: has joined #ruby
[14:32:17] Iskarlar: has joined #ruby
[14:32:18] railsraider: has joined #ruby
[14:32:58] shock_one: mistnim: you use attr_reader for the same old reasons: to abstract away internal access to a variable or to have a public getter.
[14:34:47] _lovehandle_: has joined #ruby
[14:35:39] terlar: has joined #ruby
[14:35:52] Zeroe_: has joined #ruby
[14:35:55] Philipp__: has joined #ruby
[14:36:26] mistnim: well, ok I have studied some basic c++ before ruby, and I am accustomed to the idea that when using only a getter, whatever you do with what you get won't influence the object state
[14:36:40] Rutix: has joined #ruby
[14:36:40] Rutix: has joined #ruby
[14:36:47] tubuliferous_: has joined #ruby
[14:37:01] JoshL: has joined #ruby
[14:37:19] baroquebobcat: has joined #ruby
[14:38:11] havenwood: has joined #ruby
[14:39:03] porfa: has joined #ruby
[14:39:38] Philipp__: has joined #ruby
[14:39:39] blackmesa: has joined #ruby
[14:40:10] porfa: hello! I'm in need of a newbie tutorial on mechanize, i just really need to submit a form, I've learned yesterday how to navigate throughout the stuff i wanna go and mess with, but now i can't submit it, I'm missing something really simple I'm sure ( https://gist.github.com/anonymous/d200b616c9c1670d2e9c ) that's my gist.
[14:40:14] codecop: has joined #ruby
[14:40:23] porfa: would that work?
[14:40:53] porfa: i was doing this more intensively a month ago, but something happened and i had to leave :(
[14:40:55] ta: has joined #ruby
[14:41:36] c0m0: has joined #ruby
[14:41:51] Chau: has joined #ruby
[14:41:53] linuxboytoo: has joined #ruby
[14:42:17] c0m0: can use delf self.mymethod for declare a method inside my class?
[14:42:33] RegulationD: has joined #ruby
[14:42:34] c0m0: sorry def self.mymethod
[14:43:17] [k-_: c0m0: what do you mean by "inside my class"
[14:43:28] [k-_: c0m0: how do you want to call the method?
[14:43:36] Igor2__: i like mrb_get_arg() so much that I'll probably implement something similar in libmawk
[14:43:44] c0m0: I have a class Animal, I will show the code
[14:44:37] Scripore: has joined #ruby
[14:44:58] blue_deref: has joined #ruby
[14:46:11] c0m0: http://pastebin.com/nxui8vju
[14:46:11] ruboto: c0m0, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/fed97629658cb6d0d8e6
[14:46:12] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[14:46:54] [k-_: c0m0: what you want is def check_name
[14:47:09] [k-_: c0m0: you are almost there!, pretty good, i'll say
[14:48:41] shevy: c0m0 yes a class method
[14:48:45] shevy: then you can avoid .new
[14:49:17] vaedd: has joined #ruby
[14:49:38] c0m0: shevy: can you show as avoid new
[14:49:55] [k-_: shevy: -____-
[14:50:01] chouhoul_: has joined #ruby
[14:50:16] shevy: c0m0 well you already showed the code above yourself :) def self.mymethod
[14:50:35] linuxboytoo: has joined #ruby
[14:51:00] shevy: >> class Monkey; def self.dance; puts 'The monkey dances.'; end; end; Monkey.dance
[14:51:01] ruboto: shevy # => The monkey dances. ...check link for more (https://eval.in/415888)
[14:51:57] _lovehandle_: has joined #ruby
[14:52:06] weemsledeux: has joined #ruby
[14:52:13] dtzitz: has joined #ruby
[14:52:21] [k-_: at least this is stateless
[14:52:37] ryuu: has joined #ruby
[14:52:37] josh3: has joined #ruby
[14:53:49] mary5030: has joined #ruby
[14:54:37] saddad: has joined #ruby
[14:54:55] rippa: has joined #ruby
[14:55:26] Rubie: has joined #ruby
[14:55:54] mary5030: has joined #ruby
[14:55:57] hobodave: has joined #ruby
[14:56:30] c0m0: but I don't use new methos, How can pass the parameters to the class initialize ?
[14:58:43] luckyme: has joined #ruby
[14:59:26] livcd: what's the most tricky / advanced feature or paradigm for ruby ?
[14:59:26] shevy: c0m0 initialize is called via .new, after an intrinsic call to .allocate I think
[14:59:38] Thermatix: I'm getting a version problem that doesn't make much sense to me
[14:59:57] Thermatix: I'm getting: Unable to activate react.rb-0.3.0, because opal-0.8.0 conflicts with opal (~> 0.6.0), sprockets-3.2.0 conflicts with sprockets (< 3.0.0, >= 2.2.3)
[15:00:06] theRoUS: has joined #ruby
[15:00:06] theRoUS: has joined #ruby
[15:00:09] startupality: has joined #ruby
[15:00:10] shevy: c0m0 so when you wish to call initialize then you must use .new; you can instantiate a new object inside: def self.foo; Foo.new; end
[15:00:15] centrx: livcd, it's all easy with Ruby!
[15:00:17] adaedra: you have requirements which have incompatible requirements, thermatix
[15:00:20] Thermatix: which doesn't make sense becuase I'm using opal "0.6.3" and sprockets "2.12.4"
[15:00:33] shevy: thermatix that is indeed a weird error
[15:00:58] shevy: opal conflicts with opal, who would have thought
[15:01:15] adaedra: opal 0.8.0 conflicts with opal ~> 0.6.0
[15:01:17] adaedra: it's logical
[15:01:29] icebourg: has joined #ruby
[15:01:37] havenwood: what's depending on that old Opal?
[15:01:40] Thermatix: but I'm not using opal 0.8.0
[15:01:47] bmurt: has joined #ruby
[15:01:47] Thermatix: I'm using "0.6.0"
[15:01:54] Thermatix: I'm using "0.6.3"*
[15:01:58] havenwood: then what's depending on the new Opal?
[15:02:04] Thermatix: I don't know
[15:02:07] shevy: some gem must have registered that dependency
[15:02:07] adaedra: 0.6.3 corresponds to ~> 0.6.0
[15:02:09] Thermatix: but I'm not
[15:02:34] Thermatix: umm how can I find what's depending on a certain gem?
[15:02:35] adaedra: thermatix: try bundle update
[15:02:40] linuxboytoo: has joined #ruby
[15:02:50] adaedra: rubygems.org has all dependencies
[15:03:00] Thermatix: that didn't work sadly :(
[15:03:02] Quandl: has joined #ruby
[15:03:19] havenwood: thermatix: gem dependency opal --reverse-dependencies
[15:03:22] lessless: has joined #ruby
[15:03:38] yorickpeterse: havenwood: that only shows what's installed locally
[15:03:55] yorickpeterse: https://rubygems.org/api/v1/gems/opal/reverse_dependencies.json
[15:03:58] Thermatix: which is fine
[15:04:02] havenwood: yorickpeterse: Was hoping the offender might be installed.
[15:04:11] shevy: the evil offender
[15:04:13] icebourg: has joined #ruby
[15:04:28] havenwood: yorickpeterse: I also haven't had coffee so it's a miracle if I'm coherent. Fixing that! :D
[15:04:46] sivan1525: has joined #ruby
[15:05:19] Thermatix: react.rb is depending on opal-activesupport-0.1.0 which depends on opal-0.8.0
[15:05:38] shevy: I don't know what gem it is either, sprockets has no direct opal dependency, react neither
[15:06:01] shevy: what or where does react.rb belong to?
[15:06:03] olivierrr: has joined #ruby
[15:06:06] tkuchiki_: has joined #ruby
[15:06:09] Thermatix: but if I change opal to version 0.8.0
[15:06:16] Thermatix: sprockets then breaks
[15:06:19] sivan1525: Hii I need help with getting output of float in the following format. example: 10.0000 instead of 10.0
[15:06:43] shevy: sivan1525 for display purposes you can require those trailing 0, see the sprintf formatting rules
[15:06:50] adaedra: &ri String#% sivan1525
[15:06:51] `derpy: http://www.rubydoc.info/stdlib/core/String#%25-instance_method
[15:07:04] shevy: >> '%.6f' % '3.0'
[15:07:05] ruboto: shevy # => "3.000000" (https://eval.in/415893)
[15:07:08] Thermatix: so I up sprockets from 2.12.4 to ~> 3.1 and
[15:07:18] nux443: has joined #ruby
[15:07:19] sivan1525: if I use sprintf it gives output in string where as I need the output in float
[15:07:26] jenrzzz: has joined #ruby
[15:07:33] podman: has joined #ruby
[15:07:34] shevy: >> 10.0000
[15:07:35] ruboto: shevy # => 10.0 (https://eval.in/415894)
[15:07:41] adaedra: 10.0000 and 10.o are the same float
[15:07:41] shevy: see sivan1525 the 0 get chopped away
[15:07:52] Thermatix: then react.rb wants ~> 0.6 and ~> 0.8 is too high
[15:07:53] sivan1525: as the test cases require it to be in float rather than string
[15:07:59] alxndr: has joined #ruby
[15:08:01] shevy: yes it is a float
[15:08:05] daxroc: has joined #ruby
[15:08:12] Thermatix: sooo vicious circle :P
[15:08:17] havenwood: yorickpeterse: An nice! Just saw your lovely API link. :)
[15:08:22] ss_much: has joined #ruby
[15:08:23] shevy: thermatix react.rb belongs to which gem?
[15:08:24] sphex: has joined #ruby
[15:08:24] sivan1525: Yes the 0's get chopped
[15:08:27] ponga: has joined #ruby
[15:08:28] nickfausnight: has joined #ruby
[15:08:41] adaedra: it's default float representation as string
[15:08:41] keen_: has joined #ruby
[15:08:46] culturelabs: has joined #ruby
[15:08:46] alekst_: has joined #ruby
[15:09:04] adaedra: but internally, 10.0, 10.000000 and 10.00000000000000000000000000000000000000000000000000000000000000000000000000000 are the same
[15:09:12] trwyth: has joined #ruby
[15:09:12] shevy: ok that gem https://rubygems.org/gems/react.rb
[15:09:33] Rubie: has joined #ruby
[15:09:39] shevy: It has a runtime dependenciey on opal ~> 0.6.0
[15:09:58] shevy: now havenwood knows who the offender is, he can unwrap his surgical toolset soon
[15:10:02] chouhoulis: has joined #ruby
[15:10:02] sivan1525: The requirement is such that I need it in this form 10.000000 rather than 10.0
[15:10:15] adaedra: sivan1525: where do you want it in this form?
[15:10:17] Thermatix: which installs active support 0.1.0
[15:10:24] akitada: has joined #ruby
[15:10:26] RobertBirnie: has joined #ruby
[15:10:37] shevy: sivan1525 but look at the above example, ruby will keep it as 10.0 rather than 10.000; your only option is to compare formatted-strings then if you need more than one 0
[15:10:37] kapowaz: has joined #ruby
[15:10:40] duoi: has joined #ruby
[15:10:41] duoi: has joined #ruby
[15:10:53] rflot: has joined #ruby
[15:11:03] sivan1525: there was a programming contest on hackerearth which needed in the 10.000 form
[15:11:10] trwyth: has joined #ruby
[15:11:35] Thermatix: so I set opal to 0.6.0 annnd sprockets is now too high, so I downgrade sprockets to "2.12.4"
[15:11:44] Zeroe: has joined #ruby
[15:11:47] Guest85414______: has joined #ruby
[15:11:47] Thermatix: and then when I run my ruby code
[15:11:47] adaedra: sivan1525: to *display* in this form, right?
[15:11:51] sivan1525: there was a programming contest on hackerearth which needed in the 10.000 form as they had written test case fot it in that way and I had no control over it
[15:11:59] Thermatix: I get Unable to activate react.rb-0.3.0, because opal-0.8.0 conflicts with opal (~> 0.6.0), sprockets-3.2.0 conflicts with sprockets (< 3.0.0, >= 2.2.3)
[15:12:03] basmoura: has joined #ruby
[15:12:08] jgpawletko: has joined #ruby
[15:12:21] shevy: yeah, the -> dependency does not allow a version difference
[15:12:27] shevy: the ~> one
[15:12:28] Thermatix: so what do I do?
[15:12:48] bove: has joined #ruby
[15:12:50] tmtwd: has joined #ruby
[15:12:53] Thermatix: react.rb wants a lower one but one of it's dependenies wants a higher one
[15:13:08] adaedra: you file an issue to the developper.
[15:13:16] skarn: has joined #ruby
[15:13:18] Thermatix: which developer?
[15:13:20] shevy: yeah I see, the sprocket dependencies is also hardlocked in react.rb
[15:13:24] sivan1525: please check the output as required here https://goo.gl/bFhD9T
[15:13:25] afs: has joined #ruby
[15:13:30] adaedra: of react.rb, thermatix
[15:13:40] shevy: that requires a login :(
[15:13:44] adaedra: sivan1525: requires login.
[15:13:56] shevy: can you paste the code or requirement on a pastie site?
[15:13:59] adaedra: sivan1525: if it's an /output/ required, you can format to a string then display.
[15:14:00] hotpancakes: has joined #ruby
[15:14:28] shevy: thermatix if everything fails, you could modify the .gemspec file to get rid of the hard lock dependency, but this may not work :D
[15:14:37] dr3w: has joined #ruby
[15:14:37] Thermatix: it's github hasn't been touched in 2 months :(
[15:14:39] porfa: can anyone hep me out submitting a form in ruby + mechanize ? I'm reading a a lot of stuff, but i need some questions answered i can't in google??? for i.e., do i need to emulate a browser for me to submit a simple form, on a open site like.. google? do i need to send the data in specific formatation or i just need to change the forms values as i please and submit?
[15:15:04] angrywombat: has joined #ruby
[15:15:18] shevy: thermatix 2 months is semi-ok, there are projects with +5 years no modifications!
[15:15:32] Thermatix: and it has numerous issues and PR's as well
[15:15:44] startupality: has joined #ruby
[15:15:49] kevrom: has joined #ruby
[15:15:51] angrywombat: hey guys, i'm having trouble with running ruby in zsh
[15:15:57] sivan1525: here is the pastie link http://pastie.org/10346524
[15:16:04] shevy: the above is why I don't specify hardlocked dependencies in my gems btw, I tell people to always upgrade
[15:16:17] havenwood: angrywombat: In what sense?
[15:16:17] angrywombat: keeps saying 'no command ruby found' or something but i know it's installed
[15:16:24] Thermatix: you mean use uncertain versioning?
[15:16:25] juanpaucar: has joined #ruby
[15:16:29] havenwood: angrywombat: Is it in a location in your PATH/
[15:16:30] ta: has joined #ruby
[15:16:38] Thermatix: @angrywombat
[15:16:47] Thermatix: what happens when you type ruby -v
[15:16:53] shevy: hey that text does not even mention the word float sivan1525 :D
[15:17:15] shevy: "For each test case, print the required answer rounded to exactly 4 decimal digits."
[15:17:26] shevy: so just use a method that can ensure that requirement
[15:17:43] angrywombat: thermatix: ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
[15:17:43] sivan1525: yes but if I use sprintf it not accepting : )
[15:18:04] havenwood: angrywombat: command -v ruby
[15:18:20] angrywombat: /usr/local/bin/ruby
[15:18:35] Scripore: has joined #ruby
[15:18:37] Thermatix: is /usr/local/bin/ in your path?
[15:18:47] sivan1525: It says "For each test case, print the required answer rounded to exactly 4 decimal digits."
[15:18:59] angrywombat: thermatix: yes
[15:19:02] shevy: >> '%.4f' % "10.0"
[15:19:03] ruboto: shevy # => "10.0000" (https://eval.in/415895)
[15:19:14] havenwood: angrywombat: echo $PATH
[15:19:31] Thermatix: but when you type ruby some_file.rb, it erros with "no command ruby found"?
[15:19:37] angrywombat: havenwood: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/lib/jvm/java-6-sun/bin
[15:19:39] sivan1525: here is the output file link https://goo.gl/GCYvSS
[15:20:03] Thermatix: that is odd
[15:20:04] havenwood: angrywombat: Sanity check you're still correct that `ruby -v` actually results in: zsh: command not found: ruby
[15:20:31] angrywombat: oh wait, i just have too many panes open
[15:20:38] Thermatix: he said it responds with ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
[15:20:47] angrywombat: i am ssh'd in the multiple boxes
[15:20:48] Oka: has joined #ruby
[15:20:49] havenwood: Usually turning it off and turning it back on again works.
[15:21:02] Thermatix: glad to help
[15:21:57] dtzitz: has left #ruby: ()
[15:22:14] basmoura_: has joined #ruby
[15:22:22] jbw: has joined #ruby
[15:22:48] pdoherty: has joined #ruby
[15:22:55] mistnim: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")
[15:23:07] phutchins1: has joined #ruby
[15:23:16] hakunin: has joined #ruby
[15:23:31] railsraider: has joined #ruby
[15:23:38] ctalr: has joined #ruby
[15:23:38] phutchins1: Anyone by chance know why to_a is not working on BSON::ObjectId for me here? http://pastebin.com/paRVP8ZW
[15:23:39] ruboto: phutchins1, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0a06db319dc6b61b0f1b
[15:23:39] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[15:23:57] phutchins1: well thanks ruboto!
[15:23:58] silkfox: has joined #ruby
[15:24:13] ruboto: I'm just a bot. You don't need to address me.
[15:24:22] shevy: well this object does not respond to .to_a
[15:24:32] dorei: has joined #ruby
[15:24:44] phutchins1: I see it responding to to_a elsewhere, and it was working before i updated a few things...
[15:24:56] phutchins1: trying to figure if its a jruby thing, or that i'm using the mongo BSON or what
[15:25:09] shevy: http://www.rubydoc.info/github/mongodb/bson-ruby/BSON/ObjectId
[15:25:12] phutchins1: I've tried using require 'bson'
[15:25:20] EagleDelta: has joined #ruby
[15:25:29] shevy: the docu there has no reference to a .to_a method, there is a .hash method if that helps
[15:25:34] jhass: phutchins1: where do you see it respond to to_a?
[15:25:45] jhass: and what would that return anyhow?
[15:26:01] phutchins1: Here: http://api.mongodb.org/ruby/1.2.0/BSON/ObjectId.html#to_a-instance_method
[15:26:15] kevrom: has left #ruby: ("WeeChat 1.2")
[15:26:15] sbhatore: has joined #ruby
[15:26:54] B1n4r10: has joined #ruby
[15:26:58] shevy: I guess they removed it
[15:26:58] phutchins1: jhass: it returns an array that I can then pack and unpack binary
[15:27:13] jhass: phutchins1: 1.2.0 seems really old
[15:27:17] jhass: which version do you actually use?
[15:27:21] shevy: this is funny jhass
[15:27:22] shevy: https://rubygems.org/gems/bson/versions
[15:27:26] sivan1525: @shevy , can you point me out to get the output in required format https://goo.gl/GCYvSS . Thanks in advance :)
[15:27:30] shevy: oh wait yes, 1.2.0
[15:27:42] shevy: 1.12.3 was released June 4, 2015
[15:27:45] jhass: http://api.mongodb.org/ruby/current/ the current version doesn't even ship with BSON anymore
[15:27:53] shevy: 3.2.1 was released July 30, 2015 (44 KB)
[15:27:58] phutchins1: well this is what i'm trying to do: https://github.com/phutchins/logstash-input-mongodb/blob/master/lib/logstash/inputs/mongodb.rb#L253
[15:28:03] shevy: pretty weird versioning scheme
[15:28:25] adaedra: shevy: why?
[15:28:28] shevy: sivan1525 and how do you store this internally?
[15:28:37] jhass: phutchins1: figure out what versions you have and want to support
[15:28:41] shevy: adaedra you release two version numbers a few days apart; one 1.x.x, the other 3.x.x
[15:29:00] adaedra: shevy: different release lines, when you keep updating old versions
[15:29:50] adaedra: rather common
[15:29:51] terlar: has joined #ruby
[15:29:52] shevy: adaedra this is why ruby 1.8.x should have been immortal!
[15:30:15] adaedra: ACTION slaps shevy around a bit with a large trout
[15:30:29] phutchins1: jhass: I'm requiring mongo 2.0.0
[15:30:42] jhass: phutchins1: the current mongo version is 2.0.6, which depends on BSON 3.x
[15:30:43] mrtg9970: has joined #ruby
[15:30:46] rcvalle: has joined #ruby
[15:30:46] jhass: http://www.rubydoc.info/gems/bson/3.2.1/BSON/ObjectId
[15:30:55] phutchins1: ah that would do it...
[15:30:57] sivan1525: shevy, Don't know about that but other users had written the same program in ruby and their programs are passing so I am confused here
[15:31:29] rdark: has joined #ruby
[15:31:32] phutchins1: jhass: now i just gotta figure out what to_a on an objectid did :)
[15:31:51] jhass: phutchins1: or rather http://www.rubydoc.info/gems/bson/3.0.0/BSON/ObjectId for the minimum requirement
[15:32:13] phutchins1: jhass: gotcha.
[15:32:41] shevy: sivan1525 I am sure they use a method that ensures the right amount of decimal values. if you have stored things properly internally, you can format it in any way; there is no way ruby internally has a 10.000 though, it would always be a 10.0 if it is a float, so all of them must do a conversion
[15:32:45] jhass: I'd guess #to_bson or something
[15:32:53] Cache_Money: has joined #ruby
[15:33:06] tmtwd: has joined #ruby
[15:33:09] phutchins1: jhass: yeah i'm on bson 3.2.1 now... ah, taking a look
[15:35:05] hotpancakes: has joined #ruby
[15:38:02] prestorium: has joined #ruby
[15:38:16] Guest85: has joined #ruby
[15:38:25] Iskarlar: has joined #ruby
[15:38:34] sivan1525: shevy , okay will check into making a seperate method for displaying that, thanks for looking out :)
[15:38:54] robh71: has joined #ruby
[15:39:11] jerematic: has joined #ruby
[15:40:59] Pisuke: has joined #ruby
[15:41:07] riffraff: has joined #ruby
[15:41:19] nobitanobi: has joined #ruby
[15:41:58] blackmesa: has joined #ruby
[15:42:34] hmnhf: has joined #ruby
[15:42:34] sivan1525: shevy I found the answer here http://stackoverflow.com/a/17584846
[15:42:49] livcd: what's the most tricky / advanced feature or paradigm for ruby ?
[15:43:01] adaedra: sivan1525: that's what we told you first
[15:43:08] araujo: has joined #ruby
[15:43:26] unver: livcd: probably objects
[15:44:18] da3mian: has joined #ruby
[15:44:52] sivan1525: adaedra - sorry for misunderstanding I was using p for getting output instead of puts
[15:45:08] hmnhf: has joined #ruby
[15:45:20] josh3: has joined #ruby
[15:45:21] roolo: has joined #ruby
[15:45:27] Vile`: has joined #ruby
[15:45:35] dorei: >>('??'..'??').size
[15:45:35] hotpancakes: has joined #ruby
[15:45:35] ruboto: dorei # => nil (https://eval.in/415911)
[15:45:38] dorei: >>('??'..'??').to_a.size
[15:45:39] ruboto: dorei # => 17 (https://eval.in/415912)
[15:45:42] dorei: why is this happening?
[15:46:00] yorickpeterse: >> ('??'..'??')
[15:46:01] ruboto: yorickpeterse # => "??".."??" (https://eval.in/415913)
[15:46:05] yorickpeterse: >> ('??'..'??').to_a
[15:46:06] ruboto: yorickpeterse # => ["??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??", "??"] (https://eval.in/415914)
[15:46:10] yorickpeterse: because of that
[15:46:14] phutchins1: jhass: can you by chance tell off hand what it's doing here? https://gist.github.com/anonymous/79e91f0fc4acba859de8
[15:46:21] dorei: yorickpeterse: is that a bug?
[15:46:23] nirvdrum: has joined #ruby
[15:46:25] chrishough: has joined #ruby
[15:46:41] phutchins1: maybe converting to binary string
[15:46:43] hpoydar: has joined #ruby
[15:47:27] deepu: has joined #ruby
[15:47:28] djstorm: has joined #ruby
[15:47:37] yorickpeterse: dorei: probably not
[15:47:41] [k-_: there are 24 letters in the greek alphabet?
[15:47:46] phutchins1: well not binary or hex
[15:47:47] dorei: [k-: yeap
[15:48:01] yorickpeterse: The reasoning is probably that this relies on Unicode codepoints
[15:48:04] pyon: has joined #ruby
[15:48:10] yorickpeterse: and the codepoint of ?? is 329
[15:48:14] dorei: yorickpeterse: shouldn't ('A'..'??').size return 17 too?
[15:48:17] hotpancakes: has joined #ruby
[15:48:19] yorickpeterse: But that of ?? is 931
[15:48:22] yorickpeterse: so it falls out of the range
[15:48:23] big|bad|wolf: has joined #ruby
[15:48:26] dorei: the most strange behaviour is this
[15:48:34] [k-_: >> ('??'..'??').to_a.size
[15:48:35] ruboto: [k-_ # => 25 (https://eval.in/415915)
[15:48:46] jhass: >> "55a2ff4cea9b00cb23789e22".each_char.each_slice(2).map {|b| b.join.to_i(16) } # phutchins1
[15:48:47] yorickpeterse: Enumerator#size does not return a dynamic size
[15:48:47] ruboto: jhass # => [85, 162, 255, 76, 234, 155, 0, 203, 35, 120, 158, 34] (https://eval.in/415916)
[15:48:51] dorei: >> ('??'..'??').include?('??')
[15:48:52] ruboto: dorei # => false (https://eval.in/415917)
[15:48:53] yorickpeterse: it simply returns a pre-determined size
[15:48:56] yorickpeterse: use #count instead
[15:48:59] dorei: >> ('??'..'??').cover?('??')
[15:49:00] ruboto: dorei # => true (https://eval.in/415918)
[15:49:07] yorickpeterse: >> ('??'..'??').count
[15:49:08] ruboto: yorickpeterse # => 17 (https://eval.in/415919)
[15:49:20] [k-_: what is this madness
[15:49:24] jhass: phutchins1: interpreting each two characters as a byte in hexadecimal
[15:49:26] dorei: [k-: there's a variant in '??', it's written '??' in the middle of a word, while it's written '??' in the end of a word
[15:49:41] phutchins1: jhass: you rock.
[15:50:49] dorei: yorickpeterse: thanx about the insight in the subtle difference between #count and #size :)
[15:50:55] yorickpeterse: dorei: tl;dr a character range only works reliably for ASCII characters
[15:51:09] chinmay_dd: has joined #ruby
[15:52:08] eGGsha: has joined #ruby
[15:52:20] NeverDie: has joined #ruby
[15:53:02] saddad: has joined #ruby
[15:53:56] angrywombat: has left #ruby: ("WeeChat 1.2")
[15:54:28] hmnhf: has joined #ruby
[15:54:55] leat: has joined #ruby
[15:55:02] senayar: has joined #ruby
[15:55:10] lannonbr: has joined #ruby
[15:55:13] galeido: has joined #ruby
[15:55:57] blackmesa: has joined #ruby
[15:57:23] diego_ar: has joined #ruby
[15:57:29] coban2k: has joined #ruby
[15:58:18] rehat: has joined #ruby
[15:59:30] bnizzle: has joined #ruby
[15:59:37] dperalta_: has joined #ruby
[15:59:54] tuor: hi, I have finished the first version of my "mini gem". It's just one thing and it's based on an other one. So this is the code: https://gist.github.com/anonymous/1573a0036fa6605c3e54
[16:00:16] hotpancakes: has joined #ruby
[16:00:22] railsraider: has joined #ruby
[16:00:56] hololeap: has joined #ruby
[16:01:17] tuor: it's my first ruby programm. My first (more the 10 line) programm. I know bash but that's it. So pleas tell me what you would do better or so. thx. :)
[16:01:39] zitar: has joined #ruby
[16:02:00] ljarvis: tuor: your question is incredibly vague. Is there a part of your code you'd like help on? or do you actually want someone to review all of it?
[16:02:07] techsethi: has joined #ruby
[16:02:27] bnizzle: has joined #ruby
[16:03:01] tuor: it's working. So review^^ I mean if someone has time. Or just review "fast". Or just how the syntax is.
[16:03:16] towski_: has joined #ruby
[16:03:26] atmosx: dorei: how's life :-)
[16:03:51] tuor: It's about how to write ruby in global.
[16:03:53] malconis_: has joined #ruby
[16:04:06] tuor: ljarvis, <-
[16:04:29] ljarvis: tuor: ok, I think your initialize argument spanning multiple lines is a bit ugly
[16:04:35] malconis_: has joined #ruby
[16:04:58] bnizzle: has left #ruby: ()
[16:05:02] devoldmx: has joined #ruby
[16:05:05] shevy: it makes it more readable
[16:05:19] ljarvis: tuor: also, in general, constants are UPPER_CASE
[16:05:22] bnizzle: has joined #ruby
[16:05:29] shevy: line 51 seems off
[16:05:46] ljarvis: "it makes it more readable" => "line 51 seems off" -- lol
[16:05:57] [k-_: SCREAMING_UPPER_SNAKE_CASE
[16:06:05] yorickpeterse: METAL_SNAKE_CASE
[16:06:06] shevy: it's on the same indent level as the end
[16:06:17] [k-_: another "admin" username as default :s
[16:06:28] ljarvis: it's on the same line as the method definition
[16:06:36] egtann: has joined #ruby
[16:06:56] ljarvis: tuor: def initialize(options = DEFAULT_OPTIONS)
[16:07:09] duderonomy: has joined #ruby
[16:07:17] atmosx: tuor: I wouldn't use instance variabels in teh code, I'd use attr_reader to depend on behavior not ata
[16:07:19] tuor: ljarvis, ah ok. I'll change the constant name and this to.
[16:07:30] Lildirt: has joined #ruby
[16:07:40] ljarvis: yeah using readers is better imo too
[16:07:48] mleung: has joined #ruby
[16:08:05] ljarvis: imported_templates should be a Set
[16:08:08] [Butch]: has joined #ruby
[16:08:10] [k-_: when calling super alone, ruby will pass all arguments to the "super method"
[16:08:29] but3k4: has joined #ruby
[16:08:43] ljarvis: list_dependencies uses list = [] and each, you could use map instead
[16:08:45] [k-_: so if you are passing all arguments to super, might as well not list them twice
[16:09:34] phutchins1: jhass: yep, that did the trick. your help is much appreciated!
[16:09:47] ljarvis: tuor: https://gist.github.com/leejarvis/d57cb71c8f84839e53c7
[16:09:50] khebbie: has joined #ruby
[16:09:55] TomyLobo: has joined #ruby
[16:10:01] hahuang61: has joined #ruby
[16:10:09] yh: has joined #ruby
[16:10:17] dfockler: has joined #ruby
[16:10:18] riotjones: has joined #ruby
[16:10:31] arta82: has joined #ruby
[16:10:38] [k-_: https://gist.github.com/anonymous/1573a0036fa6605c3e54#file-zabbixsync-rb-L74-L76
[16:10:39] atmosx: I would also change the 'unless' to 'if' here: https://gist.github.com/anonymous/1573a0036fa6605c3e54#file-zabbixsync-rb-L103 since it's an unless/else it could easily be done in if/else (easier to read, but also kinda irrelevant if the current version works)
[16:11:11] [k-_: use .empty? instead of == []
[16:11:13] skysploit: has joined #ruby
[16:11:29] ljarvis: also, move all that code outside of the file read block
[16:11:38] ljarvis: file open block*
[16:11:39] quimrstorres: has joined #ruby
[16:12:05] [k-_: https://gist.github.com/anonymous/1573a0036fa6605c3e54#file-zabbixsync-rb-L96
[16:12:06] ljarvis: also, you check that it exists, then write to it if it doesn't
[16:12:08] [k-_: extra space
[16:12:08] ljarvis: that's confusing
[16:12:22] tuor: ok. I'll read one after other.^^
[16:12:22] ljarvis: if it doesn't exist, just skip reading it
[16:12:41] [k-_: https://gist.github.com/anonymous/1573a0036fa6605c3e54#file-zabbixsync-rb-L103 use .empty?
[16:12:42] zendrix: has joined #ruby
[16:12:56] Diabolik: if an instance variable is a hash, how do i access the values within it?
[16:13:03] Diabolik: raise @booking_details[:appointment_information][:time]
[16:13:06] atmosx: tuor: I would also implement a logger to 'log' everything that is happening and use some Exception Handling to catch possible errors in a more 'graceful way' (if the code was made to be used by others in production env)
[16:13:06] mikecmpbll: lol, deluge.
[16:13:10] bnizzle: has joined #ruby
[16:13:13] Diabolik: undefined method `[]' for nil:NilClass
[16:13:17] tuor: shevy, what do you meen with: "line 51 seems off"
[16:13:21] banister: has joined #ruby
[16:13:33] ljarvis: Diabolik: that's because @booking_details or the value at :appointment_information is nil
[16:13:50] mikecmpbll: tuor: use the json style hash syntax for symbolic keys, too. it's way cooler.
[16:14:02] [k-_: https://gist.github.com/anonymous/1573a0036fa6605c3e54#file-zabbixsync-rb-L103 use 'r+
[16:14:07] bodgix: has joined #ruby
[16:14:09] mondo: has joined #ruby
[16:14:13] Diabolik: ljarvis within the hash the value is appointment_information: {time: DateTime.now + 30.minutes}}
[16:14:16] tuor: [k-_, thats the normal username when you install. So if you want to test then it works. When you use it, you give your own stuff to .new()
[16:14:23] tjohnson: has joined #ruby
[16:14:31] ljarvis: Diabolik: then your ivar isn't set when you try and access it
[16:14:42] Diabolik: the line before sets it :(
[16:14:42] atmosx: tuor: you know, people pay for the kind of thing we're doing at your code right now :-P
[16:14:45] mondo: What's the easiest way to make a simple HTTP GET request in Ruby? Without a 3rd party library do I have to use net:http?
[16:14:51] [k-_: tuor: i do not keep state, i do not know what you refer to
[16:14:57] ljarvis: mondo: net/http or open-uri
[16:15:01] ljarvis: mondo: both are in stdlib
[16:15:06] atmosx: mondo: open-uri
[16:15:19] benlieb: has joined #ruby
[16:15:33] bricker: has joined #ruby
[16:15:45] mondo: open-uri will do, thanks!
[16:15:47] tuor: atmosx, I don't understand why not using variables. ( I wouldn't use instance variabels in teh code, I'd use attr_reader to depend on behavior not ata)
[16:16:05] [k-_: tuor: L154 spelling mistake
[16:16:21] [k-_: tuor: L158 spelling mistake
[16:16:24] ramfjord: has joined #ruby
[16:16:32] yorickpeterse: https://gist.github.com/YorickPeterse/46b22a758641eefb6369 lololol
[16:16:37] atmosx: tuor: because your code will be harder to maintain in the future. Any changes to that instance variable will instantly reflect to the entire program.
[16:16:42] [k-_: all in all, i do not like it
[16:16:54] ljarvis: yorickpeterse: yes that's the worst part of it..
[16:16:56] atmosx: [k-_: that's evil.
[16:17:15] tuor: atmosx, ah ok.
[16:17:39] [k-_: atmosx: im not reading the whole chat, what do you mean
[16:17:45] yorickpeterse: granted if I use block form everywhere it's probably a tad easier on the eyes
[16:17:47] yorickpeterse: but first, train home!
[16:17:54] pyon: has joined #ruby
[16:18:00] akosednar: has joined #ruby
[16:18:12] atmosx: tuor: judging by your code, I think you're kinda ready to read this book http://www.poodr.com it will help a lot.
[16:18:52] atmosx: [k-_: nadah, it was a joke about the 'I do not like it' part.
[16:20:41] pyon: has joined #ruby
[16:20:47] railsraider: has joined #ruby
[16:21:45] ledestin: has joined #ruby
[16:22:17] kies: has joined #ruby
[16:22:30] tomme: has joined #ruby
[16:22:57] tomme: has left #ruby: ()
[16:24:28] Hanmac: has joined #ruby
[16:25:19] tubuliferous_: has joined #ruby
[16:27:27] Alayde: has joined #ruby
[16:28:52] shevy: Any potential pitfalls I should keep in mind when subclassing from StringIO? I am about to make some changes to an existing project in an upcoming rewrite, the main class will be the one that then subclasses from StringIO
[16:29:07] ruby-lang528: has joined #ruby
[16:29:10] tchebb: has joined #ruby
[16:30:00] tuor: ACTION will slowly go over all you wrote and thx for so much answers! Tuor will later post the changed code.
[16:30:03] renderful: has joined #ruby
[16:30:58] finisherr: has joined #ruby
[16:31:23] pietr0: has joined #ruby
[16:31:37] swgillespie: has joined #ruby
[16:35:20] Pisuke: has joined #ruby
[16:36:41] ferhaty: has joined #ruby
[16:37:34] josh3: has joined #ruby
[16:37:37] jenrzzz: has joined #ruby
[16:38:44] freerobby: has joined #ruby
[16:38:45] jpfuentes2: has joined #ruby
[16:40:51] pyon: has joined #ruby
[16:41:36] chabil: has joined #ruby
[16:41:37] bronson: has joined #ruby
[16:42:09] hashrocket: has joined #ruby
[16:42:34] TomyLobo: raise 'hell'
[16:42:45] dumdedum: has joined #ruby
[16:43:15] malconis: has joined #ruby
[16:46:19] Thermatix: has joined #ruby
[16:46:23] michaeldeol: has joined #ruby
[16:46:45] basmoura: has joined #ruby
[16:47:16] dr3w: has joined #ruby
[16:47:43] suchness: rescue FunError
[16:48:24] niiamon: has joined #ruby
[16:48:35] nuttermb: has joined #ruby
[16:48:38] shevy: Bordom hmm
[16:48:53] suchness: also rescue spelling error
[16:49:53] NeverDie: has joined #ruby
[16:50:01] TomyLobo: go to the root of the BorDOM
[16:50:07] jeremy04: has joined #ruby
[16:50:13] TomyLobo: and delete it
[16:51:56] hotpancakes: has joined #ruby
[16:52:06] last_staff: has joined #ruby
[16:54:05] j4cknewt: has joined #ruby
[16:56:30] Guest32: has joined #ruby
[16:56:51] rakm: has joined #ruby
[16:57:03] hmnhf: has joined #ruby
[16:58:44] Violentr: has joined #ruby
[16:59:53] skade: has joined #ruby
[17:00:49] juanpaucar: has joined #ruby
[17:01:59] rbennacer: has joined #ruby
[17:02:04] unver: has joined #ruby
[17:03:41] hj2007: has joined #ruby
[17:04:30] hmnhf: has joined #ruby
[17:04:46] khebbie: has joined #ruby
[17:05:24] blue_deref: has joined #ruby
[17:07:02] advorak: has joined #ruby
[17:08:50] jstacks: has joined #ruby
[17:09:36] fantazo: has joined #ruby
[17:11:54] quimrstorres: has joined #ruby
[17:12:04] JoshL: has joined #ruby
[17:12:12] mikecmpbll: has joined #ruby
[17:13:50] Scripore: has joined #ruby
[17:14:35] tuor: OK. I think i have done the changes. The code still works. :): https://gist.github.com/anonymous/2e0ad8ed1fb72e97913a
[17:15:06] hobodave: has joined #ruby
[17:15:33] lucianosousa: has joined #ruby
[17:15:55] shevy: you are the best tuor \o/
[17:16:01] chouhoulis: has joined #ruby
[17:16:09] [k-_: L39-L40 leave a blank line
[17:16:15] hmnhf: has joined #ruby
[17:16:19] tuor: atmosx, a logger & error handling will be a bigger task, can't do it in 5 min. So I'll do it in future. (it's on my list now)
[17:16:46] atmosx: tuor: yeah :-)
[17:16:56] psye: has joined #ruby
[17:17:19] havenwood: tuor: The traditional convention for constants in Ruby is SCREAMING_SNAKE_CASE (or some use CamelCase), so I'd suggest `DEFAULT_RULES` instead of `Rules_default`.
[17:17:23] tuor: mikecmpbll, "18:14:54 use the json style hash syntax for symbolic keys" I don't understand what you meen.
[17:17:46] mikecmpbll: tuor: { :foo => "bar" } is equivalent to { foo: "bar" }
[17:17:50] hj2007: has joined #ruby
[17:17:56] hmnhf: has joined #ruby
[17:17:57] havenwood: tuor: Putting `DEFAULT_` in front seems to read better and would group the defaults a bit.
[17:17:58] mikecmpbll: the latter syntax was added as an alternative in ruby 1.9.3
[17:18:07] oxpom: has joined #ruby
[17:18:11] mikecmpbll: it's more succinct for hashes where the keys are symbols.
[17:18:15] Guest85: has joined #ruby
[17:18:39] platzhirsch: has joined #ruby
[17:18:41] tuor: atmosx, yes I know that people pay for checking code and I'm very grateful.
[17:18:45] Trynemjoel: has joined #ruby
[17:19:10] [k-_: this is free if you use rubocop
[17:19:29] [k-_: that heinous thing
[17:20:05] tuor: atmosx, "judging by your code, I think you're kinda ready to read this book...": I have a book about ruby basics. I'll have to read (and train) this one first. But Then I'll see (I have it in a bookmark)
[17:20:06] ellisTAA: has joined #ruby
[17:20:31] dented42: has joined #ruby
[17:20:32] ellisTAA: can someone tell me why when i try to see if this string contains something using a regex i get nil? https://gist.github.com/ellismarte/e7d5ed2fb71ea202ed40
[17:20:55] lagweezle: [k-: heinous? Whyfor? (joking?)
[17:21:14] doodleha_: has joined #ruby
[17:21:20] shevy: how do you invoke that code EllisTAA
[17:21:34] ellisTAA: shevy: i have some test code
[17:21:54] tuor: [k-, line is added, I'll google robucop.
[17:21:54] tvw: has joined #ruby
[17:21:56] christiandsg: has joined #ruby
[17:22:18] dented42_: has joined #ruby
[17:22:37] olivierrr: has joined #ruby
[17:22:45] michaeldeol: has joined #ruby
[17:22:46] ellisTAA: shevy: here is the entire thing https://gist.github.com/ellismarte/e7d5ed2fb71ea202ed40#file-regeex-rb-L21
[17:23:39] Maletor: has joined #ruby
[17:24:02] atmosx: tuor: poodr is awesome and it's not strictly about ruby code, it's about design, which is another level of abstraction. The good thing is that uses ruby code so it's hands-on for ruby codes.
[17:24:07] atmosx: s/codes/programmers
[17:24:29] Jackneill: has joined #ruby
[17:24:44] shevy: EllisTAA that code is sorta confusing to me :D
[17:24:51] tuor: havenwood, just forgott about this one, but why DEFAULT_RULES and not RULES_DEFAULT? I meen I just like to write names like this. So is it important which way?
[17:25:00] tuor: atmosx, ah ok.
[17:25:05] leafybasil: has joined #ruby
[17:25:07] tmtwd: has joined #ruby
[17:25:10] Zeroe: has joined #ruby
[17:25:17] shevy: EllisTAA where do you get nil btw? I get: 0 1 1 1 1 - btw I think break() may return nil
[17:25:19] tuor: mikecmpbll, ah ok.
[17:25:21] shevy: or puts... either of them
[17:25:29] havenwood: tuor: It isn't important to the computer. What are the rules default? What are the default rules?
[17:25:32] spider-mario: has joined #ruby
[17:25:43] ellisTAA: shevy: i got nil in irb
[17:25:49] havenwood: tuor: Which sounds right to you?
[17:25:55] ellisTAA: it keeps saying i am missing a parenthses
[17:26:18] tuor: havenwood, I know that the computer doesn't care. and: RULES_DEFAULT ^^
[17:26:41] michaeldeol: has joined #ruby
[17:26:45] havenwood: tuor: So the rules default for how you say thing is order reverse?
[17:26:54] shevy: EllisTAA I put your code in a .rb file and it ran without error
[17:27:34] ellisTAA: shevy: yeah but it isn???t working, when i ask does this string have this incompatible expression, it returns nil
[17:28:17] tuor: havenwood, no, but it's just about rules and there are the default ones. So the name begins with rules and default is just an aditional information about which rules. ;)
[17:28:20] ellisTAA: in irb this "[)" =~ /'['/ returns SyntaxError: (irb):55: premature end of char-class: /'['/
[17:28:34] tuor: But I see it's not realy logic for other people.
[17:28:49] tuor: I'll think of changing it.
[17:28:54] ellisTAA: and this also returns nil "[)" =~ /'\[\'/
[17:29:12] michaeldeol: has joined #ruby
[17:30:36] tuor: So Thx all of you for your help! :)
[17:31:28] leafybasil: has joined #ruby
[17:31:35] burgestrand: has joined #ruby
[17:31:54] finisherr: has joined #ruby
[17:33:36] ht__: has joined #ruby
[17:33:54] shevy: EllisTAA I can not reproduce that, it works in my irb just fine as well
[17:34:02] jhack: has joined #ruby
[17:34:02] jhack: has joined #ruby
[17:34:15] shevy: the code you showed does not have: "[)" =~ /'['/
[17:34:44] shevy: [ is a special character in a regex
[17:34:56] [spoiler]: EllisTAA: you need to escape the `[`
[17:35:16] lannonbr: has joined #ruby
[17:35:32] shock_one: has joined #ruby
[17:35:35] [spoiler]: and there's no `'` character in "[)" so of course it will return nil, you're looking for "['"
[17:35:46] tubuliferous_: has joined #ruby
[17:35:56] shock_one: What do you think? Do you suffer from this as much as I do? https://github.com/pry/pry/pull/1458
[17:36:07] [spoiler]: EllisTAA: use "[)" =~ /\[\)/
[17:36:17] Trynemjoel: has joined #ruby
[17:36:23] ellisTAA: shevy: this should print 0 for the last element of expressions, but it isn???t https://gist.github.com/ellismarte/e7d5ed2fb71ea202ed40#file-regeex-rb-L9
[17:37:05] [spoiler]: shock_one: it would be most useful; does it only work on expressions, though?
[17:37:31] shock_one: [spoiler]: is there something else?
[17:37:49] postmodern: has joined #ruby
[17:37:55] shock_one: Oh, you probably mean statements or declarations, right? It will work with them.
[17:38:26] [spoiler]: i checked the commit and yeah it should work with those too
[17:38:29] sectionme: has joined #ruby
[17:38:44] [spoiler]: http://i.imgur.com/4mkUqnm.gifv
[17:38:47] a346: has joined #ruby
[17:39:02] bootstrappm: has joined #ruby
[17:39:52] choke: has joined #ruby
[17:40:07] TomyLobo: is there an original or sound to this?
[17:40:16] [spoiler]: https://www.youtube.com/watch?v=-VsDk7SIXa8
[17:40:21] [spoiler]: TomyLobo: ^
[17:40:40] [spoiler]: warning: it might get stuck in your head
[17:40:55] TomyLobo: oh god, weebl even made this
[17:42:09] mondo: Anyone that uses Sublime text, is there a way to fix this issue where "#{myvar}" doesn't tab complete? so I type "#{my and hit tab, but it doesn't complete the variable name even though it's showing the autocomplete drop down
[17:42:26] Jackneill: has joined #ruby
[17:42:46] failshell: has joined #ruby
[17:43:17] [spoiler]: mondo: I switched to atom, because of issues like that in sublime
[17:43:33] [spoiler]: mondo: v2 or v3? I think there's a way to fix it by downloading a better language pack
[17:43:59] mondo: v3, 3083 is what im on
[17:44:31] josh3: has joined #ruby
[17:44:47] [spoiler]: best bet would be to look for something to replace the default ruby highlighter
[17:44:55] [spoiler]: which adds features
[17:46:54] baweaver: has joined #ruby
[17:48:13] trwyth: has joined #ruby
[17:48:46] BraddPitt: I'm loving Atom (recently switched)
[17:49:24] platzhirsch: has left #ruby: ()
[17:49:38] ellisTAA: if anyone can help me out, i???d appreciate it https://gist.github.com/ellismarte/e7d5ed2fb71ea202ed40#file-regeex-rb-L19-L20
[17:50:41] hobodave: has joined #ruby
[17:51:29] snockerton: has joined #ruby
[17:53:31] RegulationD: has joined #ruby
[17:53:52] hj2007: has joined #ruby
[17:54:04] dr3w: has joined #ruby
[17:54:34] dfockler: has joined #ruby
[17:54:35] poguez_: has joined #ruby
[17:54:45] jackjackdripper: has joined #ruby
[17:55:15] Rubie: has joined #ruby
[17:55:35] northfurr: has joined #ruby
[17:55:58] choke: has joined #ruby
[17:56:02] martinium: has joined #ruby
[17:56:32] BraddPitt: what is your input, EllisTAA ?
[17:57:06] ellisTAA: BraddPitt: https://gist.github.com/ellismarte/e7d5ed2fb71ea202ed40#file-regeex-rb-L19
[17:57:31] jackjackdripper: has joined #ruby
[17:57:35] dseitz: has joined #ruby
[17:57:56] dopie: has joined #ruby
[17:58:33] allcentury: has joined #ruby
[17:58:33] shevy: http://rustyrazorblade.com/2015/08/migrating-from-mysql-to-cassandra-using-spark/
[17:58:42] shevy: "There's loads of documentation, examples and frameworks it works with, such as Wordpress, Pandas, Ruby on Rails, and Django."
[17:58:48] shevy: even Pandas are coding now!
[17:59:30] egtann: has joined #ruby
[17:59:37] michaeldeol: has joined #ruby
[18:00:18] BraddPitt: well EllisTAA it doesnt match either incompatible regex nor is its length % 2 == 1
[18:00:38] BraddPitt: what is Pandas again
[18:00:44] BraddPitt: I remember hearing it frmo someone on our data science team
[18:01:12] ellisTAA: the last expression contains [)
[18:01:20] choke_: has joined #ruby
[18:01:45] Gribo: has joined #ruby
[18:02:03] advorak: has joined #ruby
[18:02:19] pafin: has joined #ruby
[18:02:41] BraddPitt: ah, I get this capture; http://rubular.com/r/I0qgJNkCsp
[18:03:03] drbrain: EllisTAA: you shouldn't depend on expression being available after the block
[18:03:14] jhack: has joined #ruby
[18:03:14] jhack: has joined #ruby
[18:03:46] podman: has joined #ruby
[18:03:59] drbrain: EllisTAA: also, do you mean /#{exp}/?
[18:04:08] ellisTAA: i tried that
[18:04:21] c_nick: has joined #ruby
[18:04:22] drbrain: right now you're matching /exp/ so nothing will match
[18:04:26] drbrain: literally, exp
[18:04:55] BraddPitt: https://gist.github.com/anonymous/0c3de9bc9ce8d91a833d
[18:05:14] treehug88: has joined #ruby
[18:05:24] BraddPitt: drbrain is correct
[18:05:36] c_nick: i have ruby x64 and ruby x86 installed. x64 has bundler 1.7.4 while x86 has 1.6.3 when i try to build the project using pik use x86 bundler crashes saying fatal error in bundler please reinstall makes no sense to me
[18:05:48] devoldmx: has joined #ruby
[18:07:06] ellisTAA: balls. Hired.com???s test is hard ><
[18:07:08] drbrain: EllisTAA: your current code is checking whether the length of each item in check_braces is odd or even
[18:07:45] ellisTAA: drbrain, should it check to see if contains the incompatible expression before it checks the length
[18:08:03] hmnhf_: has joined #ruby
[18:08:05] BraddPitt: Hired didnt give me a test
[18:08:10] finisherr: has joined #ruby
[18:08:13] drbrain: you want to use /#{exp}/ then
[18:08:58] northfurr: has joined #ruby
[18:09:34] ellisTAA: i tried that and i tried /???#{exp}???/
[18:09:48] arturhoo_: has joined #ruby
[18:09:51] ellisTAA: thanks for your help
[18:11:39] choke: has joined #ruby
[18:11:39] blackmesa: has joined #ruby
[18:11:56] ramfjord: has joined #ruby
[18:12:03] Xiti: has joined #ruby
[18:12:59] michaeldeol: has joined #ruby
[18:13:53] bodgix: has joined #ruby
[18:15:56] drbrain: EllisTAA: since you have two tasks, make two methods
[18:16:02] drbrain: one to check if its incompatible
[18:16:10] ellisTAA: drbrain: ah man that???s a good idea
[18:16:11] [spoiler]: BraddPitt: I love Atom, but it does "choke" for and up to half a minute on big files, but once they're loaded it seems fine-ish
[18:16:11] drbrain: and get that working, then do the second task in a second method
[18:16:24] drbrain: then add a third method that calls each
[18:16:48] ellisTAA: drbrain: failing in high pressure situations is cool, i won???t make those mistakes again
[18:16:51] BraddPitt: yeah [spoiler] sadly thats still an issue
[18:17:20] [spoiler]: BraddPitt: it was *much* worse the first time I tried it, I don't mind the few seconds, I quickly do something else in the meantime
[18:17:55] burgestrand: has joined #ruby
[18:18:42] NeverDie: has joined #ruby
[18:19:03] leafybasil: has joined #ruby
[18:19:51] finisherr: has joined #ruby
[18:20:03] baweaver: has joined #ruby
[18:20:22] jbw_: has joined #ruby
[18:20:41] BraddPitt: otherwise i really like it
[18:20:47] Sperant: has joined #ruby
[18:20:54] c_nick: array1 - array 2 or should i literally go array1.each {delete(x)}
[18:20:56] keen__: has joined #ruby
[18:21:39] [spoiler]: c_nick: you could use the first approach if you need to delete multiple elements
[18:22:06] [spoiler]: also a delete_if block might be more apt if the logic is more complex
[18:23:05] kies: has joined #ruby
[18:24:52] c_nick: [spoiler]: one or more.. internally its doing the same thing right?
[18:25:02] michaeldeol: has joined #ruby
[18:25:05] [spoiler]: c_nick: not really
[18:25:13] c_nick: just operator overloading ?
[18:25:58] [spoiler]: `a1 - a2` is basically `a1.delete_if {|e| a2.include? e }`
[18:26:17] Mission-Critical: has joined #ruby
[18:26:22] [spoiler]: but more optimised
[18:26:53] [spoiler]: delete_if can test for more complex stuff
[18:27:55] [spoiler]: `a1.delete_if {|e| !e.valid? || e.useless! || e.marked_for_deletion? }` etc
[18:27:56] dperalta: has joined #ruby
[18:28:31] Pavel_Fin: has joined #ruby
[18:29:14] yh: has joined #ruby
[18:29:39] c_nick: cool thanks [spoiler]
[18:29:42] finisherr: has joined #ruby
[18:30:16] DLSteve: has joined #ruby
[18:30:31] c_nick: has left #ruby: ()
[18:31:14] dr3w: has joined #ruby
[18:31:32] bodgix1: has joined #ruby
[18:33:33] bodgix: has left #ruby: ()
[18:33:53] finisherr: has joined #ruby
[18:34:15] casadei: has joined #ruby
[18:34:34] Meow-J: has joined #ruby
[18:34:44] chinmay_dd: has joined #ruby
[18:36:17] finisherr: has joined #ruby
[18:36:21] tmtwd: has joined #ruby
[18:36:39] bodgix: has joined #ruby
[18:37:37] msnyon: has joined #ruby
[18:39:05] dented42: has joined #ruby
[18:39:17] christiandsg: has joined #ruby
[18:41:35] bodgix: has joined #ruby
[18:41:35] Thermatix: has joined #ruby
[18:42:45] benlieb: has joined #ruby
[18:43:10] nuttermb: has joined #ruby
[18:43:29] _blizzy_: has joined #ruby
[18:45:10] finisherr: has joined #ruby
[18:45:35] michaeldeol: has joined #ruby
[18:46:04] n008f4g_: has joined #ruby
[18:46:48] bodgix: has joined #ruby
[18:48:11] NeverDie: has joined #ruby
[18:49:53] burgestrand: has joined #ruby
[18:50:58] krz: has joined #ruby
[18:51:59] _blizzy_: has joined #ruby
[18:53:24] finisherr: has joined #ruby
[18:54:07] bodgix: has joined #ruby
[18:55:15] hotpancakes: has joined #ruby
[18:55:55] finisherr: has joined #ruby
[18:57:52] n_blownapart: has joined #ruby
[18:59:01] finisherr: has joined #ruby
[18:59:02] danman: has joined #ruby
[19:00:21] choke: has joined #ruby
[19:01:13] flak: has joined #ruby
[19:01:52] Scripore: has joined #ruby
[19:02:49] blackmesa: has joined #ruby
[19:03:09] finisherr: has joined #ruby
[19:04:15] rippa: has joined #ruby
[19:04:23] msnyon: has joined #ruby
[19:04:37] jenrzzz: has joined #ruby
[19:05:26] nahtnam: has joined #ruby
[19:05:27] egtann: has joined #ruby
[19:06:21] ccbn: has joined #ruby
[19:06:49] finisherr: has joined #ruby
[19:06:55] nahtnam: Is there a cleaner way to do beging, rescue blocks instead of nesting them like: https://gist.github.com/nahtnam/c62e86ed11b5009a817c
[19:07:12] Frem: has joined #ruby
[19:07:15] nahtnam: *beginning
[19:07:15] BraddPitt: you can have multiple rescues for 1 begin, nahtnam
[19:07:35] nahtnam: How would that help?
[19:07:39] Scriptonaut: has joined #ruby
[19:07:53] Scriptonaut: is there any syntax convention when denoting a cached value?
[19:08:06] ccbn: nahtnam: but the second BRE block in a method and call that from the outer BRE
[19:08:06] Scriptonaut: I have a method: def open_tab, that will return the current tab name that is open in my app
[19:08:08] jhass: nahtnam: use more methods
[19:08:14] Scriptonaut: is there something like
[19:08:18] Scriptonaut: _open_tab = open_tab
[19:08:29] rippa: has joined #ruby
[19:08:30] Scriptonaut: to show that _open_tab is the cached value of open_tab
[19:08:31] jhass: def foo; bar; rescue XError; end; def bar;
[19:08:40] jhass: # ...; rescue YError; end
[19:08:46] Pisuke: has joined #ruby
[19:09:32] nahtnam: cball: jhass Then that leads me to a second question. Is there something like javascripts `.then()`? So I can call one function, and if its successful, then run a second method?
[19:09:35] kadoppe: has joined #ruby
[19:09:40] nahtnam: So each method would contain a BRE
[19:09:46] jhass: Scriptonaut: try to make the method a verb and the variable a noun. tab = open_tab
[19:10:00] msnyon: has joined #ruby
[19:10:43] chipotle: has joined #ruby
[19:10:55] jhass: nahtnam: there's no asynchronous execution here, begin; code; raise; will_never_run; rescue; end;
[19:11:05] hotpanca_: has joined #ruby
[19:11:16] baweaver: has joined #ruby
[19:12:13] Scriptonaut: jhass: ya, the problem is open_tab is both a noun and a verb
[19:12:17] Scriptonaut: I went with tab like you said
[19:12:28] lucianosousa: has joined #ruby
[19:12:45] ccbn: nahtnam: , put the BRE in a method, use a Proc for the rescue block, and after the E in the BRE, use yield to pass an optional block. I think that would work
[19:13:10] chouhoul_: has joined #ruby
[19:13:10] ccbn: If the raise condition fires, yield wont because the proc will exit from the enclosing method
[19:13:35] nahtnam: jhass: ??? To be more specific I have something like this: https://gist.github.com/nahtnam/763fd9cfdb9f289a7517
[19:13:42] nahtnam: Its really messy
[19:13:56] jhass: ?gist_usage nahtnam
[19:13:56] ruboto: nahtnam, To properly use gist, please enable syntax highlighting, either by choosing the language manually or by entering a proper filename. If you post multiple things, separate them into multiple files. If you have a Github account, please update your gist with new information instead of posting a new one.
[19:14:13] nahtnam: Sorry, fixed
[19:14:23] shock_one: has joined #ruby
[19:14:38] jhass: nahtnam: as already said, use methods
[19:14:46] Cache_Money: has joined #ruby
[19:14:53] chouhoulis: has joined #ruby
[19:15:04] jhass: nahtnam: also you shouldn't rely on exceptions for something like this, try to find a check that you can use in an if / else
[19:15:21] jhass: nahtnam: at least rescue the most specific exception(s) possible
[19:15:35] jhass: and you got a repeating pattern there, just extract it into a method really
[19:15:50] nahtnam: Yeah, will do. This is just a "first draft". The final code will be written in another language
[19:15:54] nahtnam: (compiled)
[19:16:17] youngbaks: has joined #ruby
[19:16:38] jhass: ah yeah, you were the one preparing some work for the lawyers
[19:17:13] nahtnam: For the record, this one doesnt have a captcha or a rate limiter
[19:17:48] nfk: has joined #ruby
[19:18:02] C1V0: has joined #ruby
[19:18:02] DLSteve: has joined #ruby
[19:19:11] startupality: has joined #ruby
[19:19:41] Scripore: has joined #ruby
[19:19:48] nahtnam: Would the method look like this? https://gist.github.com/nahtnam/13068e653ed038f268e6 If so then how do I call a different method after this? If there is an exception, I want the app to exit, so i only want the next method to execute if the first is a success
[19:19:50] lagweezle: open_tab being both noun and verb makes me think about 'sign up' and 'signup' and the uses of them driving me nuts with the code at work. :(
[19:20:15] jhass: nahtnam: just call exit
[19:20:29] nahtnam: jhass: in the rescue?
[19:20:45] jhass: nahtnam: and please rescue Selenium::NoSuchElement or whatever the specific exception was, open rescue's are horrible
[19:21:21] dr3w: has joined #ruby
[19:22:24] big|bad|wolf: has joined #ruby
[19:23:10] Maletor: has joined #ruby
[19:24:37] nahtnam: One more question
[19:24:46] shevy: YOUR LAST QUESTION?
[19:24:55] finisherr: has joined #ruby
[19:25:44] nahtnam: Is there a way I can make a "rake application" where basically its just a bunch of ruby files and just have certain commands (rake or whatever) execute them?
[19:26:16] jhack: If i were to choose a random word from a text file i have, would it be something like this? -> File.open("text.txt", r) { |file| secret_word << file.rand }
[19:26:19] jhass: doesn't sound like you need any features from rake
[19:26:28] jhass: just ship a bunch of ruby scripts?
[19:26:44] jhass: ?try jhack
[19:26:44] ruboto: jhack, Why don't you try it and see for yourself?
[19:26:45] nahtnam: Well I want to compile them into a easy to use system
[19:27:29] choke_: has joined #ruby
[19:27:34] jhass: nahtnam: it's too vague for any specific advice, sorry
[19:28:05] jhass: "just do it" is the only sane answer to "I have some code and I want to run it"
[19:28:09] spider-mario: has joined #ruby
[19:28:21] shevy: jhack if you have it in form of an Array, you can use array.sample
[19:28:51] shevy: jhack for instance: random_word = File.readlines('text.txt').sample
[19:29:01] shevy: hey... jhack sounds almost like jhass
[19:29:05] ellisTAA: has joined #ruby
[19:29:07] nahtnam: Maybe thor is what im looking for?
[19:29:09] frecciac9: has joined #ruby
[19:29:20] jhass: I prefer slop for a subcommand CLI parser
[19:29:32] pyon: has joined #ruby
[19:30:31] slash_nick: shevy: alias_method :shuffle_pop, :sample
[19:30:40] slash_nick: shevy: shuffle_pop sounds so much cooler
[19:30:57] jhass: slash_nick: we all live in our own illusions I guess
[19:30:57] Kallis: has joined #ruby
[19:31:39] chinmay_dd: has left #ruby: ("Leaving")
[19:32:55] [spoiler]: jhass, nahtnam: not entirely correct
[19:32:58] slash_nick: jhass: haven't heard of slop... but thor i like for system wide tasks
[19:33:18] [spoiler]: jhass, nahtnam: the only sane answer is https://www.youtube.com/watch?v=-VsDk7SIXa8
[19:34:29] omegamike: has joined #ruby
[19:34:33] jhack: shevy: Thanks
[19:34:40] bruno-: has joined #ruby
[19:36:07] iceyec_: has joined #ruby
[19:36:13] shevy: slash_nick lol
[19:36:27] shevy: slash_nick I used to do .shuffle[0]
[19:36:41] shevy: but I think .sample is slightly faster
[19:37:24] jhass: not only slightly
[19:37:33] IceyEC: has joined #ruby
[19:37:37] finisherr: has joined #ruby
[19:39:01] hotpancakes: has joined #ruby
[19:39:13] slash_nick: shevy: yeah, i think i did something like that back before #sample came to exist
[19:40:12] JoshL: has joined #ruby
[19:40:12] bricker: has joined #ruby
[19:41:28] nahtnam: When I run rake my_task[1,2], I get an error saying: Don't know how to build task 'my_task' Code: https://gist.github.com/nahtnam/bc4788f1b48e0b329655
[19:42:34] vdamewood: has joined #ruby
[19:43:11] trwyth: has joined #ruby
[19:43:19] nahtnam: No idea why it doesnt work
[19:43:36] jhass: nahtnam: directory creates a task to create the directory if it doesn't exist
[19:43:44] jhass: to load code use standard require
[19:44:12] tynamite___: has joined #ruby
[19:44:24] jhass: check rake -aT
[19:44:37] finisherr: has joined #ruby
[19:44:54] nahtnam: rake lib #
[19:44:54] nahtnam: rake lib/tasks #
[19:45:02] tynamite___: Hi I'm using ruby 1.9.3 and when I enter ruby -e 'p Encoding.default_external' It says I'm using the CP850 encoding. How do I change it to UTF-8 ?
[19:45:31] jhass: tynamite___: best would be to take the chance to change your system locale to UTF-8
[19:45:47] nahtnam: jhass: So would I do require 'lib/tasks/asdf.rb'?
[19:45:48] jhass: also note that Ruby 1.9 is EOL, 2.0 will be soon enough, consider upgrading to Ruby 2.2
[19:45:57] tynamite___: I'm using Windows, but I get the same encoding on Heroku that doesn't use windows.
[19:46:04] tynamite___: How do I change the system locale for windows?
[19:46:06] djcp: has joined #ruby
[19:46:13] nahtnam: or is there a good way to auto import all rake tasks from a folder?
[19:46:14] jhass: nahtnam: require is relative to $LOAD_PATH and you don't need the .rb suffix explicitly, but yes
[19:46:30] Sperant: has joined #ruby
[19:47:06] havenwood: tynamite___: In Ruby 2.0 the default encoding was switched to UTF-8. Since Ruby 1.9 is past End-of-Life you should upgrade to 2.1+ anyways.
[19:48:03] tynamite___: Seeing as Stack Overflow couldn't solve my problem, I'll see if upgrading ruby solves anything. I'm using a portable setup so I don't have to install anything.
[19:48:06] lucianosousa: has joined #ruby
[19:48:41] baweaver: has joined #ruby
[19:48:42] nahtnam: jhass: `LoadError: cannot load such file -- lib/tasks/asdf` and `LoadError: cannot load such file -- lib/tasks/asdf.rb`
[19:49:02] jhass: nahtnam: yes, read what I said. It's relative to $LOAD_PATH
[19:49:04] davedev24: has joined #ruby
[19:49:49] nahtnam: Its working now
[19:50:40] rikkipitt: has joined #ruby
[19:50:40] jgpawletko: has joined #ruby
[19:50:40] Oog_: has joined #ruby
[19:52:19] chabil: has joined #ruby
[19:53:16] jpfuentes2: has joined #ruby
[19:55:05] benlieb: has joined #ruby
[19:56:14] finisherr: has joined #ruby
[19:56:30] juanpablo_: has joined #ruby
[19:57:15] neohunter: has joined #ruby
[19:57:24] pyon_: has joined #ruby
[19:57:58] neohunter: is there a way to access an instance variable bassed on another variable? like php $($hello)
[19:58:03] roolo: has joined #ruby
[19:58:15] bruno-: has joined #ruby
[19:58:39] finisherr: has joined #ruby
[19:58:44] neohunter: I want to do something like args.each {|k,v| @k = v}
[19:59:03] bricker: neohunter: instance_variable_set, instance_variable_get
[19:59:29] BraddPitt: or #send, as shevy pointed out last night
[20:00:22] dagda1_: has joined #ruby
[20:00:47] NeverDie: has joined #ruby
[20:01:01] jhass: neohunter: that desire is a very very strong indicator that you want to use a hash instead
[20:01:39] jhass: BraddPitt: #send only if you got an attr_reader for it, and then I prefer #public_send
[20:01:41] neohunter: jhass yes i want to use a hash to initilaize a class, but want to have each element of the hash as an instance variable
[20:01:43] baweaver: has joined #ruby
[20:01:52] jhass: neohunter: no you don't
[20:01:56] jhass: it's a code smell
[20:02:19] Torrieri: has joined #ruby
[20:02:37] Scripore: has joined #ruby
[20:02:40] eam: the hash could be derived from GET arguments!
[20:02:48] bricker: see: Rails
[20:03:10] jhass: o at least keep it explicit, not the right occasion for clever code
[20:03:25] neohunter: its not a web application,
[20:03:43] BraddPitt: I don't think thats a good way to initialize an object in ruby since there is no explicit type declaration
[20:04:08] BraddPitt: explicit assignment will make it easier to read and to debug
[20:04:24] khebbie: has joined #ruby
[20:04:26] BraddPitt: and if you have an extremely long list of arguments, then maybe think about refactoring
[20:04:30] neohunter: currently my method is like
[20:04:30] jhass: and protect against typos in the hash keys
[20:04:33] neohunter: initialize(name, email, firm, number_of_customer_meetings, number_of_topic_meetings)
[20:04:42] neohunter: so you suggest to keep it in that way?
[20:04:50] jhass: yeah, 5 is still okayish
[20:04:51] BraddPitt: 5 instance vars is a fine amount imo
[20:05:03] BraddPitt: i think 7+ range is when you should consider a refactor
[20:05:04] sepp2k: has joined #ruby
[20:05:25] neohunter: ok, and how the refactor would be? allow a hash and.. check that keys are valid?
[20:05:30] big|bad|wolf: has joined #ruby
[20:05:35] jhass: you could make it keyword arguments if you want
[20:05:52] ishahnaz: has joined #ruby
[20:06:25] djbkd: has joined #ruby
[20:06:33] devoldmx: has joined #ruby
[20:06:35] neohunter: googling...
[20:06:40] neohunter: interesting i didint know about that
[20:06:45] BraddPitt: its just named arguments instead of positional ones
[20:07:45] diegoviola: has joined #ruby
[20:07:46] ccbn: neohunter: You can also use block initialization if it fits your use case better.
[20:08:04] gambl0re: do i use validates confirmation: true on both password and password_confirmation or just one ?
[20:08:59] neohunter: thanks to all!
[20:10:06] dperalta: has joined #ruby
[20:10:50] jhass: !kick gambl0re do not crosspost without informing all sides about it
[20:10:50] helpa: jhass: No.
[20:10:51] ruboto: ruboto kicked gambl0re: not crosspost without informing all sides about it
[20:10:51] ruboto: -o ruboto
[20:12:51] Sperant: has joined #ruby
[20:14:17] prestorium: has joined #ruby
[20:14:32] tynamite___: I've upgraded to ruby 2.1.5 and the encoding is CP850. How do I change it to UTF-8?
[20:15:26] dc_: has joined #ruby
[20:16:24] Tuxero: has joined #ruby
[20:16:39] jhass: tynamite___: either explicitly open files with the right encoding (all methods take parameters for that), use Encoding.default_external=, invoke ruby with the -E parameter set accordingly or as said change your system encoding
[20:17:19] _aeris_: has joined #ruby
[20:17:43] Cust0sLim3n: has joined #ruby
[20:17:47] baweaver: has joined #ruby
[20:17:59] tynamite___: But I have the wrong encoding on both Windows and Heroku.
[20:18:17] tynamite___: Can I change the ruby encoding on the command line?
[20:18:23] _aeris_: hello #ruby !
[20:18:40] jhass: tynamite___: yes, I just wrote that you can ...
[20:19:11] _aeris_: how I can force ruby to search for .so extension on a specific folder ?
[20:19:11] yfeldblum: has joined #ruby
[20:19:30] _aeris_: i use LD_LIBRARY_PATH, but works only with plain ruby, not with bundler :(
[20:19:48] ruboto: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[20:20:20] tynamite___: I typed in ruby -e Encoding.default_internal = Encoding:UTF_8 in the command line, and nothing happened.
[20:20:20] _aeris_: jhass > ok, this is the plain context :P
[20:20:50] _aeris_: i develop a tool to check TLS configuration, and for this, i need to patch both openssl lib and ruby extension
[20:20:59] jhass: tynamite___: those are a list of alternatives, you mixed two up
[20:21:34] _aeris_: but i don???t want to patch the ruby nor openssl system, because patch reintroduce weak ciphers for testing
[20:21:35] renderful: has joined #ruby
[20:21:42] jhass: _aeris_: mmh, I guess you can try require_relative
[20:21:42] tynamite___: I tried the external one instead and it doesn't work.
[20:21:53] tynamite___: I tried both the internal and external one.
[20:21:56] jhass: what exactly did you try
[20:22:01] renderful: has joined #ruby
[20:22:03] _aeris_: jhass > this is not only .rb, this is also the openssl.so ruby ext
[20:22:05] tynamite___: http://stackoverflow.com/a/20521428/337306
[20:22:22] jhass: _aeris_: yeah, I understood that
[20:22:24] christiandsg: has joined #ruby
[20:22:25] tynamite___: It's a question for how to change the default encoding in ruby.
[20:22:48] _aeris_: libcrypto.so* libcrypto.so.1.0.0* libssl.so* libssl.so.1.0.0* openssl.so*
[20:23:02] _aeris_: i have patched openssl lib and ext here
[20:23:44] jhass: _aeris_: you load ruby extensions via require too, and all require_relative does is compute an absolute path and call require
[20:23:44] _aeris_: LD_LIBRARY_PATH=lib strace -f bin/check_https.rb 2>&1 | grep openssl.so
[20:23:48] _aeris_: [pid 15103] open("/home/aeris/Workspace/imirhil.fr/sslcheck/lib/openssl.so", O_RDONLY|O_CLOEXEC) = 7
[20:24:14] _aeris_: but LD_LIBRARY_PATH=lib strace -f bundle exec bin/check_https.rb tpeweb.paybox.com 2>&1 | grep openssl.so
[20:24:19] _aeris_: [pid 15204] open("/home/aeris/.rbenv/versions/2.2.2/lib/ruby/site_ruby/2.2.0/x86_64-linux/openssl.so", O_RDONLY|O_CLOEXEC) = 8
[20:24:30] finisherr: has joined #ruby
[20:24:30] jhass: _aeris_: the other thing to try is to modify $LOAD_PATH after require "bundler/setup"
[20:24:38] alphaatom: has joined #ruby
[20:24:40] jhass: $LOAD_PATH the Ruby global that is
[20:25:04] _aeris_: jhass > i try this, but seems the ext is loaded with ruby, so BEFORE any of my code
[20:25:24] dc_: has joined #ruby
[20:25:42] jhass: maybe try starting ruby with --disable-gems, load your extension, require "rubygems" and then load bundler
[20:26:26] michaeldeol: has joined #ruby
[20:26:31] finisherr: has joined #ruby
[20:26:42] choke: has joined #ruby
[20:27:14] TheNet: has joined #ruby
[20:27:40] TheNet: anyone have any idea what the last method here is supposed to do? https://github.com/bootstrap-ruby/bootstrap-navbar/blob/master/lib/bootstrap-navbar/helpers.rb#L46
[20:28:13] jhass: TheNet: nothing, probably a hook for subclasses
[20:28:25] jhass: or your own override somewhere
[20:28:28] bronson: has joined #ruby
[20:28:33] dc_: has joined #ruby
[20:28:58] jhass: TheNet: https://github.com/bootstrap-ruby/bootstrap-navbar/blob/89409a5bce095fb564efa97aa58397145d8a21a9/README.md#set-up-html-escaping-optional
[20:29:00] jhass: right in the readme
[20:29:44] TheNet: jhass: I should've checked that, thanks!
[20:29:57] tynamite___: When I use ruby -e Encoding.default_external = Encoding::UTF_8 The encoding doesn't change to UTF-8. Nothing happens.
[20:30:04] finisherr: has joined #ruby
[20:30:29] jhass: tynamite___: that's of course only for the current Ruby process, it doesn't change future invocations
[20:30:52] tynamite___: Hmm that's what stack overflow said to do. How do I change it for all invocations?
[20:31:05] jhass: do it in all invocations
[20:31:10] jhass: or read my previous answer
[20:31:13] alphaatom: has joined #ruby
[20:32:01] msnyon: has joined #ruby
[20:32:52] devdazed: has joined #ruby
[20:33:24] railsraider: has joined #ruby
[20:34:13] gambl0re: has joined #ruby
[20:34:45] lwu: has joined #ruby
[20:34:48] Alayde: has joined #ruby
[20:35:37] dcas: has joined #ruby
[20:35:57] shevy: was ruby more successful than smalltalk?
[20:36:06] tomphp: has joined #ruby
[20:36:21] eam: way yeah
[20:38:05] startupality: has joined #ruby
[20:39:06] coban2k: has joined #ruby
[20:39:57] infernix: with Socket I can use getifaddrs to retrieve interface ips etc. which class has route info (e.g. ip route)? i'm not finding it in Socket
[20:40:42] timanema: has joined #ruby
[20:42:54] pyon: has joined #ruby
[20:42:59] mleung: has joined #ruby
[20:43:29] baweaver: has joined #ruby
[20:43:34] eam: infernix: probably none, try a gem
[20:44:16] tynamite___: jhass you told me to either use Encoding.default_external= or change my system encoding.
[20:44:24] banister: has joined #ruby
[20:44:46] tynamite___: But the wrong encoding is also on heroku, so I can only change it with ruby
[20:44:48] jhass: tynamite___: or -E or just specify it every time you open a file
[20:45:19] hfp: has joined #ruby
[20:45:34] nisstyre: has joined #ruby
[20:46:18] sumark: has joined #ruby
[20:46:34] jpfuentes2: has joined #ruby
[20:46:35] tynamite___: I put Encoding.default_external = 'utf-8' Encoding.default_internal = Encoding::UTF_8 at the top of my ruby files and it didn't do anything.
[20:47:01] rideh: has joined #ruby
[20:48:42] jhass: maybe your methodology of verifying your claim is plain wrong
[20:49:10] last_sta1: has joined #ruby
[20:50:13] tynamite___: I say it doesn't do anything because when I put the ?? symbol on an xhtml page, I get an exception saying that I cannot print a utf-8 character on a cp850 page.
[20:50:24] mleung: has joined #ruby
[20:50:43] Motoservo: has joined #ruby
[20:51:04] hfp: Hey all, I don't understand this code from POODR: https://github.com/skmetz/poodr/blob/master/chapter_8.rb#L423-L476. When you call `Bicycle.spares', it goes to Parts.spares but then where does it get `part` from on L447? I see from the doc that `select` should be applied to an Enumerable so `[1, 2, 3].select` is fine but if `select` is not sent as a message to anything then how does it know what it applies to?
[20:51:27] jhass: tynamite___: is it a Ruby exception? copy paste it
[20:52:54] jhass: hfp: Enumerable is based on .each, Parts#each is a forward to @parts.each, Enumerable is included into Parts thus Enumerable#select is available as Parts#select
[20:53:04] elaptics: hfp: it's the parts held in spares
[20:53:17] startupality: has joined #ruby
[20:53:36] devdazed: has joined #ruby
[20:53:48] nisstyre: has joined #ruby
[20:55:01] centrx: has joined #ruby
[20:55:04] hfp: jhass: Right, but why isn't it written as self.select?
[20:55:23] jhass: that's the same
[20:55:33] hfp: Ah, the self is implied?
[20:55:43] jhass: yes, it's identical for all you need to care about atm
[20:56:12] dblessing: has joined #ruby
[20:57:02] northfurr: has joined #ruby
[20:57:09] hfp: And L439: `def_delegators :@parts, :size, :each` means that whenever you call size and each on @parts, it will forward this to each thing in @parts? So it's a bit like reverse inheritance?
[20:57:28] hfp: whereas it goes down the inheritance chain instead of up?
[20:59:05] felltir: has joined #ruby
[20:59:06] cornerma1: has joined #ruby
[20:59:09] prettiestPony11: has joined #ruby
[21:01:10] tomphp: has joined #ruby
[21:01:17] fundies: has joined #ruby
[21:01:46] fundies: can someone help me with omniauth-twitter? I''m getting 401 Authorization Required
[21:03:38] roolo_: has joined #ruby
[21:04:44] blue_deref: has joined #ruby
[21:05:16] hippyphysicist: has joined #ruby
[21:06:32] j4cknewt: has joined #ruby
[21:07:52] shinnya: has joined #ruby
[21:08:26] Symbiosisz2: has joined #ruby
[21:09:00] neohunter: has joined #ruby
[21:09:25] neohunter: I've this.. module Aaa; class A end; end; module Aaa; class B end; end;
[21:09:50] jhass: hfp: it's called delegation, it's a form of composition, not inheritance
[21:09:58] neohunter: I'm tring to instanciate class B from class A, but it says undefined constant
[21:10:07] fundies: anyone use omniauth twitter?
[21:10:14] BraddPitt: neohunter can you gist
[21:10:17] neohunter: I tried doing Aaa::B, ::Aaa::B and ::B
[21:10:18] jhass: neohunter: please provide a minimal example that actually reproduces your issue
[21:10:19] neohunter: yes hold on
[21:10:34] jhack: Can someone explain why this is giving me the wrong word length it's displaying?
[21:10:36] jhack: https://gist.github.com/a14c6e82f7667e3f55e9.git
[21:10:42] jhack: https://gist.github.com/jhack32/a14c6e82f7667e3f55e9
[21:11:08] jhass: jhack: readlines includes the trailing newline
[21:11:16] BraddPitt: what do you mean jhack?
[21:11:22] BraddPitt: god i hate your two nicks, far too similar
[21:11:53] shevy: two lost brothers once again united
[21:11:53] jhass: jhack: I recommend to be pedantic about proper indentation, your code is unnecessarily hard to read
[21:12:09] shevy: damn now jhass is talking to jhass BraddPitt
[21:12:21] prestorium: has joined #ruby
[21:12:25] BraddPitt: even shevy got confused
[21:12:49] noethics: has joined #ruby
[21:14:14] webopsx: has joined #ruby
[21:14:21] tynamite___: I've fixed the problem now. Thank you for your help.
[21:14:23] jhack: jhass: would it be better if i opened the file then used .sample on it?
[21:14:56] jhack: nvm taht wouldnt work
[21:15:01] jhass: jhack: that won't work. It would be good to read the file only once, but that's not your issue
[21:15:13] jhass: jhack: understand your current issue before you make other changes
[21:16:01] jhass: jhack: look at the return value, of File.readlines(..) and .sample, use p not puts for debug prints
[21:16:12] jhass: use .inspect of you combine it with other output
[21:16:39] alphaatom: has joined #ruby
[21:16:49] hahuang61: has joined #ruby
[21:16:53] tynamite___: has left #ruby: ()
[21:17:09] dc_: has joined #ruby
[21:17:40] jhass: fundies: might have better luck in #RubyOnRails
[21:18:05] jhack: jhass: .rjust would work ?
[21:18:23] pyon: has joined #ruby
[21:18:24] jhass: jhack: you're not trying to understand your problem
[21:19:03] jhack: jhass: I believe my problem is that it includes the \n after the word, which adds onto the length of the word
[21:19:12] jhack: jhass: after changing puts to p, thats what its showing me
[21:19:16] jhass: that's right
[21:19:20] Scripore: has joined #ruby
[21:19:32] jhass: how do you come to .rjust now? how's that related?
[21:19:43] jhack: jhass: so .rjust would eliminate this \n and give me the right length
[21:19:52] jhass: &ri String#rjust
[21:19:53] `derpy: http://www.rubydoc.info/stdlib/core/String#rjust-instance_method
[21:19:57] jhack: jhass: i mean .rstrip
[21:20:12] jhass: well, yes that would work
[21:20:20] jhass: though I prefer .chomp for that case
[21:20:42] jhack: oh right, chomps as well
[21:21:00] jhass: jhack: but you should've just tried it prior asking and then ask if it's the best solution ;
[21:21:07] jhack: yeah my b
[21:21:17] jamesaxl: has joined #ruby
[21:21:34] jhask: ok guys let's rock
[21:21:42] Alayde: has joined #ruby
[21:21:47] jhass: ?guys jhask
[21:21:48] ruboto: jhask, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
[21:21:52] al2o3-cr: Wow, I thought a was seeing someone type to oneself for a minute then
[21:21:58] jhask: hey I did not say that, that was jhack
[21:22:08] jhass: you all need clients with better color coding
[21:22:11] jhask: al2o3-cr lol
[21:22:33] jhack: hey, that was clearly jhask
[21:22:47] jhask: this is confusing me... and the heat is also making things worse
[21:22:57] jhack: jhask: no AC?!
[21:23:00] jhass: jhask: you're pink, jhack is green, can't fool me
[21:23:45] jhack: jw, how old are yall
[21:23:46] al2o3-cr: heh jhass blue jhack blue jhask green :)
[21:23:53] jhask: it takes me a few seconds to find out who of you two asked this :\
[21:24:07] apeiros: ACTION needs no colors for he can read
[21:24:07] jhask: there is no jhaks!
[21:24:50] al2o3-cr: ah, so jhask is shevy LOL
[21:25:09] shevy: no, I'm shevy
[21:25:27] jhass: no i'm jhass
[21:25:30] jhask: who stole my nick
[21:25:48] jhask: you can't get the al nick because it's so hard to type
[21:26:08] jhaks: ok let's all switch back again?
[21:26:22] jhack: starting the jha trend
[21:26:23] jhack: lets gettit
[21:26:27] Sperant: has joined #ruby
[21:26:52] shevy: nah, I keep this one and tell everybody to use UTF-8 and never built anything from source
[21:26:54] hal_9000_: has joined #ruby
[21:27:49] jhaks: I don't know who is who anymore
[21:27:56] shevy: see, that's how sad you usually make me
[21:28:33] ndrei: has joined #ruby
[21:29:32] al2o3-cr: the gold old whowas :)
[21:30:10] TheMysticWyvern: How do programming languages work if the one writing it speaks a different language, like Japanese or German? Would they have their own syntax, or would an English person be able to read their programming?
[21:31:14] jhass: TheMysticWyvern: developers you want to work with will use english identifiers and comments
[21:31:28] shock_one: has joined #ruby
[21:31:30] jhass: those that don't... try to avoid them :P
[21:31:54] TheMysticWyvern: jhass: So, a Japanese person, for example, would actually use the Japanese word for "variable" in their programming instead of, well, "variable?"
[21:31:55] jhack: How do i access an array i have in a different class? Ex: i have class Computer, i want to access an array from the Computer class in my Player class
[21:32:04] ryuu: who do i talk to to get the ?guys alias removed? it's ridiculous and actually offensive
[21:32:09] jhass: TheMysticWyvern: I just said the opposite
[21:32:34] Coraline: How is it offensive?
[21:32:47] Coraline: Actually, respond on #ruby-offtopic
[21:33:18] FernandoBasso: has joined #ruby
[21:33:21] jhass: ryuu: ^ continuing the topic here will get you removed, please respect moving to #ruby-offtopic
[21:34:24] jhass: jhack: that desire is a strong indicator that the array shouldn't live in the Computer class in the first place
[21:34:57] jhack: The computer class gets the sample from an external textfile and places it into the array though
[21:35:01] pyon: has joined #ruby
[21:35:08] jhass: there's no though in there
[21:35:29] jhass: it doesn't invalidate the point at all
[21:35:35] rehat: is there a good way to remember to prefix or postfix a ':' for symbols? When I use then in a hash def it's postfix but if I try to grab the value from a hash using [] the colon is prefixed
[21:36:02] Scripore: has joined #ruby
[21:36:12] hfp: jhass, elaptics: Thanks for the explanation earlier
[21:36:15] jhass: rehat: prefix is the standard and normal way, hash literals are the only optional exception
[21:36:23] jhass: rehat: that is :foo => bar still works in them too
[21:37:03] radgeRayden: has joined #ruby
[21:37:37] apeiros: jhass: also keyword args (symbols when passing, not symbols when defining)
[21:37:47] apeiros: that part has potential for confusion for newcomers
[21:37:49] baweaver: has joined #ruby
[21:38:08] jhass: mmh, true, though are they really symbols? aren't they just syntax?
[21:38:28] shevy: TheMysticWyvern they use english names really
[21:39:00] [spoiler]: jhass: they're just syntax
[21:39:02] hfp: TheMysticWyvern: The litterals and functions don't change, they are always in English. How you name your variables and your own functions depends on you and your team; you can very well give all your vars and functions German names but the ones from the Ruby language will always be in English. i.e. an Array will always be an Array no matter what locale your team is using
[21:39:21] radgeRayden_: has joined #ruby
[21:39:32] TheMysticWyvern: That's what I was wondering about. Thank you, everyone! :3
[21:39:38] [spoiler]: apeiros: hmm why would it confuse newcomers?
[21:39:38] jhass: you can, but you'd be a horrible person to do so
[21:40:00] hfp: Of interest, I remember Microsoft tried to localize the standard function names in Excel. It was a nightmare! Say you are proficient in Excel "programming" in English and you want to use a French version of Office... Well nothing works anymore because SUM() became SOMME()
[21:40:24] [spoiler]: apeiros: oh you mean because they'd expect to be able to do `:foo => 9001`?
[21:40:32] [spoiler]: in the definition
[21:41:46] bronson: has joined #ruby
[21:42:12] shevy: hfp that's what I hated about openoffce/libreoffice excel - when I had the german language, the function names for excel were different
[21:42:18] apeiros: jhass: which ones?
[21:42:23] shevy: since that confused the hell outta me, I switched to english always
[21:42:23] apeiros: definition or passing?
[21:42:38] jhass: mmh, both actually
[21:42:53] radgeRayden__: has joined #ruby
[21:43:00] shock_one: has joined #ruby
[21:44:16] dr3w: has joined #ruby
[21:45:00] rehat: jhass: ok thanks
[21:46:08] htmldrum: has joined #ruby
[21:47:22] radgeRayden: has joined #ruby
[21:47:26] neohunter: is possible to define a method with multiple arguments in 2 lines?
[21:47:33] neohunter: i mean the def(...) line
[21:47:38] ruboto: Why don't you try it and see for yourself?
[21:47:43] [spoiler]: I am actually still unsure how I feel about kwargs. I find it a bit annoying that we can't do `def meth(a:1, b:2)` and call it as `meth(4,5) or `meth(4)`. I foten forget I need to call it as `meth(a:4)`
[21:47:50] yqt: has joined #ruby
[21:48:14] jhass: yeah, python got that better, you can just use the names of regular args
[21:48:16] djbkd: has joined #ruby
[21:48:25] NeverDie: has joined #ruby
[21:48:35] jhass: crystal too does that for args with default values and I have some hope we'll get it for required args too
[21:48:37] [spoiler]: I mostly use the a=1, b=2 syntax
[21:48:56] Sperant: has joined #ruby
[21:49:04] [spoiler]: jhass: see, that is nice
[21:49:05] jbw: has joined #ruby
[21:49:32] [spoiler]: and I find it weird how, internally when you call those methods, it's a hash
[21:50:03] radgeRayden_: has joined #ruby
[21:50:18] [spoiler]: but at least we can do `foo(some_hash)` lol
[21:50:19] baweaver: has joined #ruby
[21:50:33] shevy: https://gist.github.com/chobie/2493950
[21:50:35] shevy: php-mruby
[21:50:59] monsieurp: has joined #ruby
[21:51:24] [spoiler]: not even ruby can save php
[21:51:48] shevy: nothing can save php!
[21:52:04] slawrence00: has joined #ruby
[21:52:22] jmignault: has joined #ruby
[21:52:56] [spoiler]: I actually added mroby into my pet language as part of my "getting familiarised with the mruby api" project
[21:53:08] [spoiler]: fuck this roby typo, it's getting on my nerves
[21:53:49] wheresmyjetpack: has joined #ruby
[21:53:50] Timba-as: has joined #ruby
[21:53:57] Coldblackice: has joined #ruby
[21:55:38] michaeldeol: has joined #ruby
[21:56:15] radgeRayden_: has joined #ruby
[21:56:28] dr3w: has joined #ruby
[21:57:06] jmignault: has joined #ruby
[21:57:07] wasamasa: roby williams
[21:57:25] hfp: batman & roby
[21:58:06] galeido: has joined #ruby
[21:58:27] hotpancakes: has joined #ruby
[22:00:34] ramfjord: has joined #ruby
[22:01:17] mleung: has joined #ruby
[22:01:21] ccbn: has joined #ruby
[22:01:26] NeverDie: has joined #ruby
[22:02:23] dc_: has joined #ruby
[22:03:19] jenrzzz_: has joined #ruby
[22:03:20] cohiijay: has joined #ruby
[22:04:15] Scripore: has joined #ruby
[22:04:28] bmurt: has joined #ruby
[22:04:33] radgeRayden_: has joined #ruby
[22:05:49] qubitz: has joined #ruby
[22:06:33] ndrei: has joined #ruby
[22:07:35] freerobby: has joined #ruby
[22:08:29] hahuang61: has joined #ruby
[22:10:49] Cache_Money: has joined #ruby
[22:11:12] christiandsg: has joined #ruby
[22:11:25] shock_one: has joined #ruby
[22:12:03] devoldmx: has joined #ruby
[22:12:51] bruno-: has joined #ruby
[22:13:14] ndrei: has joined #ruby
[22:14:04] Thermatix: has joined #ruby
[22:14:30] Zeroe: has joined #ruby
[22:14:38] Guest25077: has joined #ruby
[22:15:01] TheNet: has joined #ruby
[22:15:50] josh3: has joined #ruby
[22:16:40] NeverDie: has joined #ruby
[22:18:53] BTRE: has joined #ruby
[22:19:12] freerobby1: has joined #ruby
[22:20:41] dvabr: has joined #ruby
[22:20:55] baweaver: has joined #ruby
[22:21:01] ndrei: has joined #ruby
[22:21:20] hotpancakes: has joined #ruby
[22:21:45] lukas: has left #ruby: ("WeeChat 0.4.2")
[22:23:38] dfockler: a little late
[22:23:51] jenrzzz: has joined #ruby
[22:23:56] braincrash: has joined #ruby
[22:24:17] d10n-work: has joined #ruby
[22:26:30] Scriptonaut: has left #ruby: ()
[22:26:54] ndrei: has joined #ruby
[22:27:02] shevy: [spoiler] lol
[22:27:19] shevy: when the keyboard becomes the worst enemy
[22:27:27] shevy: it often makes for great bash.org worthy quotes :)
[22:28:06] ruby-lang270: has joined #ruby
[22:28:45] Vile`: has joined #ruby
[22:29:30] al2o3-cr: http://bash.org/?835030 (cracks me up all the time) heh
[22:30:36] darwingr: has joined #ruby
[22:30:53] [spoiler]: LOL, love that one
[22:30:54] shock_one: has joined #ruby
[22:31:46] omegamike: has joined #ruby
[22:31:58] al2o3-cr: got some corkers on there
[22:34:07] shevy: less fun, more code al2o3-cr!
[22:34:12] olivierrr: has joined #ruby
[22:34:18] yqt: has joined #ruby
[22:34:27] big|bad|wolf: has joined #ruby
[22:34:45] ndrei: has joined #ruby
[22:34:49] Coraline: Is it possible to specify a git remote other than origin when executing rake release on a gem?
[22:35:01] Coraline: It tries to tag a release on origin
[22:35:32] jhass: that's the bundler task?
[22:35:34] al2o3-cr: shevy: I've quit
[22:35:38] ecksit: has joined #ruby
[22:35:45] omegamike: has joined #ruby
[22:36:02] BLuEGoD: has joined #ruby
[22:36:34] luksaur: has joined #ruby
[22:36:49] NeverDie: has joined #ruby
[22:37:10] jhass: Coraline: https://github.com/bundler/bundler/blob/master/lib/bundler/gem_helper.rb#L54 looks like it takes it as parameter
[22:37:29] jhass: gambl0re ...
[22:37:29] shevy: al2o3-cr :(
[22:37:44] al2o3-cr: No more code for me :(
[22:38:21] michaeldeol: has joined #ruby
[22:38:49] Maletor: has joined #ruby
[22:40:03] chichou: has joined #ruby
[22:40:30] Yzguy: has joined #ruby
[22:40:42] gambl0re: why you keep banning me...
[22:41:20] dimasg: has joined #ruby
[22:41:20] davedev24: has joined #ruby
[22:41:34] jhass: gambl0re: no bans, only kicks
[22:41:43] jhass: gambl0re: and the why is in the kick message
[22:42:15] jhass: and I started to kick since you ignored the prior warning
[22:43:25] bootstrappm: "do not crosspost without informing all sides about it"
[22:43:41] choke: has joined #ruby
[22:43:45] gambl0re: you suck...
[22:43:54] apeiros: !ban gambl0re bye
[22:43:59] gambl0re: i didnt even do anything..
[22:44:03] apeiros: !ban gambl0re !T 1d bye
[22:44:04] ChanServ: +b gambl0re!*@*
[22:44:04] ChanServ: ChanServ kicked gambl0re: bye
[22:44:09] apeiros: damn, every. single. time.
[22:44:30] wldcordeiro_: has joined #ruby
[22:44:36] apeiros: so sad to say they were right. I suck. I really have to move my ass and do a release :<
[22:44:38] shadeslayer: question, I have code in a class that I want to execute when a var of that class goes out of scope
[22:44:42] jpfuentes2: has joined #ruby
[22:45:06] bougyman: he genuinely seemed to need help, not a troll.
[22:45:08] shadeslayer: actually, let me paste code
[22:45:31] jhass: &ri ObjectSpace.define_finalizer
[22:45:31] `derpy: http://www.rubydoc.info/stdlib/core/ObjectSpace#define_finalizer-class_method
[22:45:38] blue_deref: has joined #ruby
[22:45:58] zenspider: gah. jury duty... what'd I miss?
[22:45:59] apeiros: shadeslayer: beware though, finalizers have no guaranteed time when they're run
[22:46:17] zenspider: usually when you're using finalizers, you're doing it wrong.
[22:46:29] apeiros: ACTION wonders how he can change the 1d ban to a 1h ban
[22:46:31] davedev24: has joined #ruby
[22:46:34] apeiros: 1d was too much IMO
[22:46:57] shadeslayer: apeiros: that looks close
[22:46:59] zenspider: shadeslayer: consider running your code in a block that cleans up after itself when the block in done running.
[22:47:17] shadeslayer: zenspider: I'm trying to abstract away a mount operation
[22:47:38] shadeslayer: zenspider: apeiros https://gist.github.com/bc9f3091d7e01a35ff84
[22:47:41] TheNet: has joined #ruby
[22:47:45] Pupeno: has joined #ruby
[22:47:45] renderful: has joined #ruby
[22:47:48] chichouw: has joined #ruby
[22:48:12] shadeslayer: where SOMETHING is run when a var of class type Mount goes out of scope
[22:48:39] zenspider: shadeslayer: exactly... so put mount and umount in the same method... yield in between, and put the umount in the ensure like you have
[22:48:52] zenspider: make it work exactly like Dir.chdir(path) { ... }
[22:48:54] bmurt: has joined #ruby
[22:49:01] _blizzy_: has joined #ruby
[22:49:17] ChanServ: -b gambl0re!*@*
[22:49:30] zenspider: shadeslayer: also, _all_ def's have an implicit begin, so you can do: def name; ... ensure; ... end
[22:50:02] shadeslayer: zenspider: won't work, I mount multiple Dirs one after the other
[22:50:10] shadeslayer: so I'll have to use nested blocks
[22:50:26] renderful: has joined #ruby
[22:50:45] shadeslayer: zenspider: trying to get rid of https://github.com/netrunner-arm/rpi2-image/blob/master/image.rb#L73
[22:51:46] pyon: has joined #ruby
[22:52:36] zenspider: shadeslayer: there's nothing wrong with nested blocks
[22:53:01] zenspider: but you can also write it in such a way that you pass in a splatted list of mounts
[22:53:13] quimrstorres: has joined #ruby
[22:53:25] michael_mbp: has joined #ruby
[22:54:13] Sperant: has joined #ruby
[22:54:31] zenspider: shadeslayer: eh. after looking at your code... I'd say your nesting argument is weak.
[22:54:46] shadeslayer: zenspider: oh? ok
[22:54:54] shadeslayer: so nests are fine there then?
[22:55:29] michaeldeol: has joined #ruby
[22:55:41] ellisTAA: has joined #ruby
[22:56:12] htmldrum: has joined #ruby
[22:56:19] startupality: has joined #ruby
[22:56:19] zenspider: shadeslayer: compare 3 versions: https://gist.github.com/2cc962f3f4fdf47f8914
[22:56:25] shadeslayer: zenspider: ok, I'll use nested blocks, but for the sake of education completedness, what method does one overload to execute things when something goes out of scope
[22:57:08] juanpablo__: has joined #ruby
[22:57:26] _blizzy_: has joined #ruby
[22:58:00] juanpablo__: has joined #ruby
[22:58:27] zenspider: not sure I understand your question
[22:59:21] shadeslayer: zenspider: I'm looking for the opposite of the initialize method :)
[22:59:32] shadeslayer: the dtor in C++ speak :P
[23:00:36] zenspider: you use a finalizer like someone suggested... but it doesn't work the way C++'s destructors work. You'll never control when it triggers
[23:00:50] shadeslayer: that's what I can find on google as well :(
[23:00:50] zenspider: something like: https://gist.github.com/2dfa5aeb6f49d27a3e5a
[23:00:56] shadeslayer: apparently only gets run GC
[23:01:26] zenspider: and not necessarily then
[23:03:12] wldcordeiro_: has joined #ruby
[23:08:09] jpfuentes2: has joined #ruby
[23:08:23] tkuchiki: has joined #ruby
[23:08:31] bmurt: has joined #ruby
[23:08:36] bodgix: has joined #ruby
[23:10:35] hashrocket: has joined #ruby
[23:11:25] jgpawletko: has joined #ruby
[23:12:12] shadeslayer: zenspider: hm, now it tries to unmount the rootfs dir twice
[23:12:46] shadeslayer: https://gist.github.com/5d1cfcdf4bcddf3ae11d
[23:13:06] htmldrum: has joined #ruby
[23:13:20] shadeslayer: zenspider: https://gist.github.com/shadeslayer/a267f7a615cc1ad5cbb6
[23:13:59] Sperant: has joined #ruby
[23:14:01] shadeslayer: zenspider: https://gist.github.com/shadeslayer/50e22bf26ee7323cbbf2 < log
[23:15:53] zenspider: shadeslayer: because you're using an instance variable
[23:15:59] zenspider: so you're forgetting the first mount
[23:16:02] shadeslayer: zenspider: just firgured it out :P
[23:16:51] zenspider: ensure should be indented to the same level as def/end
[23:16:54] olivierrr: has joined #ruby
[23:16:56] zenspider: and everything else should be normal indentation
[23:17:05] zenspider: ie, outdent ensure
[23:17:28] zenspider: also, your string is hardcoded to say boot partition
[23:17:46] shadeslayer: ah yeah, good catch
[23:18:52] bmurt: has joined #ruby
[23:19:11] casadei: has joined #ruby
[23:19:25] charliesome: has joined #ruby
[23:19:34] rbennacer: has joined #ruby
[23:22:22] Timba-as: has joined #ruby
[23:24:08] baweaver: has joined #ruby
[23:24:35] bmurt: has joined #ruby
[23:25:06] amclain: has joined #ruby
[23:25:21] quimrstorres: has joined #ruby
[23:25:47] NeverDie: has joined #ruby
[23:27:19] dopamean_: has joined #ruby
[23:27:43] arescorpio: has joined #ruby
[23:27:57] hays: i had a script today at work that stopped working when i started accessing ARGV. specifically gets didn't seem to know to pull from stdin.. is this normal?
[23:29:01] zenspider: what does ARGV and gets have to do with each other?
[23:29:50] hays: i don't know
[23:30:12] hays: it just mysteriously started throwing an error
[23:30:14] zenspider: hays: you just want to read from files passed on cmdline?
[23:30:20] choke: has joined #ruby
[23:30:21] htmldrum: has joined #ruby
[23:30:34] dimasg: has joined #ruby
[23:30:42] hays: nah, my args were just parameter
[23:30:42] hays: parameters
[23:30:56] zenspider: so what was the error?
[23:31:13] hays: let me see if i can reproduce it at home.. i was on a winbox
[23:31:27] zenspider: ri Kernel.gets: "Returns (and assigns to $_) the next line from the list of files in ARGV (or $*), or from standard input if no files are present on the command line."
[23:31:42] rickmasta: has joined #ruby
[23:31:42] zenspider: you can be explicit by using $stdin.gets
[23:31:54] zenspider: or you can be explict by using ARGF as an IO
[23:32:12] Synthead: has joined #ruby
[23:32:42] Azure: has joined #ruby
[23:34:27] devdazed: has joined #ruby
[23:34:31] Renich: has joined #ruby
[23:34:35] michaeldeol: has joined #ruby
[23:34:47] hashrocket: has joined #ruby
[23:35:24] hays: dang. can't reproduce at home
[23:36:00] hays: I had something like while gets.chomp != 'STOP'; puts 'Type STOP to exit';end
[23:36:01] hotpancakes: has joined #ruby
[23:36:28] hydrozen: has joined #ruby
[23:38:03] hays: i'll try gain tomorrow with $stdin.gets.chomp
[23:39:37] zenspider: hays: and normally your ARGV was empty, but you started adding flags or something?
[23:39:53] hays: zenspider: yeah
[23:39:59] hotpancakes: has joined #ruby
[23:40:10] Sperant: has joined #ruby
[23:40:33] zenspider: kk. either process all your flags up front and ensure ARGV is empty, or be explicit about where you're getting your input
[23:40:57] zenspider: run `ri Kernel.gets` for full doco
[23:41:15] drewo: has joined #ruby
[23:41:17] linuxboy_: has joined #ruby
[23:42:32] northfurr: has joined #ruby
[23:46:25] hotpancakes: has joined #ruby
[23:49:16] coban2k: has joined #ruby
[23:49:16] AccordLTN: has joined #ruby
[23:49:42] Oka: has joined #ruby
[23:50:17] dimasg: has joined #ruby
[23:51:23] rbennacer: has joined #ruby
[23:52:02] bodgix1: has joined #ruby
[23:54:23] WillAmes: has joined #ruby
[23:54:43] hashrocket: has joined #ruby
[23:56:15] jpfuente_: has joined #ruby
[23:56:20] Ropeney: has joined #ruby
[23:56:35] charliesome: has joined #ruby
[23:57:02] Shibo: has joined #ruby
[23:57:04] michaeldeol: has joined #ruby
[23:57:06] tkuchiki: has joined #ruby
[23:58:30] bodgix1: has joined #ruby
[23:59:41] hays: is there a more 'natural' way to do this https://bpaste.net/show/8c577ac6882b
[23:59:56] christiandsg: has joined #ruby