« Back to channel list

#ruby - 18 January 2016

« Back 1 day Forward 1 day »
[00:02:05] ajf-: has joined #ruby
[00:02:59] emilford: has joined #ruby
[00:04:37] kobain: has joined #ruby
[00:06:55] ruby[bot]: has joined #ruby
[00:06:55] ChanServ: +o ruby[bot]
[00:08:16] victortyau: has joined #ruby
[00:08:28] lucasb: has joined #ruby
[00:11:58] chouhoulis: has joined #ruby
[00:12:03] emilford: has joined #ruby
[00:12:13] mistermocha: has joined #ruby
[00:12:18] sandstrom: has joined #ruby
[00:14:12] janebootydoe: has joined #ruby
[00:18:14] skade: has joined #ruby
[00:21:09] emilford: has joined #ruby
[00:21:40] hogetaro: has joined #ruby
[00:22:27] blackgoat: has joined #ruby
[00:25:10] drocsid: has joined #ruby
[00:25:30] C0deMaver1ck: has joined #ruby
[00:26:29] victortyau: has joined #ruby
[00:29:41] sandstrom: has joined #ruby
[00:30:13] emilford: has joined #ruby
[00:30:14] caffeinic: has joined #ruby
[00:32:04] mfb2: has joined #ruby
[00:33:06] jgt: has joined #ruby
[00:34:39] mfb2_: has joined #ruby
[00:35:06] northfurr: has joined #ruby
[00:36:09] wolffles: has joined #ruby
[00:37:03] cndiv: has joined #ruby
[00:37:45] usershell: has joined #ruby
[00:38:00] marcdel: has joined #ruby
[00:38:57] guacamole: has joined #ruby
[00:39:22] emilford: has joined #ruby
[00:39:37] rwz__: has joined #ruby
[00:41:12] norc_: dostoyevsky, I dont know. Lets figure it out.
[00:41:24] victortyau: has joined #ruby
[00:41:26] norc_: asm>> def foo(); end; foo()
[00:41:27] ruby[bot]: norc_: I have disassembled your code, the result is at https://eval.in/503532
[00:41:46] norc_: asm>> -> { puts "foo" }.call()
[00:41:48] ruby[bot]: norc_: I have disassembled your code, the result is at https://eval.in/503533
[00:41:49] krobzaur: has joined #ruby
[00:42:07] norc_: dostoyevsky, looks like it does. :)
[00:43:33] skade: has joined #ruby
[00:43:35] tuelz1: has joined #ruby
[00:44:38] pawnbox: has joined #ruby
[00:45:58] lucasb: this "asm>>" thing escapes backticks (`) ? can you try "asm>> `foo`" for me? :)
[00:46:40] hogetaro: has joined #ruby
[00:47:03] sandstrom: has joined #ruby
[00:48:28] emilford: has joined #ruby
[00:50:35] victortyau: has joined #ruby
[00:51:26] jamw: has joined #ruby
[00:51:41] shellie_: has joined #ruby
[00:57:26] northfurr: has joined #ruby
[00:57:28] marcdel: has joined #ruby
[00:57:32] emilford: has joined #ruby
[00:58:02] marcdel: has joined #ruby
[00:58:38] marcdel: has joined #ruby
[00:58:50] justbleed: has joined #ruby
[00:59:40] guacamole: has joined #ruby
[01:01:00] guacamole: has joined #ruby
[01:01:14] binaryplease: has joined #ruby
[01:02:59] blackmes1: has joined #ruby
[01:03:07] caffeinic: has joined #ruby
[01:03:28] mfb2: has joined #ruby
[01:03:41] hogetaro: has joined #ruby
[01:04:00] sandstrom: has joined #ruby
[01:04:34] howdoicomputer: has joined #ruby
[01:07:12] diego1: has joined #ruby
[01:07:29] mistermocha: has joined #ruby
[01:08:14] lannonbr: has joined #ruby
[01:08:16] mfb2: has joined #ruby
[01:09:08] diego1: has joined #ruby
[01:12:43] chouhoulis: has joined #ruby
[01:12:51] peteyg: has joined #ruby
[01:13:23] krz: has joined #ruby
[01:14:46] pawnbox: has joined #ruby
[01:15:38] B1n4r10: has joined #ruby
[01:17:23] Mokuluu: has joined #ruby
[01:18:35] hogetaro: has joined #ruby
[01:18:56] Ox0dea: dostoyevsky: Did you mean blocks?
[01:19:22] peteyg: has joined #ruby
[01:19:35] usershell: has joined #ruby
[01:20:26] emilford: has joined #ruby
[01:21:13] sandstrom: has joined #ruby
[01:21:15] dostoyevsky: Ox0dea: yeah, blocks..
[01:21:28] Ox0dea: dostoyevsky: No, you have to invoke #set_trace_func with a Proc.
[01:22:14] bvbrandon: I???m having a serious issue :/ I have a form that isn???t saving any data and I can???t understand the issue
[01:22:56] bvbrandon: in the log I see the params comming through, then the SQL commits nil
[01:24:02] dostoyevsky: Can I read the parameters of a block being called in set_trace_func?
[01:24:24] peteyg: has joined #ruby
[01:25:52] Dimik: has joined #ruby
[01:25:58] fedexo: has joined #ruby
[01:26:46] skade: has joined #ruby
[01:28:14] Ox0dea: dostoyevsky: https://eval.in/503574
[01:28:54] CloCkWeRX: has left #ruby: ()
[01:29:14] Ox0dea: TracePoint is a lot nicer to work with than #set_trace_func.
[01:29:25] Ox0dea: And, as demonstrated, it makes it quite easy to get at the block parameters.
[01:29:29] emilford: has joined #ruby
[01:29:44] arescorpio: has joined #ruby
[01:30:24] drocsid: has joined #ruby
[01:31:30] hogetaro: has joined #ruby
[01:34:08] northfurr: has joined #ruby
[01:35:33] Ox0dea: This is fun. https://eval.in/503575
[01:35:34] vishwa: has joined #ruby
[01:35:36] bvbrandon: would anyone be willing to do a google hangout for an odd form isse I???m having?
[01:35:56] vishwa: How do you install a ruby gem fron github? I'm not on rails
[01:37:42] Limix: has joined #ruby
[01:38:35] emilford: has joined #ruby
[01:38:56] sandstrom: has joined #ruby
[01:39:29] Limix: has joined #ruby
[01:41:48] griffindy: has joined #ruby
[01:43:30] B1n4r10: has joined #ruby
[01:45:31] oo7cat: has joined #ruby
[01:46:13] freudenshade: has joined #ruby
[01:46:33] weemsledeux: has joined #ruby
[01:46:40] freudenshade: When I run rake gem, I get a rake aborted!
[01:46:41] freudenshade: LoadError: cannot load such file -- bundler
[01:46:50] freudenshade: what does that mean?
[01:47:38] emilford: has joined #ruby
[01:50:17] nbdy: has joined #ruby
[01:51:38] usershell: has joined #ruby
[01:56:02] sandstrom: has joined #ruby
[01:56:45] emilford: has joined #ruby
[02:05:08] dlitvak: has joined #ruby
[02:05:53] emilford: has joined #ruby
[02:07:00] Radar: freudenshade: You don't have the bundler gem installed.
[02:07:30] bronson: has joined #ruby
[02:10:12] Channel6: has joined #ruby
[02:11:56] mfb2: has joined #ruby
[02:12:23] jamw: has joined #ruby
[02:13:18] sandstrom: has joined #ruby
[02:13:28] chouhoulis: has joined #ruby
[02:13:38] gbgdev: has joined #ruby
[02:14:38] gbgdev: has joined #ruby
[02:15:00] emilford: has joined #ruby
[02:15:09] freudenshade: Ok, done. And after bundler install, I now get ' Dont know how to build task 'gem' ' . What now Radar ?
[02:15:29] Radar: freudenshade: what is the full command that you're trying to run?
[02:17:08] krobzaur: has joined #ruby
[02:18:26] freudenshade: just rake gem Radar
[02:18:35] Radar: freudenshade: and what should that command do?
[02:18:38] freudenshade: Trying to install a gem from github
[02:18:44] Radar: freudenshade: It all depends on the context of where you're running it.
[02:18:46] Radar: freudenshade: Which gem?
[02:18:48] freudenshade: I have no idea, mate. I'm just following a tutorial
[02:18:54] Radar: freudenshade: Which tutorial?
[02:18:57] freudenshade: https://github.com/jpmckinney/tf-idf-similarity
[02:19:20] freudenshade: something on SO
[02:19:29] Radar: Got a link to that too so I can follow along too?
[02:19:31] freudenshade: DIfferent ones, in fact. After each erorr I went to a new one Radar
[02:19:45] freudenshade: http://ruby.about.com/od/advancedruby/a/gitgem.htm
[02:19:57] freudenshade: This is the one im using now
[02:20:35] Radar: freudenshade: "rake -T" will show you the commands that are available.,
[02:20:39] Radar: freudenshade: Perhaps you're after "rake install"?
[02:20:56] Radar: Where is the post that recommends this particular gem?
[02:21:31] freudenshade: No post recommended this, I was looking for something to do this and found this repo
[02:21:59] freudenshade: rake install seems to have worked.
[02:22:00] Radar: What do you want that command to do when you run it? Is it to install the gem?
[02:22:07] freudenshade: Can I require it and use it now?
[02:22:16] freudenshade: Yeah, I wanted to install the gem
[02:22:28] Radar: Yes you can require itg
[02:22:31] freudenshade: TBF I've never heard of rake before this
[02:22:39] Radar: You can require anything from a gem's lib dir
[02:22:40] Radar: https://github.com/jpmckinney/tf-idf-similarity/tree/master/lib
[02:22:47] Radar: require 'tf-idf-similiarity' will work
[02:23:01] freudenshade: I see, well thanks a lot Radar
[02:23:02] Radar: rake is Ruby's alternative to the make tool. We use it for running "tasks" in Ruby code.
[02:23:13] mahk_: has joined #ruby
[02:23:17] freudenshade: how did you learn all this stuff anyway
[02:23:42] freudenshade: I'm sort of a journeyman in ruby, I like it more than python which is why I use it. Everything is n object, is really cool
[02:25:20] phredus: has joined #ruby
[02:28:41] dlitvak_: has joined #ruby
[02:30:26] sandstrom: has joined #ruby
[02:31:40] Radar: freudenshade: I've been doing it for 10 years. I learned by asking questions in this channel and #rubyonrails.
[02:32:15] XxionxX: has left #ruby: ()
[02:32:24] Radar: freudenshade: I've also read a few books on it and I've even written some.
[02:33:37] minimalism: has joined #ruby
[02:35:33] speakingcode: has joined #ruby
[02:36:50] freudenshade: Radar: Are they good ?
[02:37:02] ruby[bot]: Radar: I don't know anything about twgr
[02:37:09] Radar: ruby[bot]: hm I could've sworn you did.
[02:37:45] freudenshade: Radar: I'll find it myself, what is it called?
[02:37:59] Radar: freudenshade: When I was learning I read the first version of https://www.manning.com/books/the-well-grounded-rubyist-second-edition which was then called "Ruby for Rails"
[02:38:34] Radar: That'll cover everything about Ruby that you need to know and probably a touch more. You know python already so a lot of the first couple of chapters should be familiar to you, but I'd recommend going through those.
[02:38:48] freudenshade: thanks, i appreciate that
[02:39:08] freudenshade: I've been using rubymonks mainly
[02:39:30] Bloomer: has joined #ruby
[02:43:36] Rodya_: has joined #ruby
[02:43:41] wolffles: ruby monks is pretty good
[02:44:21] wolffles: i just found out about projecteluer.net more complicated problems
[02:44:42] blackmes1: has joined #ruby
[02:44:44] Ox0dea: wolffles: Did you do #54?
[02:44:54] pawnbox: has joined #ruby
[02:45:02] wolffles: im struggling wiht number 4 in the archives :/
[02:45:23] wolffles: speaking of which i need some help finding a simpler way to do this problem??? i couldnt figure out which methods to use so i did it logically.
[02:45:30] wolffles: https://eval.in/503577
[02:46:11] ledestin: has joined #ruby
[02:46:22] Ox0dea: wolffles: https://eval.in/503578
[02:47:22] wolffles: you make it seem so easy :[
[02:47:39] sandstrom: has joined #ruby
[02:48:03] flughafen: has joined #ruby
[02:48:14] djbkd: has joined #ruby
[02:48:56] Ox0dea: Well, whenever you've got a nested loop, you probably want #product instead.
[02:49:18] Ox0dea: >> %i[a b c].product [1,2,3]
[02:49:19] ruby[bot]: Ox0dea: # => [[:a, 1], [:a, 2], [:a, 3], [:b, 1], [:b, 2], [:b, 3], [:c, 1], [:c, 2], [:c, 3]] (https://eval.in/503579)
[02:49:20] guacamole: has joined #ruby
[02:51:08] houhoulis: has joined #ruby
[02:53:03] Ox0dea: I dug up my #54 C solution: https://eval.in/503581
[02:53:06] freudenshade: Ox0dea: That is cool
[02:53:12] freudenshade: I did not know the bot could do that
[02:53:34] Ox0dea: freudenshade: Please be advised that it is for demonstration purposes, not experimentation.
[02:53:36] [Kicker]: has joined #ruby
[02:55:05] wolffles: Ox0dea: i just saw your #54 and i dont understand half of it :/
[02:55:26] Ox0dea: wolffles: Well, do you know C?
[02:55:45] iateadonut: has joined #ruby
[02:55:59] Ox0dea: Really bad C.
[02:56:08] Ox0dea: But it's duper-fast.
[02:56:36] victortyau: has joined #ruby
[02:58:27] ixti: has joined #ruby
[02:58:49] freudenshade: Ox0dea: I know C, what are you tryig to do?
[02:58:51] hannelita: has joined #ruby
[02:58:52] freudenshade: Winning hand of poker?
[02:59:06] B1n4r10: has joined #ruby
[02:59:32] hxegon: has joined #ruby
[02:59:49] freudenshade: Nope, it's not poker
[03:00:07] Antiarc: has joined #ruby
[03:02:52] davedev24: has joined #ruby
[03:03:03] pdoherty: has joined #ruby
[03:04:54] RobertBirnie: has joined #ruby
[03:05:01] sandstrom: has joined #ruby
[03:05:15] A124: has joined #ruby
[03:05:15] krz: has joined #ruby
[03:05:19] howdoicomputer: has joined #ruby
[03:07:55] RobertBirnie: has joined #ruby
[03:11:46] guacamole: has joined #ruby
[03:12:08] jamw: has joined #ruby
[03:13:09] CloCkWeRX: has joined #ruby
[03:14:09] al2o3-cr: has joined #ruby
[03:14:14] rkazak: has joined #ruby
[03:14:17] chouhoulis: has joined #ruby
[03:16:26] shevy: so much verbose!
[03:18:56] Xeago: has joined #ruby
[03:22:12] sandstrom: has joined #ruby
[03:23:26] northfurr: has joined #ruby
[03:23:30] hxegon: has joined #ruby
[03:24:20] wolffles: has joined #ruby
[03:26:57] B1n4r10: has joined #ruby
[03:31:02] hxegon: has joined #ruby
[03:32:32] pdoherty: has joined #ruby
[03:34:18] graffix222: has joined #ruby
[03:34:46] freudenshade: has left #ruby: ()
[03:36:57] Sperant: has joined #ruby
[03:38:45] hypermist: has left #ruby: ("Leaving")
[03:39:28] sandstrom: has joined #ruby
[03:43:16] krz: has joined #ruby
[03:44:51] baweaver: has joined #ruby
[03:47:44] blackmes1: has joined #ruby
[03:52:28] asccigcc: has joined #ruby
[03:52:37] adam_: Is there an elegant way to scanf a TCP socket? Netstrings style ("11:Hello World", where 11 is length to read)
[03:54:27] graffix222: has joined #ruby
[03:55:35] dlitvak: has joined #ruby
[03:56:03] dlitvak: has joined #ruby
[03:57:01] sandstrom: has joined #ruby
[03:58:32] mfb2: has joined #ruby
[03:59:32] hannelita: has joined #ruby
[04:00:04] Ox0dea: >> require 'scanf'; require 'socket'; TCPSocket.instance_method :scanf # adam_
[04:00:05] ruby[bot]: Ox0dea: # => #<UnboundMethod: TCPSocket(IO)#scanf> (https://eval.in/503605)
[04:00:25] adam_: Thanks. I used scanf in a prototype but it looks like it might be discarding the entire line
[04:00:56] marcdel: has joined #ruby
[04:03:56] Ivision: has joined #ruby
[04:04:39] arup_r: has joined #ruby
[04:06:06] sankaber: has joined #ruby
[04:08:40] Sperant: has joined #ruby
[04:10:55] hahuang65: has joined #ruby
[04:11:49] Ox0dea: adam_: Well, that sucks. https://git.io/vzWXV
[04:12:17] Ox0dea: It does buffer the line such that it can be searched for subsequent matches, but it's definitely eating it. :<
[04:12:58] d0nn1e: has joined #ruby
[04:13:55] adam_: I have a "solution" now using pack/unpack
[04:14:22] adam_: but broken when considering it doesn't follow netstrings protocol (http://cr.yp.to/proto/netstrings.txt)
[04:14:32] adam_: Just thought I was losing my mind with scanf ;)
[04:15:01] chouhoulis: has joined #ruby
[04:15:10] braincrash: has joined #ruby
[04:15:58] KnownSyntax: has joined #ruby
[04:16:04] KnownSyntax: has joined #ruby
[04:20:35] djbkd: has joined #ruby
[04:20:57] djbkd: has joined #ruby
[04:21:28] victortyau: has joined #ruby
[04:23:54] krz: has joined #ruby
[04:24:37] tildes: has joined #ruby
[04:24:55] al2o3-cr: has joined #ruby
[04:27:25] stannard: has joined #ruby
[04:30:38] mistermocha: has joined #ruby
[04:31:28] sandstrom: has joined #ruby
[04:32:25] janebootydoe: has joined #ruby
[04:32:54] dlitvak: has joined #ruby
[04:34:05] baweaver: has joined #ruby
[04:34:21] gregf: has joined #ruby
[04:34:46] lemur: has joined #ruby
[04:35:26] pawnbox: has joined #ruby
[04:35:53] pawnbox: has joined #ruby
[04:36:26] colegatron: has joined #ruby
[04:37:36] asccigcc: has joined #ruby
[04:38:27] B1n4r10: has joined #ruby
[04:38:43] al2o3-cr: has joined #ruby
[04:39:07] al2o3-cr: has joined #ruby
[04:40:55] al2o3-cr: has joined #ruby
[04:41:47] al2o3-cr: has joined #ruby
[04:42:32] allencs: has joined #ruby
[04:46:51] codecop: has joined #ruby
[04:48:44] sandstrom: has joined #ruby
[04:48:47] BSab: has joined #ruby
[04:50:16] rkazak: has joined #ruby
[04:50:50] blackmes1: has joined #ruby
[04:54:21] guacamole: has joined #ruby
[04:54:35] B1n4r10: has joined #ruby
[04:54:42] Ebok: has joined #ruby
[04:55:09] yeticry: has joined #ruby
[04:55:19] Ebok: has joined #ruby
[04:55:25] marcdel: has joined #ruby
[04:55:37] tmtwd: has joined #ruby
[04:57:09] gix: has joined #ruby
[04:59:57] al2o3-cr: has joined #ruby
[05:00:15] hannelita: has joined #ruby
[05:00:58] dfinninger: has joined #ruby
[05:02:05] Sperant: has joined #ruby
[05:02:14] al2o3-cr: has joined #ruby
[05:02:18] usershell: has joined #ruby
[05:02:20] dnewkerk: has joined #ruby
[05:03:47] stannard: has joined #ruby
[05:06:02] sandstrom: has joined #ruby
[05:06:03] dlitvak: has joined #ruby
[05:06:05] howdoicomputer: has joined #ruby
[05:06:15] agentmeerkat: has joined #ruby
[05:08:46] blackmes1: has joined #ruby
[05:09:03] dlitvak_: has joined #ruby
[05:09:27] bronson: has joined #ruby
[05:13:13] al2o3-cr: has joined #ruby
[05:15:44] chouhoulis: has joined #ruby
[05:18:53] adam_: Ox0dea: I fixed my problem by using `gets(':')`. Not super ideal, but an acceptable stopgap. (re: scanf on socket)
[05:19:07] Ox0dea: adam_: Ah, yep, that'd do it.
[05:19:15] rhg135: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[05:20:00] Ox0dea: I always forget that #gets can behave like StringScanner.
[05:21:36] rhg135: has joined #ruby
[05:21:55] marcdel: has joined #ruby
[05:22:20] usershell: has joined #ruby
[05:22:31] marcdel: has joined #ruby
[05:22:51] usershell: has joined #ruby
[05:23:13] sandstrom: has joined #ruby
[05:25:14] gregf: has joined #ruby
[05:29:58] etqqkoiflwhb: has joined #ruby
[05:30:24] etqqkoiflwhb: has joined #ruby
[05:31:44] st0opkid: has joined #ruby
[05:32:23] etqqkoiflwhb: has joined #ruby
[05:34:03] etqqkoiflwhb: has joined #ruby
[05:34:11] baweaver: has joined #ruby
[05:37:39] astrobun_: has joined #ruby
[05:37:50] krz: has joined #ruby
[05:40:15] akem: has joined #ruby
[05:40:26] sandstrom: has joined #ruby
[05:45:57] baweaver: has joined #ruby
[05:47:00] davedev24: has joined #ruby
[05:47:20] baweaver: has joined #ruby
[05:48:11] stevemackinnon: has joined #ruby
[05:50:55] kknight: has joined #ruby
[05:52:05] kknight: how to Implement a server rquest in Ruby any solid link?
[05:53:30] dlitvak: has joined #ruby
[05:53:40] asccigcc: has joined #ruby
[05:56:19] pawnbox: has joined #ruby
[05:57:51] guacamole: has joined #ruby
[05:58:01] sandstrom: has joined #ruby
[05:58:45] ss_much: has joined #ruby
[05:59:20] Sperant: has joined #ruby
[06:01:01] akem: has joined #ruby
[06:01:05] hannelita: has joined #ruby
[06:01:21] akem: has joined #ruby
[06:01:52] ur5us: has joined #ruby
[06:03:34] pawnbox: has joined #ruby
[06:07:21] sigurding: has joined #ruby
[06:09:41] gregf: has joined #ruby
[06:10:13] last_staff: has joined #ruby
[06:12:47] norc: has joined #ruby
[06:14:00] zeros0623: has joined #ruby
[06:15:14] sandstrom: has joined #ruby
[06:16:14] techsethi: has joined #ruby
[06:16:30] chouhoulis: has joined #ruby
[06:17:58] norc: Ox0dea: https://github.com/ruby/ruby/blob/trunk/regexec.c
[06:18:00] norc: Talk about magic.
[06:18:17] TTilus: kknight: you want to make a http request?
[06:18:19] norc: That is about the best documented portion that I have seen.
[06:18:20] Ox0dea: norc: Where do I start?
[06:18:21] TTilus: kknight: http://www.rubyinside.com/nethttp-cheat-sheet-2940.html
[06:18:26] skade: has joined #ruby
[06:18:32] dlitvak: has joined #ruby
[06:18:39] norc: Oh just skim it through.
[06:18:57] norc: Also, gotta leave the train. be back in 15 minutes.
[06:19:26] NoTroutAboutIt: has joined #ruby
[06:21:51] C0deMaver1ck: has joined #ruby
[06:22:56] pawnbox: has joined #ruby
[06:23:17] NoTroutAboutIt: Can anyone here help my figure out why my attempt to permit params from multiple controllers is not working?
[06:23:48] NoTroutAboutIt: Easiest way to share my code is to probably share the stackoverflow question I just posted http://stackoverflow.com/questions/34848277/permitting-params-in-rails-when-form-references-multiple-models
[06:24:35] Radar: ?rails NoTroutAboutIt
[06:24:35] ruby[bot]: NoTroutAboutIt: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[06:24:37] arup_r: has joined #ruby
[06:25:23] NoTroutAboutIt: I guess I should go to the rubyonrails chat
[06:25:55] asccigcc: has joined #ruby
[06:28:37] pawnbox: has joined #ruby
[06:29:08] skade: has joined #ruby
[06:29:47] osvimer: has joined #ruby
[06:32:26] sandstrom: has joined #ruby
[06:33:26] kknight: msg TTilus
[06:33:33] kknight: TTilus: yes
[06:39:38] darkf: has joined #ruby
[06:40:16] BTRE: has joined #ruby
[06:42:05] solars: has joined #ruby
[06:42:23] Ishido: has joined #ruby
[06:42:48] c0ncealed: has joined #ruby
[06:43:08] JamieD: has joined #ruby
[06:43:51] wolffles: has joined #ruby
[06:44:48] Xzanron: has joined #ruby
[06:45:04] tmtwd: has joined #ruby
[06:47:23] asccigcc: has joined #ruby
[06:47:44] blackmes1: has joined #ruby
[06:49:03] claw: has joined #ruby
[06:49:40] sandstrom: has joined #ruby
[06:49:57] ympeg: has joined #ruby
[06:50:17] krz: has joined #ruby
[06:51:24] rkazak: has joined #ruby
[06:53:10] dlitvak: has joined #ruby
[06:53:15] LMity: has joined #ruby
[06:55:58] carraroj: has joined #ruby
[06:59:57] rakm: has joined #ruby
[07:02:04] hannelita: has joined #ruby
[08:44:36] helpa: has joined #ruby
[08:45:30] beardsley: no, it's wacky
[08:45:47] beardsley: .any? implies that we're looking at elements
[08:45:56] beardsley: and no elements should be an obvious "no"
[08:46:09] Ox0dea: The bot didn't answer you, silly.
[08:46:11] beardsley: if it was "anything_in_there_falsy?" then it's cool
[08:46:31] Ox0dea: [].any? is false, [].all? is true.
[08:47:04] Ox0dea: Close one.
[08:47:48] blackmes1: has joined #ruby
[08:48:01] beardsley: I felt as though I'd entered a domain of impossible geometry
[08:53:50] helpa: has joined #ruby
[08:54:03] helpa: has joined #ruby
[08:54:12] beardsley: papers, please
[08:54:41] Radar: has joined #ruby
[08:54:45] User458764: has joined #ruby
[08:54:47] beardsley: wow, been a while since being on IRC. Guess noone #trivia's anymore...
[08:55:05] beardsley: not a *massive* loss, I suppose
[08:55:44] Radar: hi beardsley
[08:56:38] Ox0dea: beardsley: Come play Hangman in #ruby-offtopic?
[08:57:14] beardsley: meh. too late in the evening/morning/midday
[08:57:29] Ox0dea: But you were gonna play trivia?
[08:57:46] beardsley: no, just checked it out and noticed noone was tehre
[08:58:14] Ox0dea: Who is this noone guy?
[08:58:37] Ox0dea: I always pronounce that "new knee".
[08:58:45] Radar: Do you two have history?
[08:58:50] Radar: noone and beardsley I mean.
[08:58:51] Radar: Sounds like it.
[08:59:13] aspiers: has joined #ruby
[08:59:54] scepticulous: has joined #ruby
[09:00:25] hannelita: has joined #ruby
[09:02:09] mikecmpbll: has joined #ruby
[09:03:21] tesuji: has joined #ruby
[09:05:04] f4cl3y: has joined #ruby
[09:07:34] howdoicomputer: has joined #ruby
[09:10:45] pandaant: has joined #ruby
[09:14:01] drptbl: has joined #ruby
[09:16:12] beardsley: has joined #ruby
[09:16:18] beardsley: >> nil.nil?
[09:16:19] ruby[bot]: beardsley: # => true (https://eval.in/503680)
[09:18:47] chouhoulis: has joined #ruby
[09:19:11] sftrabbit: has joined #ruby
[09:22:21] mark3: has joined #ruby
[09:22:29] DoubleMalt: has joined #ruby
[09:22:56] snowy: has joined #ruby
[09:24:18] benhuda: has joined #ruby
[09:25:07] iskander: has joined #ruby
[09:25:40] techsethi: has joined #ruby
[09:32:24] marcdel: has joined #ruby
[09:33:20] Xeago: has joined #ruby
[09:34:18] howdoi: has joined #ruby
[09:36:02] dmolina: has joined #ruby
[09:36:43] c0m0: has joined #ruby
[09:37:18] skade: has joined #ruby
[09:38:00] beardsley: has joined #ruby
[09:40:12] tvw: has joined #ruby
[09:40:49] krz: has joined #ruby
[09:41:02] rdark: has joined #ruby
[09:45:38] marr: has joined #ruby
[09:47:31] blur3d: has joined #ruby
[09:48:08] Pupeno: has joined #ruby
[09:48:08] Pupeno: has joined #ruby
[09:49:08] blackmes1: has joined #ruby
[09:52:16] djbkd: has joined #ruby
[09:54:06] dwfait: has joined #ruby
[09:54:20] User458764: has joined #ruby
[09:56:43] f4cl3y: has joined #ruby
[09:56:54] Xeago: has joined #ruby
[09:57:05] huyderman: has joined #ruby
[10:00:20] neoliis: has joined #ruby
[10:01:16] FernandoBasso: has joined #ruby
[10:02:04] einarj: has joined #ruby
[10:05:25] FernandoBasso1: has joined #ruby
[10:05:33] last_staff: has joined #ruby
[10:05:43] Maxona: has joined #ruby
[10:05:44] grasshopper: has joined #ruby
[10:06:10] jaiks: has joined #ruby
[10:10:29] oo7cat: i can manipulate com of microsoft by ruby?
[10:10:53] jhass: most likely
[10:11:16] oo7cat: you can give me link that related with
[10:11:25] jhass: sure, http://google.com
[10:11:44] oo7cat: microsoft com ruby
[10:11:51] oo7cat: i can???t find result
[10:12:04] jhass: !enable Google
[10:12:13] jhass: ah right, not here
[10:12:52] drptbl: has joined #ruby
[10:12:53] jhass: try to think of other terms?
[10:12:55] oo7cat: i type ???microsoft com ruby??? on the google search windows
[10:13:00] sepp2k: has joined #ruby
[10:13:52] jhass: type something else if that doesn't yield anything useful?
[10:13:54] jhass: https://rubygems.org/gems/windows-api/
[10:14:07] oo7cat: i can???t find it with ???ruby com???
[10:14:14] jhass: took me one and a half minute on google because I have no clue about this stuff
[10:14:53] jhass: use windows com api ruby
[10:15:11] pawnbox: has joined #ruby
[10:15:15] jhass: that's what I ended up searching
[10:15:53] norc: has joined #ruby
[10:15:57] oo7cat: gem install windows-api <?????? if i type like this, then i can install win32 api?
[10:16:06] jamw: has joined #ruby
[10:16:08] norc: apeiros: Damn I should not have touched El Capitan...
[10:16:19] rodfersou: has joined #ruby
[10:16:34] norc: Getting the most bizarre behavior with ruby-oci8 now, different from what you experienced.
[10:17:37] jhass: oo7cat: http://ruby-community.com/pages/user_rules#rule_2_2 and http://ruby-community.com/pages/user_rules#rule_2_3
[10:17:43] jhass: please stop violating our channel rules
[10:18:19] joonty: has joined #ruby
[10:18:51] tomphp: has joined #ruby
[10:19:22] Sperant: has joined #ruby
[10:19:32] chouhoulis: has joined #ruby
[10:19:45] Xeago: has joined #ruby
[10:21:09] karapetyan: has joined #ruby
[10:23:02] karapetyan: has joined #ruby
[10:24:21] karapetyan: has joined #ruby
[10:24:55] sonOfRa: has joined #ruby
[10:25:59] Eising: hmm, I seem to have a gem in my Gemfile that pulls a specific version of json as dependency, and that specific version fails to build with the ruby 2.3 docker I'm running. Any idea what I could do to find out which one it is?
[10:26:23] skade: has joined #ruby
[10:26:35] marcdel: has joined #ruby
[10:26:54] jhass: which version? bundle show json, bundle list | grep json or just look at your Gemfile.lock
[10:27:15] jhass: or which gem pulls it in as dependency?
[10:27:25] Eising: jhass: http://pastie.org/10693258
[10:27:26] jhass: in that case looking at the Gemfile.lock is the easiest IMO
[10:27:32] spooq: has joined #ruby
[10:28:15] Eising: jhass: ah, Gemfile.lock might give me the answer. Didn't think of that
[10:28:17] arup_r: has joined #ruby
[10:29:55] ldnunes: has joined #ruby
[10:30:08] Eising: jhass: but this is actually weird. Let me pastebin the Gemfile.lock
[10:31:00] skade: has joined #ruby
[10:31:14] Eising: https://gist.github.com/Eising/a67b3357bddc5f038a50
[10:31:22] Eising: (pastie is unstable)
[10:32:01] Eising: there's only one mention of json and that's as (1.8.1)
[10:32:26] Eising: but the newest is 1.8.3, and that is the one that will be installed with gem install...
[10:32:36] stamina: has joined #ruby
[10:32:57] Eising: Furthermore the Gemfile only wants 'json', no specific version
[10:34:08] User458764: has joined #ruby
[10:36:32] DirtyFInn: has joined #ruby
[10:37:19] jhass: Eising: that's just bundler doing its job
[10:37:25] jhass: run bundle update json if you want to update it
[10:37:31] colegatron: has joined #ruby
[10:37:53] binaryplease: has joined #ruby
[10:39:43] tagrudev: has joined #ruby
[10:41:16] hannelita: has joined #ruby
[10:41:23] binaryplease: has joined #ruby
[10:44:33] lipoqil: has joined #ruby
[10:45:16] skade: has joined #ruby
[10:45:57] last_staff: has joined #ruby
[10:47:43] jottr: has joined #ruby
[10:59:05] CloCkWeRX: has joined #ruby
[11:00:02] usershell: has joined #ruby
[11:00:21] lxsameer: has joined #ruby
[11:01:32] platzhirsch: has joined #ruby
[11:02:57] blackgoat: has joined #ruby
[11:03:18] slackR: has joined #ruby
[11:05:09] dlitvak: has joined #ruby
[11:05:40] DefV: I have a specific method that I'm trying to improve memory usage on. Is there some way to benchmark this? Something I can wrap around the method call that gives me memory allocated / GC run etc, so I can see improvement?
[11:07:13] yorickpeterse: DefV: https://github.com/ko1/allocation_tracer, https://gitlab.com/gitlab-org/allocations (only gives counts), stuff like GC.stat
[11:08:20] howdoicomputer: has joined #ruby
[11:14:32] bronson: has joined #ruby
[11:15:14] fsapo: has joined #ruby
[11:16:47] blackmes1: has joined #ruby
[11:19:12] VaibhavRajput: has joined #ruby
[11:19:49] Coldblackice: has joined #ruby
[11:20:17] chouhoulis: has joined #ruby
[11:20:55] marcdel: has joined #ruby
[11:21:15] VaibhavRajput: Are there any way to upload file (multipart_part post form) with only Net::HTTP::Post
[11:22:35] dlitvak: has joined #ruby
[11:23:44] adaedra: ?crosspost
[11:23:44] ruby[bot]: Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[11:26:41] rns: has joined #ruby
[11:27:20] f4cl3y: has joined #ruby
[11:31:07] FernandoBasso: has joined #ruby
[11:32:50] FooMunki: has joined #ruby
[11:33:00] dlitvak_: has joined #ruby
[11:33:38] FernandoBasso1: has joined #ruby
[11:33:51] yfeldblum: has joined #ruby
[11:35:35] Ropeney: has joined #ruby
[11:36:34] codecop: has joined #ruby
[11:36:51] x0F: has joined #ruby
[11:40:55] blackmesa: has joined #ruby
[11:42:12] myntcake: has joined #ruby
[11:43:54] techsethi: has joined #ruby
[11:44:01] al2o3-cr: has joined #ruby
[11:45:35] karapetyan: has joined #ruby
[11:49:25] SamGerber: has joined #ruby
[11:50:16] SamGerber: Anyone been forced to track down a mutable hash key bug irl? Is there a way to safely use arrays as hash keys? https://gist.github.com/SamGerber/8f0a5abb7133f649d188
[11:51:17] sunslide: has joined #ruby
[11:53:40] sunslide: hi guys, could use some very basic help with threads, I'm not sure how to return a value from a thread (using the 'thread' lib) as I can't really return a value from the callback nor can I pass it a variable by reference, anyone with a tip?
[11:59:41] Kijkek: has joined #ruby
[12:00:16] Mon_Ouie: You can call Thread#value to get the value of the block that was executed in the thread (if the thread isn't done running, this causes it to wait)
[12:00:28] Mon_Ouie: this causes the calling thread to wait*
[12:02:36] dlitvak: has joined #ruby
[12:03:48] TomyWork: is anyone aware of a library that can walk remote commits, either via normal git protocols or via the gitlab api? kinda like rugged, just remote
[12:04:31] TomyWork: right now I'm using rugged and I just run it locally on the gitlab server
[12:07:13] sunslide: Mon_Ouie: thanks for your help man! do you have any idea how I can make this asynchronous? like maybe with a global variable or anything else?
[12:07:29] skade: has joined #ruby
[12:09:08] spooq: has joined #ruby
[12:11:04] Xeago: has joined #ruby
[12:11:32] ferr: has joined #ruby
[12:14:25] usershell: has joined #ruby
[12:14:40] dmst: has joined #ruby
[12:15:06] marcdel: has joined #ruby
[12:16:51] jamw: has joined #ruby
[12:18:13] jhass: samgerber: I yet have to find a good usecase to use an array as hash key
[12:18:31] jhass: but if you do and don't freeze them you basically want to call .rehash all the time, so meh
[12:18:52] SamGerber: jhass: Thanks! I'll go read about .rehash!!
[12:19:34] jhass: samgerber: I think you rather should think about why you think you need an array as hash key, as said usually you don't and if you do I'd be really curious as to why you think you do
[12:20:00] dlitvak_: has joined #ruby
[12:21:03] chouhoulis: has joined #ruby
[12:21:07] jhass: TomyWork: I don't think "normal git protocols" even allow that
[12:21:34] tvw: has joined #ruby
[12:22:15] lucasb: has joined #ruby
[12:22:37] Jardayn: has joined #ruby
[12:22:56] SamGerber: jhass: I don't think I need them; just trying to soak up information at this point. Now I know not to use arrays as hash keys. Thanks!
[12:23:20] kobain: has joined #ruby
[12:26:22] Xeago: has joined #ruby
[12:27:29] binaryplease: has joined #ruby
[12:27:48] Miuers: has joined #ruby
[12:27:53] TomyWork: jhass well a commit is an object. the normal git protocols should support querying objects, right?
[12:28:00] TomyWork: the dumb http protocol at least *g*
[12:28:11] jhass: afaik they only support downloading them
[12:28:32] c355E3B: has joined #ruby
[12:28:37] jhass: "give me the object id for this ref" and "give me everything from this object id to this object id"
[12:29:11] sftrabbit: has joined #ruby
[12:29:35] oo7cat: has left #ruby: ()
[12:30:45] TomyWork: should be enough
[12:31:02] TomyWork: unless "from A to A" means nothing
[12:31:07] jhass: well, where ref is basic, not stuff like HEAD~50
[12:31:37] ereslibre: has joined #ruby
[12:31:38] ereslibre: has joined #ruby
[12:32:33] jhass: so you'd always have at least a shallow clone I guess
[12:32:44] jhass: and then work on that locally
[12:32:55] jhass: requires some disk/ramdisk space still
[12:33:20] dlitvak: has joined #ruby
[12:34:13] aryaching: has joined #ruby
[12:35:09] sigurding: has joined #ruby
[12:37:48] dwfait: has joined #ruby
[12:38:44] brendan-: has joined #ruby
[12:39:10] f4cl3y: has joined #ruby
[12:45:27] casadei: has joined #ruby
[12:46:30] krz: has joined #ruby
[12:47:59] snowy: has joined #ruby
[12:49:35] dlitvak: has joined #ruby
[12:49:47] aupadhye: has joined #ruby
[12:52:10] snowy: has joined #ruby
[12:52:23] dwfait: has joined #ruby
[12:54:51] blackmesa: has joined #ruby
[12:55:45] TomPeed: has joined #ruby
[12:56:36] shinnya: has joined #ruby
[13:01:06] sigurding: has joined #ruby
[13:01:34] konsolebox: has joined #ruby
[13:03:09] sdothum: has joined #ruby
[13:06:08] hxegon: has joined #ruby
[13:07:52] dlitvak: has joined #ruby
[13:08:58] marcdel: has joined #ruby
[13:09:08] howdoicomputer: has joined #ruby
[13:10:21] FernandoBasso: has joined #ruby
[13:10:22] dwfait: has joined #ruby
[13:11:53] benhuda: has joined #ruby
[13:14:59] GinoManWorks: has joined #ruby
[13:15:04] emilford: has joined #ruby
[13:15:16] snowy: has joined #ruby
[13:18:26] dlitvak_: has joined #ruby
[13:19:12] dorei: has joined #ruby
[13:20:59] krz: has joined #ruby
[13:21:48] chouhoulis: has joined #ruby
[13:22:11] FernandoBasso1: has joined #ruby
[13:22:12] gagrio: has joined #ruby
[13:23:18] skade: has joined #ruby
[13:25:20] govg: has joined #ruby
[13:25:28] sankaber: has joined #ruby
[13:25:49] futilegames_: has joined #ruby
[13:35:27] usershell: has joined #ruby
[13:38:08] pdoherty: has joined #ruby
[13:43:20] ghox: has joined #ruby
[13:44:13] phredus: has joined #ruby
[13:44:55] sftrabbit: has joined #ruby
[13:45:33] grxpwa: has joined #ruby
[13:47:51] emilford: has joined #ruby
[13:49:12] dlitvak: has joined #ruby
[13:50:22] futilegames: has joined #ruby
[13:51:17] jghgh: has joined #ruby
[13:52:16] arup_r: has joined #ruby
[13:54:13] frozen3: has joined #ruby
[13:56:37] krobzaur: has joined #ruby
[13:56:42] disconnekted: has joined #ruby
[13:56:52] ramortegui: has joined #ruby
[13:57:42] futilegames_: has joined #ruby
[14:00:47] kalopsian: has joined #ruby
[14:02:07] floatingpoint: has joined #ruby
[14:03:13] marcdel: has joined #ruby
[14:04:43] benjohn: has joined #ruby
[14:06:43] steffkes: has joined #ruby
[14:07:12] futilegames: has joined #ruby
[14:07:25] myntcake: has joined #ruby
[14:09:38] osvimer: has joined #ruby
[14:10:42] B1n4r10: has joined #ruby
[14:12:54] steffkes: has joined #ruby
[14:14:22] stevenhaddox: has joined #ruby
[14:15:30] mfb2: has joined #ruby
[14:17:08] TomPeed: has joined #ruby
[14:17:23] bronson: has joined #ruby
[14:17:33] jamw: has joined #ruby
[14:17:57] aegis3121: has joined #ruby
[14:18:28] atomical: has joined #ruby
[14:18:46] mfb2_: has joined #ruby
[14:20:05] User458764: has joined #ruby
[14:22:29] chouhoulis: has joined #ruby
[14:22:42] ghox_: has joined #ruby
[14:24:10] ixti: has joined #ruby
[14:24:54] Polysics: has joined #ruby
[14:28:49] dfinninger: has joined #ruby
[14:29:44] hxegon: that feeling when you scrap 6 hours of work, rewrite it in 2 hours and its 100 * better :D
[14:29:58] Xeago: has joined #ruby
[14:31:01] nickjj: hxegon, welcome to programming
[14:31:41] hxegon: I've been here a while, but it can be like looking for a light switch in a dark room sometimes. pretty nice when you find it though.
[14:34:42] nickjj: i still go through similar things too
[14:35:22] nickjj: write code -> make it work -> if it's worth it then make it better/more maintainable/etc.
[14:36:12] stevenhaddox: This is pretty much the whole point of red -> green -> refactor. Our second time through will almost always be cleaner and worth the effort.
[14:37:16] kerunaru: has joined #ruby
[14:37:54] hxegon: stevenhaddox finally got the diff between tdd and bdd and it's making my life so much simpler :)
[14:38:25] stevenhaddox: hxegon: I think that line varies from person to person, but I loved that moment for me personally.
[14:39:13] hehnope: has joined #ruby
[14:39:24] hehnope: anyone run activerecord behind pgpool with load balancing?
[14:40:47] freerobby: has joined #ruby
[14:41:32] northfurr: has joined #ruby
[14:41:45] floatingpoint: has joined #ruby
[14:42:16] Legit: has left #ruby: ("Leaving")
[14:43:31] dlitvak: has joined #ruby
[14:43:50] B1n4r10: has joined #ruby
[14:45:14] Carella: has joined #ruby
[14:49:02] Jardayn: has joined #ruby
[14:49:05] hxegon: is this a rails question, or just a general postgres question hehnope
[14:49:23] hxegon: ?rails hehnope
[14:49:23] ruby[bot]: hehnope: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[14:49:29] TomPeed: has joined #ruby
[14:49:37] hehnope: has left #ruby: ()
[14:49:40] hxegon: probably have better luck there
[14:49:54] victortyau: has joined #ruby
[14:51:06] fmcgeough: has joined #ruby
[14:53:00] nerfando: has joined #ruby
[14:53:02] pawnbox: has joined #ruby
[14:53:46] pawnbox: has joined #ruby
[14:54:07] nerfando: has joined #ruby
[14:55:23] gagrio: has joined #ruby
[14:55:55] weemsledeux: has joined #ruby
[14:56:48] minimalism: has joined #ruby
[14:57:26] marcdel: has joined #ruby
[14:57:45] CloCkWeRX: has left #ruby: ()
[14:57:48] decoponio: has joined #ruby
[15:01:07] Xzanron_: has joined #ruby
[15:02:05] floatingpoint: has joined #ruby
[15:03:45] aegis3121: has joined #ruby
[15:05:16] skade: has joined #ruby
[15:06:25] steffkes: has joined #ruby
[15:06:26] steffkes: has joined #ruby
[15:07:06] imperator: has joined #ruby
[15:07:47] imperator: Anyone here have an HP-UX box I could have a dev account on? I'd like to port some C code to FFI, but have no way to test it.
[15:08:10] roshanavand: has joined #ruby
[15:09:15] roshanavand: has joined #ruby
[15:09:49] howdoicomputer: has joined #ruby
[15:11:01] dionysus69: has joined #ruby
[15:11:39] troulouliou_div2: has joined #ruby
[15:12:11] Carella: has joined #ruby
[15:13:03] Mirza: has joined #ruby
[15:14:47] dlitvak: has joined #ruby
[15:16:20] ghox: has joined #ruby
[15:20:43] Polysics_: has joined #ruby
[15:21:18] steffkes: has joined #ruby
[15:22:12] Frem: has joined #ruby
[15:23:19] chouhoulis: has joined #ruby
[15:23:55] j_mcnally: has joined #ruby
[15:23:58] mfb2: has joined #ruby
[15:24:29] roshanav_: has joined #ruby
[15:26:32] usershell: has joined #ruby
[15:27:06] Polysics: has joined #ruby
[15:29:27] carraroj: has joined #ruby
[15:29:36] eyesnot: has joined #ruby
[15:31:16] casadei: has joined #ruby
[15:32:12] Azulinho: has joined #ruby
[15:32:39] mrtomme: has joined #ruby
[15:39:24] Gasher: has joined #ruby
[15:39:35] Gasher: Hi, what's up with the whole 1.9.3 vs 2.* thing?
[15:39:47] ericwood_: Gasher: you should upgrade to 2
[15:39:52] ericwood_: 1.9.3 is EOL
[15:40:25] Gasher: I'm looking at a hosting website and they have the 1.9.3 only limitation of Ruby.
[15:40:45] ericwood_: doesn't sound like a very good website host, then
[15:40:54] ericwood_: hate to say it but that's kind of ridiculouus
[15:41:17] Gasher: ericwood_; It's one of the leading ones, gandi.net
[15:41:23] aegis3121: has joined #ruby
[15:41:27] oo7cat: has joined #ruby
[15:42:15] oo7cat: who live in us? today is holiday in us?
[15:42:22] ericwood_: oo7cat: MLK day
[15:42:31] aegis3121: Martin Luther King Jr. Day
[15:42:32] oo7cat: i don???t know?
[15:42:45] oo7cat: Martin Luther King Jr. Day is holiday?
[15:43:02] aegis3121: Federal and State. Some schools, some businesses.
[15:43:04] oo7cat: thanks aegis3121 and ericwood_ :)
[15:43:21] oo7cat: thanks for information.
[15:43:39] ericwood_: Gasher: 1.9.3 as a requirement seems so irresponsible
[15:44:11] ericwood_: Gasher: 1.9.3 no longer receives security updates: https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/
[15:44:13] TomPeed: has joined #ruby
[15:44:27] ericwood_: and it hasn't for nearly a year now...you might want to look for another host :|
[15:45:01] depesz: has joined #ruby
[15:45:22] hightower2: has joined #ruby
[15:45:26] babblebre: has joined #ruby
[15:45:43] Gasher: I just thought about changing my sites to one site, gandi offers domains, VPSes and shared hosting.
[15:45:56] depesz: hi. i'm hitting strange thing. It looks that when I have "class Discover::AWS", and in that class, I do: ec2 = Aws::EC2::Client.new() - ruby tried to load Discover::AWS::Aws (and probably Discover::AWS::Aws::EC2::Client
[15:46:01] depesz: any idea on why this might be?
[15:46:20] agentmeerkat: has joined #ruby
[15:46:31] Carella: has joined #ruby
[15:47:18] Gasher: What was the change from Ruby 1 to Ruby 2 anyway?
[15:47:44] tvw: has joined #ruby
[15:47:48] tenderlove: has joined #ruby
[15:49:18] ericwood_: Gasher: quite a few things...google "ruby 1.9.3 vs ruby 2" and you'll get a bunch of stuff
[15:49:24] ericwood_: too many things to list out here
[15:49:36] depesz: example: http://fpaste.org/312003/31321711/
[15:49:38] ericwood_: but regardless, 1.9.3 as a requirement is irresponsible and a red flag
[15:50:11] dlitvak_: has joined #ruby
[15:50:23] User458764: has joined #ruby
[15:51:11] havenwood: Gasher: Think of 1.9.3 as a release candidate for 2.0.
[15:51:13] User458764: has joined #ruby
[15:51:16] workmad3: depesz: constant lookup (e.g. Aws::EC2::Client) starts in the current scope and unwinds to the top... if the constant isn't found, ruby will raise an error with the current scope prefixed to the constant
[15:51:17] Carella: has joined #ruby
[15:51:27] marcdel: has joined #ruby
[15:51:51] depesz: workmad3: ok, how can I make it use "global" Aws::EC2::Client?
[15:52:01] depesz: or any other class for that matter?
[15:52:11] workmad3: depesz: it would 'just work' if that class was loaded... it sounds like it isn't
[15:52:28] depesz: well, it is - i have "require 'aws-sdk'" at the beginning
[15:52:28] hightower2: Hey, is there a way I can use alias_method to alias class/module method to instance method? Such as: alias_method My::Module.method, :method ?
[15:52:36] workmad3: depesz: but if you want to force a top-level scope, you can use `::Aws::EC2::Client`
[15:52:47] benhuda: has joined #ruby
[15:52:49] workmad3: depesz: is that pulling in `Aws::EC2` or `AWS::EC2` though?
[15:52:55] havenwood: Gasher: The good news is its much easier to upgrade from 1.9+ than it was from 1.8 to 1.9. It may even *just work*.
[15:52:57] workmad3: depesz: this stuff is case-sensitive
[15:53:07] depesz: workmad3: will check, thank you.
[15:53:27] TomPeed: has joined #ruby
[15:53:27] workmad3: depesz: if it should be `AWS::EC2` then you'll definitely need to use `::AWS::EC2::Client` in your class
[15:53:34] depesz: hmm .. it seems on work on one server, and doesn't on another.
[15:53:38] depesz: AWS seems to work everywhere.
[15:53:46] workmad3: as otherwise that first `::AWS` will conflict with your own class
[15:54:32] depesz: according to docs, it should be Aws: https://github.com/aws/aws-sdk-ruby
[15:54:54] volty: has joined #ruby
[15:55:06] workmad3: depesz: ok, then in one place you've not got the code you expected loaded
[15:55:27] depesz: workmad3: check this: http://fpaste.org/312003/31321711/
[15:55:35] depesz: from all I understand, it should work, shouldn't it?
[15:55:35] workmad3: depesz: which could mean you have the wrong version installed
[15:55:36] pawnbox: has joined #ruby
[15:55:42] Bish: can somebody tell me, how i do custom selects on Sequel::Model without encapsulating the answer as the model?
[15:55:45] workmad3: depesz: https://github.com/aws/aws-sdk-ruby#nameerror-uninitialized-constant-aws see this
[15:55:53] depesz: workmad3: reading
[15:55:57] Bish: i mean, if i do a group and count, it's still an instance of that model
[15:56:15] depesz: workmad3: but I'm getting error on uniitialized constant Aws, not AWS
[15:56:26] YankNYC: has joined #ruby
[15:56:49] workmad3: depesz: which would imply that you have version 1 installed
[15:57:05] workmad3: depesz: and are using version 2 docs
[15:57:14] depesz: =$ gem list aws-sdk | grep 'aws-sdk '
[15:57:16] depesz: aws-sdk (2.2.11, 1.64.0)
[15:57:23] depesz: ok. i see that I have both. maybe that's the problem.
[15:57:36] workmad3: depesz: could easily be
[15:57:39] depesz: how can I make the script use v2 ?
[15:58:49] ferr: has joined #ruby
[16:00:03] rkazak: has joined #ruby
[16:00:17] havenwood: depesz: gem 'aws-sdk', '~> 2'
[16:00:23] volty: gem server, search does not work. Do I miss something?
[16:00:35] depesz: havenwood: in the .rb script?
[16:00:58] havenwood: depesz: Check the aws-sdk docs, but yeah right before the require. (Assuming you're not using a Gemfile here.)
[16:01:14] havenwood: volty: gem -v
[16:01:34] mary5030: has joined #ruby
[16:01:40] depesz: havenwood: OK. added before 'require' and it works.
[16:01:41] havenwood: volty: Well, that's not terribly old at all.
[16:01:49] havenwood: volty: Current is: 2.5.1
[16:02:23] havenwood: volty: What happens when you `gem search` then?
[16:02:25] volty: havenwood: does gem server's search work for you ?
[16:02:47] volty: havenwood: it says not found, always
[16:02:54] havenwood: volty: Oh, maybe I misunderstood the question. What's the line you're trying?
[16:02:55] mary5030: has joined #ruby
[16:03:01] volty: No gems matched "mechanize"
[16:03:12] lacrymology: has joined #ruby
[16:03:21] lacrymology: I upgraded my system and now I'm getting this: /home/lacrymology/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/activesupport-4.2.4/lib/active_support/dependencies.rb:274:in `require': This installation of RMagick was configured with ImageMagick 6.9.2 but ImageMagick 6.9.3-0 is in use. (RuntimeError)
[16:03:24] volty: havenwood: I am talking about the gem server & browser accessing localhost:8808
[16:03:35] lacrymology: I tried uninstalling activesupport and reinstalling it but I'm seeing the same error
[16:03:39] lacrymology: how can I rebuild that?
[16:04:03] lacrymology: or clean the cache
[16:04:21] havenwood: volty: Yeah, just realized that. I thought you meant the two commands weren't working. What do you get for?: gem source
[16:04:58] havenwood: lacrymology: Have you already?: rbenv rehash
[16:05:57] volty: havenwood: I have the page, I can click on single gems from the list (and consult the doc), but the search isn't working.
[16:06:29] havenwood: lacrymology: For a fresh version of the cache see: gem help pristine
[16:07:06] havenwood: volty: I'm trying to see what your gem source is. What was the output from the `gem source` command?
[16:07:27] gbgdev: has joined #ruby
[16:07:46] fmcgeough: has joined #ruby
[16:07:51] havenwood: ?rbenv lacrymology
[16:07:52] ruby[bot]: lacrymology: Missing command under rbenv? Did you try `rbenv rehash`?
[16:08:47] volty: havenwood: *** CURRENT SOURCES *** \nhttps://rubygems.org/
[16:09:00] volty: havenwood: you say I should try to regenerate it ?
[16:09:20] havenwood: The Bundler motto should be "Prefix `bundle exec` or it's not your Bundle!" and the rbenv motto should be "Run `rbenv rehash` or they might not be your gems!"
[16:09:47] havenwood: volty: That look right. Just wanted to make sure you had the right source. Can you `gem install` gems?
[16:10:17] volty: havenwood: yes, absolutely
[16:10:23] havenwood: might not be your Bundle, I suppose...
[16:10:47] havenwood: volty: Gist the output from?: gem source --debug
[16:11:11] davedev24: has joined #ruby
[16:12:14] drptbl_: has joined #ruby
[16:12:33] lacrymology: has joined #ruby
[16:12:54] lacrymology: havenwood: yes
[16:12:55] stevenhaddox: havenwood: Truth on both bundler & rbenv. I've got `b` aliased to `bundle exec`
[16:13:38] volty: havenwood: https://gist.github.com/anonymous/0b9c9d69bc21a57b16f0
[16:14:10] casadei_: has joined #ruby
[16:14:16] pawnbox: has joined #ruby
[16:14:27] havenwood: volty: Still looks good.
[16:16:00] volty: havenwood: I am trying now to generate rdoc.
[16:16:10] volty: regenerate
[16:17:26] BSaboia: has joined #ruby
[16:17:27] rippa: has joined #ruby
[16:17:45] havenwood: volty: I'm confused. What are you running exactly and what's the error?
[16:18:22] codecop: has joined #ruby
[16:18:36] jamw: has joined #ruby
[16:19:21] volty: gem server starts a server that serves rdoc at (default) port 8808. Then you go there and consult the rdoc for your installed gems. Above on the right is an input field for search, but doesn't find anything I type..
[16:19:45] bronson: has joined #ruby
[16:20:15] volty: and, of course, the url shorcuts do not get result (not found, always)
[16:20:22] havenwood: volty: Aha, gotcha. I wonder if ruby-build had rdoc disabled when you installed Ruby?
[16:20:35] govg_: has joined #ruby
[16:20:53] hannelita: has joined #ruby
[16:21:46] volty: havenwood: have no idea. The fact is there is a list, but seems not indexed. I'll retry as soon as rdoc finishes the generation of the content. And hope.
[16:22:09] havenwood: volty: Ahhh.
[16:22:19] Xeago: has joined #ruby
[16:22:38] steffkes: has joined #ruby
[16:22:39] steffkes: has joined #ruby
[16:22:39] ixti: has joined #ruby
[16:23:50] duckson: has joined #ruby
[16:23:52] psye: has joined #ruby
[16:24:04] chouhoulis: has joined #ruby
[16:26:55] Bloomer: has joined #ruby
[16:29:14] oo7cat: has left #ruby: ()
[16:31:10] usershell: has joined #ruby
[16:32:19] aegis3121: has joined #ruby
[16:32:59] guacamole: has joined #ruby
[16:36:40] volty: rdoc stuck. what is the latest ruby stable version ?
[16:36:49] havenwood: volty: 2.3.0
[16:37:03] volty: havenwood: do you use rbenv ?
[16:37:12] havenwood: volty: nope, i use chruby
[16:37:53] havenwood: ruby-install --latest ruby
[16:38:20] aryaching: has joined #ruby
[16:41:58] dcunit3d: has joined #ruby
[16:42:35] Azulinho: has joined #ruby
[16:43:02] dlitvak: has joined #ruby
[16:43:33] hxegon: if I have 2 classes, say Person and People, would it make sense to have People inherit from Array?
[16:43:37] Rodya_: has joined #ruby
[16:44:11] volty: better: or Array containing People or People containing array
[16:44:12] aegis3121: but it would probably be better to just include Enumerable
[16:44:27] chouhoulis: has joined #ruby
[16:45:00] hxegon: aegis3121 thats probably what I'm looking for, ty
[16:45:22] Azulinho: has joined #ruby
[16:45:29] marcdel: has joined #ruby
[16:45:49] jbrhbr: has joined #ruby
[16:46:17] davedev24: has joined #ruby
[16:46:18] sandstrom: has joined #ruby
[16:46:37] drocsid: has joined #ruby
[16:48:54] futilegames: has joined #ruby
[16:49:17] maikowblue: has joined #ruby
[16:50:01] skade: has joined #ruby
[16:50:28] aegis3121: hxegon delegate should be able to solve other problems you have (like using :[])
[16:50:35] pdoherty: has joined #ruby
[16:50:42] aegis3121: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes kind of puts into words this idea
[16:51:07] davedev24: has joined #ruby
[16:52:03] dfinninger: has joined #ruby
[16:52:30] tenderlove: has joined #ruby
[16:54:18] dn`: has joined #ruby
[16:54:20] skade: has joined #ruby
[16:54:30] zambini: has joined #ruby
[16:54:33] NoTroutAboutIt: has joined #ruby
[16:56:10] zambini: has joined #ruby
[16:58:43] houhoulis: has joined #ruby
[16:59:57] dlitvak: has joined #ruby
[17:00:05] ympeg: has joined #ruby
[17:00:10] govg: has joined #ruby
[17:01:14] lxsameer: has joined #ruby
[17:01:14] lxsameer: has joined #ruby
[17:06:42] Renich: has joined #ruby
[17:06:56] amclain: has joined #ruby
[17:07:00] davedev24: has joined #ruby
[17:07:51] blackmesa: has joined #ruby
[17:08:19] ferr: has joined #ruby
[17:09:59] workmad3_: has joined #ruby
[17:10:27] tomphp_: has joined #ruby
[17:10:32] howdoicomputer: has joined #ruby
[17:10:44] dlitvak: has joined #ruby
[17:13:14] usershell: has joined #ruby
[17:14:48] yfeldblum: has joined #ruby
[17:18:23] carraroj: has joined #ruby
[17:18:38] BrunoSaboia: has joined #ruby
[17:19:13] arthurix: has joined #ruby
[17:19:53] arthurix_: has joined #ruby
[17:21:06] usershell: has joined #ruby
[17:22:24] mikecmpbll: bitwise operations on Bignum are like many many many multitudes slower than fixnum :'(
[17:22:33] TomyLobo: has joined #ruby
[17:22:51] RobertBirnie: has joined #ruby
[17:24:22] ico: has joined #ruby
[17:24:26] dmolina: has joined #ruby
[17:25:48] tomphp: has joined #ruby
[17:26:14] al2o3-cr: has joined #ruby
[17:26:20] Carella: has joined #ruby
[17:26:30] mikecmpbll: nvm i take that back
[17:26:39] Macaveli: has joined #ruby
[17:26:47] Moblin: has joined #ruby
[17:29:18] BrunoSaboia: has joined #ruby
[17:30:42] tmtwd: has joined #ruby
[17:30:48] ico_: has joined #ruby
[17:30:58] imperator: there a nicer way to write this? results = network_interfaces.select{ |nic| nic if nic_ids.include?(nic.id) }
[17:31:34] Papierkorb: imperator: leave out the 'nic if' part
[17:31:45] workmad3_: has joined #ruby
[17:32:04] Papierkorb: imperator: #select only cares about if the block returns truthy or falsy
[17:32:08] imperator: Papierkorb, ah, true
[17:32:41] finisherr: has joined #ruby
[17:33:12] Papierkorb: imperator: isn't there "get network interface by nic id" method?
[17:33:55] bmalum: has joined #ruby
[17:34:16] bronson: has joined #ruby
[17:34:47] wolffles: has joined #ruby
[17:34:55] symm-: has joined #ruby
[17:35:12] nettoweb: has joined #ruby
[17:36:53] dlitvak_: has joined #ruby
[17:37:54] norc_: has joined #ruby
[17:39:07] Melpaws: has joined #ruby
[17:39:24] carraroj: has joined #ruby
[17:39:36] marcdel: has joined #ruby
[17:40:31] BSaboia: has joined #ruby
[17:43:29] mikecmpbll: has joined #ruby
[17:43:53] cschneid_: has joined #ruby
[17:44:49] lucasb: has joined #ruby
[17:45:14] chouhoulis: has joined #ruby
[17:46:04] dlitvak: has joined #ruby
[17:46:14] jpterry: has joined #ruby
[17:47:14] usershell: has joined #ruby
[17:47:23] techsethi: has joined #ruby
[17:47:35] usershell: has joined #ruby
[17:47:39] User458764: has joined #ruby
[17:48:06] DarkElement: has joined #ruby
[17:48:29] Melpaws1: has joined #ruby
[17:48:33] beast: has joined #ruby
[17:48:35] DarkElement: How can I connect and parse a url with nokogiri/openuri? This is never connecting: Nokogiri::HTML.parse(open(url, :proxy => '159.122.253.8:3128'))
[17:49:22] drocsid: has joined #ruby
[17:50:02] usershell: has joined #ruby
[17:51:50] jbrhbr: has joined #ruby
[17:53:46] lucasb: I wonder if it makes difference to prepende "http://" to your :proxy string
[17:54:32] zambini: lucasb: I ran into this last week, if Nokogiri uses the `URI` lib, you need to prepend the protocol
[17:54:53] BrunoSaboia: has joined #ruby
[17:55:44] al2o3-cr: lucasb: good call
[17:57:49] agentmeerkat: has joined #ruby
[17:59:33] finisherr: has left #ruby: ()
[17:59:53] rkazak: has joined #ruby
[18:00:36] usershell: has joined #ruby
[18:01:01] dlitvak_: has joined #ruby
[18:01:23] guacamole: has joined #ruby
[18:02:16] ThirstForKnowled: has joined #ruby
[18:03:55] DarkElement: I tried it both with and without that
[18:04:01] DarkElement: Didn't make a difference
[18:04:08] NoTroutAboutIt: has joined #ruby
[18:04:22] RobertBirnie: has joined #ruby
[18:05:06] namic: has joined #ruby
[18:06:52] OmegaA_: has left #ruby: ()
[18:07:10] SenpaiSilver: has joined #ruby
[18:08:44] TomPeed: has joined #ruby
[18:10:10] Channel6: has joined #ruby
[18:10:43] Melpaws: has joined #ruby
[18:10:50] speakingcode: has joined #ruby
[18:11:17] devbug: has joined #ruby
[18:11:18] howdoicomputer: has joined #ruby
[18:12:55] floatingpoint: has joined #ruby
[18:13:19] lucasb: sorry, I don't know any further. but, open(url) doesn't give any errors?
[18:14:15] camillo: has joined #ruby
[18:15:04] dlitvak: has joined #ruby
[18:15:13] dorei: DarkElement: try: require 'nokogiri' ; require 'open-uri' ; doc = Nokogiri::HTML(open('http://www.google.com'))
[18:15:19] edwinvdgraaf: has joined #ruby
[18:15:44] B1n4r10: has joined #ruby
[18:16:45] DarkElement: dorei, that works
[18:16:45] dorei: DarkElement: if this doesnt work for the url you want, then maybe u need other lib to open the url, use wireshark to verify what's actually being send/received on the network
[18:17:08] dorei: there are some shitty sites that endup in an endless loop unless you get their cookies
[18:17:23] DarkElement: Do I need to do .parse for the doc variable now? (with nokogiri)
[18:17:39] dorei: doc is your nokogiri document
[18:17:53] DarkElement: and I can just add :proxy => "http://ip:port" now
[18:18:02] dorei: ready for your xpath queries
[18:18:12] bronson: has joined #ruby
[18:18:21] marcdel: has joined #ruby
[18:18:31] DarkElement: I prefer css selectors
[18:18:49] DarkElement: Will it work with the :proxy => "http://ip:port" now?
[18:19:03] hxegon: hmm... 'You may have encountered a bug in ruby'. You don't say.
[18:19:06] JamieD: has joined #ruby
[18:19:15] drptbl: has joined #ruby
[18:19:23] dorei: DarkElement: no idea, give it a try
[18:19:24] pdoherty: has joined #ruby
[18:20:21] dorei: DarkElement: from open-uri documentation: The environment variables such as http_proxy, https_proxy and ftp_proxy are in effect by default.
[18:20:27] dorei: http://ruby-doc.org/stdlib-2.3.0/libdoc/open-uri/rdoc/OpenURI.html
[18:20:55] CoderPuppy: has joined #ruby
[18:21:13] j4d: has joined #ruby
[18:21:19] DarkElement: Oh, so it was already doing proxies?
[18:21:34] hahuang65: has joined #ruby
[18:21:37] DarkElement: Also, it's not working with the proxy I added, unfortunately.
[18:21:41] s00pcan: has joined #ruby
[18:22:01] stamina: has joined #ruby
[18:23:31] dorei: DarkElement: try setting you proxy in enviroment variable
[18:23:46] cndiv: has joined #ruby
[18:23:49] DarkElement: what do you mean
[18:24:22] DarkElement: I disabled the proxy, it is working, just slower. Oh well
[18:24:25] Carella: has joined #ruby
[18:24:31] DarkElement: Reloading the page on error seems to work
[18:24:34] dorei: DarkElement: if you use bash it's something like: export HTTP_PROXY="http://my.proxy.com/"
[18:24:45] al2o3-cr: doc = Nokogiri.parse(open("http://www.google.com", :proxy => 'http://159.122.253.8:3128')) # this works on machine
[18:24:49] victorty_: has joined #ruby
[18:25:01] DarkElement: al2o3-cr, doesn't work for craigslist though.
[18:25:15] [Butch]: has joined #ruby
[18:25:28] DarkElement: dorei, then it would default to that proxy?
[18:25:57] gregf: has joined #ruby
[18:26:45] dlitvak_: has joined #ruby
[18:27:05] lucasb: I'm not sure, but maybe the envvar should be lowercase
[18:27:29] DarkElement: I'll just leave the scraper on while I work
[18:27:37] DarkElement: Will be at coffee shop all day anyway
[18:28:22] bronson: has joined #ruby
[18:29:26] dfinninger: has joined #ruby
[18:29:34] Spami: has joined #ruby
[18:29:47] Melpaws: has joined #ruby
[18:30:13] Outlastsheep: has joined #ruby
[18:31:06] Moblin: has joined #ruby
[18:31:52] anisha: has joined #ruby
[18:31:53] Gasher: has left #ruby: ("Leaving")
[18:32:03] aegis3121: has joined #ruby
[18:33:29] juddey: has joined #ruby
[18:34:50] apeiros: !ban oo7cat !P dear jackcom, we don't like it if you try to evade your ban.
[18:34:50] ruby[bot]: +bb oo7cat!*@*$#ruby-banned *!*@unaffiliated/oo7cat$#ruby-banned
[18:35:36] jgt: has joined #ruby
[18:38:26] bronson: has joined #ruby
[18:38:50] krz: has joined #ruby
[18:39:02] ta: has joined #ruby
[18:39:29] ta: has joined #ruby
[18:41:01] roshanavand: has joined #ruby
[18:41:18] roshanav_: has joined #ruby
[18:41:29] hxegon: anyone want to help me hunt a ruby bug?
[18:41:48] hxegon: (potentially a ruby bug, I should say)
[18:42:23] Papierkorb: hxegon: just begin to describe the issue, and if at all possible, !gist (self-contained) an code example
[18:42:44] arlek: has joined #ruby
[18:42:53] JohnT: has joined #ruby
[18:42:58] arlek: are there any modern benchmarks between ruby and lua?
[18:43:12] dlitvak: has joined #ruby
[18:43:29] roshanavand: has joined #ruby
[18:43:32] hxegon: When I run my tests (minitest) I get a crash report from ruby. I have the crash report, and the code, here. https://github.com/clebrun/taxons
[18:43:42] jbrhbr: has joined #ruby
[18:43:46] NoTroutAboutIt: has joined #ruby
[18:43:47] zambini: has joined #ruby
[18:44:25] hxegon: started noticing it around the time I was working on these tests https://github.com/clebrun/taxons/blob/master/test/test_taxons.rb#L54 but I haven't been able to replicate outside guard yet
[18:45:05] craysiii: has joined #ruby
[18:45:51] TomyLobo: arlek, my last info is that ruby doesn't have a JIT, hence Lua wins by default. I could be wrong, absolutely do not take my word for it
[18:45:53] sigurding: has joined #ruby
[18:45:57] chouhoulis: has joined #ruby
[18:46:00] craysiii: has joined #ruby
[18:46:07] dwfait: has joined #ruby
[18:47:24] zambini: has joined #ruby
[18:47:27] hxegon: ok, about to upload a rakefile that generates the crash for me with 2.3
[18:48:25] bronson: has joined #ruby
[18:49:47] ta: has joined #ruby
[18:50:17] Papierkorb: hxegon: link?
[18:50:42] hxegon: Papierkorb https://github.com/clebrun/taxons
[18:50:57] Papierkorb: .. to that 'rakefile' ?
[18:50:58] hxegon: sorry, https://github.com/clebrun/taxons/tree/replicate_bug
[18:51:23] TomyLobo: arlek, https://attractivechaos.github.io/plb/ in this benchmark LuaJIT is faster than all ruby implementations in all but 2 tests (patmch:1t and patmch:2t)
[18:51:48] TomyLobo: those are regex stuff
[18:51:52] Papierkorb: hxegon: That's far from being self-contained, right now don't have the time to dig through some whole app
[18:52:02] hxegon: Papierkorb I'm reducing it now
[18:53:02] TomyLobo: arlek, the author notes that "Lua does not come with a real regex engine, so its string pattern matching functions were used instead, which were not intended for speed."
[18:53:17] tomphp: has joined #ruby
[18:53:59] hxegon: alright, thinking this is with minitest. reduced the test file to this: https://github.com/clebrun/taxons/blob/replicate_bug/test/test_taxons.rb#L19
[18:54:17] Papierkorb: arlek: would've surprised me if LuaJIT would be slower, as it is really fast. Also, MRI does not do JITing.
[18:54:23] podman: has joined #ruby
[18:54:40] nerfando: has joined #ruby
[18:55:14] arlek: Hm... so it seems like Ruby would be more on par with Python than it is Lua!
[18:55:18] arlek: Lua's pretty fast!
[18:55:27] depesz: has left #ruby: ("WeeChat 1.4-rc1")
[18:56:15] firstdayonthejob: has joined #ruby
[18:57:13] uri___: has joined #ruby
[18:57:27] TomyLobo: and pretty limited :)
[18:57:33] TomyLobo: i think the two are related
[18:57:53] dlitvak_: has joined #ruby
[18:59:07] TomyLobo: hah, there's llvm-lua
[18:59:14] Papierkorb: Lua's standard library *is* really limited, but it serves a different purpose than say ruby, so that's fine.
[18:59:26] d0nn1e: has joined #ruby
[18:59:40] tubuliferous_: has joined #ruby
[18:59:56] dlitvak_: has joined #ruby
[19:00:17] arlek: Well is there a way to precompile scripts into bytecode with ruby?
[19:00:50] TomyLobo: arlek, what do you mean by bytecode?
[19:01:01] sankaber: has joined #ruby
[19:01:19] TomyLobo: like .pyc files in python??
[19:01:21] Papierkorb: arlek: it's possible to do with ruby2.3, but not out of the box using some program parameter (AFAIK!). Also, this feature is experimental, and experimental features WILL be removed if people don't like it.
[19:01:22] al2o3-cr: you mean as luac foo.lua arlek
[19:01:27] arlek: Just an intermediate bytecode in order to get past parsing times
[19:01:44] arlek: intermediate form*
[19:01:48] TomyLobo: arlek, parsing is done once
[19:02:02] TomyLobo: i would guess when the file is require'd
[19:02:29] TomyLobo: or first required, rather
[19:02:30] Papierkorb: arlek: Oh, and that file format is afaik not portable. So you could in theory cache it locally, but that's about it. But in general, I don't see the point of doing this...
[19:02:47] TomyLobo: Papierkorb, it could be used with omnibus
[19:03:04] Papierkorb: TomyLobo: a what?
[19:03:19] TomyLobo: Papierkorb, do you know gitlab?
[19:03:29] TomyLobo: it comes in a package with everything and its dog in it
[19:03:36] TomyLobo: they call it an omnibus package
[19:03:42] Darmani: has joined #ruby
[19:03:47] TomyLobo: after the thing they use to package it
[19:03:55] Darmani: Hey kids<3
[19:04:35] TomyLobo: it bundles at least the software itself, the required ruby version, nginx, postresql and probably some more things i'm not aware of
[19:04:44] TomyLobo: oh, the gems of course
[19:04:47] fantazo: has joined #ruby
[19:04:56] Papierkorb: TomyLobo: Well then, that package is then installed locally to your computer I take? Well, no, as far I recall reading the ruby discussion on this feature, it's not portable, so that won't work. You could be lucky that it works from x64 to x64 machine, but that's not guaranteed.
[19:04:59] Papierkorb: has left #ruby: ("Konversation terminated!")
[19:05:03] Papierkorb: has joined #ruby
[19:05:22] TomyLobo: Papierkorb, so it's precompiled with cpu-specific optimization even?
[19:05:40] einarj: has joined #ruby
[19:06:04] Papierkorb: TomyLobo: No idea why it's not portable, I guess the usual endianess issues. In general, no guarantee on being portable, so it's not portable and if it works, you're just lucky :)
[19:06:23] steffkes: has joined #ruby
[19:06:23] steffkes: has joined #ruby
[19:06:56] TomyLobo: so let's say i have two amd64 ubuntu trusty machines. you're saying it's possible that it's not possible to run it on both?
[19:07:07] TomyLobo: i.e. down to luck?
[19:07:17] dpg1: has joined #ruby
[19:07:18] finisherr_: has joined #ruby
[19:08:09] Papierkorb: TomyLobo: As there is no guarantee given on that, yes. You could always be lucky that it works from x64 to x64 machine, but it could blow up if you e.g. to x64 to ARM.
[19:08:33] TomyLobo: gitlab omnibus packages package ruby
[19:08:44] TomyLobo: which is a native platform-specific binary
[19:08:45] Papierkorb: TomyLobo: I'm not claiming that what you think about won't work. The issue is not if it's possible, but if it's guaranteed to work. If it's not guaranteed, but it works, then you're just lucky that it does
[19:09:07] TomyLobo: so amd64 <-> arm isnt even relevant here
[19:09:38] Papierkorb: TomyLobo: there is no guarantee. It doesn't matter from what to what you go.
[19:10:29] sftrabbit: has joined #ruby
[19:10:33] TomyLobo: oh well, they could always precompile in postinst
[19:10:48] krz: has joined #ruby
[19:14:33] sakix: has joined #ruby
[19:14:35] freerobby: has joined #ruby
[19:14:53] radgeRayden_: has joined #ruby
[19:15:40] aegis3121: has joined #ruby
[19:15:47] Mackerel_: has joined #ruby
[19:17:50] sandstrom: has joined #ruby
[19:19:14] BigFish: has joined #ruby
[19:19:52] zeroDivisible: has joined #ruby
[19:22:16] tildes: has joined #ruby
[19:23:22] platzhirsch: has left #ruby: ()
[19:25:14] User458764: has joined #ruby
[19:26:25] Azulinho: has joined #ruby
[19:28:21] edwinvdgraaf: has joined #ruby
[19:31:09] emilford_: has joined #ruby
[19:31:19] hxegon: If anyone is interested, here is what came of that bug: https://github.com/thoughtbot/shoulda-context/issues/46
[19:31:28] blackmesa: has joined #ruby
[19:32:45] nettoweb: has joined #ruby
[19:34:45] Jackneill: has joined #ruby
[19:34:57] ur5us: has joined #ruby
[19:35:09] choke: has joined #ruby
[19:35:44] wolffles: has joined #ruby
[19:37:37] ohaibbq: has joined #ruby
[19:38:03] arup_r: has joined #ruby
[19:38:28] tomchapin: has joined #ruby
[19:39:44] dlitvak: has joined #ruby
[19:41:09] pizzaops: Is there a way to do a hash lookup with dot syntax, that just returns the key, bare?
[19:41:12] pizzaops: erm, the value, bare.
[19:41:30] pizzaops: Something like myhash.lookup(:foo)
[19:41:31] Dimik: has joined #ruby
[19:41:43] adaedra: &ri Hash#fetch
[19:41:43] `derpy: http://ruby-doc.org/core-2.3.0/Hash.html#method-i-fetch
[19:41:55] pizzaops: rad, thanks!
[19:42:04] jhass: why though?
[19:42:07] adaedra: Be careful that it doesn't have the same semantics as Hash#[] in regard to missing keys.
[19:42:14] jhass: hash[:foo] is a method call too
[19:42:25] pizzaops: I want to mock (stub?) out the return values of certain hash lookups.
[19:42:30] disconnekted: has joined #ruby
[19:42:30] pizzaops: But I'm not sure how to do it with brace-syntax
[19:42:32] jhass: >> {foo: "bar"}.[](:foo)
[19:42:34] ruby[bot]: jhass: # => "bar" (https://eval.in/504096)
[19:42:40] jhass: you can just stub :[]
[19:42:42] pizzaops: Double thanks!
[19:43:13] apeiros: and that'd be a classic case of xy
[19:43:21] jhass: pizzaops: and now you learned why you should describe your problem, not the solution you imagine ;)
[19:43:51] emilford: has joined #ruby
[19:44:24] pizzaops: What about this? allow settings.to receive(:host).and_return('pizza.vsphere.com')
[19:45:05] adaedra: you have other ways to mock in rspec iirc.
[19:45:18] Papierkorb: adaedra: if you
[19:45:20] bronson: has joined #ruby
[19:45:27] adaedra: why wouldn't we stop the xy and you explain the whole problem?
[19:45:28] jhass: settings is the hash?
[19:45:29] Papierkorb: adaedra: if you're thinking about #stub, that's deprecated :)
[19:45:36] Ishido: has joined #ruby
[19:45:57] carraroj: has joined #ruby
[19:45:57] adaedra: Papierkorb: I'm thinking I'm too old for this shit.
[19:46:12] pizzaops: settings is the hash, yes. Basically I have some methods to load settings into said hash from env vars or from a file, but for the method that USES the settings, I want to mock out that file/envvar parsing bit
[19:46:16] pizzaops: and just supply a valid hash
[19:46:31] jhass: so do that?
[19:46:38] jhass: why would you need to mock anything on the hash?
[19:46:41] Mon_Ouie: has joined #ruby
[19:46:44] chouhoulis: has joined #ruby
[19:46:46] jhass: mock the method that returns it
[19:47:08] pizzaops: If I knew the answers to those questions I wouldn't be asking :)
[19:47:16] pizzaops: So mock out the parse_config_file method, basically?
[19:47:21] vF3hNGxc47h8: has joined #ruby
[19:47:28] jhass: you realize we don't see your screen?
[19:47:51] pizzaops: Just imagine I have some method that parses the config file and returns values, and some method that uses said values, and invokes parse_config_file to get them.
[19:48:11] jhass: probably yes
[19:48:12] pizzaops: And I'm trying to test the method that uses the values, not the functioning of my file parse.
[19:48:16] jhass: it's still very vague
[19:50:00] dwfait: has joined #ruby
[19:50:43] ferr: has joined #ruby
[19:53:15] dwfait: has joined #ruby
[19:53:31] jackjackdripper: has joined #ruby
[19:53:54] adaedra: pizzaops: If I understand correctly, you want to test that something that uses your option hash does it correctly?
[19:54:16] pizzaops: And I don't want to test the logic that creates the hash (in this test)
[19:54:29] pizzaops: I have a method that returns said hash, which should be tested separately, as I understand unit testing.
[19:54:41] adaedra: Just replace the hash by something else
[19:55:39] pizzaops: adaedra: oh as in, I can replace the method that returns a hash, inside the tests for this thing that uses the tests, with just methodname = { somehash }?
[19:55:47] pizzaops: uses the hash*
[19:55:48] gregf: has joined #ruby
[19:56:00] adaedra: or use rspec with expect(hash).to receive(:[]).with(:key).and_return(:potato) or something like that (I feel like Papierkorb wants to fix my syntax)
[19:56:19] adaedra: you don't replace the method which returns the hash, you make something else in place.
[19:56:32] Papierkorb: adaedra: looks fine. Although mocking a Hash sounds like overkill ^^;
[19:56:51] adaedra: Papierkorb: have a better idea?
[19:57:08] pizzaops: adaedra: the thing that "uses" the hash explicitly calls the method though, and sets local var "settings" equal to it. So how can I just use "something else?
[19:57:09] adaedra: Papierkorb: mit mehr Efficiency?
[19:57:25] Papierkorb: pizzaops, adaedra: expect(that_object).to receive(:that_config_hash_method).and_return(foo: 'bar')
[19:57:30] adaedra: pizzaops: ok, code please.
[19:57:44] jackjackdripper: has joined #ruby
[19:58:09] adaedra: Papierkorb: yeah, but that don't solve the problem of "does the next methods calls the right things on the hash", how suspect it looks
[19:58:18] pawnbox: has joined #ruby
[19:58:35] Steve_Jobs: has joined #ruby
[19:59:18] pizzaops: adaedra: not sure why gist is making the indents look so weird, not like that in vim, but anyway: https://gist.github.com/pizzaops/5a1469d1a2f72f0ffafb
[19:59:24] pizzaops: I'm trying to test the initialize method.
[19:59:35] adaedra: Because you use tabs and spaces mixed.
[19:59:40] adaedra: :set sw=2 sts=2 sw=8 et
[19:59:49] pizzaops: adaedra: ah you know, the person I'm working with must be using tabs :P
[20:00:02] dpg1: has joined #ruby
[20:00:04] adaedra: ACTION gives pizzaops the tab correcter
[20:00:07] Papierkorb: adaedra: ok, in that case, both ways of "return a hash and expect(it) to receive :[] with :foo and_call_original" and "expect it to receive [] with :foo and return :bar" are equally good & ugly. Let's face it, those lines /are/ ugly ;)
[20:00:11] adaedra: Also called "baseball bat"
[20:00:31] Papierkorb: adaedra: Btw, sorry but I'm not closely following the conversation otherwise
[20:00:37] adaedra: Papierkorb: blame rspec.
[20:00:40] adaedra: Papierkorb: it's ok.
[20:00:54] pizzaops: adaedra: here it is, less weird: https://gist.github.com/pizzaops/b38c286ff517c88401ee
[20:01:23] adaedra: Once you checked the settings and thrown your colleague in a volcano, you can ggVG=.
[20:01:34] pizzaops: adaedra: hah. So, it's line 15 that I'm talking about basically.
[20:01:44] pwnd_nsfw: has joined #ruby
[20:02:11] pizzaops: process_environment_variables and process_config_file can both return a hash but I don't want to actually invoke those real methods when I test initialize.
[20:02:17] adaedra: this gist lacks of tests.
[20:02:38] puria: has joined #ruby
[20:04:03] pizzaops: adaedra: because I'm not sure how to fake the hash so I'm not sure how to write the test :P
[20:04:35] pizzaops: adaedra: added one thing I was considering trying in the comments.
[20:04:42] pizzaops: It should at least illustrate what my intention is...
[20:06:29] adaedra: Your before do nothing, as you're assigning a local variable which goes out of scope the line after.
[20:06:46] pizzaops: adaedra: I realized that. But it still hopefully demonstrates what I'm trying to do.
[20:06:58] adaedra: Also, you make me hungry with your pizza.
[20:07:12] imperator: has left #ruby: ("Leaving")
[20:07:52] tomchapin: has joined #ruby
[20:08:55] spider-mario: has joined #ruby
[20:09:42] adaedra: Your file is not even valid
[20:10:01] adaedra: ah no, I misread
[20:10:12] adaedra: I hate github coloring.
[20:10:17] BigFish: this is terrible
[20:10:40] BigFish: why am i trying to introduce myself to coding, it's like giving myself splinters
[20:10:48] Rodya_: has joined #ruby
[20:11:45] yqt: has joined #ruby
[20:11:55] adaedra: that won't be testable that way
[20:11:57] dpg1: has joined #ruby
[20:12:07] howdoicomputer: has joined #ruby
[20:12:38] adaedra: you can't call process_envthing and process_confthing independently, as they are both called by initialize
[20:13:12] dionysus69: has joined #ruby
[20:13:30] pizzaops: It's fine for just one to return valid data.
[20:13:30] adaedra: so yeah, you have to mock them before initializing your object
[20:13:38] ta: has joined #ruby
[20:14:06] adaedra: and in this mock, return a stubbed hash to see if you hit the right boxes
[20:14:16] jokke1: has joined #ruby
[20:14:27] RalfJ: has joined #ruby
[20:14:28] Rodya_: has joined #ruby
[20:15:03] pizzaops: So I tried https://gist.github.com/pizzaops/3f38f6ff44d58ddc88e2, and no matter where I put the before(:all) I get something like `The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.`
[20:15:26] pizzaops: I've tried it at the describe level, context level, it do level, and always that kind of error. Which makes me feel like I'm a crazy person.
[20:15:42] adaedra: Should be valid in the it block
[20:16:19] Xeago: has joined #ruby
[20:16:24] ferr: has joined #ruby
[20:17:06] who42: has joined #ruby
[20:17:20] adaedra: That's going too far into rspec for me
[20:18:36] awox: Using savon, is there a way to dump the list of types from a WDSL? I see client.operations returns the functions, but I'm looking for a list of the objects
[20:20:27] pizzaops: adaedra: thanks for trying :)
[20:20:32] Papierkorb: pizzaops: first, put the hash into a let(:config_hash){ .. }. then expect (prefer that over allow if possible) to receive your method .and_return(config_hash) - Prefer that over doing the same in the block.
[20:20:46] Papierkorb: pizzaops: then, don't use .should. just don't.
[20:21:01] Papierkorb: pizzaops: third, expect that process_env_vars to eq config_hash
[20:21:11] asmodlol: has joined #ruby
[20:21:15] Papierkorb: pizzaops: you can also expect process_env_vars to *be* config_hash
[20:21:51] pizzaops: Papierkorb: why not just let(:setting){..}?
[20:21:58] pizzaops: erm s/setting/settings
[20:21:59] PedramT: has joined #ruby
[20:22:15] Papierkorb: pizzaops: but IMO 'eq' is strong enough of an expectation here. The configuration class may create a #clone or #dup'licate of the hash, that won't alter the behaviour and thus will only crash your test for no gain (still, IMO)
[20:22:31] Papierkorb: pizzaops: well, you can choose whatever name, both are fine to me
[20:22:48] pizzaops: I just mean that settings is the actual variable the hash is stored in in the initialize method
[20:23:35] Papierkorb: pizzaops: the let() block returns the settings hash (or in general, you use let() to return test data)
[20:24:33] diegoviola: has joined #ruby
[20:24:54] al2o3-cr: has joined #ruby
[20:25:11] n00bDev: has joined #ruby
[20:25:14] adaedra: ACTION sends Papierkorb a virtual beer ????
[20:27:01] tubuliferous_: has joined #ruby
[20:27:03] devbug: has joined #ruby
[20:27:49] finisherr: has joined #ruby
[20:30:13] dfinninger: has joined #ruby
[20:30:23] chouhoulis: has joined #ruby
[20:31:14] fatih: has joined #ruby
[20:35:00] Papierkorb: pizzaops: Oh, and I wouldn't use describe blocks like that. I'd do something like this: https://gist.github.com/Papierkorb/320e3902343abc380136
[20:35:18] Papierkorb: pizzaops: also see the warning i wrote as comment
[20:36:36] pizzaops: Papierkorb: ah I see, this makes sense, thanks.
[20:36:45] Papierkorb: pizzaops: that method name sounds like it accesses ENV or some other (semi-)global variable. Consider modifying those instead.
[20:37:01] pizzaops: Yes, it accesses ENV because I want users to be able to configure via env var
[20:37:09] Papierkorb: pizzaops: Like you could do before{ ENV['Foo'] = 'bar' } # And then check in the example that it was handled correctly
[20:37:47] tomphp: has joined #ruby
[20:38:55] weemsledeux: has joined #ruby
[20:40:12] johnbburg: has joined #ruby
[20:40:33] dlitvak: has joined #ruby
[20:40:45] vifino: has joined #ruby
[20:41:19] Rodya_: has joined #ruby
[20:42:12] fantazo: has joined #ruby
[20:44:05] pizzaops: Papierkorb: so this ??? https://gist.github.com/pizzaops/3f38f6ff44d58ddc88e2 ??? now returns `You must provide credentials in either environment variables or a config file.` but I know from manual testing it won't return that if the env vars are correctly set. So I feel like I'm not successfully faking the return value of #process_environment_variables.
[20:44:23] pizzaops: That being said, #process_environment_variables is an instance method. Could that be why?
[20:44:56] Papierkorb: pizzaops: ...Yes.
[20:45:35] pizzaops: Something like this then, maybe? https://www.relishapp.com/rspec/rspec-mocks/v/2-6/docs/method-stubs/stub-on-any-instance-of-a-class
[20:46:00] Papierkorb: Don't look into the Rspec 2.6 docs, look at the RSpec 3.x docs
[20:46:09] Cohedrin: has joined #ruby
[20:46:15] astrofog: has joined #ruby
[20:46:26] Papierkorb: you're looking for expect_any_instance_of(TheClass).to receive(:the_method)...
[20:46:56] Papierkorb: I'd still change the environment around the method rather than stubbing it out thoughj
[20:47:42] tomphp: has joined #ruby
[20:48:42] Cohedrin: has joined #ruby
[20:49:01] kadoppe: has joined #ruby
[20:49:25] pizzaops: I think I'm looking for allow_any...., I'm not trying to test the output of TheClass's method TheMethod. I'm trying to fake it.
[20:49:34] pizzaops: i think i have something working now actually
[20:50:16] deallocate: has joined #ruby
[20:50:20] trif: has joined #ruby
[20:50:30] johnzorn: has joined #ruby
[20:50:50] trif: has left #ruby: ()
[20:50:53] diegoviola: has joined #ruby
[20:51:05] diegoviola: has joined #ruby
[20:51:34] pizzaops: Really appreciate your help.
[20:51:51] roshanavand: has joined #ruby
[20:54:15] mikecmpbll: has joined #ruby
[20:54:46] FernandoBasso: has joined #ruby
[20:55:31] hannelita: has joined #ruby
[20:56:17] who42: has joined #ruby
[21:00:33] norc: has joined #ruby
[21:01:24] kfpratt: has joined #ruby
[21:02:19] norc: TomyLobo, technically the MRI does JIT
[21:02:22] durstburger: has joined #ruby
[21:02:41] norc: Not in the same sense that Rubinius or JRuby have it though.
[21:02:52] chrisseaton: norc: you mean it JITs to bytecode?
[21:03:40] mwlang: has joined #ruby
[21:03:52] mondok: has joined #ruby
[21:04:09] norc: Or actually no. It is not real JIT.
[21:04:11] tomchapin: has joined #ruby
[21:04:16] norc: It is just pure interpretation of bytecode.
[21:04:34] choke: has joined #ruby
[21:04:36] griffindy: has joined #ruby
[21:04:39] chrisseaton: norc: I don't think that's what anyone anywhere means by JIT though
[21:05:03] yfeldblum: has joined #ruby
[21:05:06] norc: asm>> puts "foo"
[21:05:07] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/504173
[21:05:22] norc: Is going to yield the same machine code regardless.
[21:05:41] norc: https://github.com/ruby/ruby/blob/trunk/insns.def
[21:06:08] chrisseaton: norc: right, but that's not what anyone calls a 'JIT', technically or informally
[21:06:18] norc: As I said, I correct myself.
[21:08:33] Rodya_: has joined #ruby
[21:08:41] asmodlol: has joined #ruby
[21:09:02] shinnya: has joined #ruby
[21:09:37] tvw: has joined #ruby
[21:12:26] tomchapin: has joined #ruby
[21:13:34] Bish: hi guys, how do you model the mysql type "set" in sequel?
[21:13:48] Bish: or how would you guys handle flags for certain datasets
[21:14:15] diego3: has joined #ruby
[21:14:19] diego3: has joined #ruby
[21:14:47] hannelita: has joined #ruby
[21:14:57] zacts: has joined #ruby
[21:19:42] nerfando: has joined #ruby
[21:20:51] nerfando: has joined #ruby
[21:22:01] nerfando: has joined #ruby
[21:22:25] norc: Bish, flags would be a different topic. The best way would be to use bitmasks there.
[21:23:09] nerfando: has joined #ruby
[21:24:19] nerfando: has joined #ruby
[21:24:46] robbyoconnor: has joined #ruby
[21:25:21] robbyoconnor: has joined #ruby
[21:25:29] Bish: norc: so i wouldve handle them myself?
[21:25:37] mikecmpbll: has joined #ruby
[21:25:40] norc: Bish, for bitmask flags, absolutely.
[21:25:52] Bish: well, the set-type of mysql is the exact same thing
[21:25:58] norc: That is enums..
[21:26:03] norc: What do you want. Flags or enums?
[21:26:10] Bish: set,enums both exist in mysql
[21:26:37] Bish: but sequel does't seem to support them, i might be wrong about that though, just didn't find it yet
[21:26:55] norc: If it doesn't, you can still use bitmasks with some integer type.
[21:26:57] Bish: they work great, but sometimes working with it is kind of a hazzle, since they will be put out as strings
[21:27:09] norc: Honestly I dont know much about MySQL.
[21:27:11] StevenXL: has joined #ruby
[21:27:11] StevenXL: has joined #ruby
[21:27:13] Bish: yeah i thought about that one, too, but i figured if mysql has them, i might use them
[21:27:17] norc: Have successfully managed to avoid it for many years.
[21:27:24] Bish: norc: what are you using for high relational data?
[21:27:38] norc: Bish, PostgreSQL and Oracle.
[21:27:43] nerfando: has joined #ruby
[21:27:49] Bish: ah, okay, postgre doesn't have sets?
[21:27:52] howdoicomputer: has joined #ruby
[21:28:12] Bish: yeah bitmasks, hmm could model them inside the model
[21:28:26] zerowaitstate: has joined #ruby
[21:28:27] norc: Bish, well you have bit strings
[21:28:47] Bish: no, they will internally be handled as 32*x integers
[21:28:58] Bish: last time i checked
[21:29:09] norc: Bish, indeed.
[21:29:18] Bish: actually they're neat, i used them alot with php, but i stopped using anything else than ruby
[21:29:24] akem: has joined #ruby
[21:29:25] Bish: because, fuck me, ruby is nice, isn't it?
[21:29:31] norc: That depends on who you ask./
[21:29:50] diego2: has joined #ruby
[21:29:52] Bish: well if you ask me, it's the best language out there, wish it was faster , though
[21:29:58] choke: I started ruby/rails less than a year ago from PHP. I look at PHP now, and swear I get a rare form of cancer every time I do
[21:30:06] diego2: has joined #ruby
[21:30:25] norc: Bish, it is all domain specific though.
[21:30:31] norc: Most languages have their uses.
[21:30:43] choke: PHP's use is to make me throw up and wish I was dead... lol
[21:31:35] Bish: didn't yet hit a problem wish wasn't cleanly solved with ruby
[21:31:36] Ox0dea: PHP is for when you need to GSD, emphasis on the S.
[21:31:41] norc: Any Ruby has its flaws too.
[21:31:57] norc: Just look at Ox0dea for example, he is our prime example.
[21:32:03] Bish: for what?
[21:32:09] norc: When the languages forces you into boredom to come up with things like Otokari...
[21:32:24] Ox0dea: I wasn't bored when I wrote Otokari.
[21:32:27] Ox0dea: I was excited.
[21:32:52] Darmani: https://repl.it/Benw/1
[21:32:52] Darmani: I wrote this script to check if a word could be an anagram. Do you think it's okay? Or could it be better?
[21:32:52] norc: Well. The excitement surely was preceeded by boredome.
[21:32:53] choke: I dunno about that Ox0dea -- with ruby I GSD more than I ever did with PHP in a single day
[21:32:55] fantasticsid: has joined #ruby
[21:33:11] xet7: has joined #ruby
[21:33:35] dtordable: has joined #ruby
[21:33:46] norc: Darmani, you do not need the ternary operator at all.
[21:34:11] Darmani: just noticed that norc lol
[21:34:42] norc: Darmani, for extra points, refine that method into String.
[21:34:44] choke: Darmani, yeah don't need that ternary... would be nicer if there was some sort of dictionary attached so input is one word... there's a big chance that if i have two words, I already know if they're anagrams of each other.
[21:35:02] norc: Darmani, and by that I mean refinement. Not just monkey patching String.
[21:35:03] Darmani: norc - how2dothat.jpg
[21:35:10] Ox0dea: >> @_,$_,@__=->_,__{_==''?_:(__[_[$_-$_]]?_[$_-$_]:'')+@_[_[$_..-$_],__]},$$/$$,@__=->_{__,___=_[$_-$_],_[$_..-$_];_==''?_:@__[@_[___,->_{_<__}]]+__+@__[@_[___,->_{_>=__}]]};($__=->*_{__=@__[_[$.]];$*[$_-$_]==__ ?_:$*<<__;_[$.+=$_]?$__[*_]:!$*[$_]})['allergy', 'gallery', 'largely', 'regally'] # Darmani
[21:35:12] ruby[bot]: Ox0dea: # => true (https://eval.in/504176)
[21:35:13] dlitvak: has joined #ruby
[21:35:15] Ox0dea: There's my anagram checker.
[21:35:28] Bish: >> x = "anna";x[0...x.length] == x[x.length..-1] # naive version
[21:35:29] norc: Darmani, http://ruby-doc.org/core-2.0.0/doc/syntax/refinements_rdoc.html
[21:35:29] ruby[bot]: Bish: # => false (https://eval.in/504177)
[21:35:35] Bish: haha, okay
[21:35:39] Darmani: choke - okay for sure.
[21:35:43] norc: Darmani, I think the examples show how to do it fairly simply.
[21:35:50] Darmani: Ox0dea - once again, that is hideous.
[21:36:01] norc: It is not hideous.
[21:36:09] Bish: >> x = "anna";x[0...x.length/2] == x[x.length/2..-1] # naive version
[21:36:10] ruby[bot]: Bish: # => false (https://eval.in/504178)
[21:36:13] norc: The key is just $$/$$
[21:36:25] Rodya_: has joined #ruby
[21:36:28] norc: Once you figure that one out, the rest suddenly becomes obvious.
[21:36:39] Ox0dea: >> ' '=~/$/ # norc
[21:36:40] ruby[bot]: Ox0dea: # => 1 (https://eval.in/504179)
[21:36:43] Darmani: norc - Thanks! I'm going to read that right now.
[21:36:54] norc: Ox0dea, I like that one too.
[21:37:50] norc: Darmani, http://ruby-doc.org/core-2.3.0/doc/syntax/refinements_rdoc.html
[21:37:54] norc: updated for version.
[21:38:07] norc: (They are not experimental anymore)
[21:38:09] blackgoat: has joined #ruby
[21:38:16] Darmani: roger that
[21:38:20] Ox0dea: Just gimped. :/
[21:38:50] Ox0dea: It used to be that you could refine #method_missing but not #const_missing; instead of making the latter refineable, they made the former not. :(
[21:39:02] tubuliferous_: has joined #ruby
[21:39:26] norc: I have seen too many awful hacks using method_missing.
[21:39:41] norc: They can remove the method altogether for all I care.
[21:39:55] norc: Just leads to things like Rails.
[21:41:13] norc: ast>> @_,$_,@__=->_,__{_==''?_:(__[_[$_-$_]]?_[$_-$_]:'')+@_[_[$_..-$_],__]},$$/$$,@__=->_{__,___=_[$_-$_],_[$_..-$_];_==''?_:@__[@_[___,->_{_<__}]]+__+@__[@_[___,->_{_>=__}]]};($__=->*_{__=@__[_[$.]];$*[$_-$_]==__ ?_:$*<<__;_[$.+=$_]?$__[*_]:!$*[$_]})['allergy', 'gallery', 'largely', 'regally']
[21:41:20] ruby[bot]: norc: I have parsed your code, the result is at https://eval.in/504180
[21:41:35] norc: Yes. Helpful.
[21:42:37] karapetyan: has joined #ruby
[21:42:39] mwieloch: has joined #ruby
[21:44:21] norc: Ox0dea, btw I realized the other day that the scare about //=~str creating locals is perfectly fine.
[21:44:28] norc: Since that is what lhs regex are for.
[21:44:29] Ox0dea: norc: Have you seen? https://eval.in/459020
[21:44:50] Ox0dea: Is that right?
[21:44:54] ixti: has joined #ruby
[21:45:14] Ox0dea: The implicit matching stuff for -p and -n a la Perl?
[21:45:24] norc: What do you mean?
[21:45:42] Darmani: docs are overrated
[21:45:48] Darmani: explain to me why all this extra shit is necessary
[21:45:49] Darmani: https://repl.it/BeoF
[21:45:53] norc: >> case "2" when /(?<foo>.)/ then puts foo end
[21:45:54] ruby[bot]: norc: # => undefined local variable or method `foo' for main:Object ...check link for more (https://eval.in/504182)
[21:46:05] norc: Even here its fine.
[21:46:40] johnzorn: has joined #ruby
[21:46:41] norc: Darmani, lets say for some bizarre reason you want to override String#length.
[21:46:55] norc: Darmani, by doing that you are likely to break tons of libraries and gems you might be using.
[21:47:03] karapetyan: has joined #ruby
[21:47:10] Spami: has joined #ruby
[21:47:31] Ox0dea: norc: Regexp#=== isn't #=~.
[21:47:33] norc: Monkey patching stdlib clases should only be done with refinements.
[21:47:43] norc: Ox0dea, oh right.
[21:47:56] Darmani: Isn't that why we have Modules??
[21:48:15] norc: Darmani, modules are for reusing code mostlz.
[21:49:03] norc: Darmani, whenever you write functions and do not need state, put it inside a module.
[21:49:16] norc: That is the second use case for modules.
[21:49:31] norc: Otherwise you will be polluting Object.
[21:49:54] norc: &ri Math
[21:49:54] `derpy: http://ruby-doc.org/core-2.3.0/Math.html
[21:49:56] norc: is a good example
[21:50:03] Ox0dea: >> def anagrams? words; words.uniq { |w| w.upcase.chars.sort }.size == 1 end; anagrams? %w[snipe pines penis spine] # Darmani
[21:50:04] ruby[bot]: Ox0dea: # => true (https://eval.in/504183)
[21:50:11] Darmani: So, refining is to create your own methods within an already existing class?
[21:50:27] norc: Darmani, it is for modifying a class locally.
[21:50:37] Darmani: Ox0dea: That looks really nice
[21:50:43] antgel: has joined #ruby
[21:50:59] Ox0dea: Darmani: Is that a dick joke?
[21:51:05] norc: Darmani, think of using a refinement inside a module.
[21:51:15] Darmani: Ox0dea: It can be if you want it to.
[21:51:22] norc: Darmani, once you leave the module, the class is like it was before, unchanged - which is a good thing.
[21:51:41] Darmani: norc: You are destroying my poor mind.
[21:51:52] norc: Darmani, just stop writing code outside modules and classes.
[21:51:56] Darmani: shattering the illusions that held me together Q.Q
[21:52:05] norc: It is just wrong.
[21:52:09] Darmani: YOUR WRONG
[21:52:10] skade: has joined #ruby
[21:53:47] choke: has joined #ruby
[21:54:37] guacamole: has joined #ruby
[21:55:27] norc: Ox0dea, I just realized that executing Ruby code in the SIGSEGV handler is not a wise idea..
[21:55:32] Darmani: Whenever I make a new method
[21:55:36] Darmani: I should do it like that?
[21:55:50] Ox0dea: norc: But totally doable!
[21:56:29] ss_much: has joined #ruby
[21:56:33] norc: Ox0dea, except the SIGSEGV is a strong indicator that memory was fucked up - not the best starting point for continuing to execute Ruby code.
[21:56:48] norc: (Ignoring how charliesome shows how that can be neatly abused)
[21:56:59] Ox0dea: Aye, that's the trick I had in mind.
[21:57:41] norc: Ox0dea, did you also know that charliesomes trick was the reason I started dissecting Ruby?
[21:57:53] norc: Couldnt get it to work on eval.in...
[21:57:55] gbgdev: has joined #ruby
[21:58:20] norc: That is how it all began. :S
[21:58:25] Ox0dea: Interesting.
[21:58:45] Ox0dea: I do vaguely remember your first questions being about exception handling.
[21:59:18] Asher: has joined #ruby
[21:59:40] norc: I hear exception and think longjmp.
[21:59:54] norc: I am that blemished.
[22:00:02] kalopsian: has joined #ruby
[22:01:07] Ox0dea: Unbowed. Unbent. Unbroken.
[22:02:32] stevemackinnon: has joined #ruby
[22:03:07] antgel: has joined #ruby
[22:03:24] Darmani: https://repl.it/BeoF/1 - norc, Ox0dea
[22:03:31] blackmesa: has joined #ruby
[22:03:42] Darmani: It's a script that adds a number to an array. Does it look good?
[22:04:27] norc: Darmani, looks fine.
[22:04:49] norc: Darmani, you can leave the "" parameter to join btw
[22:05:06] Darmani: norc: really? It does that naturally?
[22:05:11] norc: Darmani, try it out and see.
[22:05:23] Darmani: thats cool.
[22:05:30] norc: Darmani, or better yet, read the documentation on methods before you use them.
[22:05:35] norc: ri is really easy to use
[22:05:43] Darmani: Reading is for suckers
[22:06:17] norc: Then you better start sucking.
[22:06:28] Darmani: norc: lmao good answer.
[22:07:00] Darmani: For real though, it feels good to look at a problem and have kind of an idea of how to solve it.
[22:07:02] Ox0dea: >> "Got #{?e * 20}m"
[22:07:03] ruby[bot]: Ox0dea: # => "Got eeeeeeeeeeeeeeeeeeeem" (https://eval.in/504185)
[22:07:16] Ox0dea: Burnt to cinders, mate.
[22:07:36] blackmes1: has joined #ruby
[22:07:52] Ox0dea: Sorry, that really was a great riposte.
[22:08:37] nettoweb: has joined #ruby
[22:08:43] Darmani: yes yes credit where credit is due.
[22:08:53] Carella: is there any reason you used .split(//) instead of .split('')?
[22:09:18] Ox0dea: carella: Did you mean #chars?
[22:09:22] Ox0dea: >> 'foo'.chars
[22:09:23] ruby[bot]: Ox0dea: # => ["f", "o", "o"] (https://eval.in/504186)
[22:09:39] ixti: has joined #ruby
[22:09:44] Darmani: carella - I understood them to be the same thing.
[22:09:45] hannelita: has joined #ruby
[22:10:05] Darmani: Although you should probably ask norc or Ox0dea. They are great at sucking =P
[22:10:24] norc: I dont read Ruby documentation.
[22:10:37] rickmasta: has joined #ruby
[22:10:51] Ox0dea: http://catb.org/jargon/html/U/UTSL.html
[22:10:54] Carella: Darmani: I think (//) may work slower because it is a regex.
[22:11:32] norc: Ox0dea, I haven't heard that in a while.
[22:11:35] Darmani: carella - I mean... Possibly?
[22:11:49] fantasticsid: has joined #ruby
[22:12:01] tubbo: haha Ox0dea i love that
[22:12:02] Carella: Ox0dea: Darmani, .chars looks better anyway
[22:12:10] havenwood: carella: A method without arguments is simpler than a method with arguments. :)
[22:12:31] nettoweb: has joined #ruby
[22:12:38] Darmani: carella - You're probably right ^.^ thanks
[22:12:45] Ox0dea: It's got nothing to do with looks or whatever; split(//) is retarded cargo-culting that should've died long ago.
[22:12:55] gerep: has joined #ruby
[22:12:59] havenwood: Is that a thing?
[22:13:02] Ox0dea: Of course.
[22:13:09] Darmani: norc - https://repl.it/BeoF/2
[22:13:10] Carella: havenwood: I dont think I can agree with you in general
[22:13:13] Darmani: Why isn't my exception working?
[22:13:17] gerep: Hello people. I'm using FPM and running it with bundle exec I get an error on a ruby 2.0.0 file: find.rb on line 40 No such file or directory (Errno::ENOENT). The gist with my command and the error message: https://gist.github.com/gerep/20bd09fa45fe80beb3e0
[22:13:25] apneic: has joined #ruby
[22:13:29] havenwood: carella: It's true nonetheless.
[22:13:44] norc: havenwood, look at some popular Java classes. The endless stream of FactoryFactories is their newest achievement.
[22:13:57] Carella: havenwood: Are you speaking about method that can't take arguments or about the method that can take no argument? :)
[22:13:58] melter: has joined #ruby
[22:14:25] Carella: I thought of the latter at first
[22:14:35] Ox0dea: carella: Methods which take no arguments are likely to be more focused and thus easier to finagle into doing The Right Thing.
[22:14:38] Ox0dea: Sometimes.
[22:14:40] Carella: Then you have to know what default will be use
[22:14:42] havenwood: carella: Like use ''.chars (no arguments) rather than any combo of a method with arguments.
[22:14:51] norc: Ox0dea, especially split. ;-)
[22:15:10] Carella: In that case, I agree
[22:15:13] norc: What a horrid Perl remnant.
[22:15:21] havenwood: carella: [:pie].one? rather than [:pie].size == 1
[22:15:23] Ox0dea: >> "foo \s\a\t\a\n bar".split
[22:15:24] ruby[bot]: Ox0dea: # => ["foo", "\a", "\a", "bar"] (https://eval.in/504200)
[22:15:43] Darmani: Ox0dea, norc - https://repl.it/BeoF/2
[22:15:45] norc: Ox0dea, that works as expected until $; is set.
[22:15:49] Ox0dea: norc: Just so.
[22:16:04] Darmani: when you get a chance, take a look.
[22:16:15] havenwood: I mean: ?\S
[22:16:22] norc: Darmani, use .chars instead of .split(//)
[22:16:30] Ox0dea: havenwood: Huh?
[22:16:37] Darmani: https://repl.it/BeoF/3
[22:17:15] dstarh: has joined #ruby
[22:17:18] havenwood: Ox0dea: Just blathering in psudocode. I need more coffee!
[22:17:21] norc: Darmani, then turn the conditional around to use Enumerable#any?
[22:17:27] norc: Which is more sensible to read.
[22:17:30] cicloid: has joined #ruby
[22:17:35] Ox0dea: havenwood: I mean, you *can* make the default splitter a Regexp, but ?\S is just "S".
[22:17:42] norc: returning from blocks is just ugh ugh.
[22:17:44] havenwood: Ox0dea: aye
[22:17:58] Darmani: norc - Okay fine. But it comes up as false and it shouldn't...
[22:17:59] havenwood: Ox0dea: I should have said: /\S/
[22:18:37] norc: Darmani, you also probably want to use < rather than <=
[22:18:39] jbrhbr: has joined #ruby
[22:18:44] norc: Darmani, because 010 is quite a valid number.
[22:19:02] ruby[bot]: Ox0dea: # => 8 (https://eval.in/504203)
[22:19:05] Darmani: norc - wat
[22:19:09] Ox0dea: ??\_(???)_/??
[22:19:37] norc: Ox0dea, well we are doing "010".to_i
[22:19:52] aspire: has joined #ruby
[22:19:54] norc: Darmani, https://repl.it/BeoF/5
[22:20:04] Ox0dea: >> '%d' % '010' # norc
[22:20:05] ruby[bot]: Ox0dea: # => "8" (https://eval.in/504204)
[22:20:07] havenwood: >> Integer("010")
[22:20:20] ruby[bot]: havenwood: # => 8 (https://eval.in/504205)
[22:20:26] norc: "010".to_i
[22:20:29] norc: >> "010".to_i
[22:20:30] ruby[bot]: norc: # => 10 (https://eval.in/504206)
[22:20:37] norc: that is quite random here...
[22:20:39] jamw: has joined #ruby
[22:20:47] Ox0dea: How do we stop the madness?
[22:20:50] Darmani: that link doesn't work norc.
[22:20:54] norc: Just accept it and call it Ruby.
[22:21:24] zambini: has joined #ruby
[22:21:27] norc: Darmani, it works just fine.
[22:21:50] norc: Ox0dea, sadly this is probably something that will never be changed to be consistent
[22:21:57] Ox0dea: Definitely not. :/
[22:22:03] Darmani: http://ideone.com/p95sdq - norc
[22:22:16] norc: Darmani, drop the return nil.
[22:22:23] norc: it is not necessary.
[22:22:38] Darmani: norc - It's part of the challenge from the website.
[22:22:43] Darmani: I didn't choose to include it.
[22:22:48] norc: Darmani, the website is dumb then.
[22:23:01] DoubleMalt: has joined #ruby
[22:23:06] Darmani: Why does it return nil at all? It shouldn't.
[22:23:08] norc: Darmani, take a good long look at this> arr.any?{ |i| i < 0; return nil}
[22:23:08] Darmani: I don't get that.
[22:23:14] norc: Take a real good long look at it.
[22:23:34] norc: It is just a really long way of simply saying: return nil.
[22:23:34] StevenXL: has joined #ruby
[22:23:35] caffeinic: has joined #ruby
[22:23:38] ascarter: has joined #ruby
[22:23:55] norc: (Assuming the array has at least one element)
[22:24:13] Ox0dea: Just keep throwing shit at the wall.
[22:24:13] Darmani: ohh wait...
[22:24:15] norc: Darmani, the block consists or two separate expressions.
[22:24:19] Darmani: return nil isn't under the conditional???
[22:24:30] Carella: norc: I think it was a stub for one's implementation
[22:24:37] norc: Darmani, yes, and there is absolutely no reason whatsoever to return nil.
[22:24:49] Darmani: whaaaaat that's retarded
[22:24:54] Darmani: it's within the block
[22:24:56] norc: Darmani, arr.any?{ |i| i < 0 }
[22:24:58] norc: Darmani, is just fine.
[22:24:59] Darmani: how is it not under the conditional?
[22:25:44] Carella: You don't have a condition operator like `if` in there
[22:25:47] Carella: why should it be?
[22:25:50] norc: Darmani, https://gist.github.com/norc/c09002b786f36c748a10
[22:26:02] norc: Darmani, you are doing something like this.
[22:26:12] Darmani: norc - I get that now.
[22:26:19] Carella: Unless is outer scope
[22:26:22] emilford: has joined #ruby
[22:26:25] norc: Darmani, and again, arr.any?{ |i| i < 0 } - do it like that.
[22:26:44] Darmani: I did. That's how it looks in my editor.
[22:27:20] Darmani: norc - Thanks norc. For putting up with me and my stupid questions.
[22:27:22] Darmani: You're my hero.
[22:29:16] lucasb: Darmani: you are learning ruby pretty fast, congrats.
[22:29:46] bollullera: has joined #ruby
[22:29:55] edwinvdgraaf: has joined #ruby
[22:30:15] Darmani: lucasb - Thanks dude. But I can't actually create a program to save my life. I can write tiny scripts that do this and that. But that's all :P
[22:30:52] dfinninger: has joined #ruby
[22:31:33] Cohedrin: Darmani what program do you want to be writting?
[22:31:46] Cohedrin: most programs start as just writting a script
[22:31:54] Cohedrin: then they evolve into a "program"
[22:33:25] TomPeed: has joined #ruby
[22:33:39] jbrhbr: Integer() and .to_i differ in integer format error handling as well (exception vs do-your-best). it's for the same reason but i first ran across this inconsistency there
[22:34:46] Darmani: Cohedrin - yeah... I never know how to answer that question. That's what everyone keeps telling me though.
[22:35:16] Darmani: Cohedrin - One of these days I want to make a music player of some sort. When I'm at Ox0dea's or Radar's level =P
[22:35:23] lacrymology: has joined #ruby
[22:36:48] Ox0dea: Darmani: Dir['*.mp3'].each { |f| `mpg123 #{f}` }
[22:37:12] lacrymology: how can I construct a list and then yield each element in it?
[22:37:25] apeiros: Ox0dea: use glob and drop the .each ;-p
[22:37:42] Darmani: glob? Really that's a thing? lmao
[22:38:19] Ox0dea: apeiros: Could still use #[].
[22:38:36] apeiros: Ox0dea: sugared [] does not take blocks
[22:38:43] Ox0dea: apeiros: I meant unsugared, of course.
[22:38:45] Ox0dea: *desugared
[22:38:55] apeiros: yeah, ew. don't :)
[22:39:12] Ox0dea: Won't. :)
[22:39:31] choke: has joined #ruby
[22:40:20] Carella: what's that?)
[22:41:29] Ox0dea: carella: Dir['*.foo'] returns all the files in the current directory that match that pattern. If you spell it differently, you can say Dir.glob('.*foo') { |f| ... } to "do something" with each file.
[22:41:56] Ox0dea: Dir[foo] is just "sugar" for Dir.[](foo), but only the latter can take a block.
[22:42:11] Carella: So #[] is a syntax sugar for glob?
[22:42:19] Ox0dea: It's an alias, yeah.
[22:42:24] Carella: oh, thanks
[22:43:33] croberts: has joined #ruby
[22:43:41] Radar: lacrymology: Do you have an example of what you're trying to do?
[22:43:53] zenlot1: has joined #ruby
[22:44:03] moeabdol: has joined #ruby
[22:44:44] yfeldblum: has joined #ruby
[22:44:51] lacrymology: Radar: I get a list of objects, modify some of them, and filter them, it's kind of involved. At the end I have a list and I want the caller to do `foo do |e| ... end`
[22:45:06] lacrymology: with |e| being each element of that list
[22:45:40] diegoviola: has joined #ruby
[22:45:41] Ox0dea: lacrymology: list.each { |e| yield e }
[22:45:43] huluhuluhulu: has joined #ruby
[22:45:46] moeabdol: has joined #ruby
[22:45:56] Ox0dea: Can't say list.each(&method(:yield)) since yield isn't a method.
[22:46:16] lucasb: I put a yield method in my Object
[22:46:39] radgeRayden__: has joined #ruby
[22:46:59] Ox0dea: >> Enumerator::Yielder.instance_method :yield
[22:47:00] ruby[bot]: Ox0dea: # => #<UnboundMethod: Enumerator::Yielder#yield> (https://eval.in/504213)
[22:47:27] karapetyan: has joined #ruby
[22:47:42] Radar: Ok calm dowon there
[22:48:29] SenpaiSilver: has joined #ruby
[22:48:59] Ox0dea: https://en.wikipedia.org/wiki/Tom_Dwan
[22:51:13] Ox0dea: Hash#merge lets you pass a block for resolving conflicts; it'd be nice if #invert did too.
[22:51:38] aryaching: has joined #ruby
[22:51:57] CloCkWeRX: has joined #ruby
[22:52:26] derailed: Hey everyone, newbie ruby question here: What's the different between defining classes in a module, versus defining a class like "class MyModule::MyClass"
[22:52:54] lucasb: {}.merge(h.to_a.map(&:reverse)) { ... }
[22:53:21] lucasb: oops, no, this doesn't work
[22:53:56] Ropeney: has joined #ruby
[22:54:47] Ox0dea: Derailed: Constant resolution works differently: https://eval.in/504214
[22:55:38] dlitvak: has joined #ruby
[22:56:44] Hammy_Work: has joined #ruby
[22:57:02] Carella: Isn't MyModule::MyClass exist mostly for module extension?
[22:57:19] devbug: has joined #ruby
[22:57:59] derailed: Ox0dea, thanks. I clearly need to get my head around constant resolution and namespaces in ruby. I'm looking at code that defines classes "Product", "Domestic::Product" and "International::Product", and just trying to work out if they might ever be 'mistaken' for each other
[22:58:27] derailed: But I guess if you're ever referring to those classes, you would always do so with the fully qualified name?
[22:59:41] derailed: ...unless you're a in a block delimited by 'module Domestic' for example?
[23:01:19] Ox0dea: Derailed: `self` is the same in both of those.
[23:01:50] derailed: in both of which?
[23:01:57] Ox0dea: https://eval.in/504214
[23:02:04] nerium: has joined #ruby
[23:02:16] Ox0dea: If you replace `p Foo` with `p self`, you get `M::C` in both cases.
[23:02:40] Ox0dea: Resolving the constant `Product` is never a "guessing game", so to speak.
[23:02:48] BigFish: the tutorial for Greeter classes are already giving me errors
[23:02:57] BigFish: it's a sign, i should run while i can
[23:03:02] phredus: has joined #ruby
[23:03:08] Ox0dea: Don't succumb to the sunk cost fallacy.
[23:03:30] BigFish: sunk cost ?
[23:03:36] derailed: Ox0dea, I think I get it, I'll find something to read about the constant resolution
[23:04:23] Ox0dea: Derailed: It's more or less like method resolution.
[23:04:57] Ox0dea: It walks up the ancestor chain looking for a matching constant; if it doesn't find one, it tries to invoke #const_missing on the receiver, and then walks up the ancestor chain resolving that.
[23:05:04] herbst: has joined #ruby
[23:06:02] Ox0dea: You'd only have to use a qualifier if you wanted to refer to Domestic::Product from within Internation::Product or vice-versa.
[23:07:24] rakm: has joined #ruby
[23:07:50] zambini: has joined #ruby
[23:08:56] NoTroutAboutIt: has joined #ruby
[23:09:08] derailed: Ox0dea, side track: am I correct that the actual .rb files or directories these classes are defined in is meaningless? Unlike Python/java/etc, Ruby does not CARE what the filename is (although rails might care for it's magical autoloading?)
[23:09:24] Ox0dea: Derailed: Just so.
[23:09:43] Ox0dea: No harm in keeping things sanely organized, of course.
[23:10:09] derailed: For context, it's a rails project I'm reading. These are all different models
[23:11:23] Ox0dea: Rails is picky about directory structure out-of-the-box, and there's little sense in bothering to circumvent it there.
[23:11:41] sakix: has joined #ruby
[23:11:55] Ox0dea: Convention > configuration only works if everybody's on board. :P
[23:12:52] babblebre: has joined #ruby
[23:14:11] Mia: has joined #ruby
[23:14:11] Mia: has joined #ruby
[23:14:29] solocshaw: has joined #ruby
[23:15:36] BigFish: wrong number of arguments..
[23:15:47] BigFish: I don't see how, I'm following the dumb tut just fine
[23:15:57] BigFish: unless @name is a variable
[23:16:00] BigFish: ( ???? ???? ????)
[23:16:03] Ox0dea: ??\_(???)_/??
[23:16:07] Ox0dea: Learn the violin.
[23:16:08] rickmasta: has joined #ruby
[23:18:52] Radar: BigFish: Just give it the right number of arguments.
[23:18:55] Sperant: has joined #ruby
[23:18:57] Radar: That'll fix it.
[23:19:14] Radar: BigFish: what version of Ruby do you have installed btw? 2.3 has a better error message for that case.
[23:19:19] BigFish: i know you guys are programmers but these jokes give me no confidence
[23:19:33] Carella: Paste some code
[23:19:56] Mia: has joined #ruby
[23:19:56] Mia: has joined #ruby
[23:20:03] moeabdol: has joined #ruby
[23:20:33] wolffles: has joined #ruby
[23:20:36] cicloid: has joined #ruby
[23:20:54] BigFish: carella: https://www.ruby-lang.org/en/documentation/quickstart/2/
[23:20:57] BigFish: bottom of that page
[23:20:59] Radar: BigFish: No, your code.
[23:21:20] BigFish: you mean what i'm typing in
[23:21:20] Radar: ?gist BigFish
[23:21:20] ruby[bot]: BigFish: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[23:21:24] Radar: Take what code you have and put it on that.
[23:22:42] ChameleonSix: has joined #ruby
[23:23:17] wolffles: has joined #ruby
[23:23:35] devbug: has joined #ruby
[23:23:49] BigFish: Radar https://gist.github.com/anonymous/38b9050bdf593fb3ae87
[23:23:58] BigFish: How exciting, sharing tut code.
[23:24:20] Radar: BigFish: What method are you calling to get the error that you're seeing?
[23:24:33] Radar: BigFish: (gotta crawl before you can walk, etc.)
[23:25:10] huluhuluhulu: has left #ruby: ()
[23:25:44] Carella: initialize, not initalize
[23:25:48] Carella: to begin with
[23:26:03] Carella: but that's another issue
[23:26:12] ChameleonSix: has left #ruby: ()
[23:26:17] Radar: carella: That might be it actually.
[23:26:18] uris: has joined #ruby
[23:26:23] zenspider: what is this, python?
[23:26:40] Radar: zenspider: THIS. IS. ... ok I'll stop now.
[23:26:49] Carella: Radar: shouldn't be. It will just print nil
[23:26:52] Radar: zenspider: The indentation needs some work, but he's just new.
[23:27:00] choke: has joined #ruby
[23:27:01] Radar: carella: Greeter.new("name") would give the wrong number of arguments.
[23:27:15] Carella: Radar: crap, right
[23:27:22] Radar: ArgumentError: wrong number of arguments (given 1, expected 0) in my Ruby 2.34.
[23:27:26] Radar: Ruby 2.3*
[23:27:35] B1n4r10: has joined #ruby
[23:27:46] zenspider: carella: is it another issue?
[23:28:01] zenspider: it isn't, is it?
[23:28:14] BigFish: forgot to end after say_hi
[23:28:22] guacamole: has joined #ruby
[23:28:31] zenspider: that's a syntax error, you didn't get a syntax error
[23:28:36] howdoicomputer: has joined #ruby
[23:28:37] Carella: zenspider: that's it
[23:28:38] zenspider: you just have shitty indentation and can't tell you ended it
[23:28:49] Carella: BigFish: You didn't forget
[23:29:00] BigFish: no I just had to rewrite it
[23:29:20] zenspider: you didn't HAVE to rewrite it. you rewrote it.
[23:29:47] Carella: Do you really write it right in the irb?
[23:30:01] BigFish: It's what I know right now so yes
[23:30:13] BigFish: It's like what Radar said, crawling before I can walk
[23:30:18] karapetyan: has joined #ruby
[23:30:43] pdoherty: has joined #ruby
[23:30:59] BigFish: it worked for some reason
[23:31:19] Carella: Well, it's your call, but i'd suggest writing it in the text editor
[23:31:49] dn`: has joined #ruby
[23:32:00] Carella: so you wouldn't have to retype it everytime
[23:32:03] mary5030: has joined #ruby
[23:32:19] guacamole: has joined #ruby
[23:32:37] dlitvak_: has joined #ruby
[23:32:46] herbst: has joined #ruby
[23:33:56] lucasb: has joined #ruby
[23:33:58] zambini: has joined #ruby
[23:34:29] vikas027: has joined #ruby
[23:34:54] asmodlol: has joined #ruby
[23:36:20] dpg1: has joined #ruby
[23:36:30] chouhoulis: has joined #ruby
[23:36:46] pawnbox: has joined #ruby
[23:37:18] vikas027: Hello Everyone, how can I write a file to a particular location in ruby, without location it is working fine though. - https://dpaste.de/FPiR
[23:37:43] ur5us: has joined #ruby
[23:37:43] Radar: vikas027: line 13 is invalid syntax.
[23:37:47] zast: has joined #ruby
[23:38:02] Radar: vikas027: Perhaps you meant FIle.join("/tmp/configs", job) ?
[23:38:13] karapetyan: has joined #ruby
[23:38:29] vikas027: @Radar: No, I don't want to join the files
[23:38:48] Carella: it will join the name of the folder with the filename
[23:38:53] vikas027: Radar: There are bunch of different files, which I want to write to a location
[23:39:13] Carella: http://ruby-doc.org/core-2.2.0/File.html#method-c-join
[23:39:33] lucasb: I created a class Box with a single instance variable "@value", just to play with the concept of a variable storage as a first class object. this pattern has a name? is there example of this in the ecosystem or other languages?
[23:39:36] Radar: vikas027: Line 13 should probably be open(File.join("/tmp/configs/",job), 'a') { |f|
[23:39:36] zambini: has joined #ruby
[23:39:39] northfurr: has joined #ruby
[23:39:40] vikas027: carella: Ah, okay. Got it. Thanks, I will try this out.
[23:39:47] vikas027: Radar: Thanks to you too. :)
[23:39:54] Radar: ?code lucasb
[23:39:54] ruby[bot]: lucasb: We can't help you without your code, please post it to https://gist.github.com
[23:40:38] lucasb: class Box; def initialize(value); @value = value; end; end; Box.new(42)
[23:40:48] Carella: please, open the link :)
[23:41:05] dfinninger: has joined #ruby
[23:41:25] lkba: has joined #ruby
[23:41:39] Radar: lucasb: That's just an instance variable which is exactly what it says on the tin: a variable for just that one instance.
[23:41:57] Ox0dea: lucasb: That should just be `Box = Struct.new(:value)`, mind.
[23:42:16] lucasb: Ox0dea: indeed, that would be simpler
[23:42:23] Ox0dea: Not simpler, but easier.
[23:43:08] lucasb: I'm just playing with ideas, I still don't know what I really want :)
[23:43:34] lucasb: anyway, I wanted a mutable self. But then I hit that error "Can't change the value of self"
[23:43:40] lucasb: that's why I created this Box
[23:44:41] Ox0dea: Are you sure you want a mutable self?
[23:44:57] vikas027: Radar, Carella: Thank you for pointing me there. This is working fine :) https://dpaste.de/6gpJ
[23:45:25] lucasb: Ox0dea: well, I'm just experimenting
[23:45:32] dpg1: has joined #ruby
[23:45:35] Ox0dea: lucasb: I won't knock that.
[23:46:50] rcs: has joined #ruby
[23:47:07] Axy: has joined #ruby
[23:47:07] Axy: has joined #ruby
[23:47:11] Carella: lucasb: When you asked about the name of this pattern what exactly did you mean? A class that will consist of exactly one variable?
[23:47:47] blackmes1: has joined #ruby
[23:47:50] skade: has joined #ruby
[23:48:19] lucasb: carella: yes, just wanted to know if there was something as simple as this concept in the wild. I think I saw something like that in Rust, but I don't understand that language very well
[23:48:41] Ox0dea: Boxing is for when your primitive types can't behave like objects.
[23:48:46] Ox0dea: That doesn't apply to Ruby.
[23:49:25] uris: has joined #ruby
[23:49:39] lucasb: yes, in that sense, I agree.
[23:49:51] xm: has joined #ruby
[23:51:14] Ox0dea: lucasb: https://eval.in/504236
[23:51:55] Carella: lucasb: it can be useful if you want to separate your domain entity from its implementation
[23:52:02] dlitvak: has joined #ruby
[23:52:03] Ox0dea: lucasb: But probably pretend you didn't see that.
[23:52:58] Ox0dea: It quickly goes wonky: https://eval.in/504237
[23:53:50] djbkd: has joined #ruby
[23:54:08] Ox0dea: Oh, and here's Hash#invert with conflict resolution: https://eval.in/504238
[23:54:10] skade: has joined #ruby
[23:54:47] lucasb: yeah, I know nothing about fiddle. I still need to clarify my ideas before asking something concrete. Thanks for the initial sanity check, people :)
[23:55:26] casadei: has joined #ruby
[23:55:42] futilegames: has joined #ruby
[23:55:59] rcs: has joined #ruby
[23:57:58] NoTroutAboutIt: has joined #ruby
[23:58:53] chouhoul_: has joined #ruby