« Back to channel list

#ruby - 14 June 2017

« Back 1 day Forward 1 day »
[00:02:15] knight33: has joined #ruby
[00:11:14] enterprisey: has joined #ruby
[00:12:57] AnoHito: has joined #ruby
[00:19:46] ecuanaso: has joined #ruby
[00:21:46] dannyh: has joined #ruby
[00:25:37] duderonomy: has joined #ruby
[00:28:10] Rodya_: has joined #ruby
[00:31:05] Rodya__: has joined #ruby
[00:34:01] d^sh: has joined #ruby
[00:34:22] cats: has joined #ruby
[00:35:57] ghs39ghsggf: has joined #ruby
[00:36:57] ghs39ghsggf: has left #ruby: ()
[00:43:43] Rodya_: has joined #ruby
[00:44:04] shinnya: has joined #ruby
[00:44:27] bruce_lee: has joined #ruby
[00:44:27] bruce_lee: has joined #ruby
[00:46:07] centrx: has joined #ruby
[00:46:35] nesoi: has joined #ruby
[00:46:42] konsolebox: has joined #ruby
[00:48:48] charliesome: has joined #ruby
[00:52:36] dannyh: has joined #ruby
[00:53:13] ascarter: has joined #ruby
[00:57:31] Kilo`byte: has joined #ruby
[01:01:04] KillerFox: has joined #ruby
[01:01:11] forgot: has joined #ruby
[01:01:15] FastJack: has joined #ruby
[01:02:57] SeepingN: Anyone have a decent online ruby checker where you can dump your single file and have it check for unmatched begin/end and parens?
[01:05:07] havenwood: SeepingN: echo "def hi" > seepingn.rb; ruby -w seepingn.rb #!> seepingn.rb:1: syntax error, unexpected end-of-input
[01:06:10] havenwood: err, i mean to use -c
[01:06:13] havenwood: SeepingN: ruby -c seepingn.rb
[01:06:24] havenwood: -c check syntax only
[01:06:33] d^sh: has joined #ruby
[01:08:05] gothicsouth: has joined #ruby
[01:08:41] dviola: has joined #ruby
[01:12:03] mjuszczak: has joined #ruby
[01:12:24] SeepingN: yep, just re-learned of -w, thank you
[01:12:43] SeepingN: it was enough to find all sort of glorious to-do's :\
[01:13:01] mjuszczak: has joined #ruby
[01:13:04] SeepingN: and I found where I had dumped some code but hadn't commented it out for testing/tweaking
[01:14:27] weathermaker: has joined #ruby
[01:14:35] vincent_: has joined #ruby
[01:14:50] vincent_: has joined #ruby
[01:16:54] PorcoRex: has joined #ruby
[01:17:03] PorcoRex: Good evening.
[01:18:17] cats: has joined #ruby
[01:26:31] jenrzzz: has joined #ruby
[01:26:32] jenrzzz: has joined #ruby
[01:27:18] elifoster: has joined #ruby
[01:31:42] theunraveler: has joined #ruby
[01:33:07] gothicsouth: has joined #ruby
[01:38:41] Jameser: has joined #ruby
[01:40:11] jackjackdripper: has joined #ruby
[01:43:56] poloych: has joined #ruby
[01:44:03] uZiel: has joined #ruby
[01:47:31] gizmore|2: has joined #ruby
[01:50:40] Asher: has joined #ruby
[01:51:51] Hunter1: has joined #ruby
[01:59:19] ascarter: has joined #ruby
[02:03:38] d^sh: has joined #ruby
[02:06:29] eightlimbed: has joined #ruby
[02:07:38] enterprisey: has joined #ruby
[02:08:05] __Yiota: has joined #ruby
[02:10:39] arescorpio: has joined #ruby
[02:12:06] AnoHito: has joined #ruby
[02:12:41] [dmp]: has joined #ruby
[02:12:47] turingbombe: has joined #ruby
[02:14:23] shadeslayer: has joined #ruby
[02:14:53] __Yiota: has joined #ruby
[02:14:54] bkxd: has joined #ruby
[02:14:56] bkxd_: has joined #ruby
[02:19:25] __Yiota: has joined #ruby
[02:20:14] bkxd: has joined #ruby
[02:20:25] genpaku: has joined #ruby
[02:24:12] _whitelogger: has joined #ruby
[02:30:08] brent__: has joined #ruby
[02:31:15] belmoussaoui: has joined #ruby
[02:32:46] gothicsouth: has joined #ruby
[02:37:17] sleetdrop: has joined #ruby
[02:40:14] Rodya_: has joined #ruby
[02:41:44] jrafanie: has joined #ruby
[02:43:11] xall: has joined #ruby
[02:44:11] j0bk: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[02:51:14] belmoussaoui: has joined #ruby
[02:52:02] sleetdrop: has joined #ruby
[02:53:43] yeticry: has joined #ruby
[03:01:59] QpQ4: has joined #ruby
[03:02:51] cschneid_: has joined #ruby
[03:03:29] __Yiota: has joined #ruby
[03:06:49] ascarter: has joined #ruby
[03:08:15] pankaj: has joined #ruby
[03:09:07] eightlimbed: has joined #ruby
[03:10:55] cschneid_: has joined #ruby
[03:18:28] gix: has joined #ruby
[03:18:48] SeepingN: has joined #ruby
[03:23:56] __Yiota: has joined #ruby
[03:24:48] skixlix: has joined #ruby
[03:29:24] username1: has joined #ruby
[03:49:49] rohitpaulk: has joined #ruby
[03:55:06] skixlix: has joined #ruby
[04:01:45] nofxxxx: has joined #ruby
[04:05:49] Vingador: has joined #ruby
[04:11:57] ruby-lang817: has joined #ruby
[04:12:17] ruby-lang817: How can I pass in a function into ruby's map? I don't want to use an anonymous function...
[04:12:33] ascarter: has joined #ruby
[04:15:21] havenwood: ruby-lang817: What do you mean by function? A proc or method?
[04:15:55] havenwood: >> 3.times.map &:abs2
[04:15:56] ruby[bot]: havenwood: # => [0, 1, 4] (https://eval.in/816529)
[04:16:32] havenwood: >> :abs2.to_proc.call 2
[04:16:33] ruby[bot]: havenwood: # => 4 (https://eval.in/816530)
[04:17:28] havenwood: ruby-lang817: The `&` calls #to_proc on the object to its right then passes that as the block.
[04:17:41] ruby-lang817: then what is the colon for?
[04:17:55] havenwood: >> :abs2.class
[04:17:56] ruby[bot]: havenwood: # => Symbol (https://eval.in/816531)
[04:18:22] renchan: has joined #ruby
[04:19:11] havenwood: >> module Example; module_function def example n; n * 42 end end; 3.times.map &Example.public_method(:example)
[04:19:12] ruby[bot]: havenwood: # => [0, 42, 84] (https://eval.in/816532)
[04:19:55] havenwood: Which is more nicely written without the shorthand: 3.times.map { |n| Example.example n }
[04:21:12] havenwood: >> ['ruby-lang817', 'yarrr'].map &:upcase
[04:21:13] ruby[bot]: havenwood: # => ["RUBY-LANG817", "YARRR"] (https://eval.in/816533)
[04:21:37] havenwood: ruby-lang817: You're welcome.
[04:22:11] Hunter1: has joined #ruby
[04:27:59] rohitpaulk: has joined #ruby
[04:29:26] Bilge: has joined #ruby
[04:30:39] mradmacher: has joined #ruby
[04:31:09] KrzaQ: Can I have the %03d functionality while using %{name} to format my strings? Something like '%{03d:foo}' % { foo: 1 }
[04:32:48] elomatreb: `%{}`? Are you sure you don't mean `#{}`?
[04:33:51] elomatreb: From the docs: %{name} does not support modifiers, but %<name> does
[04:33:56] oz: has joined #ruby
[04:34:04] elomatreb: http://ruby-doc.org/core-2.4.1/Kernel.html#method-i-sprintf (last paragraph)
[04:34:18] Batholith: has joined #ruby
[04:34:28] zack6849: has joined #ruby
[04:34:28] zack6849: has joined #ruby
[04:34:29] gothicsouth: has joined #ruby
[04:34:29] KrzaQ: the problem with % is that it's really difficult to google if you don't know the name for it :)
[04:35:25] elomatreb: Remember that % is just a method in Ruby, which does formatstrings on String: http://ruby-doc.org/core-2.4.1/String.html#method-i-25
[04:35:35] haylon: has joined #ruby
[04:36:04] KrzaQ: It works, thanks again :)
[04:36:45] svkurowski: has joined #ruby
[04:37:34] Jamdaman: has joined #ruby
[04:38:16] KrzaQ: and what if my question was about `#{}`?
[04:38:29] KrzaQ: (it wasn't, but I'm curious)
[04:39:08] elomatreb: #{} is ruby code, unless you do formatting yourself it doesn't do anything special
[04:39:38] elomatreb: I.e. you can put any Ruby expression in there and it will insert the .to_s of that value into the String
[04:40:36] vincent_: has joined #ruby
[04:40:44] KrzaQ: okay, so it basically puts eval(code).to_s in place of #{code}?
[04:40:59] KrzaQ: ^ might be pseudocode
[04:41:21] Hunter1: has joined #ruby
[04:41:28] elomatreb: In effect, yeah. It doesn't do a detour with eval but it works like that
[04:41:29] baweaver: eval isn't used there
[04:41:38] baweaver: it just calls to_s on it
[04:41:50] baweaver: Hunter1: where's hunter2?
[04:42:02] elomatreb: Forgot their password
[04:42:36] KrzaQ: I meant it conceptually
[04:43:03] maxexcloo1234: has joined #ruby
[04:43:05] vincent_: has joined #ruby
[04:43:17] Hunter1: He's been deprecated
[04:43:21] KrzaQ: It does execute the code, at least for me
[04:43:56] cschneid_: has joined #ruby
[04:44:46] elomatreb: Try `"this is a String with interpolation: #{puts 'I was executed!'}"`
[04:45:04] elomatreb: (I'd present a demo but eval.in is broken again)
[04:46:13] maxexcloo1234: Hi, I'm having some trouble with mapping arrays, it's probably a very quick fix, if anyone could have a look at https://pastebin.com/jfunYp8n it would be greatly appreciated. Basically, I'm trying to map a nested array and it's not working properly, happy to explain in more detail if anyone can help
[04:46:15] ruby[bot]: maxexcloo1234: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/c576e70981621d2fe63d8fcd841a1636
[04:46:15] ruby[bot]: maxexcloo1234: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[04:46:30] maxexcloo1234: sorry ruby bot ;)
[04:47:22] KrzaQ: I did try something to that effect and puts was executed
[04:47:27] maxexcloo1234: I realise it's rails code but I'm having trouble with map! syntax so I figured it was more appropriate to post here
[04:47:56] balazs_: has joined #ruby
[04:47:57] ruby[bot]: baweaver: # => 1 (https://eval.in/816536)
[04:48:15] baweaver: Map returns the last value in the block
[04:48:24] baweaver: >> [1,2,3].map { |x| x * 2 }
[04:48:30] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[04:48:34] baweaver: >> [1,2,3].map { |x| x * 2; 'foo!' }
[04:48:35] ruby[bot]: baweaver: # => ["foo!", "foo!", "foo!"] (https://eval.in/816538)
[04:48:41] baweaver: >> [1,2,3].map { |x| x * 2 }
[04:48:42] ruby[bot]: baweaver: # => [2, 4, 6] (https://eval.in/816539)
[04:48:47] baweaver: there we go
[04:48:48] maxexcloo1234: @baweaver I assumed that actually, have had some trouble finding how to do what I'd like
[04:48:58] maxexcloo1234: any chance you could point me in the right direction?
[04:49:12] elomatreb: You want each iteration of the block to reutnr the value you want the new items in your array to have
[04:49:47] baweaver: So you're trying to take a CSV row, replacing two columns with the entities, and trying to take a certain subset (trim) of it
[04:49:58] maxexcloo1234: yes, basically
[04:50:04] baweaver: What's up with the delete_at?
[04:50:11] baweaver: seems fairly arbitrary
[04:50:26] baweaver: [1,2,3,4,5,6,7,8][3..-1]
[04:50:30] baweaver: >> [1,2,3,4,5,6,7,8][3..-1]
[04:50:31] ruby[bot]: baweaver: # => [4, 5, 6, 7, 8] (https://eval.in/816542)
[04:50:42] baweaver: arrays can be sliced with ranges like that.
[04:50:53] maxexcloo1234: each command individually works, if I print out csv_line after line 6 it works
[04:51:13] baweaver: make a new line with csv_line on it
[04:51:26] elomatreb: >> [1, 2, 3].each {|i| i * 2 } # Observe the difference to the map above
[04:51:27] ruby[bot]: elomatreb: # => [1, 2, 3] (https://eval.in/816543)
[04:51:29] govg: has joined #ruby
[04:51:53] maxexcloo1234: will have a look now
[04:51:56] baweaver: >> a = [1,2,3,4,5,6,7,8]; [a[2], a[1], *a[3..-1]] # if you want to go slicing segments of the array out.
[04:51:58] ruby[bot]: baweaver: # => [3, 2, 4, 5, 6, 7, 8] (https://eval.in/816545)
[04:53:34] maxexcloo1234: @baweaver, I'm assuming I shouldn't be mapping csv_line as well?
[04:53:42] maxexcloo1234: basically a map inside a map?
[04:53:53] elomatreb: Unrelated: Are there any conventions yet for how we should name refinement modules?
[04:54:02] baweaver: Comment on that gist with an example line and what you want to get out of it as a result
[04:54:28] baweaver: elomatreb: -able mostly if you go by the module extension pattern
[04:54:53] baweaver: or just go with hungarian notation style: RefinedClassName
[04:55:05] baweaver: not sure if there really is one though
[04:55:11] elomatreb: Oh, that makes sense. Nice, thank you
[04:57:20] maxexcloo1234: @baweaver I added a comment :)
[05:02:45] astrobunny: has joined #ruby
[05:02:48] roshanavand: has joined #ruby
[05:03:04] cschneid_: has joined #ruby
[05:04:28] baweaver: the delete_at is hacky. Which columns specifically do you want maxexcloo1234 ?
[05:07:24] kies: has joined #ruby
[05:07:30] baweaver: maxexcloo1234 - should be cleaner: https://gist.github.com/anonymous/c576e70981621d2fe63d8fcd841a1636#gistcomment-2122969
[05:07:41] username1: has joined #ruby
[05:07:53] baweaver: How many lines do you have there?
[05:08:19] baweaver: because that find_by is going to do two queries for every single line. That adds up fast.
[05:09:02] baweaver: You may want to do something instead like querying for all of them at once
[05:11:18] SeepingN: has joined #ruby
[05:11:30] Hunter1: has joined #ruby
[05:11:47] baweaver: patient_ids, bank_ids = importer.csv_lines[1..-2].map { |line| [line[22].to_s, line[23].to_s.rjust(6, '0')] }.transpose; Patient.where(uid: patient_ids).pluck(:uid, :id); Bank,where(bsb: bank_ids).pluck(:bsb, :id)
[05:12:07] govg: has joined #ruby
[05:12:14] baweaver: that way you do two larger queries once instead of potentially thousands of smaller ones
[05:12:34] baweaver: pluck will also be efficient in only getting back the individual fields
[05:12:35] maxexcloo1234: that makes sense now
[05:12:50] baweaver: you probably need their unique ids and the rails id to map 1 to 1 there for the other bit.
[05:12:56] baweaver: play with that some
[05:13:48] PaulCapestany: has joined #ruby
[05:14:40] maxexcloo1234: Thank you so much, lifesaver!
[05:14:49] maxexcloo1234: Really appreciate your help :)
[05:15:10] baweaver: https://gist.github.com/anonymous/c576e70981621d2fe63d8fcd841a1636#gistcomment-2122975
[05:15:13] bkxd: has joined #ruby
[05:15:14] bkxd_: has joined #ruby
[05:19:08] ascarter: has joined #ruby
[05:20:43] blackwind_123: has joined #ruby
[05:28:07] Garo_: has left #ruby: ()
[05:32:40] PatrikasZvaigzde: has joined #ruby
[05:33:21] biberu: has joined #ruby
[05:34:42] dionysus69: has joined #ruby
[05:36:43] roshanavand: has joined #ruby
[05:41:05] Bock: has joined #ruby
[05:43:12] ascarter: has joined #ruby
[05:44:31] Bock: has joined #ruby
[05:46:18] igniting: has joined #ruby
[05:47:00] xall: has joined #ruby
[05:47:53] rgr_: has joined #ruby
[05:48:18] biberu: has joined #ruby
[05:49:03] rohitpaulk: has joined #ruby
[05:52:11] xall_: has joined #ruby
[05:53:53] enterprisey: has joined #ruby
[05:58:58] eightlimbed: has joined #ruby
[06:00:24] anisha: has joined #ruby
[06:03:37] xall_: has joined #ruby
[06:04:00] harfangk: has joined #ruby
[06:05:11] ascarter: has joined #ruby
[06:18:09] Coldblackice: has joined #ruby
[06:21:04] conta: has joined #ruby
[06:26:07] ascarter_: has joined #ruby
[06:29:07] dh64: has joined #ruby
[06:29:29] uZiel: has joined #ruby
[06:29:37] PaulCapestany: has joined #ruby
[06:30:19] mtkd: has joined #ruby
[06:30:38] BloodSkin: has joined #ruby
[06:31:28] anisha_: has joined #ruby
[06:34:32] cyphase: has joined #ruby
[06:35:37] anisha__: has joined #ruby
[06:39:08] dionysus69: has joined #ruby
[06:44:20] patarr: has joined #ruby
[06:45:38] apparition: has joined #ruby
[06:51:48] BloodSkin: ACTION waves at Talltree_
[06:51:52] pandaant: has joined #ruby
[06:56:26] Mortomes|Work: has joined #ruby
[06:59:50] aufi: has joined #ruby
[07:00:53] jaruga________: has joined #ruby
[07:01:43] ascarter: has joined #ruby
[07:03:19] bithon: has joined #ruby
[07:03:27] bithon: Is ruby a programming language or a meme ?
[07:04:08] rohitpaulk: has joined #ruby
[07:04:09] elomatreb: >> ["meme", "programming language"].sample
[07:04:10] ruby[bot]: elomatreb: # => "meme" (https://eval.in/816598)
[07:04:28] elomatreb: Damn, I thought I could earn money with this
[07:04:44] bithon: elomatreb: "Internal Server Error" seems like it's a meme, pretty evident to me.
[07:05:34] havenwood: bithon: 500
[07:06:38] ddffg: has joined #ruby
[07:07:31] spectrum: has joined #ruby
[07:07:45] BloodSkin: what are some reasons i should learn ruby
[07:08:17] bithon: It's a meme language. That should be a reason enough for you BloodSkin
[07:09:02] BloodSkin: what does that even mean
[07:09:45] AlexRussia: has joined #ruby
[07:10:51] TomyWork: has joined #ruby
[07:10:55] BloodSkin: anyone who doesnt have their head up their ass got an answer?
[07:11:34] bithon: If I was an OP I'd ban you this instant, you worm
[07:12:22] elomatreb: havenwood: I'm detecting some trolling here
[07:12:41] havenwood: BloodSkin: Please don't be rude.
[07:12:55] elomatreb: BloodSkin: Fun scripting language with a very usable standard library
[07:13:01] nicesignal: has joined #ruby
[07:13:15] elomatreb: havenwood: I was talking more about bithon
[07:13:22] havenwood: bithon: Please don't be rude.
[07:13:31] bithon: I was merely making I joke elomatreb.
[07:13:31] ascarter: has joined #ruby
[07:13:57] BloodSkin: is there anything that sets it apart from other languages?
[07:13:59] bithon: I wasn't being rude havenwood. The gent here was being condiscending
[07:14:23] BloodSkin: or that makes it easier to achieve a certain goal
[07:14:36] BloodSkin: or something it excels at
[07:15:01] BloodSkin: idk how to ask what im thinking
[07:16:08] dminuoso: BloodSkin: It excels at giving you the tools to be stupid and lazy.
[07:16:14] dminuoso: It also has a pretty awesome logo.
[07:16:18] havenwood: BloodSkin: Ruby is designed to make programmers happy.
[07:16:23] dminuoso: havenwood: So is porn.
[07:16:24] elomatreb: Ruby's syntax is fairly unique, and the standard library is probably one of the best I've worked with
[07:16:47] BloodSkin: ok so its for advanced programmers to just have fun with?
[07:16:58] dminuoso: Though I wish it was.
[07:17:32] Silthias1: has joined #ruby
[07:17:49] dminuoso: The best thing about Ruby is that you have ObjectSpace, send, Fiddle and Module#prepend.
[07:18:28] BloodSkin: ok i am someone who has a tiny bit of scripting experience
[07:18:37] BloodSkin: i dont know any language inside and out
[07:18:59] BloodSkin: i guess what im asking is what would be a reason to make ruby the first lang i really dive into
[07:19:00] xall: has joined #ruby
[07:19:03] havenwood: BloodSkin: It's a general purpose programming language that's used for all sorts of things. Beyond web it's often used for text processing and system administration. Though it's also used for all sorts of stuff from modeling fighter jet hardware and software to supercomputers (which surprised even Matz) or telephony like Adhearsion, etc.
[07:19:42] havenwood: BloodSkin: It's a multi-paradigm language that will give you plenty of room to dive in deeply.
[07:21:52] BloodSkin: thanks for the info
[07:21:58] aupadhye: has joined #ruby
[07:22:01] havenwood: BloodSkin: If you want something simpler with a single paradigm consider a functional language like Elixir or Clojure.
[07:22:15] dminuoso: Never not clojure.
[07:22:36] dminuoso: It's still downright amazing that LISP is so vibrant and alive.
[07:22:45] BloodSkin: ultimately i am looking for somthing diverse
[07:22:52] BloodSkin: i dont have any specific goal
[07:23:03] havenwood: BloodSkin: Then Ruby is a great option.
[07:23:50] BloodSkin: i see a lot of peopl really praise it
[07:23:56] BloodSkin: so thats why i figured id come ask
[07:24:12] dminuoso: I am great people.
[07:24:16] BloodSkin: my E key is on its way out the door
[07:25:02] BloodSkin: i dont think ive ever actually bought a keyboard to be honest
[07:25:11] BloodSkin: they just show up
[07:25:52] dminuoso: I think the legal term is "theft"
[07:27:36] BloodSkin: people used to give me their old computers
[07:28:08] BloodSkin: they seem to think that just because i can google something im a computer genius
[07:28:31] BloodSkin: which im sure everyone in this channel has experienced
[07:29:12] havenwood: >> (Math::PI ** 4 / 36 * 100_000_000).floor.to_s.reverse.each_char.first(4).map(&:to_i).map { |n| (n + 100).succ.chr }.join
[07:29:17] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[07:31:44] mark_66: has joined #ruby
[07:33:15] ascarter_: has joined #ruby
[07:34:07] cschneid_: has joined #ruby
[07:35:30] andikr: has joined #ruby
[07:35:30] havenwood: >> ((Math::E ** Math::E) ** Math::E * 100_000_000).floor.digits.first(4).map { |n| n + 100 }.map(&:chr).join.reverse
[07:35:36] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[07:35:53] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[07:36:00] havenwood: You win ruby[bot], you win.
[07:38:53] burgestrand: has joined #ruby
[07:40:31] Jameser`: has joined #ruby
[07:47:56] tAn: has joined #ruby
[08:01:46] mim1k: has joined #ruby
[08:02:02] antgel: has joined #ruby
[08:03:58] bigkevmcd: has joined #ruby
[08:04:11] bigkevmcd: has joined #ruby
[08:04:32] Kug3lis: has joined #ruby
[08:06:56] mim1k_: has joined #ruby
[08:07:22] webopsx: has joined #ruby
[08:07:45] havenwood: >> require 'bigdecimal/math'; include BigMath; best = 0; last_best_char = nil; seen = Hash.new(0); PI(1000).to_s[2..-3].each_char.with_object([]) { |char, results| seen[char] += 1; results << char and last_best_char = char and best = seen[char] if seen[char] > best and last_best_char != char }.last(4).map { |s| (s.to_i + 100).chr }.join
[08:07:50] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[08:08:17] joonty: has joined #ruby
[08:15:38] webopsx: has joined #ruby
[08:20:37] dminuoso: There's no cheats.
[08:21:01] dminuoso: They are called efficient solutions.
[08:27:11] Bhootrk_: has joined #ruby
[08:29:27] wnd: has joined #ruby
[08:30:29] mim1k: has joined #ruby
[08:30:53] mikecmpbll: has joined #ruby
[08:30:58] AnoHito_: has joined #ruby
[08:35:57] haylon: has joined #ruby
[08:39:09] rohitpaulk: has joined #ruby
[08:41:06] ferr1: has joined #ruby
[08:43:24] marr: has joined #ruby
[08:43:53] ascarter: has joined #ruby
[08:45:09] patarr: has joined #ruby
[08:49:18] lxsameer: has joined #ruby
[08:51:36] ljarvis: efficient cheats
[08:54:50] cfec0b8d: has joined #ruby
[08:58:26] mim1k: has joined #ruby
[08:59:52] quobo: has joined #ruby
[09:01:57] ur5us: has joined #ruby
[09:04:42] uZiel: has joined #ruby
[09:05:22] brent__: has joined #ruby
[09:15:00] belmoussaoui: has joined #ruby
[09:23:43] hightower3: has joined #ruby
[09:31:14] bigkevmcd: has joined #ruby
[09:31:21] jokke: has joined #ruby
[09:34:49] im0nde: has joined #ruby
[09:38:03] workmad3: has joined #ruby
[09:38:12] mim1k: has joined #ruby
[09:39:09] zenspider: tok>> 1 + 2
[09:39:10] ruby[bot]: zenspider: I have tokenized your code, the result is at https://eval.in/816736
[09:39:32] zenspider: ast>> 1 + 2
[09:39:34] ruby[bot]: zenspider: I have parsed your code, the result is at https://eval.in/816737
[09:39:58] ruby[bot]: zenspider: # => 3 (https://eval.in/816739)
[09:40:19] zenspider: >> puts "Hello"
[09:40:21] ruby[bot]: zenspider: # => Hello ...check link for more (https://eval.in/816740)
[09:40:32] zenspider: hrm... I wonder what happens when it freaks out
[09:49:27] elomatreb: eval.in 500s *sometimes*
[09:50:20] ascarter: has joined #ruby
[09:51:06] Hunter1: has joined #ruby
[09:54:03] futilegames: has joined #ruby
[10:01:05] ledestin: has joined #ruby
[10:05:40] rohitpaulk: has joined #ruby
[10:12:07] mim1k: has joined #ruby
[10:13:25] uZiel: has joined #ruby
[10:13:52] sonOfRa: has joined #ruby
[10:17:25] idakyne: has joined #ruby
[10:22:12] patarr: has joined #ruby
[10:33:11] KeyJoo: has joined #ruby
[10:33:23] ur5us: has joined #ruby
[10:35:45] gix: has joined #ruby
[10:38:07] jane_booty_doe: has joined #ruby
[10:42:33] iamayam: has joined #ruby
[10:44:46] psychicist__: has joined #ruby
[10:55:42] ascarter: has joined #ruby
[10:58:51] johnmccabe: has joined #ruby
[11:06:46] Rodya_: has joined #ruby
[11:08:09] hlmjr: has joined #ruby
[11:09:37] Kug3lis: has joined #ruby
[11:13:23] andikr: has joined #ruby
[11:16:13] astrobunny: has joined #ruby
[11:16:26] stamina: has joined #ruby
[11:20:30] rohitpaulk: has joined #ruby
[11:22:50] ltem: has joined #ruby
[11:23:20] ur5us: has joined #ruby
[11:29:51] HoierM: has joined #ruby
[11:32:18] Rodya_: has joined #ruby
[11:32:50] ayonkhan: has joined #ruby
[11:33:43] AlexRussia: has joined #ruby
[11:35:36] nadir: has joined #ruby
[11:35:50] cschneid_: has joined #ruby
[11:35:50] ldnunes: has joined #ruby
[11:41:06] xall: has joined #ruby
[11:46:24] sepp2k: has joined #ruby
[11:47:22] dminuoso: Do you folks ever do type checks?
[11:47:29] dminuoso: Or .responds_to? checks?
[11:49:53] adam12: respond_to is better than is_a, for sure.
[11:51:35] dminuoso: adam12: Why?
[11:51:45] dminuoso: I mean not everything is duck typy
[11:51:45] adam12: dminuoso: duck typing.
[11:52:02] hs366: has joined #ruby
[11:52:16] dminuoso: adam12: That is just giving that recommendation a name, but not a reason why it's better.
[11:52:27] adam12: dminuoso: I guess on your own code, it doesn't really matter, but for libraries, why should you dictate what is passed
[11:52:40] adam12: as long as the contract for what is passed is satisfied.
[11:53:30] dminuoso: adam12: Well let's think in terms of C++ inheritance. When I have a library package_delivery, and a class DeliveryTruck with a method "load", it stands to reason I have an abstract class Package that users can derive from and modify.
[11:53:49] dminuoso: adam12: Just because a class has "size", it doesn't mean it will return what my DeliveryTruck expects.
[11:53:59] dminuoso: >> [1,2,3].size
[11:54:00] ruby[bot]: dminuoso: # => 3 (https://eval.in/816836)
[11:54:29] dminuoso: adam12: If my DeliveryTruck does a package.size and expects an array of dimensions, then merely responding to is not enough, it wants to know whether the class follows an interface.
[11:54:42] dminuoso: Whether invariants are held.
[11:55:20] dminuoso: I mean technically deriving from Package does not make that guarantee either, but if a user intentionally overrides size to return back stuff that's just the dev shooting his own foot.
[11:55:34] hfp_work: has joined #ruby
[11:55:37] matthewd: I do (often spelled as case/when), when there are multiple types the value could be, and I want to handle each of them
[11:58:00] matthewd: I don't do it to attempt to implement strict typing though. If I don't have a specific need to distinguish which of several valid arguments you gave me, IMO ruby style is to just trust the caller, and leave you with whatever NoMethodError eventually arises otherwise
[11:58:11] dminuoso: matthewd: Do you ever check against modules or base classes? Or do your checks imply that you expect those types directly?
[11:58:22] elomatreb: That size example is a nasty one
[11:58:42] ldnunes: has joined #ruby
[11:58:51] dminuoso: elomatreb: Granted, the proper method would in reality rather be named "dimensions".
[11:59:34] gnufied: has joined #ruby
[12:00:17] matthewd: There are, for example, places in Rails that'll handle an instance of any subclass of AR::Base one way, and other types another
[12:01:18] dminuoso: matthewd: Could you name any such example from the top off your head?
[12:02:42] matthewd: A simple abstract example is where we'd call .id on an AR record, and otherwise assume we have the "raw" string/integer/whatever directly
[12:03:21] matthewd: A complex concrete example of type-distinguishing is in processing the RHS of where(foo: x)
[12:03:44] dminuoso: matthewd: Oh yeah that last example makes immediate sense.
[12:04:09] dminuoso: For the first, is that when you care about generic equality?
[12:05:33] matthewd: No... two records with the same [class and] PK are equal, but they're not equal *to* their PK. I don't know that the first actually occurs anywhere specific in itself... it's more a simplification of what #where does.
[12:09:53] synthroid: has joined #ruby
[12:10:01] matthewd: Looking at the 7 places in rails/rails we raise a TypeError: one is a re-raise, one is explicitly disallowing one type, and the others are all `case when A; ..; when B; ..; else raise TypeError; end`
[12:10:17] __Yiota: has joined #ruby
[12:10:30] matthewd: (just because that's easy to search for; clearly not exhaustive)
[12:13:08] ineb: has joined #ruby
[12:13:38] ineb: hello, quick question: how to? system("echo", "foobar", ">>", "/tmp/test")
[12:13:43] ineb: this approach does not work
[12:13:44] mjuszczak: has joined #ruby
[12:14:24] matthewd: ineb: That doesn't work because the multiple-argument form bypasses the shell, and the shell is what does the >> redirect
[12:14:45] matthewd: ineb: You can either run it through a shell, or read the output and add it to the file yourself
[12:15:05] ineb: i see, makes sense
[12:18:17] ineb: like system("sh -c 'echo foobar >> /tmp/test'"
[12:18:25] ineb: system("sh -c 'echo foobar >> /tmp/test'")
[12:20:17] konsolebox: has joined #ruby
[12:20:40] dminuoso: matthewd: That's interesting. Ill take a look at those cases later.
[12:22:07] matthewd: ineb: Well, system("sh", "-c", "echo foobar >> /tmp/test"), or you can just system("echo foobar >> /tmp/test")
[12:22:31] ecuanaso: has joined #ruby
[12:24:05] johnmccabe_: has joined #ruby
[12:24:09] matthewd: ineb: If you need to approximate the safety of separated parameters while building a string that a shell will parse, you may be interested in Shellwords from stdlib
[12:24:10] mjuszczak: has joined #ruby
[12:25:11] warrshrike: has joined #ruby
[12:25:20] warrshrike: I have an error
[12:25:46] warrshrike: consider this: Base = '/state/partition1/APPSEC/APKMirror/' GL = "/state/partition1/home/17100148/paper93/artifact/binary"
[12:26:13] warrshrike: and this if !(File.exist?("#{Base}#{appname}/#{appname}.yml")) puts "File doesnt exist!" File.open("#{Base}#{appname}/#{appname}.yml", "w") do |file| file.write(YAML::dump(cflArray(appname))) end end
[12:26:21] dminuoso: warrshrike: ?gist
[12:26:25] dminuoso: warrshrike: !gist
[12:26:33] dminuoso: !gist warrshrike
[12:26:35] dminuoso: ?gist warrshrike
[12:26:36] ruby[bot]: warrshrike: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[12:26:37] dminuoso: There we go.
[12:26:43] warrshrike: finally these errors /state/partition1/home/17100148/Malware/DroidInfer_Wrapper.rb:28:in `initialize': No such file or directory @ rb_sysopen - /state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ (Errno::ENOENT) /1Password_-_Password_Manager_6.5.BETA-9_ .yml
[12:26:49] warrshrike: okay sorry brothers
[12:26:55] warrshrike: i will remake a gist
[12:27:13] dminuoso: warrshrike: please name your file with an .rb extension so it gets syntax highlighting
[12:27:35] uZiel: has joined #ruby
[12:29:19] warrshrike: https://gist.github.com/anonymous/c42ce868fffa87f296f4c9f257e9afe5
[12:29:26] warrshrike: dminuoso: Duly done good sir.
[12:29:42] claw: if i have {foo: "bar"} how do i get the key ?
[12:29:53] dminuoso: warrshrike: My first instinct is: update 1password! badly
[12:30:01] claw: i can do {foo: "bar"}keys.first but thats kind of ugly
[12:30:14] dminuoso: claw: That's it.
[12:30:18] claw: {foo: "bar"}.keys.first
[12:30:30] warrshrike: dminuoso: hahaa it isnt an actual password...just the name of an app
[12:30:31] dminuoso: claw: you can also do .keys[0], .keys.reverse.last
[12:30:36] dminuoso: tons of funny other ways
[12:30:38] ineb: matthewd: my real system call looks a bit more messy, but its working now https://gist.github.com/anonymous/70e115c735c43defc6586573f8a1e03f but i dont like it a bit
[12:30:42] pupsicle: has joined #ruby
[12:30:50] claw: dminuoso: what about shuffle
[12:30:54] dminuoso: warrshrike: No I know, which is why I know that your 1Password is out of date
[12:31:01] dminuoso: claw: Depends. Is there only one key available?
[12:31:20] claw: dminuoso: yes thats why the .keys.first is ugly
[12:31:26] warrshrike: dminuoso: whats a 1password?
[12:31:33] dminuoso: claw: Dont use a Hash. Use Struct.
[12:31:50] dminuoso: warrshrike: haha nevermind.
[12:32:04] Fernando-Basso: has joined #ruby
[12:32:05] warrshrike: dminuoso: any idea whats wrong here?
[12:33:34] DoubleMalt: has joined #ruby
[12:34:15] matthewd: warrshrike: You can't write a file into a directory that doesn't exist
[12:34:57] dminuoso: matthewd: Does the error look at bit broken to you?
[12:35:22] warrshrike: matthewd: but pasting /state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ into terminal says
[12:35:27] warrshrike: Is a directory
[12:35:52] dminuoso: warrshrike: I cant relate the error to the code.
[12:36:44] warrshrike: dminuoso: yeah error does seem broken....its over ssh tho
[12:36:51] warrshrike: should i paste entire code dminuoso ?
[12:37:59] dminuoso: warrshrike: Yeah. Did you introduce a linebreak between lines 15 and 16?
[12:38:17] dminuoso: No even then...
[12:38:29] dminuoso: Did you put a newline/carriage return in there perhaps?
[12:38:40] matthewd: warrshrike: Looks like there's a space on the end of the path
[12:39:26] dminuoso: matthewd: That still wouldn't explain why the (Errno::ENOENT) would appear right in the middle fo the path :S
[12:39:27] warrshrike: Okay to give context
[12:39:38] warrshrike: this code worked fine before I changed BASE and GL
[12:39:48] warrshrike: to process over a different set of data
[12:40:09] warrshrike: dminuoso: how would i intro a linebreak? by pressing enter>
[12:40:25] dminuoso: warrshrike: Yeah Im fairly sure there is a linebreak in there.
[12:40:47] warrshrike: dminuoso: in the paths?
[12:40:51] dminuoso: "/state/partition1/APPSEC/APKMirror/1Password_-_Password_Manager_6.5.BETA-9_ \n/1Password_-_Password_Manager_6.5.BETA-9_ \n"
[12:40:53] dminuoso: warrshrike: Yes.
[12:40:59] dminuoso: warrshrike: ^- Im sure it looks like that.
[12:41:00] t-recx: has joined #ruby
[12:41:24] dminuoso: warrshrike: for lines 6 and 8 use a variable, and then print that path.inspect
[12:42:05] dminuoso: Perhaps a carriage return too, or maybe only a carriage return - depending on your system
[12:42:08] warrshrike: dminuoso: yeah doing exactly that
[12:42:45] rohitpaulk: has joined #ruby
[12:44:26] Kug3lis: has joined #ruby
[12:45:40] warrshrike: damn taking long
[12:46:22] charliesome: has joined #ruby
[12:47:10] dminuoso: warrshrike: This btw is in addition to the "space" at the end of appname that matthewd mentioned.
[12:47:52] my123: has joined #ruby
[12:47:53] my123: has joined #ruby
[12:49:34] warrshrike: yes theres a space
[12:50:05] warrshrike: dminuoso: what is in addition to that?
[12:50:23] dminuoso: matthewd | warrshrike: Looks like there's a space on the end of the path
[12:51:04] warrshrike: before the yml
[12:51:07] texasmynsted: has joined #ruby
[12:53:01] warrshrike: dminuoso: how can i remove it
[12:53:30] warrshrike: i think there is an \n. how to remove that?
[12:53:45] catphish: has joined #ruby
[12:54:15] catphish: is there a good way to install a modern ruby on centos 7 without compiling it? i'm used to usin ubuntu PPAs
[12:54:49] dminuoso: warrshrike: Do you just care about the newline? Or all whitespace?
[12:54:58] dminuoso: catphish: ruby-install
[12:55:13] dminuoso: And I blatantly ignored your "without compiling it" to preserve sanity.
[12:55:33] catphish: i actually have no real problem with compiling it
[12:55:45] dminuoso: catphish: Then use ruby-install. It does it cleanly and automaticalyl for you :)
[12:55:47] catphish: i'm just used to using a PPA and have it maintained forme
[12:56:06] dminuoso: catphish: It's just as easy as apt
[12:57:05] catphish: dminuoso: happy with that, thanks :)
[12:57:24] warrshrike: dminuoso: both good sir
[12:57:56] dminuoso: warrshrike: Take your pick between chomp and strip
[12:59:15] warrshrike: they dont remove newlines do they?
[12:59:23] warrshrike: isnt ti just whitespace
[12:59:32] dminuoso: warrshrike: Please read the documentation for each.
[12:59:44] dminuoso: &ri String#chomp String#strip
[12:59:44] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-chomp, http://ruby-doc.org/core-2.4.1/String.html#method-i-strip
[13:00:09] chouhoulis: has joined #ruby
[13:00:20] nanoz: has joined #ruby
[13:00:23] warrshrike: okay thanks!
[13:00:30] etehtsea: has joined #ruby
[13:07:29] sami: has joined #ruby
[13:07:45] sami: I'm having some trouble with learning arrays and hashes.
[13:07:48] sami: https://gist.github.com/anonymous/cc323648958d942573514a0b4e5f717e
[13:08:30] svkurowski: has joined #ruby
[13:09:14] dminuoso: sami: Get pry, and toy around manually.
[13:09:23] dminuoso: Helps you preserve sanity while learning arrays and hashes.
[13:10:29] Kug3lis: has joined #ruby
[13:10:44] rohitpaulk: has joined #ruby
[13:13:47] my123_: has joined #ruby
[13:13:48] my123_: has joined #ruby
[13:13:59] haylon: has joined #ruby
[13:16:22] mim1k: has joined #ruby
[13:16:28] bkxd: has joined #ruby
[13:16:30] bkxd_: has joined #ruby
[13:18:28] yehowyada: has joined #ruby
[13:18:31] pupsicle: sami: in your loop, you are reassigning the entire movie_complete hash each iteration.
[13:19:08] dminuoso: sami: Oh yeah. Also, there's a slightly better pattern to this.
[13:19:39] dminuoso: sami: movies_complete = movies_hash.each.with_object({}) { |acc, movie| ...now modify acc... }
[13:20:31] catphish: for starters, you probably mean: movies_complete[movie['name']] = { id: movie['id'], plot: movie_temp['Plot'], image: movies_temp['image'] }
[13:20:56] catphish: or even just: movies_complete[movie['name']] = get_movie_info(movie['name'])
[13:21:10] catphish: unless you want to change the data
[13:21:40] sami: dminuoso: solved it by doing movies = [] and then movies << {...}
[13:21:48] bkxd: has joined #ruby
[13:21:55] catphish: sami: ah yes, making an array of hashes
[13:22:13] sami: thank you all for the help!
[13:22:26] catphish: you can do that with map
[13:22:36] shinnya: has joined #ruby
[13:23:14] catphish: movies_array = movie_hash.map { movie| {...} }
[13:23:42] catphish: it'll automatically add each thing to the array :)
[13:24:12] jrafanie: has joined #ruby
[13:24:22] sami: catphish: Hmm, interesting!
[13:24:33] catphish: https://gist.github.com/anonymous/cc323648958d942573514a0b4e5f717e
[13:24:36] dminuoso: sami: same thing again.
[13:24:44] dminuoso: sami: use each.with_object([]) then
[13:24:59] catphish: dminuoso: why would you use that over map?
[13:25:01] dminuoso: sami: It does the same thing, but just is a lot more ruby-esque.
[13:25:11] dminuoso: catphish: Oh.
[13:25:23] catphish: see my comment: https://gist.github.com/anonymous/cc323648958d942573514a0b4e5f717e
[13:25:26] dminuoso: catphish: How are you doing! Fine weather today.
[13:25:36] catphish: it is indeed!
[13:25:47] catphish: i'm stuck inside
[13:25:53] catphish: because work
[13:26:47] dminuoso: catphish: Or more like this? https://gist.github.com/dminuoso/cf43dceca25e5f9f612bdf8f1ec2e1e2
[13:26:56] dminuoso: I've been doing JavaScript too much :D
[13:27:27] catphish: dminuoso: if you really wanted that i suppose
[13:27:46] dminuoso: catphish: What can I say, I stopped disliking implicit returns at the end of blocks and functions.
[13:28:08] catphish: i finally got over my fear of implicit return
[13:28:11] Hunter1: has joined #ruby
[13:28:29] dminuoso: catphish: I developed it this year.
[13:28:35] dminuoso: From 0 to 100.
[13:28:39] belmoussaoui: has joined #ruby
[13:29:11] DLSteve: has joined #ruby
[13:29:33] kobain: has joined #ruby
[13:29:38] cyphase: has joined #ruby
[13:30:14] mim1k: has joined #ruby
[13:30:39] elifoster: has joined #ruby
[13:34:22] belmoussaoui: has joined #ruby
[13:36:33] cschneid_: has joined #ruby
[13:36:55] ur5us: has joined #ruby
[13:42:10] chouhoul_: has joined #ruby
[13:46:16] centrx: has joined #ruby
[13:47:26] enterprisey: has joined #ruby
[13:49:57] oleo: has joined #ruby
[13:51:46] spectrum: has joined #ruby
[13:54:13] meshsmith: has joined #ruby
[13:57:32] nanoz: has left #ruby: ("Leaving")
[14:02:03] __Yiota: has joined #ruby
[14:02:23] cttttt: has joined #ruby
[14:04:43] belmoussaoui: has joined #ruby
[14:04:52] merlac: has joined #ruby
[14:06:21] bkxd: has joined #ruby
[14:07:13] mwlang: has joined #ruby
[14:07:21] harfangk: has joined #ruby
[14:08:03] dances_with_taco: has joined #ruby
[14:08:40] bkxd_: has joined #ruby
[14:09:16] Hunter1: has joined #ruby
[14:09:37] dances_with_taco: has joined #ruby
[14:13:23] cdg: has joined #ruby
[14:14:22] mim1k: has joined #ruby
[14:18:58] aurelien: has joined #ruby
[14:20:40] ahrs: has joined #ruby
[14:23:24] belmoussaoui: has joined #ruby
[14:25:22] bkxd__: has joined #ruby
[14:25:44] bkxd___: has joined #ruby
[14:27:48] haylon: has joined #ruby
[14:28:50] joonty: has joined #ruby
[14:28:57] cjohnson: Using guard/guard-rspec, when I make a file change on the guest machine (vbox) guard inspects and tests, however when I make the change on my host via NFS share, it doens't pick it up
[14:29:21] cjohnson: Does anybody know a straight forward way to get it to watch nfs? Do I have to use polling mode? And if so, how do I configure that?
[14:29:30] jrafanie: has joined #ruby
[14:30:08] burgestrand: has joined #ruby
[14:32:40] cjohnson: Nevermind found an article on exactly this issue
[14:32:42] jrafanie_: has joined #ruby
[14:32:45] cjohnson: -p passed to guard tells it to use polling mode
[14:33:08] Rodya_: has joined #ruby
[14:34:40] cjohnson: http://blog.skrobul.com/getting-vagrant-guard-rspec-to-work-together/
[14:34:50] cjohnson: there's also some sort of tcp listener you can set up
[14:36:16] cschneid_: has joined #ruby
[14:38:27] cjohnson: Ah, I will have to go that route because the -p method really chews up CPU. Even delaying to every 5 seconds
[14:40:11] anisha__: has joined #ruby
[14:42:54] enterprisey: has joined #ruby
[14:45:46] nothingnew: has joined #ruby
[14:55:00] ineb: cjohnson: this comes down to nfs and inotify which simply does not work because of the way nfs is designed
[14:55:08] cjohnson: Right, makes sense
[14:55:22] cjohnson: the listen approach in this article looks like it will be easy to get going :)
[14:56:09] quobo: has joined #ruby
[14:56:31] cjohnson: Ok that prompts another question. My OS X ruby is not new enough for listen
[14:56:37] cjohnson: So I installed rvm and rvm install 2.2
[14:56:39] cjohnson: then rvm use 2.2
[14:56:39] polishdub: has joined #ruby
[14:56:48] cjohnson: Is there a special way to use gem in conjunction with rvm?
[14:56:58] cjohnson: Or do I just
[14:57:01] cjohnson: # gem install listen
[14:57:04] cjohnson: after rvm use 2.2
[14:57:49] elomatreb: If your RVM is set up properly you just use gem install regularly
[14:58:49] cjohnson: Does gem naturally sort gems by ruby version or something?
[14:58:58] cjohnson: Just curious how it keeps things safe
[14:59:47] dc4: has joined #ruby
[14:59:59] igniting: has joined #ruby
[15:00:08] elomatreb: I think RVM does that, but I don't know how much safety it gives you there
[15:00:09] cschneid_: has joined #ruby
[15:00:39] cschneid_: has joined #ruby
[15:00:41] cjohnson: oh it looks like it puts the gems in ~/.rvm so yeah looks fairly safe
[15:00:49] rippa: has joined #ruby
[15:02:17] ujjain: has joined #ruby
[15:02:17] ujjain: has joined #ruby
[15:02:24] haylon: has joined #ruby
[15:02:36] cadillac_: has joined #ruby
[15:03:41] mjolnird: has joined #ruby
[15:04:05] GinoMan: has joined #ruby
[15:05:23] blackwind_123: has joined #ruby
[15:07:00] skweek: has joined #ruby
[15:07:09] bkxd: has joined #ruby
[15:07:49] ThatsNotJack: has joined #ruby
[15:07:58] bkxd_: has joined #ruby
[15:08:00] mjuszczak: has joined #ruby
[15:09:36] JustTheDoctor: has joined #ruby
[15:09:55] patarr: has joined #ruby
[15:12:44] mim1k: has joined #ruby
[15:13:13] jrafanie: has joined #ruby
[15:15:29] belmoussaoui: has joined #ruby
[15:17:24] ecuanaso: has joined #ruby
[15:25:23] Benshiro: has joined #ruby
[15:25:58] jaruga_________: has joined #ruby
[15:26:06] TomyLobo: has joined #ruby
[15:28:01] balazs_: has joined #ruby
[15:30:12] synthroid: has joined #ruby
[15:36:28] PatrikasZvaigzde: has joined #ruby
[15:37:42] ur5us: has joined #ruby
[15:39:50] brent__: has joined #ruby
[15:40:18] Rodya_: has joined #ruby
[15:41:15] ascarter: has joined #ruby
[15:42:08] plujon: has joined #ruby
[15:43:59] plujon: What's the inverse of klass.name?
[15:44:32] matthewd: plujon: Object.const_get
[15:44:55] plujon: matthewd: Object.const_get(Integer.name) # cool, thanks!
[15:47:47] pupsicle: plujon: ActiveSupport also has a method called "constantize" if you happen to be depending on it.
[15:49:04] pupsicle: It adds method to String object I should say.
[15:51:19] plujon: Integer.name.constantize == Object.const_get(Integer.name) # good to know
[15:51:26] username1: has joined #ruby
[16:00:07] hobodave: has joined #ruby
[16:01:35] pazzaz: has joined #ruby
[16:02:16] __Yiota: has joined #ruby
[16:02:51] apollo274: has joined #ruby
[16:04:17] firstdayonthejob: has joined #ruby
[16:08:47] patarr: has joined #ruby
[16:11:37] mim1k: has joined #ruby
[16:13:27] ecuanaso: has joined #ruby
[16:14:45] cdg: has joined #ruby
[16:14:58] ltem: has joined #ruby
[16:15:03] synthroid: has joined #ruby
[16:16:31] cdg_: has joined #ruby
[16:18:56] cdg: has joined #ruby
[16:18:57] __Yiota: has joined #ruby
[16:29:53] amclain: has joined #ruby
[16:30:41] xzhao: has joined #ruby
[16:30:44] nitric: has joined #ruby
[16:32:27] Kug3lis: has joined #ruby
[16:35:31] chouhoulis: has joined #ruby
[16:36:47] dc4: has joined #ruby
[16:42:26] gothicsouth: has joined #ruby
[16:43:15] dionysus69: has joined #ruby
[16:46:36] nullset68: has joined #ruby
[16:48:55] [Butch]: has joined #ruby
[16:49:00] AlexRussia: has joined #ruby
[16:50:02] cadillac_: has joined #ruby
[16:50:09] dcluna: has joined #ruby
[16:50:56] Kerea: has joined #ruby
[16:53:05] Rodya_: has joined #ruby
[16:55:44] nesoi: has joined #ruby
[16:58:39] bvcosta: has joined #ruby
[16:59:23] bvcosta: I'm using JRuby+Puma
[16:59:48] bvcosta: I'm starting a new connection on the startup of the application
[17:00:02] bvcosta: and I need to close the connection on the shutdown
[17:00:20] bvcosta: do you guys know any shutdown hook to use for this use case?
[17:03:03] jrafanie: has joined #ruby
[17:03:24] ascarter: has joined #ruby
[17:03:49] chouhoulis: has joined #ruby
[17:04:02] ledestin: has joined #ruby
[17:04:44] adam12: bvcosta: can you use at_exit ?
[17:05:35] bvcosta: where should I use it? I did try it, but I'm not sure if I'm using it at the right place
[17:06:16] adam12: bvcosta: It should be effective in any file that's evaluated.
[17:09:43] nanoz: has joined #ruby
[17:09:43] nanoz: has joined #ruby
[17:12:45] bvcosta: trying now on boot.rb
[17:13:17] bvcosta: yes, I think it will work
[17:17:04] uZiel: has joined #ruby
[17:22:50] gusrub: has joined #ruby
[17:24:30] psychicist__: has joined #ruby
[17:30:38] kies: has joined #ruby
[17:31:28] shinnya: has joined #ruby
[17:31:49] tubuliferous: has joined #ruby
[17:31:56] GinoMan2440: has joined #ruby
[17:33:47] GinoMan2440: has joined #ruby
[17:38:26] ur5us: has joined #ruby
[17:41:22] railswebdev: has joined #ruby
[17:44:00] Guest69: has joined #ruby
[17:44:40] mikecmpbll: has joined #ruby
[17:44:59] SeepingN: has joined #ruby
[17:45:23] marxarelli: has joined #ruby
[17:47:46] synthroid: has joined #ruby
[17:51:32] meshsmith: has joined #ruby
[17:52:15] aenialis: has joined #ruby
[17:53:00] rohitpaulk: has joined #ruby
[17:56:06] haylon: has joined #ruby
[17:56:07] uZiel: has joined #ruby
[17:56:40] __Yiota: has joined #ruby
[17:58:30] sepp2k: has joined #ruby
[18:02:33] jrafanie_: has joined #ruby
[18:03:15] duderonomy: has joined #ruby
[18:03:20] mwlang: has joined #ruby
[18:05:32] Kerea: has joined #ruby
[18:06:05] bkxd: has joined #ruby
[18:06:07] bkxd_: has joined #ruby
[18:14:19] dc4: has joined #ruby
[18:17:58] ecuanaso: has joined #ruby
[18:19:21] cadillac__: has joined #ruby
[18:20:28] ldnunes: has joined #ruby
[18:21:52] ma0: has joined #ruby
[18:25:57] mim1k: has joined #ruby
[18:26:32] thisguy123: has joined #ruby
[18:29:55] Dimik: has joined #ruby
[18:32:28] Silthias: has joined #ruby
[18:34:05] Kug3lis: has joined #ruby
[18:34:08] gnufied: has joined #ruby
[18:36:13] __Yiota: has joined #ruby
[18:37:25] Silthias1: has joined #ruby
[18:38:23] GinoMan2440: has joined #ruby
[18:40:10] andrzejku: has joined #ruby
[18:40:30] cyphase: has joined #ruby
[18:40:37] elifoster: has joined #ruby
[18:42:44] eckhardt: has joined #ruby
[18:43:43] xall: has joined #ruby
[18:43:59] ascarter: has joined #ruby
[18:44:27] A124: has joined #ruby
[18:45:18] johnny56_: has joined #ruby
[18:48:50] gusrub_: has joined #ruby
[18:51:20] __Yiota: has joined #ruby
[18:51:37] cdg_: has joined #ruby
[18:58:47] nankyokusei: has joined #ruby
[19:00:19] SaschaVoid: has joined #ruby
[19:00:44] AndBobsYourUncle: has joined #ruby
[19:02:07] ecuanaso: has joined #ruby
[19:03:04] cdg: has joined #ruby
[19:03:39] nowhereman_: has joined #ruby
[19:04:40] weaksauce: has joined #ruby
[19:05:25] DoubleMalt: has joined #ruby
[19:05:33] kobain: has joined #ruby
[19:06:01] nesoi: has joined #ruby
[19:08:59] Silthias: has joined #ruby
[19:10:13] mjuszczak: has joined #ruby
[19:11:06] mjuszczak: has joined #ruby
[19:11:33] gusrub: has joined #ruby
[19:11:38] postmodern: has joined #ruby
[19:13:41] Joufflu: has joined #ruby
[19:14:36] Joufflu: any ruby developers from Los Angeles
[19:16:05] Zarthus: just ask your question
[19:16:14] Zarthus: if you're recruiting, this is not the right channel to do it in
[19:16:43] Joufflu: I'd like to know where other ruby developers meetup so I can code with them
[19:16:59] Joufflu: I am a ruby developer not a recruiter
[19:17:16] Zarthus: have you tried meetup.com
[19:18:17] havenwood: Joufflu: Join us at Ruby in Hollywood every Wednesday in Silver Lake.
[19:18:32] havenwood: (Maybe we should change the name to Ruby in Silver Lake.)
[19:19:27] Joufflu: @havenwood, awesome ! is that the Lamill Coffee shop one?
[19:19:33] SeepingN: has joined #ruby
[19:19:35] havenwood: Joufflu: Yup!
[19:26:04] pupsicle: has joined #ruby
[19:27:01] DoubleMalt: has joined #ruby
[19:27:14] meshsmith: is there a Ruby installer/compilier I can download or do I need to hunker down and learn to command line?
[19:27:41] Kerea: has joined #ruby
[19:31:12] SeepingN: one cannot get far in Ruby land without using the command line
[19:31:24] havenwood: meshsmith: What OS are you on?
[19:31:33] SeepingN: unless you have others to do all the lifting for you and all you do is program
[19:31:44] SeepingN: (don't say windows, don't say windows)
[19:31:55] bougyman: I know some rubymine people who have never seen the command line.
[19:32:03] SeepingN: frightening
[19:32:41] havenwood: meshsmith: If you ever upgrade to Windows 10 there's a very nice Windows Subsystem for Linux for developers that works great with Ruby.
[19:33:29] havenwood: meshsmith: There's currently a WindowsInstaller and DevKit for windows but I believe it's shy on maintenance while RubyInstaller2 is being worked on.
[19:33:30] meshsmith: Ill take that as a "get up off your ass and get gud"
[19:34:05] havenwood: meshsmith: Or there's a Ruby package for Chocolatey if you want to use a command line package manager.
[19:34:14] havenwood: meshsmith: https://rubyinstaller.org/
[19:34:28] havenwood: Looks like RubyInstaller has 2.4.1 for Windows, not bad!
[19:34:31] havenwood: Latest stable ftw.
[19:34:44] havenwood: meshsmith: https://rubyinstaller.org/add-ons/devkit.html
[19:35:26] meshsmith: Fair. Its looks better coming from not-github to be honest. I will take a look and hopefully it works out. Thanks.
[19:36:42] havenwood: meshsmith: If you want to try a Ruby version switcher to get at different Ruby VMs or versions on Windows there's uru: https://bitbucket.org/jonforums/uru
[19:36:53] nobodyzxc: has joined #ruby
[19:37:03] gusrub: has joined #ruby
[19:37:05] havenwood: meshsmith: There's a Chocolatey package for uru as well: https://bitbucket.org/jonforums/uru/wiki/Chocolatey
[19:37:53] havenwood: meshsmith: If you're going to stay on Windows 7 instead of using some sort of Linux, via WSL or VM or whatev, consider using a package manager for Windows: https://chocolatey.org/
[19:38:32] havenwood: meshsmith: If you run into install trouble we might be able to help. Happy coding!
[19:38:40] meshsmith: Its my first time handling this sort of thing, I'd rahter know what to do about this before I start messing with a virtual machine.
[19:39:17] meshsmith: I already see myself doing something similar with node.js, but you gotta start somewhere...
[19:40:01] havenwood: meshsmith: I'd still suggest upgrading to Win 10 Creative Update so you can just start with bash.
[19:40:04] havenwood: Bash on Windows.
[19:40:44] havenwood: meshsmith: Unless you're already fluent in PowerShell, you'll probably have a better time on bash.
[19:41:29] havenwood: Then you can just follow tutorials and not worry about library compatibility or Windows quirks like no fork.
[19:42:07] meshsmith: In neither actually, not to overwhelm myself and hope to get to a state everyone seems to prefer in a not-windows environment.
[19:42:11] havenwood: meshsmith: https://msdn.microsoft.com/en-us/commandline/wsl/install_guide#enable-the-windows-subsystem-for-linux-feature-gui
[19:42:18] eckhardt: has joined #ruby
[19:42:37] havenwood: meshsmith: Win 10 makes it easy for developers by just giving you bash.
[19:42:48] centrx: has joined #ruby
[19:44:21] havenwood: meshsmith: It also looks like Chocolatey and RubyInstaller support the latest stable Ruby, so that's promising.
[19:44:31] GinoMan1423: has joined #ruby
[19:45:10] andrzejku: has joined #ruby
[19:45:32] mim1k: has joined #ruby
[19:51:58] pupsicle: has joined #ruby
[19:52:15] poloych: has joined #ruby
[19:53:55] ecuanaso: has joined #ruby
[19:56:06] vuoto: has joined #ruby
[20:00:08] ma0: has left #ruby: ()
[20:00:16] zenspider: chocolatey?
[20:00:32] mwlang: has joined #ruby
[20:00:33] zenspider: what a great name
[20:01:03] mjuszczak: has joined #ruby
[20:01:29] muelleme: has joined #ruby
[20:03:54] nofxx: has joined #ruby
[20:05:59] gusrub: has joined #ruby
[20:11:40] tAn: has joined #ruby
[20:12:43] justizin: has joined #ruby
[20:13:23] Xyvir: has joined #ruby
[20:18:18] ascarter: has joined #ruby
[20:18:35] centrx: has joined #ruby
[20:18:45] username1: has joined #ruby
[20:22:28] jrafanie: has joined #ruby
[20:23:28] rgr: has joined #ruby
[20:23:52] troys: has joined #ruby
[20:26:08] JoshS: has joined #ruby
[20:28:16] zenspider: In bundler, is there a way to do pessimistic versioning for major.minor but say "include beta releases"? I currently have: gem "sexp_processor", "~> 4.10.0b1" but would rather specify "~> 4.10"
[20:28:36] gnufied: has joined #ruby
[20:29:17] zenspider: the doco is piss poor imho
[20:32:49] workmad3: has joined #ruby
[20:36:25] patarr: Does Ruby support using a hash to map an array?
[20:36:42] patarr: I mean it should be as simple as my_array.map(my_hash)
[20:36:58] patarr: Instead of my_array.map{ |i| my_hash[i] }
[20:38:37] zenspider: patarr: did you try it? or look at the doco for Array.map?
[20:40:50] PatrikasZvaigzde: has joined #ruby
[20:41:32] havenwood: >> desired = %i[aim another]; h = {aim: true, another: :yerp, more: false}; h.values_at(*desired) # patarr
[20:41:38] ruby[bot]: havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[20:41:43] ascarter: has joined #ruby
[20:41:53] havenwood: #=> [true, :yerp]
[20:41:56] havenwood: patarr: Maybe consider the other way around ^
[20:42:35] zenspider: seems like the bot is more down than up these days
[20:42:35] ur5us: has joined #ruby
[20:42:52] apeiros: it's still eval.in, but yes, it is :|
[20:43:23] zenspider: can we at least improve the message to say that? or make it retry?
[20:44:37] apeiros: I've got a holiday tomorrow. will see what I can do.
[20:44:55] apeiros: will try to switch it to jhass server, or at least improve the message. also switch it to 2.4.
[20:45:08] BSaboia: has joined #ruby
[20:48:23] hutch34: has joined #ruby
[20:50:11] AndBobsYourUncle: has joined #ruby
[20:53:28] chrisgopher: has joined #ruby
[20:54:48] ThatsNotJack: zenspider: I don't think twiddlewakka ever matches prereleases https://github.com/rubygems/rubygems/blob/master/test/rubygems/test_gem_requirement.rb#L292
[20:57:27] reacquaint: has joined #ruby
[20:58:51] gheegh: has joined #ruby
[20:59:04] matthewd: thatsnotjack: That's because 1.1.pre is < 1.1; 1.2.pre would match
[20:59:34] mtkd: has joined #ruby
[21:00:09] ThatsNotJack: Ah right, my mistake!
[21:01:28] arup_r: has joined #ruby
[21:02:06] matthewd: zenspider: "~> 4.10.x" will do what you want, IIRC
[21:03:15] reacquaint: has joined #ruby
[21:05:18] Xyvir: Not that anyone cares, I found the answer to my Dashing question I asked yesterday, there is a certain tag you have to add to the HTML file of the widget so that Batman won't strip out the HTML
[21:05:46] Xyvir: By default Batman strips all HTML out of data it is binding to. If you want to get around this, simply pass in the raw filter.
[21:05:46] Xyvir: https://github.com/Shopify/dashing/wiki/How-To:-Send-HTML-data-to-your-widgets article showed what I needed
[21:05:51] zenspider: matthewd: .x ? literally?
[21:06:06] zenspider: there's nothing in the doco for that, that I can find.
[21:06:30] matthewd: zenspider: Yeah: it's a prerelease of 4.10, which means it comes before 4.10.[number].pre
[21:06:47] zenspider: but what I don't want is to specify the bug version, so they'll update to 4.11 if/when I release it
[21:07:07] zenspider: ahhhh... interesting. I'd try it out, but I'm in the middle of a painful docker rebuild thanks to touching the Gemfile at all. :(
[21:07:18] zenspider: maybe after, once I'm plugged in again :)
[21:07:22] matthewd: So the .x isn't actually special: it could be any alpha string... it's just a slightly more indicative choice than .a or whatever
[21:07:37] zenspider: building node instead of updating your shit to use a packaged version is a DUMB idea
[21:07:46] reacquaint: has left #ruby: ()
[21:07:56] zenspider: right. 4.10.including_betas
[21:08:20] ecuanaso: has joined #ruby
[21:08:23] matthewd: Doesn't help you if you want a minimum of a specific prerelease, of course... then you'd still need to add a second >= qualifier
[21:12:13] zenspider: true, luckily this one is pretty clean
[21:14:02] zenspider: seriously... why are they still using node 5 or at least why aren't they packaging their own??
[21:14:47] ivanskie: has joined #ruby
[21:15:04] ivanskie: i have a method which uses net/http to download something.
[21:15:42] ivanskie: i need to implement a timeout and raise if reached time out. after some research it sounds like ruby's own TIMEOUT isn't safe.
[21:15:44] ivanskie: any suggestions?
[21:15:48] cfec0b8d: has joined #ruby
[21:16:24] zenspider: isn't safe for what?
[21:16:29] ivanskie: nevermind looks like it already does it on its own lol
[21:18:13] reacquaint: has joined #ruby
[21:18:39] nankyokusei: has joined #ruby
[21:20:06] xenops: has joined #ruby
[21:24:45] cjohnson: Can somebody explain to me what syntax magic provides for this? post :create, params: params
[21:24:59] cjohnson: named params? mixing named and non-named?
[21:25:24] centrx: Where's the magic?
[21:25:50] cjohnson: I'm new to ruby I'm just trying to understand what is going on
[21:26:01] cjohnson: I'm guessing ruby does named params, that's not hard to grasp
[21:26:09] cjohnson: but is this mixing positional + named params?
[21:26:16] cjohnson: and how might the method def look for this?
[21:27:04] pupsicle: def post action, params: nil
[21:27:20] pupsicle: def post(action, params: nil)
[21:27:41] cjohnson: Do keyword params always have to come after positional?
[21:27:56] cjohnson: def foo(a, b, c: nil, d: nil)
[21:28:08] mtkd: has joined #ruby
[21:28:17] cjohnson: (if you hae an article on mixing the two I could read that would be good as well)
[21:28:41] pupsicle: https://github.com/rails/rails/blob/843345cae59b73e50af685ac1303a419a06b4c91/actionpack/lib/action_controller/test_case.rb#L399
[21:29:15] dc4: has joined #ruby
[21:29:18] pupsicle: thats the actual code for your posted example.
[21:29:47] pupsicle: https://robots.thoughtbot.com/ruby-2-keyword-arguments
[21:30:10] cjohnson: I just read that one but it didn't explain mixing
[21:30:24] cjohnson: just one or the other
[21:30:31] cjohnson: https://stackoverflow.com/a/20633975
[21:30:33] cjohnson: just found this though
[21:30:34] cjohnson: bookmarking
[21:30:50] pupsicle: positional args must come before
[21:31:31] chouhoul_: has joined #ruby
[21:32:45] pupsicle: otherwise you get a syntax error
[21:33:06] cjohnson: that is a mess lol
[21:33:27] Rodya_: has joined #ruby
[21:33:35] cjohnson: I only knew about arguments + the special block argument + named block arguments before
[21:33:43] cjohnson: Oh that was my other question
[21:33:56] cjohnson: what would a function def look like that doesn't use the named &block syntax that still accepts a block
[21:33:58] pupsicle: http://ruby-doc.org/core-2.0.0/doc/syntax/methods_rdoc.html#label-Arguments
[21:34:01] cjohnson: how do you reference the block
[21:34:14] matthewd: cjohnson: If you're going code-reading, it'll be worth knowing that it used to work differently: post(:create, params: x) might also invoke a method def post(foo, options) -- where options is a hash
[21:34:37] cjohnson: ah yes yield
[21:35:11] matthewd: i.e., it's "actually" post(:create, { params: x }), with the braces elided
[21:35:33] cjohnson: is that magic specific to method calls?
[21:35:42] pupsicle: it's not magic
[21:35:45] cjohnson: or did foo: 'a' imply braces anywhere?
[21:36:35] matthewd: Mostly method calls. I know it's also true in an array literal... but you can't do `v = a: 1`, for example
[21:36:47] cjohnson: IMO that's absolutely magic then :P
[21:37:00] cjohnson: if it knows it's in a method call and you can use special alternate syntax to get the same thing, that's magic
[21:37:20] cjohnson: thanks for clarifying
[21:37:21] havenwood: Now a days we have keyword args.
[21:38:08] matthewd: havenwood: Yeah, we started there.. I was just filling in backstory because so much existing code still uses the old form
[21:38:15] SeepingN: now (a daze)
[21:38:26] havenwood: nowadæges
[21:38:44] havenwood: matthewd: Aye, and the Hash form is still in wide use so you've got to know it.
[21:38:56] cjohnson: matthewd: Ok so how about this:
[21:39:08] cjohnson: post(:create, params: x, other: bar)
[21:39:14] cjohnson: does that become one hash? or two hashes
[21:39:29] matthewd: cjohnson: One
[21:39:35] cjohnson: and then how do you know what it's going to become? You have to know which ruby version you are targeting?
[21:40:00] matthewd: Anything that looks like hash key-value pairs, at the end of the method argument list, will always become a positional parameter, in that position, containing a hash
[21:40:15] cjohnson: very strange
[21:40:19] matthewd: It'll do whichever thing the called method's signature wants
[21:40:27] cjohnson: got it ok that makes more sense then
[21:40:39] cjohnson: so does it actually match the keywords against the signature to see if it's keyword form or hash form?
[21:41:20] cjohnson: like if I had def foo(a, b: nil, c: nil) and called foo('a', b: 5, d: 5) it would turn that into a hash since there's no c?
[21:41:55] lxsameer: has joined #ruby
[21:42:15] matthewd: No, that's an error
[21:42:23] matthewd: (for a start, there'd be nowhere for the hash to go)
[21:42:51] matthewd: But even with foo(a, hash_maybe=nil, b: nil, c: nil), you'll get an error for foo('a', b: 5, d: 5)
[21:43:16] matthewd: (I just checked -- I didn't know)
[21:43:17] cjohnson: because it found b and then assumed it was keyword?
[21:43:28] cjohnson: Or how does it know it's an error and shouldn't become a hash
[21:44:01] cjohnson: foo('a', x: 5, y: 5) for example I'm guessing wouldn't error since there's no ambiguous possibly-keyword
[21:44:16] matthewd: Nothing to do with the names: the called method has kwargs, so if the last parameter in the call is a hash, it'll get unpacked as kwargs
[21:44:26] matthewd: So yes, that will still error
[21:44:29] zenspider: cjohnson: don't guess. put it in a file and try it out
[21:44:43] zenspider: this is all really cheap and easy to figure out
[21:44:43] cjohnson: Well I wasn't sure if this required a specific version of ruby to observe
[21:45:02] cjohnson: so testing locally with faulty assumptions would just confuse further
[21:45:23] cjohnson: and, we are already here talking after all, and irb won't explain the things matthewd just explained to me :)
[21:45:25] matthewd: No, this is all true for any modern version (2.0 for kwargs, 2.1 for optional kwargs, I think?)
[21:45:32] cjohnson: Yeah that sounds right
[21:45:53] graft: has joined #ruby
[21:46:33] matthewd: cjohnson: So the only way to do foo('a', x: 5, y: 5) would actually be foo('a', { x: 5, y: 5 }, {}), AFAICS
[21:46:55] username1: has joined #ruby
[21:47:26] dc4: has joined #ruby
[21:48:02] matthewd: Which would make this a good point to emphasise that this is an edge case I've not yet encountered in practice :)
[21:48:06] roshanavand: has joined #ruby
[21:48:09] cjohnson: got it. seems like you wouldn't ever want to intentionally do that
[21:48:21] cjohnson: I was more just curious about when you might accidentally invoke hash instead of kwargs
[21:48:31] cjohnson: thanks for clarifying
[21:52:10] matthewd: No worries!
[21:52:43] bkxd: has joined #ruby
[21:52:44] bkxd_: has joined #ruby
[21:52:57] mjuszczak: has joined #ruby
[21:53:42] graft: has joined #ruby
[21:57:23] sonOfRa: has joined #ruby
[22:00:31] TomyLobo2: has joined #ruby
[22:02:22] baweaver: matthewd: yeah, it's 2.1 for optionals
[22:03:01] jinie_: has joined #ruby
[22:03:06] AKPWD: has joined #ruby
[22:04:25] AKPWD: has joined #ruby
[22:05:16] Fysicus: has joined #ruby
[22:05:31] FysiWRK: has joined #ruby
[22:06:13] Fysicus: has joined #ruby
[22:07:10] creshiem: has joined #ruby
[22:07:44] chouhoulis: has joined #ruby
[22:21:31] ruby[bot]: -b sun[BEAM]!*@*$#ruby-banned
[22:23:59] zenspider: matthewd: hrm... turns out that "~> 4.10including_betas" is considered "illformed"
[22:24:49] zenspider: ah. it's the underscore
[22:25:46] zenspider: "~> 4.10including-betas0"
[22:27:50] PresidentBiscuit: has joined #ruby
[22:28:30] HoierM: has joined #ruby
[22:32:30] bvcosta: has joined #ruby
[22:44:36] eightlimbed: has joined #ruby
[22:46:04] eightlimbed: i'm trying to get a string "[5, 8, 11]" to an array, [5, 8, 11]. i used .scan(/\d/).map(&:to_i) and it returned [5, 8, 1, 1]. is there a simpler way?
[22:46:47] eightlimbed: \d++ worked - nevermind - sorry, i'm new to regex
[22:48:29] gusrub: has joined #ruby
[22:48:32] apeiros: eightlimbed: https://github.com/apeiros/literal_parser
[22:48:59] apeiros: depending on what it is, you might also want JSON/YAML
[22:49:42] Antiarc: has joined #ruby
[22:50:36] eightlimbed: oh, cool. thanks apeiros!
[22:51:01] ule: hey guys.. after passing {orderBy: '"company_id"', equalTo: 7} via parameter to my method, it's being converted to: {:orderBy=>"\"company_id\"", :equalTo=>7}
[22:51:17] SeepingN: much happiness after discovering Sublime Text _UI_ themes
[22:51:24] ule: how can I avoid this convertion?
[22:51:53] darix: eightlimbed: keep using regexp. it is much easier to shoot yourself in the foot with them. ;)
[22:52:25] SeepingN: what conversion are you talking about. you wanted company_id with double quotes around it, so that's what you got
[22:52:41] SeepingN: if you don't, then remove the single quotes around it all
[22:52:41] apeiros: ule: '"' == "\""
[22:52:50] ThatsNotJack: ule: Those look like the same hash to me, with no conversion occuring. Those are just two different ways of representing it
[22:53:50] apeiros: eightlimbed: also are you a spider or an octopus?
[22:54:50] ule: apeiros: thatsnotjack
[22:55:02] ule: thank you
[22:55:11] apeiros: saywhat? :D
[22:55:17] eightlimbed: i'm an ashtanga yogi :)
[23:01:36] dc4: has joined #ruby
[23:03:35] muelleme: has joined #ruby
[23:03:43] ziyangtian: has joined #ruby
[23:10:51] kgzm: has joined #ruby
[23:14:31] Kerea: has joined #ruby
[23:16:58] Rutix: has joined #ruby
[23:16:58] Rutix: has joined #ruby
[23:18:37] quobo: has joined #ruby
[23:19:25] nankyokusei: has joined #ruby
[23:22:45] gothicsouth: has joined #ruby
[23:24:36] Joufflu: has joined #ruby
[23:30:48] agent_white: has joined #ruby
[23:31:37] cdg_: has joined #ruby
[23:32:15] zenspider: yay! I think it all works! boo! I think my contract with codeclimate might be over as a result.
[23:32:46] elifoster: has joined #ruby
[23:34:41] ascarter: has joined #ruby
[23:37:44] zapata: has joined #ruby
[23:37:48] cschneid_: has joined #ruby
[23:38:20] im0nde: has joined #ruby
[23:39:54] banisterfiend: has joined #ruby
[23:44:23] alveric3: has joined #ruby
[23:47:08] bauruine: has joined #ruby
[23:49:00] solocshaw: has joined #ruby
[23:51:28] eightlimbed: has joined #ruby
[23:59:38] al2o3-cr: has joined #ruby