« Back to channel list

#ruby - 10 April 2017

« Back 1 day Forward 1 day »
[00:03:35] milardovich: has joined #ruby
[00:05:25] volty: has joined #ruby
[00:06:37] SuperLag_: has joined #ruby
[00:08:55] impermanence: has joined #ruby
[00:09:18] impermanence: Is there triple quoting in Ruby or not? Zed Shaw's book has an exercise covering it, but the internet seems to suggest that this is not actual Ruby syntax.
[00:09:26] hutch34: has joined #ruby
[00:10:27] SteenJobs: has joined #ruby
[00:14:07] matthewd: impermanence: Nope
[00:14:23] impermanence: Some parts of the internet would disagree.
[00:14:36] cerulean: meaning """?
[00:14:42] cerulean: i think that it starts a multi-line string
[00:14:49] impermanence: https://content.pivotal.io/blog/stupid-ruby-quoting-tricks
[00:14:59] matthewd: impermanence: Wait.. are you suggesting some parts of the internet are wrong? ;)
[00:15:43] impermanence: k, check this out: https://learnrubythehardway.org/book/ex10.html
[00:15:58] impermanence: I mean...wtf...
[00:16:12] cerulean: ahh my eyes hurt
[00:16:15] cerulean: ok here's the facts
[00:16:16] cerulean: don't do it
[00:16:20] cerulean: use '' and ""
[00:16:25] matthewd: It *works*.. but it's not a thing
[00:16:50] impermanence: but did you check out the Zed Shaw link? I mean...he has a whole exercise in there...wtf?
[00:17:03] matthewd: """foo""" is actually three strings next to each other, which get auto-concatenated
[00:17:13] matthewd: >> """foo"""
[00:17:14] ruby[bot]: matthewd: # => "foo" (https://eval.in/771510)
[00:17:24] matthewd: >>> "x""foo""x"
[00:17:38] ruby[bot]: impermanence: # => "bar" (https://eval.in/771511)
[00:17:43] cerulean: he does what i told you to do, use it for multi line strings
[00:17:48] matthewd: >> "x""foo""x"
[00:17:49] ruby[bot]: matthewd: # => "xfoox" (https://eval.in/771513)
[00:17:54] skweek: has joined #ruby
[00:18:00] cerulean: """ makes it obvious you're doing a multiline
[00:18:00] impermanence: cerulean: k. Why?
[00:18:09] cerulean: makes it obvious to your eyes whats going on
[00:18:14] matthewd: Do not do that.
[00:18:16] PresidentBiscuit: has joined #ruby
[00:18:30] matthewd: It makes it obvious it's been written by a python programmer who doesn't understand ruby syntax
[00:18:40] cerulean: yeah fair enough
[00:18:48] cerulean: you can do <<---HEREDOC or something as well
[00:19:01] cerulean: just google ruby multiline strings for the correct syntax
[00:19:03] matthewd: Yeah, if you want a really multi-line string, use a heredoc
[00:19:09] cerulean: i agree with matthewd and i never see """ in 7 years of ruby coding
[00:19:24] impermanence: maybe I shouldn't use his book then. Fuck.
[00:19:26] matthewd: For a simple case, just use ordinary quotes
[00:19:37] cerulean: yeah isnt zed shaw from python?
[00:19:46] cerulean: his python book is huge in the python community or something
[00:19:49] impermanence: Well he apparently wrote Mongrel...
[00:19:53] esObe_: has joined #ruby
[00:19:57] impermanence: not apparently, he did.
[00:20:12] cerulean: yeah i know he wrote mongrel, its a foundational piece of ruby architecture
[00:20:34] cerulean: look how all the modern ruby webservers are based on it
[00:20:40] cerulean: i remember when i first got monrel
[00:20:43] cerulean: from webrick
[00:20:47] cerulean: huge speed difference
[00:20:59] impermanence: Well...his book is probably okay for a Ruby quickstart then...
[00:21:10] cerulean: probably fine
[00:21:27] cerulean: """ will work for multiline string. ultimately its up to you. there's no one true way of coding
[00:21:38] cerulean: i dont agree with this string tho """""""""hi""""""""
[00:22:04] matthewd: (Part of) the point of triple-quoted strings in python is that they can contain quotes -- because they're not a real thing in ruby, and more just a quirk of the parse rules, that doesn't apply
[00:22:29] cerulean: depends on what you need
[00:22:32] cerulean: code at your own risk
[00:22:36] cerulean: no life guard
[00:23:12] matthewd: So, """x""" is effectively "" + "x" + ""
[00:23:27] impermanence: okay. got it.
[00:23:40] impermanence: thanks for the insight as usual :)
[00:23:58] Lord_of_Life: has joined #ruby
[00:24:02] mim1k: has joined #ruby
[00:24:55] flips: ACTION just started reading the Eloquent Ruby book. Seems helpful for getting good habits and better understanding
[00:25:21] impermanence: is it true that while loops are rare in ruby?
[00:25:45] volty: as it is true that goto's are rare
[00:26:01] impermanence: what's a goto?
[00:26:02] volty: is your a quiz ?
[00:26:11] matthewd: impermanence: Yes; most loops will generally be using Enumerable methods
[00:26:41] cerulean: yeah you dont use while much
[00:27:09] cerulean: instead of while i == 1 do you can do (0...x).each do
[00:27:16] impermanence: matthewd: eh, I don't know what Enumberable methods are yet so I'll have to come back to that. But okay. no while loops.
[00:27:27] impermanence: oh that's cool. yeah, cool syntax. okay.
[00:27:33] cerulean: .each is an enumarable method. .map is one too
[00:28:03] cerulean: they are methods which iterate an array (an enumerable) and run a function, passing your block
[00:28:13] cerulean: for each item
[00:28:26] cerulean: yes it is a a cool and good syntax for you to use :)
[00:28:43] cerulean: check out #each #map #reject #collect
[00:29:08] matthewd: 134 'while', 1416 '.each', 846 '.map'
[00:29:16] matthewd: So yeah.. rare
[00:29:26] cerulean: where'd you get that statistic?
[00:29:42] matthewd: (and that's without trying to exclude mentions of 'while' from comments/strings, for example)
[00:29:47] matthewd: rails/rails
[00:29:51] cerulean: i see i see
[00:30:02] cerulean: they probably SAID while and not used it
[00:30:05] cerulean: i doubt they used while
[00:30:20] matthewd: We do use it a reasonable amount
[00:30:35] hahuang61: has joined #ruby
[00:30:39] cerulean: you're on rails team?
[00:31:25] cerulean: i love rails 5
[00:31:47] cschneid_: has joined #ruby
[00:32:06] cerulean: what could be the reason to use while?
[00:32:12] matthewd: Some crude exclusions suggest it could be in the 40-50 range
[00:32:28] cerulean: 40 lines using while?
[00:33:01] cerulean: i'm suspicious of zed's titles of books. "the hard way". obviously it is the hard way if he's gonna teach you to use """ lol
[00:33:46] matthewd: Yes, 40 lines contain 'while' and don't contain '#' or '"'
[00:34:05] PresidentBiscuit: has joined #ruby
[00:34:59] matthewd: Sometimes it just fits what we're doing, and sometimes we're in enough of a hotspot that it's worth writing the ugly fast thing
[00:37:15] matthewd: And in one case, I use `while true` to avoid the stack frames from #loop
[00:37:42] milardovich: has joined #ruby
[00:38:50] volty: stack frames? what goes on the stack ?
[00:39:06] cerulean: i get to that point matthewd too and go the fast way as well
[00:39:32] cerulean: i think he means #each requires more frames than a simple white true
[00:39:49] cerulean: because it uses a #loop which is more complicated than while true
[00:40:03] matthewd: >> loop { explode! }
[00:40:05] ruby[bot]: matthewd: # => undefined method `explode!' for main:Object (NoMethodError) ...check link for more (https://eval.in/771523)
[00:40:19] matthewd: >> while true; explode!; end
[00:40:21] ruby[bot]: matthewd: # => undefined method `explode!' for main:Object (NoMethodError) ...check link for more (https://eval.in/771524)
[00:40:49] cerulean: >> puts rand(256)
[00:40:52] matthewd: Ugly backtrace, nice backtrace
[00:40:56] cerulean: oh, im not authorized
[00:41:16] cerulean: i believe you
[00:41:35] matthewd: I was answering volty
[00:41:44] volty: yes, thanks
[00:41:48] b3l914n: has joined #ruby
[00:41:57] volty: but that's only one extra call per loop
[00:42:02] impermanence: is there a name for just a basic .rb file? rube, gemmy, something? Like in python it's module, in java it's class file, in puppet it's manifest, etc...
[00:42:32] cerulean: "dot rb file" is what i call it?
[00:42:58] skweek: has joined #ruby
[00:43:03] matthewd: volty: In this case, it was literally about preventing the lines in the backtrace
[00:43:20] def_jam: has joined #ruby
[00:43:28] Lord_of_Life: has joined #ruby
[00:43:31] impermanence: k. regarding gets...what part of the language is this of?
[00:43:38] cerulean: impermanence: i/o
[00:43:42] impermanence: I assume there are a ton of methods associated with it?
[00:43:42] cerulean: line based i/o
[00:43:53] jgt2: has joined #ruby
[00:44:01] matthewd: &ri Kernel#gets
[00:44:01] `derpy: http://ruby-doc.org/core-2.4.0/Kernel.html#method-i-gets
[00:44:18] eb0t_: has joined #ruby
[00:44:18] impermanence: So is gets like a package or a gem or a module...or what would I call that?
[00:44:29] matthewd: impermanence: It's a method ^
[00:44:31] cerulean: it's a method
[00:44:38] cerulean: inside module Kernel
[00:44:55] cerulean: # means it's a method in the sense of <class/module>#<method>
[00:45:09] impermanence: oh, it's a method. I assume class: gets ; method: chomp => gets.chomp
[00:45:26] matthewd: Being defined in Kernel, which every object contains, it's effectively global
[00:45:50] impermanence: kernel of MRI?
[00:46:01] matthewd: Yeah.. no. Method #gets returns a string, which has a #chomp method.
[00:46:37] esObe_: has joined #ruby
[00:46:39] matthewd: Kernel, yes. Kernel is a module.
[00:47:03] impermanence: So in Ruby a module is a bunch of classes...?
[00:47:46] cerulean: module is where you put methods that dont need to have an object
[00:47:52] cerulean: classes are for when you need an object
[00:48:06] impermanence: module is a bunch of functions.
[00:48:31] matthewd: A module is a collection of methods that can be included into a class
[00:48:42] matthewd: (and also a namespace that can contain nested constants)
[00:48:54] matthewd: No; methods with implementations
[00:49:11] impermanence: ah. But these methods are static...?
[00:49:46] volty: nothing static here
[00:49:47] cerulean: not necessarily
[00:49:50] matthewd: >> module X; def hello; "hello from #{self}"; end; end; class String; include X; end; class Integer; include X; end; ["world".hello, 17.hello]
[00:49:51] ruby[bot]: matthewd: # => ["hello from world", "hello from 17"] (https://eval.in/771527)
[00:51:06] solocshaw: has joined #ruby
[00:51:18] impermanence: Is the concept of Ruby module equal to concept of Python module? Because in Python methods that don't require an object are called functions...
[00:52:04] impermanence: thx. I'll keep reading.
[00:52:29] volty: and breaking :)
[00:52:46] cerulean: ACTION pets the #ruby cat
[00:53:04] Xiti`: has joined #ruby
[00:53:07] ruby[bot]: volty: # => #<Enumerator: main:loop> (https://eval.in/771529)
[00:53:22] volty: what can be done with this enumerator ?
[00:53:31] cerulean: its the equivelent of while 1
[00:53:37] volty: ops, what could
[00:53:54] cerulean: an infinite loop
[00:53:58] cerulean: any recursive stuff
[00:54:28] volty: recursive ? how that ?
[00:54:46] volty: though I understand the useless 'infinite'
[00:54:55] cerulean: maybe not recursive
[00:55:03] cerulean: just infite
[00:55:14] cerulean: you can call break or something when you wanna break
[00:55:27] volty: also inside a simple loop
[01:00:41] Jayson_Virissimo: has joined #ruby
[01:02:14] impermanence: so are there methods on chomp? I mean...if there are method on gets the maybe there are methods on chomp?
[01:02:38] matthewd: impermanence: There aren't methods on gets. gets is returning a string. There are methods on String.
[01:02:48] matthewd: chomp also returns a String.
[01:03:18] impermanence: oh. chomp is a String method.
[01:03:34] impermanence: from the String module, presumably?
[01:04:02] volty: impermanence is a double expert — expert in ruby, and expert in stupid question on ruby (and I have a good nose and good memory :) )
[01:05:03] impermanence: volty: not sure you need to act like in that in either here or life in general. but I have no control over that. later then.
[01:05:49] AndBobsYourUncle: has joined #ruby
[01:06:23] volty: never mind, dear. I have to add that I find you useful since you force people to articulate well their knowledge on ruby
[01:09:32] matthewd: volty: That seemed quite uncalled for
[01:10:58] volty: I don't know what you mean, matthewd. I can only repeat that I have an expert nose and excellent memory of benevolent trolls
[01:11:16] solocshaw: has joined #ruby
[01:12:00] Xiti: has joined #ruby
[01:13:40] volty: (I didn't know what 'uncalled for' means; went for a dictionary - that english is not my mother lang)
[01:14:01] harfangk: has joined #ruby
[01:20:11] cerulean: he wasn't a trol
[01:20:22] cerulean: try to be nicer, you scared off a n00b
[01:20:45] volty: loop enumerator could find a use in functional programming constructs, but I can't imagine a case usage now.
[01:20:53] volty: cerulean: no way
[01:20:59] herbmillerjr: has joined #ruby
[01:21:14] cerulean: he wasnt asking stupid questions, he was just learning
[01:21:18] cerulean: don't be so paranoid
[01:21:30] volty: though the next time I can state the same with other words
[01:21:45] volty: nothing to do with fear (paranoid).
[01:21:52] pwnd_nsfw: loop enumerator? an enumerator enumerator?
[01:22:02] ruby[bot]: volty: # => #<Enumerator: main:loop> (https://eval.in/771532)
[01:23:35] volty: cerulean: anyway the next time you see somebody that seems a bit too noob, try to give a look at the coherency of his not-knowledge
[01:24:46] volty: anybody here tried scala ?
[01:26:02] CloCkWeRX: has joined #ruby
[01:28:39] nankyokusei: has joined #ruby
[01:29:52] allisio: >> loop.first 3
[01:29:53] ruby[bot]: allisio: # => [nil, nil, nil] (https://eval.in/771533)
[01:30:01] nebiros: has joined #ruby
[01:30:01] nebiros: has joined #ruby
[01:30:05] hndk: has joined #ruby
[01:31:02] allisio: >> loop { 1 }.lazy.first 3
[01:31:06] ruby[bot]: allisio: # => (https://eval.in/771534)
[01:31:15] allisio: I feel like that should work?
[01:33:10] volty: no, it returns enumerator only without block
[01:35:07] _djbkd: has joined #ruby
[01:36:38] allisio: Makes sense. It'd be nice if `loop.lazy` were an Enumerator over the naturals, though.
[01:38:19] volty: >> (1..Float::INFINITY).first(5)
[01:38:20] ruby[bot]: volty: # => [1, 2, 3, 4, 5] (https://eval.in/771536)
[01:41:03] allisio: >> (0..Float::INFINITY).map { |n| n * 2 }.first 5
[01:41:06] ruby[bot]: allisio: # => (https://eval.in/771537)
[01:41:51] volty: >> (0..Float::INFINITY).lazy.map { |n| n * 2 }.first 5
[01:41:52] ruby[bot]: volty: # => [0, 2, 4, 6, 8] (https://eval.in/771538)
[01:44:20] allisio: Right; block-less `loop` as a synonym for `(0..Float::INFINITY)` would be nifty.
[01:44:45] jokester: has joined #ruby
[01:46:48] volty: >> def loop_naturals; (0..Float::INFINITY).to_enum; end
[01:46:49] ruby[bot]: volty: # => :loop_naturals (https://eval.in/771542)
[01:48:09] esObe_: has joined #ruby
[01:48:40] SuperLag: has joined #ruby
[01:50:04] matthewd: loop is intended to be used in places where it will loop ~infinitely
[01:50:40] astrobunny: has joined #ruby
[01:50:43] matthewd: .. which means it would count high enough to get into bignums, at which point every iteration is an allocation. That would be bad.
[01:51:53] ebbflowgo: has joined #ruby
[01:52:09] volty: yes, but that is a limit of ruby trying to mimic the true functional languages
[01:52:42] impermanence: has joined #ruby
[01:53:28] soppe: has joined #ruby
[01:53:59] impermanence: In Learn Ruby the Hard Way it is suggested that to take an integer from STDIN to use gets.chomp.to_i? but is this bad practice? because can't I just use gets.to_i? Or I suppose that the latter takes in the integer and then converts it to a string?
[01:56:49] volty: Hard Way brings hard questions. How can a newbie doubt the words of the 'hard way'?
[01:57:03] br0d1n: has joined #ruby
[01:58:20] matthewd: impermanence: bad practice how?
[02:00:16] impermanence: matthewd: After the triple quote thing when I ran into that I wanted to just check if there was anything strange with that because I've had a couple of doubts about continuing with hard way and starting with something else. But it sounds like that's normal use.
[02:01:57] volty: our expert probably meant 'redundant' - since the chars removed by chomp do not change the result ? but his instinct tells him that we should always chomp, because chomp could change the result.
[02:04:22] volty: >> $/ = "3"; s = "33"; [s.to_i, s.chomp.to_i]
[02:04:24] ruby[bot]: volty: # => [33, 3] (https://eval.in/771553)
[02:04:49] volty: did I prove that he is an expert ? :)
[02:05:09] libastral: has joined #ruby
[02:06:30] impermanence: volty: I guess I don't understand the difference between gets.to_i and gets.chomp.to_i ... I think chomp removes \r\n but is there any other difference?
[02:07:32] matthewd: impermanence: No; that is indeed what chomp does.
[02:07:42] volty: impermanence: I wanted so say the same you are asking about — how can a novice imagine there could be "other difference"
[02:08:14] impermanence: matthewd: okay.
[02:08:21] volty: chomp removes whatever $/ 's value is
[02:10:48] soppe: has joined #ruby
[02:13:50] acalycine: has joined #ruby
[02:21:51] nofxxx: volty, actually nice is that it's kinda of beginning of /^\d regex... so "123-rocknroll".to_i -> 123
[02:21:59] armyriad: has joined #ruby
[02:22:05] nofxxx: what's nice in #to_i*
[02:22:37] nofxxx: easy to make permalinks that way
[02:22:40] rexb0t: has joined #ruby
[02:24:28] mim1k: has joined #ruby
[02:31:24] hahuang61: has joined #ruby
[02:35:03] xall: has joined #ruby
[02:35:07] PresidentBiscuit: has joined #ruby
[02:38:08] yaewa: has joined #ruby
[02:38:36] PorcoRex: has joined #ruby
[02:38:54] PorcoRex: Good evening.
[02:39:23] yaewa: has joined #ruby
[02:40:13] yaewa: has joined #ruby
[02:40:27] maum: has joined #ruby
[02:41:02] maum: how can I get author value from {:author=>"Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr.", :date=>"1988.", :title=>"Climatological observations and predicted sublimation rates at La ke Hoare, Antarctica.", :journal=>"Journal of Climate", :volume=>"1:", :pages=>"715-728."} ?
[02:41:17] maum: This is hash
[02:41:21] Radar: maum: So what have you tried?
[02:41:33] maum: h[:author]
[02:41:42] moei: has joined #ruby
[02:41:44] Radar: maum: Did that not work?
[02:41:57] Radar: How did that not work?
[02:42:11] Radar: >> {:author=>"Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr."}[:author]
[02:42:12] ruby[bot]: Radar: # => "Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr." (https://eval.in/771571)
[02:42:31] maum: anystyle.rb:21:in `[]': can't convert Symbol into Integer (TypeError)
[02:42:44] _djbkd: has joined #ruby
[02:42:47] Radar: maum: looks like you're calling [] on an array instead. Show us the rest of the code please.
[02:43:24] soppe: has joined #ruby
[02:43:52] maum: Radar: http://codepad.org/Q9GCdLw5
[02:44:10] hutch34: has joined #ruby
[02:44:16] Radar: maum: Output h for us please.
[02:44:23] Radar: I think it's an array, not a hash.
[02:44:47] maum: how to get the value from array?
[02:44:53] PorcoRex: It seems you're using Anystyle. Not sure what it is, but that may not be a raw hash.
[02:45:23] Radar: PorcoRex: possibly https://github.com/inukshuk/anystyle-parser
[02:45:37] Radar: https://github.com/inukshuk/anystyle-parser#parsing
[02:45:43] Radar: Example here shows it does indeed return an array
[02:45:55] maum: the output of h is {:author=>"Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr.", :date=>"1988.", :title=>"Climatological observations and predicted sublimation rates at La ke Hoare, Antarctica.", :journal=>"Journal of Climate", :volume=>"1:", :pages=>"715-728."}
[02:45:58] Radar: maum: I would suggest experimenting with how to get the first element of an array.
[02:46:50] Radar: maum: Did you use puts or p?
[02:46:57] Radar: maum: to get that output: did you use puts or p?
[02:47:06] PorcoRex: There's also something, in the original input, there isn't an "author" key. Where should that be coming from?
[02:47:24] Pumukel: has joined #ruby
[02:47:45] __Yiota: has joined #ruby
[02:48:07] Radar: maum: puts takes an array and iterates through it all, outputting each element
[02:48:14] Radar: maum: use `p` to get the actual object's representation.
[02:48:28] Radar: maum: It's an array. You'll need to find the first element of that array and then call [:author] on that element.
[02:48:32] maum: Radar: how? would you show me an example?
[02:48:39] Radar: maum: ?g ruby first element on array
[02:48:44] Radar: ?g ruby first element on array
[02:48:44] ruby[bot]: Radar: I don't see no ruby, whom should I tell about g?
[02:48:52] Radar: one day I will figure out ruby[bot]
[02:49:37] Radar: maum: experiment in irb. Create an array and then try to get the _first_ element from that array. I'm sure you can figure it out.
[02:49:51] maum: h[0] shows {:author=>"Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr.", :date=>"1988.", :title=>"Climatological observations and predicted sublimation rates at La ke Hoare, Antarctica.", :journal=>"Journal of Climate", :volume=>"1:", :pages=>"715-728."}
[02:50:25] PorcoRex: maum, interesting... How about h[0][:author] ?
[02:51:13] maum: PorcoRex: you are very nice commentor
[02:51:28] PorcoRex: Did that work or are you just stroking my ego?
[02:51:39] maum: it shows Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr.
[02:51:53] PorcoRex: That's pretty close I think.
[02:52:14] maum: but why 0?
[02:52:25] maum: the output of h and h[0] are same
[02:52:31] PorcoRex: How about h.first[:author] ?
[02:53:03] maum: also same
[02:53:07] maum: it prints the authors
[02:53:10] PorcoRex: How about h.class ?
[02:53:54] PorcoRex: Ah, you should always print arrays with "p", not "puts".
[02:54:03] PorcoRex: Try now p h .
[02:54:32] maum: anystyle.rb:23:in `<main>': private method `puts' called for #<Array:0x00000002808610> (NoMethodError)
[02:55:49] PorcoRex: Why are you using anystyle?
[02:56:02] maum: to parse references
[02:56:34] PorcoRex: How about puts h.inspect ?
[02:57:08] maum: it prints [{:author=>"Clow GD, McKay CP, Simmons Jr. GM, and Wharton RA, Jr.", :date=>"1988.", :title=>"Climatological observations and predicted sublimation rates at L ake Hoare, Antarctica.", :journal=>"Journal of Climate", :volume=>"1:", :pages=>"715-728."}]
[02:57:16] PorcoRex: Ah, there's the array.
[02:57:35] PorcoRex: You'll notice it's different from puts h.first.inspect .
[02:58:16] maum: anystyle.rb:22:in `<main>': private method `puts' called for #<String:0x00000003548140> (NoMethodError)
[02:58:40] PorcoRex: Well, that's different, alright.
[03:01:02] PorcoRex: That gem doesn't seem to be too flexible, but to answer you question, it seems to parse several records. So, you want to get the first record (using h[0] or h.first) and then query the :author from that record.
[03:08:21] xenops: has joined #ruby
[03:09:09] Pumukel: has joined #ruby
[03:09:56] Pumukel: has joined #ruby
[03:10:10] astrobunny: has joined #ruby
[03:10:17] _djbkd: has joined #ruby
[03:10:44] Pumukel: has joined #ruby
[03:11:08] gix: has joined #ruby
[03:11:32] Pumukel: has joined #ruby
[03:12:20] Pumukel: has joined #ruby
[03:13:14] cschneid_: has joined #ruby
[03:14:00] impermanence: has joined #ruby
[03:15:09] esObe_: has joined #ruby
[03:16:37] msafi: has joined #ruby
[03:18:02] impermanence: has joined #ruby
[03:19:26] msafi: Hey folks, I don't know much about Ruby, but Travis CI is telling me I need to use their gem to encrypt values for the CI. Thing is, I tried `gem install travis` but got a permission error. So I tried `gem install travis --user-install` and it worked.
[03:19:41] msafi: Then I don't know what I did, and it broke. Now I get this error when I run it https://i.imgur.com/auGJAga.png
[03:19:45] msafi: Any ideas how to fix this?
[03:21:21] impermanence: has joined #ruby
[03:22:48] _tk421_: has joined #ruby
[03:24:57] PorcoRex: Looks like it's not finding the gem where it expects it to. Also, are encripted values used for integration with code climate or something like that? I don't remember you needing to generate a key for Travis only use.
[03:25:09] SHyx0rmZ: has joined #ruby
[03:26:05] knight33: has joined #ruby
[03:26:19] msafi: PorcoRex: I need to use Travis CI for an unrelated project on GitHub
[03:26:28] _djbkd: has joined #ruby
[03:27:34] PorcoRex: msafi, do you have a .travis.yml file in your project?
[03:28:06] PorcoRex: Did you configure the travis dashboard to login through Github?
[03:28:27] jusa: has joined #ruby
[03:28:29] msafi: Hmmm, I found a fix. I needed to remove `export GEM_HOME` and `export GEM_PATH` which were = `~/.gem` from my environment
[03:29:33] nankyokusei: has joined #ruby
[03:32:50] hutch34: has joined #ruby
[03:40:02] solocshaw: has joined #ruby
[03:44:53] xall: has joined #ruby
[03:47:32] cerulean: i let some designers from twitter connect to my secret app without an NDA
[03:47:35] cerulean: am i a fucking idiot?
[03:47:57] msafi: Nah, you'll be fine
[03:48:00] cerulean: alright cool
[03:50:48] jdm: has joined #ruby
[03:51:45] impermanence: has joined #ruby
[03:54:12] _djbkd: has joined #ruby
[03:57:50] claw: has joined #ruby
[04:03:34] jgt2: has joined #ruby
[04:09:35] esObe_: has joined #ruby
[04:10:24] acalycine: has joined #ruby
[04:13:40] grh: has joined #ruby
[04:14:45] Ropeney: has joined #ruby
[04:19:17] tristanp: has joined #ruby
[04:19:45] babykosh: has joined #ruby
[04:22:24] babykosh: greetings ruby makers…..noob question….is an easy to understand comparison chart between ruby 2.1.2 and 2.4? Trying to understand what differences exist. Thank you in advance.
[04:25:03] mim1k: has joined #ruby
[04:28:02] Radar: babykosh: You could always look at the changelogs for 2.2, 2.3 and 2.4
[04:28:18] enterprisey: has joined #ruby
[04:28:24] Radar: https://www.ruby-lang.org/en/news/2014/12/25/ruby-2-2-0-released/
[04:28:28] Radar: https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/
[04:28:31] Radar: https://www.ruby-lang.org/en/news/2016/12/25/ruby-2-4-0-released/
[04:29:10] figures_: has joined #ruby
[04:29:50] babykosh: @radar thank you
[04:30:11] babykosh: @radar looking now
[04:32:16] hahuang61: has joined #ruby
[04:42:03] lele: has joined #ruby
[04:42:10] iamayam: has joined #ruby
[04:43:56] solocshaw: has joined #ruby
[04:45:48] am55: has joined #ruby
[04:52:18] eclecticjohny: has joined #ruby
[04:56:12] astrobunny: has joined #ruby
[05:03:50] astrobunny: has joined #ruby
[05:05:09] eclecticjohny: has joined #ruby
[05:09:00] xenops: has joined #ruby
[05:10:43] babykosh: has joined #ruby
[05:12:18] goodroot: has joined #ruby
[05:14:59] anisha: has joined #ruby
[05:16:07] RobertBirnie: has joined #ruby
[05:16:44] babykosh: ok ruby makers…on github for ruby 2.1… where is the kernel module…I want to look at it with my human eyes.
[05:18:05] jdm: has joined #ruby
[05:18:20] herwin: `git grep Kernel`
[05:21:48] naprimer: has joined #ruby
[05:24:17] armyriad: has joined #ruby
[05:27:26] esObe_: has joined #ruby
[05:30:25] nankyokusei: has joined #ruby
[05:31:08] _tk421_: has joined #ruby
[05:36:53] wkoszek: So I'm still looking for testers for my reproducible Ruby builds: https://github.com/wkoszek/ruby_packages
[05:38:15] solocshaw: has joined #ruby
[05:38:44] BubonicPestilenc: has joined #ruby
[05:41:59] Silthias: has joined #ruby
[05:47:18] ruby[bot]: -b john11111!*@*$#ruby-banned
[05:48:37] soppe: has joined #ruby
[05:56:57] _djbkd: has joined #ruby
[05:59:06] hutch34: has joined #ruby
[06:01:28] yaewa: has joined #ruby
[06:02:10] User458764: has joined #ruby
[06:04:25] dminuoso: Radar in here? :o
[06:04:33] Radar: dminuoso: yes
[06:04:36] dminuoso: ?seen Radar
[06:04:36] ruby[bot]: dminuoso: I don't know anything about seen
[06:04:46] dminuoso: Amazing. How did you find this channel?
[06:04:57] Radar: dminuoso: I've known about it for a while.
[06:05:01] Radar: Sorry for not telling you.
[06:06:04] djbkd_: has joined #ruby
[06:07:44] dminuoso: babykosh: Also be sure to look at the minor changelogs. Ruby has a tendency to shove syntax changes down your throat in minor versions. ;-)
[06:07:58] jgt2: has joined #ruby
[06:08:45] babykosh: @dminuoso are those in the same location as the regular changelogs (on github)?
[06:08:52] c-fu: has joined #ruby
[06:10:55] gdonald: has joined #ruby
[06:11:28] charliesome: has joined #ruby
[06:11:54] dminuoso: babykosh: Personally I would go for the announcements at ruby-lang.org -> they have summaries of the most notable features. The changelog from the git repository will usually contain a lot of technical things that are less relevant just to get an impression of the differences.
[06:12:07] dminuoso: https://www.ruby-lang.org/en/news/
[06:18:27] babykosh: @dminuoso oh this is good yes! combined with the general changelogs, I have a good place to start. Thank you!
[06:18:43] vali: has joined #ruby
[06:18:46] ferr1: has joined #ruby
[06:19:25] soppe: has joined #ruby
[06:24:02] hfp: has joined #ruby
[06:25:29] mim1k: has joined #ruby
[06:29:54] rgtk: has joined #ruby
[06:33:19] hahuang61: has joined #ruby
[06:33:40] vali: has joined #ruby
[06:35:50] PresidentBiscuit: has joined #ruby
[06:37:10] bungoman: has joined #ruby
[06:37:51] conta: has joined #ruby
[06:37:51] Bozo: has joined #ruby
[06:37:58] Qchmqs: has joined #ruby
[06:44:15] griff: has joined #ruby
[06:47:08] fantasticsid: has joined #ruby
[06:47:15] Bozza: has joined #ruby
[06:54:12] jokester: has joined #ruby
[06:54:47] bigkevmcd: has joined #ruby
[06:57:15] esObe_: has joined #ruby
[06:59:35] esObe_: has joined #ruby
[07:01:28] esObe_: has joined #ruby
[07:07:45] ddffg: has joined #ruby
[07:09:54] astrobunny: has joined #ruby
[07:10:33] jgnagy: has joined #ruby
[07:10:38] Arpanet69: has joined #ruby
[07:14:58] moei: has joined #ruby
[07:15:02] Pumukel: has joined #ruby
[07:16:59] Silthias: has joined #ruby
[07:17:42] zun: has joined #ruby
[07:18:53] TomyWork: has joined #ruby
[07:19:54] nofxxxx: has joined #ruby
[07:24:07] anisha: has joined #ruby
[07:24:36] mim1k: has joined #ruby
[07:24:59] lenwood: has joined #ruby
[07:28:05] mark_66: has joined #ruby
[07:28:42] renchan: has joined #ruby
[07:31:16] nankyokusei: has joined #ruby
[07:31:18] biberu: has joined #ruby
[07:33:12] vondruch_: has joined #ruby
[07:34:16] kristofferR: has joined #ruby
[07:34:30] babykosh: has joined #ruby
[07:35:14] jusa: has joined #ruby
[07:40:37] govg: has joined #ruby
[07:41:41] andikr: has joined #ruby
[07:46:21] snickers: has joined #ruby
[07:51:35] flying: has joined #ruby
[07:52:50] grh: has joined #ruby
[08:00:47] burgestrand: has joined #ruby
[08:05:57] impermanence: has joined #ruby
[08:12:12] mikecmpbll: has joined #ruby
[08:13:51] tvw: has joined #ruby
[08:14:17] mim1k: has joined #ruby
[08:14:38] Olipro: has joined #ruby
[08:20:24] Mortomes|Work: has joined #ruby
[08:21:10] aenialis_: has joined #ruby
[08:23:49] jsrn_: has joined #ruby
[08:24:41] yxhuvud: has joined #ruby
[08:27:25] marr: has joined #ruby
[08:28:46] nowhere_man: has joined #ruby
[08:30:18] gizmore: has joined #ruby
[08:34:09] hahuang61: has joined #ruby
[08:37:48] postmodern: has joined #ruby
[08:43:28] conta: has joined #ruby
[08:45:24] toretore: has joined #ruby
[08:47:44] xenops: has joined #ruby
[08:48:42] ctompkinson: has joined #ruby
[08:52:10] lxsameer: has joined #ruby
[08:55:13] cgfbee: has joined #ruby
[08:55:14] Beams: has joined #ruby
[08:58:25] jenrzzz: has joined #ruby
[08:58:25] jenrzzz: has joined #ruby
[09:00:38] gdonald: has joined #ruby
[09:02:22] ctompkin1on: has joined #ruby
[09:04:43] pulkit4tech: has joined #ruby
[09:12:06] ledestin: has joined #ruby
[09:14:57] raspado: has joined #ruby
[09:15:23] esObe_: has joined #ruby
[09:17:29] pandaant: has joined #ruby
[09:18:00] astrobunny: has joined #ruby
[09:23:38] mim1k: has joined #ruby
[09:30:16] teddysmoker: has joined #ruby
[09:31:08] jaequery: has joined #ruby
[09:32:06] nankyokusei: has joined #ruby
[09:32:34] ddffg: why i get such error libreadline.so.6: cannot open shared object file: No such file or directory
[09:34:49] Lartza: ddffg, Probably because you have readline 7 but your ruby is compiled with 6
[09:36:14] ddffg: No such file or directory - /home/user/.rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-linux/readline.so
[09:36:42] ddffg: it wokred 4 weeks ago
[09:41:15] Bozza: has joined #ruby
[09:43:13] jaequery: has joined #ruby
[09:43:38] bodgix: has joined #ruby
[09:43:50] acalycine: has joined #ruby
[09:45:16] dionysus69: has joined #ruby
[09:45:32] griff: has joined #ruby
[09:45:53] jennyrgb: has joined #ruby
[09:45:57] jennyrgb: I hate racial mixing. Niggerapes and humans shouldn't mix
[09:47:17] psychicist__: has joined #ruby
[09:48:07] ruby[bot]: tobiasvl: ops currently in #ruby: adaedra, aredridel, havenwood, Radar, apeiros, baweaver, helpa, jhass, ljarvis, matthewd, miah, ruby[bot], zenspider and zzak
[09:48:44] matthewd: !ban jennyrgb
[09:48:44] ruby[bot]: +bbb $a:jennyrgb$#ruby-banned jennyrgb!*@*$#ruby-banned *!*@gateway/tor-sasl/jennyrgb$#ruby-banned
[09:48:44] ruby[bot]: ruby[bot] kicked jennyrgb: offense, see http://ruby-community.com/pages/user_rules
[09:55:08] ferr1: has joined #ruby
[10:01:37] stoffus: has joined #ruby
[10:01:42] halogenandtoast: has joined #ruby
[10:01:59] halogenandtoast: Is there any good documentation discouraging the extension of ruby's core classes?
[10:02:08] ctompkinson: has joined #ruby
[10:02:31] herwin: halogenandtoast: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes
[10:02:35] jottr: has joined #ruby
[10:03:12] halogenandtoast: herwin: that's subclassing though, I meant reopening the class and adding `my_random_method` to that class.
[10:03:27] tobiasvl: monkey patching
[10:03:53] halogenandtoast: or duck punching, whatever your flavor is.
[10:05:22] matthewd: halogenandtoast: That comes down to "there might be name conflicts"
[10:06:24] matthewd: That makes it rather rude for a random library to be doing... but doesn't really affect the application author, or a library whose whole purpose is to make such extensions
[10:07:02] halogenandtoast: matthewd: right, I'm trying to find a good way to discourage my students from doing this arbitrarily
[10:07:18] halogenandtoast: I mentioned name conflicts.
[10:08:07] matthewd: In their end application? I'm not sure I necessarily see anything wrong with that.
[10:08:17] fivmo: has joined #ruby
[10:09:22] matthewd: It's then an API design question: "does this method make sense on every String, or does it only really work for this particular one?", etc
[10:09:32] halogenandtoast: matthewd: It opens the door for unexpected errors. And these students will be contributing to our companies code base at some point
[10:09:57] matthewd: i.e., exactly the same "is this the right class for that method" questions you'd ask about any other class
[10:10:29] halogenandtoast: Sure in this case they've monkey-patched Integer to have a digits method, to return the number of digits a number has.
[10:10:48] matthewd: Well that's an ideal example
[10:11:13] matthewd: http://blog.bigbinary.com/2017/02/23/ruby-2-4-implements-integer-digits-for-extracting-digits-in-place-value-notation.html
[10:11:40] halogenandtoast: Seems like its not an ideal example then...
[10:11:45] halogenandtoast: as this will conflict
[10:12:02] halogenandtoast: actually it depends on what you meant by example
[10:12:03] matthewd: I mean it's an ideal example for your "don't do this" argument
[10:12:24] matthewd: But, that conflict with the future notwithstanding, I'd personally be fine with the addition of such a method
[10:12:40] matthewd: Again, within the application -- not a library.
[10:14:41] ebbflowgo: has joined #ruby
[10:16:40] moei: has joined #ruby
[10:18:12] halogenandtoast: matthewd: thanks for the insight.
[10:18:54] halogenandtoast: I generally have a "no extending core classes" mentality, only because I've been bitten by it every single time I've done it.
[10:19:15] blackwind_123: has joined #ruby
[10:19:31] halogenandtoast: but that's the result of library authors extending core classes (I'm looking at you rails)
[10:20:44] raspado: has joined #ruby
[10:21:14] matthewd: My counter-argument is that Rails is primarily a framework, so we play by different rules: we're generally present from the start, to adjust the base environment... not pulled in as some arbitrary dependency to stomp on your namespace unexpectedly
[10:21:27] raspado: has joined #ruby
[10:21:32] halogenandtoast: matthewd: yeah still not sure why rails needed to add Numeric#bytes
[10:21:34] matthewd: Admittedly, that doesn't work so well when you think about using activerecord in isolation, or similar
[10:22:02] halogenandtoast: seems like "not the frameworks responsibility"
[10:22:33] halogenandtoast: and of course that meant they added gigabytes, exabytes, and friends...
[10:23:59] halogenandtoast: </rant> heading home now, thanks again.
[10:32:44] kent\n: has joined #ruby
[10:32:56] pwnd_nsfw`: has joined #ruby
[10:34:57] hahuang61: has joined #ruby
[10:36:33] PresidentBiscuit: has joined #ruby
[10:37:38] GodFather: has joined #ruby
[10:40:14] Guest96: has joined #ruby
[10:42:17] jusa: has joined #ruby
[10:46:12] Bozo: has joined #ruby
[10:46:36] cschneid_: has joined #ruby
[10:50:58] Lord_of_Life: has joined #ruby
[10:53:57] mim1k_: has joined #ruby
[10:55:48] User458764: has joined #ruby
[10:59:58] impermanence: has joined #ruby
[11:00:48] impermanence: has joined #ruby
[11:05:54] jeyraof^mbpr: has joined #ruby
[11:10:24] ebbflowgo: has joined #ruby
[11:14:23] jwheare: has joined #ruby
[11:22:44] kent\n: has joined #ruby
[11:23:37] impermanence: has joined #ruby
[11:27:45] jgt2: has joined #ruby
[11:33:00] nankyokusei: has joined #ruby
[11:37:47] burgestrand: has joined #ruby
[11:38:05] valkyrka: has joined #ruby
[11:38:40] valkyrka: hi guys, a little bit of an odd one, I wrote a script which doesn’t behave as I would expect it
[11:39:01] valkyrka: https://gist.github.com/anonymous/ade70d93dee45a08c13adceaab0cb8e7 is the script and basically when I call it script.rb 5, instead of printing the beers with more than 5 abv, I get odd results
[11:39:39] valkyrka: https://gist.github.com/anonymous/a00cfd7aa10a8213b9b1b60959131f6d here is what I mean
[11:40:07] valkyrka: I mean, I don’t understand when I run it with the parameter 5 why it’s printing out a beer w/ 4.5 alchohol
[11:41:04] harfangk: has joined #ruby
[11:41:13] dminuoso: valkyrka: ?testcase
[11:41:17] ruby[bot]: dminuoso: I don't know anything about testcase
[11:41:20] dminuoso: ACTION sighs.
[11:41:56] dminuoso: valkyrka: Let's clean up some things for readabilities sake.
[11:42:26] dminuoso: valkyrka: "#{beer["abv"]}" is ugly. Use beer["abv"].to_s instead.
[11:43:15] valkyrka: ok, cool, let me do that
[11:43:23] dminuoso: And that puts is replaced best with sprinft using the following shorthand:
[11:43:49] dminuoso: well that last puts is fine
[11:43:54] dminuoso: valkyrka: For that second, please read the documentation of https://ruby-doc.org/core-2.2.0/String.html#method-i-3C-3D-3E
[11:44:30] valkyrka: thanks for pointing me in the right direction
[11:46:05] ddrmanxbxfr: has joined #ruby
[11:50:49] nadir: has joined #ruby
[11:51:28] Lord_of_Life: has joined #ruby
[11:52:12] KrzaQ: has left #ruby: ()
[11:52:14] yaw: has joined #ruby
[11:59:36] rippa: has joined #ruby
[12:01:51] stoffus1: has joined #ruby
[12:02:24] ldnunes: has joined #ruby
[12:02:51] HoierM: has joined #ruby
[12:09:44] User458764: has joined #ruby
[12:20:18] cseder: has joined #ruby
[12:20:59] Lord_of_Life: has joined #ruby
[12:23:31] bungoman: has joined #ruby
[12:27:52] csk: has joined #ruby
[12:29:45] pupsicle: has joined #ruby
[12:30:13] mim1k: has joined #ruby
[12:30:44] csk: has joined #ruby
[12:31:33] jamesaxl: has joined #ruby
[12:33:14] xall: has joined #ruby
[12:34:38] gdonald: has joined #ruby
[12:36:35] hahuang61: has joined #ruby
[12:37:56] AlienElite_: has joined #ruby
[12:39:29] naprimer: has joined #ruby
[12:40:06] CloCkWeRX: has joined #ruby
[12:40:37] gnufied: has joined #ruby
[12:41:58] AlienElite_: Anyone seen a nigga on a bike lately?
[12:42:06] CloCkWeRX1: has joined #ruby
[12:42:16] matthewd: !ban AlienElite_
[12:42:16] ruby[bot]: +bb AlienElite_!*@*$#ruby-banned *!*@gateway/web/freenode/ip.69.14.118.203$#ruby-banned
[12:42:17] ruby[bot]: ruby[bot] kicked AlienElite_: offense, see http://ruby-community.com/pages/user_rules
[12:42:18] ruby[bot]: -bb $a:crime$#ruby-banned crime!*@*$#ruby-banned
[12:42:56] Arpanet69: has joined #ruby
[12:43:32] aupadhye: has joined #ruby
[12:43:56] Pumukel: has joined #ruby
[12:44:41] Pumukel: has joined #ruby
[12:47:49] harfangk: has joined #ruby
[12:52:14] iamayam: has joined #ruby
[12:52:58] SuperLag_: has joined #ruby
[12:53:31] User458764: has joined #ruby
[12:54:29] __Yiota: has joined #ruby
[12:58:33] bodgix: has joined #ruby
[12:59:01] Polysics: has joined #ruby
[13:00:39] HoierM: has joined #ruby
[13:01:13] CloCkWeRX: has joined #ruby
[13:04:07] ramortegui: has joined #ruby
[13:04:22] ghornet: has joined #ruby
[13:07:35] burgestrand: has joined #ruby
[13:08:16] hutch34: has joined #ruby
[13:09:14] Polysics: has joined #ruby
[13:11:40] Polysics_: has joined #ruby
[13:13:31] grh: has joined #ruby
[13:13:46] gdonald: has joined #ruby
[13:14:53] Polysics: has joined #ruby
[13:15:15] pulkit4tech: has joined #ruby
[13:16:58] SuperLag: has joined #ruby
[13:21:37] ramortegui: has joined #ruby
[13:24:46] claudevandort: has joined #ruby
[13:27:23] banisterfiend: has joined #ruby
[13:31:43] rgtk: has joined #ruby
[13:32:35] DLSteve: has joined #ruby
[13:33:50] nankyokusei: has joined #ruby
[13:35:45] scrooloose: has joined #ruby
[13:35:47] patarr: has joined #ruby
[13:35:52] charliesome: has joined #ruby
[13:43:24] xall: has joined #ruby
[13:43:41] mazeinmaze_: has joined #ruby
[13:45:30] grh: has joined #ruby
[13:46:02] IRCFrEAK: has joined #ruby
[13:46:25] millerti: has joined #ruby
[13:48:30] IRCFrEAK: has left #ruby: ()
[13:52:51] jusa: has joined #ruby
[13:54:09] gdonald: has joined #ruby
[13:54:53] meshsmith: has joined #ruby
[13:56:05] pupsicle: has joined #ruby
[13:56:32] bounb: has joined #ruby
[13:56:33] bounb: has joined #ruby
[13:59:49] conta: what's good ruby book these days? general intermediate stuff
[14:02:09] agent_white: has joined #ruby
[14:04:03] impermanence: has joined #ruby
[14:04:11] bounb: has joined #ruby
[14:04:12] bounb: has joined #ruby
[14:05:04] houhoulis: has joined #ruby
[14:08:30] mzo: has joined #ruby
[14:09:20] EXCHGR: has joined #ruby
[14:09:48] chouhoulis: has joined #ruby
[14:10:15] xall: has joined #ruby
[14:12:02] yehowyada: has joined #ruby
[14:15:10] jgt2: has joined #ruby
[14:15:31] roshanavand: has joined #ruby
[14:17:36] roshanavand: has joined #ruby
[14:17:54] lmc: has joined #ruby
[14:19:46] shinnya: has joined #ruby
[14:21:37] ldnunes: has joined #ruby
[14:22:41] impermanence: What module is ARGV in?
[14:22:55] raspado: has joined #ruby
[14:23:03] govg: has joined #ruby
[14:24:01] chouhoulis: has joined #ruby
[14:26:04] flying: has joined #ruby
[14:26:32] agent_white: Mornin' folks
[14:28:23] flying: has joined #ruby
[14:30:36] t-recx: has joined #ruby
[14:31:15] knight33: has joined #ruby
[14:32:37] GSilva: has joined #ruby
[14:34:18] narval: has joined #ruby
[14:34:44] User458764: has joined #ruby
[14:37:19] hahuang61: has joined #ruby
[14:37:26] cdg: has joined #ruby
[14:38:14] dionysus69: has joined #ruby
[14:40:26] cdg: has joined #ruby
[14:41:12] mazeinmaze_: has joined #ruby
[14:41:21] mim1k: has joined #ruby
[14:42:03] Xiti: has joined #ruby
[14:42:30] Beams: has joined #ruby
[14:45:02] Guest96: has joined #ruby
[14:48:50] solocshaw: has joined #ruby
[14:49:05] ghormoon: has joined #ruby
[14:50:53] impermanence: Why does the following fail: dir_to_create = gets.chomp ; ARGV[0] = dir_to_create ? (ignore the semi-colon obviously)
[14:51:55] impermanence: maybe it doesn't, actually.
[14:52:37] impermanence: heh. nevermind.
[14:53:35] CloCkWeRX: has joined #ruby
[14:54:03] eneas: has joined #ruby
[14:55:47] eneas: has left #ruby: ("Adiós")
[15:00:32] allisio: impermanence: How did that happen?
[15:01:21] impermanence: I'm new and was rushing. I didn't read the interpret output carefully enough.
[15:02:08] jgnagy: has joined #ruby
[15:04:26] theRoUS: has joined #ruby
[15:08:16] cschneid_: has joined #ruby
[15:08:21] amargherio: has joined #ruby
[15:09:43] bodgix1: has joined #ruby
[15:10:33] rgtk: has joined #ruby
[15:10:43] haylon: has joined #ruby
[15:18:29] jwheare: has joined #ruby
[15:20:29] cerulean: gmourin guys
[15:20:39] gdonald: has joined #ruby
[15:21:00] boombox_: has joined #ruby
[15:23:12] cdg_: has joined #ruby
[15:23:35] griff: has joined #ruby
[15:24:23] Siyfion: has joined #ruby
[15:25:17] hxegon: has joined #ruby
[15:25:19] govg: has joined #ruby
[15:25:51] Siyfion: Does anyone know what my issue might be here (http://imgur.com/a/QKsXZ)
[15:26:10] Siyfion: I think I'
[15:26:30] Siyfion: *I've got all the gems installed that I need, but for some reason it comes up with this...
[15:26:45] psychicist__: has joined #ruby
[15:26:54] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[15:27:08] baweaver: much easier to use than imgur
[15:27:33] Siyfion: baweaver true, but it's a bit of a mess with word-wrap
[15:28:12] impermanence: morning. Do I need to require anything in order for Dir.chdir("/tmp") to work? I'm calling it but my current shell does not change directory...
[15:28:30] dlitvak: has joined #ruby
[15:28:41] Siyfion: baweaver: https://gist.github.com/Siyfion/1c7fe36e6a5a82c4746ec761995d821d each to their own :)
[15:29:39] baweaver: impermanence: It'll only "cd" inside the ruby process
[15:30:35] impermanence: baweaver: oh. so basically in the threads being executed...the cd is happening there?
[15:30:52] impermanence: oh, wow. okay then.
[15:30:59] baweaver: Siyfion: which OS / how did you install it?
[15:31:16] Siyfion: OSX / gem install
[15:31:26] Siyfion: or bundle install
[15:31:39] baweaver: https://github.com/Homebrew/homebrew-core/issues/11636
[15:31:45] baweaver: seeing some issues cropping around there
[15:32:02] baweaver: though I'd go with another manager for it honestly
[15:32:22] baweaver: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you
[15:32:26] polishdub: has joined #ruby
[15:32:30] baweaver: brew ruby can be a bit off on occasion
[15:32:52] Siyfion: Okay, thats a shame.. I love brew :(
[15:32:54] baweaver: that'll get you ready for Rails, so you can skip a few steps if you won't need that.
[15:33:09] baweaver: brew works for most things
[15:33:24] baweaver: languages can be finnicky, especially if you need more than one version
[15:33:43] Siyfion: rvm / nvm to the rescue?
[15:34:06] baweaver: I've used rvm in the past and currently use nvm
[15:34:20] baweaver: there's a lot of skepticism lately around RVM though it seems
[15:34:34] baweaver: something about 20k line shell scripts being dangerous
[15:34:50] nankyokusei: has joined #ruby
[15:34:50] baweaver: I think ruby-install / chruby are the new favorites
[15:34:53] Siyfion: Ah... so at the moment you'd recommend chruby?
[15:35:00] Siyfion: Okay, I'll take a look
[15:35:14] baweaver: Radar's guide there does a good job of getting everything working
[15:35:27] Siyfion: In the meantime... https://github.com/Homebrew/homebrew-core/issues/11636#issuecomment-290892884 that did work
[15:35:52] baweaver: If you're only using the one version though it may not be worth the effort
[15:36:13] Siyfion: Yeah, I generally only use latest
[15:36:36] Siyfion: I only do a *very* small app in Ruby, everything else is Node.js/React/etc.
[15:36:49] Siyfion: To create PDFs weirdly
[15:37:05] Siyfion: But it works well... so hey, why not!?
[15:37:42] baweaver: Wicked was it?
[15:38:01] Siyfion: No, PrawnPDF actually ;)
[15:38:06] baweaver: ACTION wishes pdf would die
[15:38:31] dionysus69: has joined #ruby
[15:38:32] Siyfion: Haha... well for very accurate printing, it's quite useful.. ie. labelling.
[15:38:56] baweaver: Never said it wasn't, but the caveats leave some things to be desired :)
[15:39:05] Siyfion: But it's not generated from HTML, due to the simple fact that I don't think I'd be able to position things as accurately as I'd like..
[15:39:16] baweaver: namely playing chicken with Java for most exploits on record
[15:39:26] Siyfion: Oh there's a hell of a LOT to be desired from PDFs
[15:40:04] dminuoso: Siyfion: Such as?
[15:40:14] dminuoso: PDFs are actually one of the better formats out there.
[15:40:20] baweaver: you summoned dminuoso
[15:40:30] Siyfion: ACTION runs away and hides
[15:40:30] dminuoso: ACTION growls
[15:40:48] Siyfion: Hey I like them... *for my use case
[15:41:02] Siyfion: But there are places where they are used that I'd prefer they weren't!
[15:41:18] gregf_: has joined #ruby
[15:42:46] dminuoso: Siyfion: The thing that really triggers me about them if when companies start abusing cmap to make them un-copy-pastable, and then do positional tricks to ruin OCR attempts.
[15:43:18] Siyfion: dminuoso: Couldn't agree more
[15:45:27] Siyfion: For creating a document that you want printed in a *very* specific way... I love them, I don't think there's much else I could use...
[15:45:55] ketan: has joined #ruby
[15:47:11] dminuoso: Siyfion: They are at least truly portable.
[15:47:32] Siyfion: Yup, and fairly printer-friendly
[15:47:38] TomyLobo: has joined #ruby
[15:47:58] rakm: has joined #ruby
[15:48:45] preyalone: has joined #ruby
[15:50:07] amargherio: has joined #ruby
[15:50:30] [Butch]: has joined #ruby
[15:53:44] amclain: has joined #ruby
[15:57:16] levifig: has joined #ruby
[15:57:47] Slinky_Pete: has joined #ruby
[15:59:54] jusa: has joined #ruby
[16:00:09] Dry_Lips: has joined #ruby
[16:00:09] Dry_Lips: has joined #ruby
[16:02:52] patarr1: has joined #ruby
[16:07:40] Beams: has joined #ruby
[16:13:17] knight33: has joined #ruby
[16:16:39] bodgix: has joined #ruby
[16:18:14] mephistophocles: has joined #ruby
[16:18:23] Sweetlie: has joined #ruby
[16:18:38] amargherio: has joined #ruby
[16:19:04] cloaked1: has joined #ruby
[16:19:04] cloaked1: has joined #ruby
[16:20:46] outreachdan: has joined #ruby
[16:20:54] cschneid_: has joined #ruby
[16:21:41] solocshaw: has joined #ruby
[16:22:00] GinoManWorks: has joined #ruby
[16:25:30] nitric: has joined #ruby
[16:28:09] ResidentBiscuit: has joined #ruby
[16:28:15] grh: has joined #ruby
[16:30:58] govg: has joined #ruby
[16:32:39] gusrub: has joined #ruby
[16:34:39] raspado: has joined #ruby
[16:35:10] ntnvgu: has joined #ruby
[16:38:26] hahuang61: has joined #ruby
[16:46:54] jaequery: has joined #ruby
[16:47:34] ddffg: has joined #ruby
[16:47:52] AndBobsYourUncle: has joined #ruby
[16:49:52] cdg: has joined #ruby
[16:56:14] _djbkd: has joined #ruby
[16:57:07] br0d1n: has joined #ruby
[16:57:38] Guest57405: has joined #ruby
[16:58:21] chouhoulis: has joined #ruby
[17:00:00] Ishido: has joined #ruby
[17:05:52] esObe_: has joined #ruby
[17:08:13] nitric: has joined #ruby
[17:12:46] gusrub: has joined #ruby
[17:14:06] gusrub: has joined #ruby
[17:14:12] jgt2: has joined #ruby
[17:15:30] outreachdan: has joined #ruby
[17:19:38] mim1k: has joined #ruby
[17:21:05] ketan: has joined #ruby
[17:23:26] griff: has joined #ruby
[17:24:01] s2013: has joined #ruby
[17:26:02] ddffg: has joined #ruby
[17:27:47] moei: has joined #ruby
[17:29:25] mikecmpbll: has joined #ruby
[17:35:40] nankyokusei: has joined #ruby
[17:35:54] chouhoulis: has joined #ruby
[17:37:23] jgt2: has joined #ruby
[17:39:20] ResidentBiscuit: has joined #ruby
[17:46:07] jespada: has joined #ruby
[17:46:16] hahuang61: has joined #ruby
[17:47:45] CGibsonmm: has joined #ruby
[17:48:04] ResidentBiscuit: has joined #ruby
[17:48:57] duderonomy: has joined #ruby
[17:53:20] antoniobeyah: has joined #ruby
[17:54:17] gusrub: has joined #ruby
[17:58:44] gbailey: has joined #ruby
[17:58:52] gusrub: has joined #ruby
[18:01:25] bodgix: has joined #ruby
[18:01:49] GodFather: has joined #ruby
[18:02:17] cfec0b8d: has joined #ruby
[18:03:25] Silthias: has joined #ruby
[18:04:08] GodFather: has joined #ruby
[18:06:07] dn`: has joined #ruby
[18:07:45] nitric: has joined #ruby
[18:10:53] gdonald: has joined #ruby
[18:18:28] GodFather: has joined #ruby
[18:20:32] _sfiguser: has joined #ruby
[18:21:26] contradictioned: has joined #ruby
[18:27:15] outreachdan: has joined #ruby
[18:27:20] SeepingN: has joined #ruby
[18:29:28] User458764: has joined #ruby
[18:31:32] rgtk: has joined #ruby
[18:33:26] ResidentBiscuit: has joined #ruby
[18:39:25] jusa: has joined #ruby
[18:41:35] reaVer: has joined #ruby
[18:49:31] Jayson_Virissimo: has joined #ruby
[18:53:31] nowhere_man: has joined #ruby
[18:56:28] loincloth: has joined #ruby
[18:57:55] patarr: has joined #ruby
[18:58:38] war_pigs: has joined #ruby
[19:04:56] d10n-work: has joined #ruby
[19:05:34] grh: has joined #ruby
[19:05:46] chrisgopher: has joined #ruby
[19:08:41] minimalism: has joined #ruby
[19:09:37] esObe_: has joined #ruby
[19:11:47] skweek: has joined #ruby
[19:16:22] Pierreb|home: system('perl /opt/ruby/sms.pl' "#{phone}") is there a way to add space between when sent to cmdline? it's sent as perl /opt/ruby/sms.pl11111111111
[19:16:57] apeiros: system('perl', '/opt…', phone)
[19:17:16] apeiros: (assuming phone already contains a string, then "#{phone}" is being pointlessly verbose)
[19:18:20] Pierreb|home: just phone didnt work
[19:18:26] Pierreb|home: ill try that, thanks apeiros
[19:18:51] apeiros: "didn't work" doesn't work as a problem description
[19:19:09] apeiros: and it probably didn't work because you passed the arguments wrongly to system
[19:19:46] apeiros: if phone truly is not a string, phone.to_s is IMO still cleaner than "#{phone}" (and that's just what that construct does anyway)
[19:20:16] lel: has joined #ruby
[19:21:08] Pierreb|home: ok ill play around a bit
[19:21:16] lagweezle: I'm also noting that your call, apeiros, has commas, where as Pierreb|home just has strings following each other.
[19:21:28] AndBobsYourUncle: has joined #ruby
[19:21:45] apeiros: lagweezle: yes, that's the main part
[19:21:53] Pierreb|home: i tried the commas between perl /opt/script, variable
[19:22:12] Pierreb|home: not sure why i didnt do it that time
[19:22:41] _tk421_: has joined #ruby
[19:23:14] lagweezle: Not just that, but breaking up 'perl /opt/...' into 'perl', '/opt/...'
[19:23:15] apeiros: you have to either put everything into a single string (creates a subshell) or use separate arguments for each (bypasses subshell)
[19:23:27] apeiros: &ri Kernel#system
[19:23:28] `derpy: http://ruby-doc.org/core-2.4.0/Kernel.html#method-i-system
[19:24:14] darwish_: has joined #ruby
[19:24:27] darwish_: Hi .. I see this line in some open-source project: execute_cmdstager(flavor: :vbs)
[19:24:33] cek: has joined #ruby
[19:24:47] darwish_: Is the "flavor: vbs" part a hash short form?
[19:25:15] apeiros: it's either keyword arguments, or a hash. depends on the method definition.
[19:25:20] cek: Anyone knows how to use http://www.w3.org/TR/xpath#section-String-Functions in nokogiri, so that it returns not a nodeset but an actual substring ?
[19:25:27] havenwood: darwish_: Either a "naked hash" short form of Hash or it could be a keyword argument with default value.
[19:25:33] apeiros: cek: I'm sure people over in ##ruby know
[19:26:05] darwish_: havenwood, apeiros .. yeah the method takes a hash; So it's 100% equivalent to execute_cmdstager(:flavor => :vbs)
[19:26:32] apeiros: yes. which in turn is equivalent to execute_cmdstager({:flavor => :vbs})
[19:26:45] esObe_: has joined #ruby
[19:27:27] darwish_: apeiros, hmm .. from a language design perspective, was it worth it to create new syntax for such a very special case?
[19:27:29] muelleme_: has joined #ruby
[19:27:42] apeiros: darwish_: yes. but I wish they'd done it differently.
[19:28:09] darwish_: apeiros, if you have the time, I'd be very interested to listen :D
[19:28:41] apeiros: I don't have the issues and IMO better solution at the ready anymore, sorry. you're about 5y late ;-)
[19:29:09] apeiros: it mainly boils down to me preferring to have explicit kwarg syntax, which is not mixed up with hash syntax
[19:29:25] psychici1t__: has joined #ruby
[19:29:53] outreachdan: has joined #ruby
[19:30:13] jespada: has joined #ruby
[19:31:16] darwish_: apeiros, I see :-)
[19:33:10] bodgix: has joined #ruby
[19:36:28] nankyokusei: has joined #ruby
[19:38:59] xenops: has joined #ruby
[19:39:39] skweek: has joined #ruby
[19:40:30] enterprisey: has joined #ruby
[19:41:59] Lord_of_Life: has joined #ruby
[19:45:01] zapata: has joined #ruby
[19:47:27] babykosh: has joined #ruby
[19:48:11] esObe_: has joined #ruby
[19:48:32] Guest96_: has joined #ruby
[19:51:12] wilbert: has joined #ruby
[19:53:23] __Yiota: has joined #ruby
[19:53:44] raul782: has joined #ruby
[19:54:17] Lord_Squirrel: has joined #ruby
[19:54:36] Lord_Squirrel: has left #ruby: ()
[19:54:47] Robtop__: has joined #ruby
[19:55:57] jenrzzz: has joined #ruby
[19:55:58] jenrzzz: has joined #ruby
[19:59:18] galtgendo: has left #ruby: ()
[20:00:48] cdg: has joined #ruby
[20:02:15] Lord_Squirrel: has joined #ruby
[20:02:30] bungoman: has joined #ruby
[20:02:42] SteenJobs: has joined #ruby
[20:02:49] knight33: has joined #ruby
[20:04:50] ozcanesen: has joined #ruby
[20:08:06] meshsmith: has joined #ruby
[20:09:06] AndBobsYourUncle: has joined #ruby
[20:11:34] chrisseaton: has joined #ruby
[20:11:40] GodFather: has joined #ruby
[20:13:01] nankyokusei: has joined #ruby
[20:13:10] NightMonkey: has joined #ruby
[20:13:15] enterprisey: has joined #ruby
[20:15:53] kitikonti: has joined #ruby
[20:20:48] hxegon: has joined #ruby
[20:24:18] hazelux: has joined #ruby
[20:30:03] NightMonkey: has joined #ruby
[20:36:49] Fin1te: has joined #ruby
[20:36:57] jdm: has joined #ruby
[20:39:33] cam27: has joined #ruby
[20:41:05] jane_booty_doe: has joined #ruby
[20:42:02] toretore: has joined #ruby
[20:44:59] lxsameer: has joined #ruby
[20:46:06] ryan_notabot: has joined #ruby
[20:47:04] gusrub: has joined #ruby
[20:48:17] electrostat: has joined #ruby
[20:49:30] cisco: has joined #ruby
[20:50:15] cisco: has joined #ruby
[20:54:14] rakm: has joined #ruby
[20:56:20] hays: what's the best way to compatibly integrate a ruby script into a logging facility like syslog? I know about Syslog::Logger
[20:56:35] hays: but it seems like maybe some Linux distros for example are shipping without syslog these days
[20:56:57] lagweezle: ACTION lights systemd on fire.
[20:57:14] cek: has left #ruby: ()
[20:57:22] matthewd: hays: You want the best way to integrate with syslog without using syslog? :/
[20:58:42] hays: i don't particulrly care about using syslog or whatever else, just looking for something as platform independent as practicable
[20:59:19] hays: something that would hopefully end up in syslog for a system running syslog, but end up wherever else is appropriate for a system running something else
[21:00:19] matthewd: AFAIK, the "whatever else is appropriate" is still syslog
[21:00:53] eam: syslog(3) is a posix defined libc call. It's not going anywhere
[21:01:10] eam: the daemon that services the /dev/log socket is more or less irrelevant
[21:01:41] hays: ok. well that is helpful actually
[21:02:21] hays: so Syslog::Ruby is tying to a POSIX call
[21:02:26] eam: most likely
[21:02:54] eam: the posix call is, in turn, very simple and probably amounts to a particular string format and sendto() to /dev/log
[21:02:56] hays: erm Syslog::Logger
[21:03:44] hays: I started down this rabbit hole because my Syslog::Logger messages look crappy in console.log (MacOS)
[21:04:07] hays: just trying to get a flavor at this point that its working..
[21:04:10] narval: has joined #ruby
[21:04:35] hays: all my messages show up with the name 'ruby' instead of what I pass into the Syslog::Logger constructor
[21:04:43] hays: and levels don't seem to be coming through
[21:06:45] hays: yeah, just verified that Syslog::Logger works with a Syslog module, that is an interface for syslog(3) which I think means POSIX
[21:07:19] eam: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/syslog.h.html
[21:07:58] eam: hays: because /dev/log is just a regular old socket it's pretty easy to debug. Try attaching strace and looking at the format of the string being sent to the socket
[21:08:20] hays: not sure how to do that
[21:09:56] war_pigs: has joined #ruby
[21:10:10] eam: here's a pretty fun 'zine about how to use it https://jvns.ca/blog/2015/04/14/strace-zine/
[21:11:06] eam: strace shows you the system calls a process is making, easiest way to test it: `strace ls` to see what system calls the `ls` program invokes
[21:11:09] NightMonkey: has joined #ruby
[21:11:31] eam: anyway, you can use it to see what data is flowing over a descriptor
[21:12:00] __Yiota: has joined #ruby
[21:16:09] jusa: has joined #ruby
[21:16:29] raul782: has joined #ruby
[21:17:51] millerti: has joined #ruby
[21:23:30] hxegon: has joined #ruby
[21:28:50] jenrzzz: has joined #ruby
[21:28:50] jenrzzz: has joined #ruby
[21:34:17] spiette: has joined #ruby
[21:35:11] mim1k: has joined #ruby
[21:40:23] chichou: has joined #ruby
[21:42:12] nadir: has joined #ruby
[21:46:24] am55: has joined #ruby
[21:46:32] skweek: has joined #ruby
[21:49:28] _tk421_: has joined #ruby
[21:50:19] pupsicle: has joined #ruby
[21:56:03] babykosh: has joined #ruby
[21:58:14] outreachdan: has joined #ruby
[22:04:09] chichou: has joined #ruby
[22:04:58] nitric_: has joined #ruby
[22:05:50] blackwind_123: has joined #ruby
[22:07:34] esObe_: has joined #ruby
[22:07:45] esObe_: has joined #ruby
[22:09:45] war_pigs: has joined #ruby
[22:10:03] rakm: has joined #ruby
[22:16:22] mikecmpbll: has joined #ruby
[22:21:59] nankyokusei: has joined #ruby
[22:26:24] NightMonkey: has joined #ruby
[22:29:21] war_pigs: has joined #ruby
[22:30:29] hazelux: has joined #ruby
[22:37:13] Hanmac: has joined #ruby
[22:37:38] cam27: has joined #ruby
[22:43:03] rexb0t: has joined #ruby
[22:47:31] milardovich: has joined #ruby
[22:48:41] millerti: has joined #ruby
[22:50:58] workmad3: has joined #ruby
[22:51:42] skweek: has joined #ruby
[22:52:32] s2013: has joined #ruby
[22:53:06] griff: has joined #ruby
[22:55:22] mikecmpbll: anyone know any guides on writing protocols over TCP, in general or specifically in ruby?
[22:55:30] mikecmpbll: (TCP or UDP)
[22:55:46] dminuoso: mikecmpbll: RFC.
[22:57:47] mikecmpbll: dminuoso : got a link? can't find anything
[22:59:32] esObe_: has joined #ruby
[22:59:45] mikecmpbll: oh, do you mean the standards. i don't mean implementing existing protocols but creating a custom one
[23:01:33] am55: has joined #ruby
[23:02:10] matthewd: mikecmpbll: 1. Don't; use an existing protocol. 2. Open a socket and read & write to it.
[23:02:40] mikecmpbll: yeah. i don't really know why i asked the question, i know it's as simple as that.
[23:02:49] hazelux: has joined #ruby
[23:02:49] mikecmpbll: it's late, my brain isn't functioning good :d
[23:05:00] matthewd: Yeah, beyond that it's a matter of protocol design, in which case see 1.
[23:05:44] mikecmpbll: hmm. lots of software implement custom protocols for talking between their various components
[23:13:00] esObe_: has joined #ruby
[23:15:55] jusa: has joined #ruby
[23:17:25] minimalism: has joined #ruby
[23:21:08] hutch34: has joined #ruby
[23:21:39] outreachdan: has joined #ruby
[23:24:53] Guest96: has joined #ruby
[23:33:51] tdy: has joined #ruby
[23:35:38] mim1k: has joined #ruby
[23:36:24] s2013: has joined #ruby
[23:42:47] jdbrowne: has joined #ruby
[23:44:34] mint: has joined #ruby
[23:48:46] chouhoulis: has joined #ruby
[23:50:17] enterprisey: has joined #ruby
[23:54:00] rexb0t: has joined #ruby
[23:54:35] jdbrowne: has joined #ruby
[23:55:02] ryan_notabot: has joined #ruby
[23:58:13] _tk421_: has joined #ruby