« Back to channel list

#ruby - 28 July 2015

« Back 1 day Forward 1 day »
[00:00:11] texasmade: I'm missing something minor here and it's bugging me. I'm getting two numbers and storing them each in a variable (x, y), but when i sum = x+y and puts #{sum} it gives me the number mashed together
[00:00:25] texasmade: example 1 + 3 = 13
[00:00:41] Ox0dea: texasmade: You're using strings.
[00:00:49] Ox0dea: >> [1 + 3, '1' + '3']
[00:00:50] ruboto: Ox0dea # => [4, "13"] (https://eval.in/407016)
[00:01:38] texasmade: I miss small details when i don't get enough sleep. Thanks
[00:01:42] Ox0dea: Sure thing.
[00:01:59] casadei_: has joined #ruby
[00:03:39] Scripore: has joined #ruby
[00:05:47] hays: what is a sensible pattern for handling a pair of persistent TCP connections? do I need threads for this?
[00:06:44] eam: hays: no, an alternative to threads is multiplexed i/o
[00:08:02] Alayde: has joined #ruby
[00:08:06] eam: (threads are fine, but so are alternatives)
[00:08:43] willywos: has joined #ruby
[00:11:10] ecksit: has joined #ruby
[00:11:44] Contigi: has joined #ruby
[00:15:18] sevenseacat: has joined #ruby
[00:16:53] nobitanobi: has joined #ruby
[00:18:15] dopie: has joined #ruby
[00:20:08] gheegh: has joined #ruby
[00:20:17] senayar: has joined #ruby
[00:20:39] swgillespie: has joined #ruby
[00:21:10] T3: has joined #ruby
[00:21:16] mary5030: has joined #ruby
[00:24:31] gheegh: hey all. given I'm using a gem (Legato) that has basically class-method-based configuration.. how do I modify that without producng another class? https://gist.github.com/wflanagan/8a34fe2d592df1ade45f
[00:25:13] Vile`: has joined #ruby
[00:26:06] neoseeker: has joined #ruby
[00:28:33] benlovell: has joined #ruby
[00:30:34] freerobby: has joined #ruby
[00:33:45] arescorpio: has joined #ruby
[00:34:45] Ox0dea: gheegh: It's not clear what you intend to do.
[00:34:58] xcyclist: http://pastie.org/10315479
[00:35:04] xcyclist: Sorry it took so long.
[00:35:56] Ox0dea: $ irb -rubygems
[00:36:01] Ox0dea: xcyclist: What happens if you run that?
[00:36:02] mleung: has joined #ruby
[00:36:24] gheegh: basically.. i want to change the items that are in the "metrics" and dimensions.. without defining an additional class.. say, for example, i want to change the dimentions from "goal_previous_step_1" to "goal_previous_step_2".. if this is static, i have to define a new model.. i have to believe there's a way i can "ocnfigure" thte class to avoid it.
[00:37:08] xcyclist: irb is not available.
[00:37:13] kies^: has joined #ruby
[00:37:25] xcyclist: I just made http://pastie.org/10315483
[00:37:49] xcyclist: This is in cygwin on windows 10.
[00:38:23] Ox0dea: xcyclist: Did you use RubyInstaller?
[00:38:42] dseitz: has joined #ruby
[00:39:19] xcyclist: No. I just install cygwin.
[00:39:22] Oog: has joined #ruby
[00:39:26] garbgargh: has joined #ruby
[00:39:54] xcyclist: Python works fine.
[00:40:59] Ox0dea: xcyclist: Windows + Ruby is painful, and I've only heard of RubyInstaller easing that pain to any considerable degree.
[00:41:17] baweaver: has joined #ruby
[00:41:23] Ox0dea: gheegh: #metrics and #dimensions are just methods here.
[00:41:34] Ox0dea: You should be able to invoke them dynamically with #send.
[00:41:56] gheegh: ok.. interesting.. i'll try it.
[00:42:05] gheegh: didn't think of that. .thought it would be harder than that.
[00:42:09] Asher: has joined #ruby
[00:42:17] xcyclist: Ok. I'll just not use Ruby then.
[00:43:31] michaeldeol: has joined #ruby
[00:44:00] Yzguy: has joined #ruby
[00:44:11] benlovell: has joined #ruby
[00:45:08] charliesome: has joined #ruby
[00:45:50] sevenseacat: cygwin causes nothing but grief.
[00:46:32] CloCkWeRX: has joined #ruby
[00:46:35] CloCkWeRX: has left #ruby: ()
[00:47:02] sevenseacat: like, I used to think I was awesome, using it for all my uni assignments so I didn't have to learn unix, but then all the code I wrote completely broke when run there
[00:47:16] sevenseacat: soooo much fun
[00:48:04] JeramyRR: has joined #ruby
[00:48:57] chipotle: has joined #ruby
[00:48:58] senayar: has joined #ruby
[00:49:00] s00pcan: has joined #ruby
[00:49:45] iWaffles: has joined #ruby
[00:51:00] juanpablo____: has joined #ruby
[00:51:03] iateadonut: has joined #ruby
[00:52:38] allcentury: has joined #ruby
[00:53:28] shevy: tis be not a unix cat!
[00:53:48] shock_one: has joined #ruby
[00:54:07] yaw: has joined #ruby
[00:54:11] tabakhase: has joined #ruby
[00:54:23] yaw: has left #ruby: ()
[00:54:43] sankaber: has joined #ruby
[00:56:01] nobitanobi: has joined #ruby
[00:56:14] dbussink: has joined #ruby
[00:56:14] dented42: has joined #ruby
[00:56:34] rmoriz: has joined #ruby
[00:57:50] Gadgetoid: has joined #ruby
[00:58:04] nklv: has joined #ruby
[00:59:05] Ox0dea: $ cat $(cat)
[00:59:20] keen__________32: has joined #ruby
[00:59:31] laurentide: has joined #ruby
[01:00:43] minmax: has joined #ruby
[01:01:13] NeverDie: has joined #ruby
[01:02:14] Papierkorb_: has joined #ruby
[01:03:10] Jester13: has joined #ruby
[01:03:38] radgeRayden: has joined #ruby
[01:06:15] Azure: has joined #ruby
[01:08:47] rcvalle: has joined #ruby
[01:10:32] neoseeker: has joined #ruby
[01:12:02] The_Phoenix: has joined #ruby
[01:12:24] crdpink2: has joined #ruby
[01:12:38] EminenceHC: has joined #ruby
[01:17:08] dfockler: has joined #ruby
[01:17:26] pauly_oc: has joined #ruby
[01:17:47] Vile`: has joined #ruby
[01:20:42] Westerbly_: has joined #ruby
[01:21:05] icharlie: has joined #ruby
[01:21:22] webopsx: has joined #ruby
[01:23:16] werelivinginthef: has joined #ruby
[01:24:28] lwu_: has joined #ruby
[01:25:08] user1138: has joined #ruby
[01:26:09] werelivi_: has joined #ruby
[01:26:10] Yzguy: has joined #ruby
[01:26:42] aaeron: has joined #ruby
[01:27:02] auzty: has joined #ruby
[01:28:26] aaeron: Hi Ox0dea: I used multipart post to upload a file. I am not sure how to do a regular set_form_data post using this. Hence I decided to use RestClient. My concern is that how does it upload the file. Does it put everything in memory or does it do a streaming post
[01:28:38] aaeron: There documentation does not provide enough information
[01:29:03] tabakhase: when installing my gem as --dev it correctly gets bundler and rake - but fails on installing spec
[01:29:05] Coraline: aaeron: is this for a Rails app?
[01:29:29] tabakhase: "rspec requires rspec-core (~> 3.3.0)" and fails like that ignoring whatever stack of versions i specify
[01:29:40] aaeron: Coraline: nope
[01:29:43] kenndel: has joined #ruby
[01:29:47] RobertBirnie: has joined #ruby
[01:30:25] Coraline: tabakhase: how are you specifying rpsec in your gem spec?
[01:30:44] Coraline: aaeron: sorry, I'm not familiar enough with RestClient to answer that.
[01:30:52] Coraline: aaeron: you could browse the source?
[01:30:59] aaeron: Oh. np Coraline
[01:31:04] aaeron: Okay I can try that
[01:31:20] tabakhase: Coraline first i had a "spec.add_development_dependency 'rspec'" - but that gave me a 0.9.2 at some point :D - so im struggeling to say "+3" i think
[01:31:39] tabakhase: '~> 3.3.0' would seem legit, but fails with sayd error
[01:31:48] Ox0dea: aaeron: https://github.com/rest-client/rest-client/blob/master/lib/restclient/request.rb#L325
[01:32:01] Ox0dea: That seems to indicate that it's at least capable of streaming.
[01:32:14] Coraline: tabakhase: try specifying the gem version
[01:32:21] tabakhase: funFact now, when i run the install of my bundler in my repo it can install rspec correctly (using rspec-core 3.3.2)
[01:32:28] aaeron: Ox0dea. thanks.
[01:32:35] Ox0dea: Sure thing.
[01:32:38] aaeron: But I am not sure if that is the default use
[01:32:57] Ox0dea: How do you mean?
[01:33:08] Ox0dea: You're doing a POST, no?
[01:33:15] tabakhase: EOL is "spec.add_development_dependency "rspec", "~> 3.0"" works fine with bundler, but fails with checking spec-core using "gem instal --dev"
[01:33:27] aaeron: Oh I was thinking if we are suppose to specify stream somewhere
[01:33:46] aaeron: Like in this
[01:33:47] aaeron: RestClient.post( url,
[01:33:47] aaeron: :transfer => {
[01:33:47] aaeron: :path => '/foo/bar',
[01:33:47] aaeron: :owner => 'that_guy',
[01:33:47] aaeron: :group => 'those_guys'
[01:33:48] aaeron: :upload => {
[01:33:49] aaeron: :file => File.new(path, 'rb')
[01:33:52] Ox0dea: This guy.
[01:34:12] aaeron: They hav e this
[01:34:13] aaeron: ??? manually handle the response (e.g. to operate on it as a stream rather than reading it all into memory)
[01:34:19] aaeron: In their readme
[01:34:39] Ox0dea: Right, you'll need to set up a block to handle the streamed response if that's what you intend to do.
[01:35:10] kies^: has joined #ruby
[01:35:12] Ox0dea: aaeron: RestClient.post eventually calls #net_http_do_request, to clarify.
[01:35:22] aaeron: that helps
[01:35:27] aaeron: Thanks Ox0dea
[01:35:35] Radar: aaeron: no spam plzkthx
[01:35:36] Coraline: tabakhase do you mean bundle install?
[01:35:54] tabakhase: Coraline jep
[01:36:02] aaeron: Radar: I meant no spam
[01:36:21] Emmanuel_Chanel: Hello! Someone knows some good file uploader CGI software in open source or so?
[01:36:30] braincrash: has joined #ruby
[01:36:31] Ox0dea: > 2015 cgi
[01:36:50] Coraline: tabakhase: take a look inside your Gemfile.lock and see if rspec-core is there
[01:37:00] joneshf-laptop: has joined #ruby
[01:37:29] workmad3: has joined #ruby
[01:38:28] tkuchiki: has joined #ruby
[01:38:48] tabakhase: Coraline in the .gem tar that i try to install Gemfile.lock is not present -- in my repo (what is a exact clone of this VM) i have rspec-core (3.3.2) -- "bundle install" also sucessfully installs 3.3.2 on the test machine
[01:39:12] tabakhase: just the "gem install --dev" method does not find it
[01:39:23] bendiken: has joined #ruby
[01:40:29] chills42: has joined #ruby
[01:40:41] tabakhase: i also tryed listing all the dependencies for the rspec package, no success ether
[01:41:20] swgillespie: has joined #ruby
[01:41:25] markholmes: has joined #ruby
[01:44:50] auzty: has joined #ruby
[01:47:41] tabakhase: wrote that rspec issue down to compare http://nopaste.linux-dev.org/?664269 Coraline
[01:49:59] nobitanobi: has joined #ruby
[01:52:52] Coraline: tabakhase: sorry, I don't know what's happening
[01:53:16] arescorpio: has joined #ruby
[01:54:23] christiandsg: has joined #ruby
[01:55:19] tabakhase: its werido, a manual gem install rspec succeds with all the latest versions just fine
[01:55:24] bruno-: has joined #ruby
[01:55:34] markholm_: has joined #ruby
[01:55:35] omegamike: has joined #ruby
[01:55:46] tabakhase: what should my version string look like to say "any 3"? i belive i dont understand what ~> does here exacly...
[01:55:51] shevy: do you guys recommend for methods such as this: def foo; return 42; end to omit the return statement?
[01:56:20] GriffinHeart: has joined #ruby
[01:56:47] tabakhase: and after manually installing rspec also instally my gem as --dev is successfull
[01:56:52] RickHull: i do. I like explicit returns only for abnormal control flow
[01:56:59] Ox0dea: shevy: `return` is virtually a code smell.
[01:57:38] eam: I also like explicit returns
[01:57:43] Ox0dea: eam: You misread RickHull.
[01:57:56] HoppingMadMan: has joined #ruby
[01:57:58] eam: well, I know he only likes them conditionally
[01:58:11] eam: my appreciation outstrips his
[01:59:55] brandon: has joined #ruby
[02:00:04] tsujp: has joined #ruby
[02:00:47] thang: has joined #ruby
[02:00:51] adaedra: has joined #ruby
[02:02:10] Mendenhall: has joined #ruby
[02:02:36] weemsledeux: has joined #ruby
[02:04:41] shevy: one day I should write a shevy's ruby styleguide
[02:05:06] JCOE: has joined #ruby
[02:05:26] tuxtgz: has joined #ruby
[02:07:56] Cache_Money: has joined #ruby
[02:08:01] xcesariox: has joined #ruby
[02:08:07] juanpablo____: has joined #ruby
[02:08:09] j4d: has joined #ruby
[02:10:55] tuxtgz: has joined #ruby
[02:11:06] GriffinHeart: has joined #ruby
[02:12:52] lwu: has joined #ruby
[02:12:57] Maletor: has joined #ruby
[02:13:18] Ox0dea: shevy: You write some pretty crazy Ruby. :P
[02:13:21] dymk: It seems like there's no way to change the path of a gem based on the group the gem is in
[02:13:29] dymk: has anyone done that before?
[02:13:48] RickHull: dymk: in what context?
[02:14:17] Aeyrix: Ox0dea: Even, say
[02:14:21] dymk: RickHull, lets say you've got `gem "my_priv_gem", path: "../../some_path"` that exists on development, but at a different path in prod
[02:14:24] Aeyrix: return unless <something>
[02:14:44] dymk: RickHull, what I did was put two `gem my_private_gem` in different groups with different paths
[02:14:57] Ox0dea: Aeyrix: That's arguably "abnormal control flow", but it makes sense enough.
[02:14:58] dymk: however bundler complains about duplicate gems
[02:15:10] Aeyrix: Ox0dea: Preferred?
[02:15:30] Ox0dea: Yes, I think it's an exception to the rule.
[02:15:50] n_blownapart: has joined #ruby
[02:15:55] Ox0dea: It helps combat rightward drift, if nothing else.
[02:16:00] RickHull: arguably still a smell. doesn't mean rotten. just an indicator that there is likely a more elegant way
[02:16:17] Aeyrix: RickHull: The alternative would most probably be wrapping it all in an `unless`.
[02:16:26] sankaber: has joined #ruby
[02:16:32] Ox0dea: Which is indeed not as "elegant".
[02:16:45] Aeyrix: I like your term: rightward drive. :^)
[02:17:12] Ox0dea: http://i.imgur.com/BtjZedW.jpg
[02:17:22] Ox0dea: Also known as "Hadouken code".
[02:17:24] Aeyrix: ififififififififififif
[02:17:25] RegulationD: has joined #ruby
[02:18:02] Alayde: has joined #ruby
[02:18:05] Ox0dea: Regarding `return unless`, there are points for and against having the unhappy path right at the top of a method.
[02:18:46] Ox0dea: "Here's what could but probably won't go wrong; important shit to follow." > "Hm, looks good. Oh, wait, here's all the error handling."
[02:18:49] RickHull: i like the top. validate, then process
[02:18:57] christiandsg: has joined #ruby
[02:19:09] PhantomSpank: has joined #ruby
[02:19:36] ledestin: has joined #ruby
[02:22:01] werelivinginthef: has joined #ruby
[02:22:05] mbeasley_: has joined #ruby
[02:23:25] thiagovsk: has joined #ruby
[02:23:27] ramfjord: has joined #ruby
[02:25:33] icebourg: has joined #ruby
[02:25:36] havenwood: has joined #ruby
[02:29:58] MrSamuel: has joined #ruby
[02:31:25] christiandsg: has joined #ruby
[02:32:30] Musashi007: has joined #ruby
[02:33:15] dseitz: has joined #ruby
[02:33:52] qiukun: has joined #ruby
[02:34:16] ruby-lang871: has joined #ruby
[02:34:40] sypheren: has joined #ruby
[02:34:43] JCOE: has joined #ruby
[02:34:45] ddarkpassenger: has joined #ruby
[02:36:50] s2013: has joined #ruby
[02:37:42] krz: has joined #ruby
[02:41:33] christiandsg: has joined #ruby
[02:47:46] Channel6: has joined #ruby
[02:48:42] ReK2: has joined #ruby
[02:48:44] ReK2: has joined #ruby
[02:49:02] bosma: has joined #ruby
[02:50:24] texasmade: has joined #ruby
[02:53:08] christiandsg: has joined #ruby
[02:55:37] benlovell: has joined #ruby
[02:55:46] RonRichie: has joined #ruby
[02:56:15] shock_one: has joined #ruby
[02:56:17] dudoom: has joined #ruby
[02:58:14] havenn: has joined #ruby
[02:58:32] bronson: has joined #ruby
[02:58:47] bosma: has joined #ruby
[02:59:36] sypheren: has joined #ruby
[02:59:49] Vile`: has joined #ruby
[03:03:52] shum: has joined #ruby
[03:04:52] RonRichie: has joined #ruby
[03:09:29] darkf: has joined #ruby
[03:09:31] werelivinginthef: has joined #ruby
[03:10:05] Maletor: has joined #ruby
[03:10:11] braincrash: has joined #ruby
[03:10:14] Feyn: has joined #ruby
[03:10:47] Feyn: has joined #ruby
[03:10:59] maletor_: has joined #ruby
[03:12:18] towski_: has joined #ruby
[03:13:04] MrSamuel: has joined #ruby
[03:13:19] tsujp: has joined #ruby
[03:13:29] sypheren: has joined #ruby
[03:14:42] xkickflip: has joined #ruby
[03:15:31] theery: has joined #ruby
[03:18:46] Fezzler: has joined #ruby
[03:18:55] RegulationD: has joined #ruby
[03:19:25] webopsx: has joined #ruby
[03:20:00] baweaver: has joined #ruby
[03:21:07] theery: has joined #ruby
[03:22:07] theery: has joined #ruby
[03:22:18] mbeasley_: has joined #ruby
[03:22:45] theery: has joined #ruby
[03:23:22] michael_mbp: has joined #ruby
[03:23:27] theery: has joined #ruby
[03:23:45] theery: has joined #ruby
[03:26:12] workmad3: has joined #ruby
[03:30:06] Mendenhall: has joined #ruby
[03:30:38] sypheren: has joined #ruby
[03:31:08] Aeyrix: Finally got a Mac keyboard at work.
[03:31:12] Aeyrix: 1v1 me typeracer :^)
[03:31:40] bronson: has joined #ruby
[03:34:59] kies^: has joined #ruby
[03:36:26] Ox0dea: Aeyrix: Lemme prep.
[03:36:34] Aeyrix: gotta work now :P
[03:38:29] sevenseacat: ACTION gets popcorn
[03:39:44] Aeyrix: Fuck I don't have my superhero cape here
[03:39:45] willywos: has joined #ruby
[03:39:48] Aeyrix: Looks like it'll have tow ait
[03:39:54] Aeyrix: I can't speedtype without my superhero cape
[03:40:30] GeissT: has joined #ruby
[03:41:43] sypheren: has joined #ruby
[03:42:59] icharlie: has joined #ruby
[03:44:23] omegamike: has joined #ruby
[03:44:36] gix: has joined #ruby
[03:45:12] astrobunny: has joined #ruby
[03:46:34] willywos: has joined #ruby
[03:49:04] Ox0dea: It is politely requested that you MacGyver a suitable facsimile.
[03:49:37] dseitz: has joined #ruby
[03:50:16] ghormoon: has joined #ruby
[03:51:33] craysiii: is it time for speedracer again?
[03:51:40] craysiii: i mean typeracer***
[03:52:21] texasmade: if anybody has time, would you mind looking over this briefly code and telling me if it's clean enough to get the job done?
[03:52:26] texasmade: http://paste.ofcode.org/bBJQYEXGnXUfFXtJ6Bv9Y2
[03:52:37] Aeyrix: texasmade: Does it work?
[03:53:06] sypheren: has joined #ruby
[03:53:33] texasmade: it all runs. just wanted a 2nd pair of eyes
[03:55:02] Ox0dea: >> 'Foo'.capitalize! # texasmade
[03:55:03] ruboto: Ox0dea # => nil (https://eval.in/407083)
[03:55:46] Ox0dea: A decent handful of "bang methods" do this, return nil if their operation would have made no change.
[03:56:10] davedev24: has joined #ruby
[03:56:14] juanpablo____: has joined #ruby
[03:56:16] Ox0dea: >> ['foo'.downcase!, 'FOO'.upcase!]
[03:56:17] ruboto: Ox0dea # => [nil, nil] (https://eval.in/407085)
[03:56:40] Ox0dea: texasmade: It's actually what you want, once you know that's what they do.
[03:57:04] duder: has joined #ruby
[03:58:15] craysiii: is there a benefit to using Integer(gets.chomp) vs gets.chomp.to_i
[03:58:19] ecksit: has joined #ruby
[03:58:20] sevenseacat: >> "FOO".downcase!
[03:58:21] ruboto: sevenseacat # => "foo" (https://eval.in/407086)
[03:58:28] Ox0dea: craysiii: Kernel.Integer raises an ArgumentError on non-numeric input.
[03:58:57] mary5030: has joined #ruby
[03:59:00] Ox0dea: sevenseacat: It's done this way to faciliate using bang methods in conditionals.
[03:59:58] craysiii: >> Integer(:a)
[03:59:59] ruboto: craysiii # => can't convert Symbol into Integer (TypeError) ...check link for more (https://eval.in/407087)
[04:00:12] Ox0dea: >> Integer('foo') rescue $!
[04:00:13] ruboto: Ox0dea # => #<ArgumentError: invalid value for Integer(): "foo"> (https://eval.in/407088)
[04:00:31] craysiii: what does $! mean
[04:00:34] Ox0dea: For what it's worth, #chomp is superfluous for both Integer() and #to_i.
[04:00:43] Ox0dea: craysiii: It contains the most recent Exception.
[04:01:04] Ox0dea: Sure thing.
[04:01:38] T3: has joined #ruby
[04:02:00] Ox0dea: texasmade: Ruby's === is not like JavaScript's.
[04:03:20] texasmade: it all starts to make more sense the more I practice. I think a large part of it is that I still have other languages fresh in my mind since I've been cramming the past few weeks and just started to focus soley on ruby as of two days ago
[04:03:38] craysiii: texas what wwere you studying before
[04:04:12] texasmade: I started with Python and Javascript.
[04:04:27] craysiii: ah. i love python, but im starting to love ruby more
[04:05:03] texasmade: I've decided to stick with Ruby until i get fairly decent and then try my hand at Java
[04:05:16] Aeyrix: Java's okay.
[04:05:22] sevenseacat: why would you subject yourself to that
[04:05:25] texasmade: I like Ruby the most so far.
[04:05:28] Aeyrix: I wrote Java for Bukkit / Minecraft stuff a few years back.
[04:05:35] craysiii: java bad. scala good
[04:05:40] texasmade: just for the experience
[04:05:45] krz: has joined #ruby
[04:06:08] texasmade: a friend said if i was going to move from ruby to another language then Java would be a good choice before going to C/C++
[04:06:17] sevenseacat: I tend to avoid experiences that I know will make me want to not program anymore
[04:06:22] Aeyrix: Why do you want to learn C / C++ though?
[04:06:26] Aeyrix: sevenseacat: tbh I enjoyed Java.
[04:06:46] Aeyrix: Granted the APIs I was working with were really quite nice, very well documented, and logically named.
[04:07:02] texasmade: I like having experience in multiple areas in case the need to know arises
[04:07:20] jenrzzz: has joined #ruby
[04:07:33] Aeyrix: Good choice.
[04:08:34] Scripore: has joined #ruby
[04:08:37] tabakhase: so yay, appart from the "gem cant install rspec" issue ( http://nopaste.linux-dev.org/?664269 ) im fine now =)
[04:09:09] tabakhase: can build my gem, install it elsewhere with it pulling all the things and such + nicely wraped all that into a vagrant to dev/run locally
[04:09:56] RonRichie: has joined #ruby
[04:10:12] sypheren: has joined #ruby
[04:10:15] werelivinginthef: has joined #ruby
[04:10:23] freerobby1: has joined #ruby
[04:12:30] freerobby: has joined #ruby
[04:15:08] yfeldblum: has joined #ruby
[04:15:35] transiency: has joined #ruby
[04:15:42] freerobby1: has joined #ruby
[04:15:52] nahtnam: has joined #ruby
[04:16:09] yfeldblum: has joined #ruby
[04:19:15] squireboy: has joined #ruby
[04:28:41] Fezzler: has joined #ruby
[04:29:21] michas: has joined #ruby
[04:29:40] sypheren: has joined #ruby
[04:29:52] astrobun_: has joined #ruby
[04:29:55] leex: has joined #ruby
[04:31:13] michas: hi, is it possible to define assignment to an attribute like `def foo=(arg1,arg2)`? how do you assign afterwards? for example `object.foo=(1,2)` does not work.
[04:31:51] craysiii: you could assign values to a hash and pass that to your method.
[04:32:19] Ox0dea: michas: You'll have to use #send. :(
[04:33:33] lxsameer: has joined #ruby
[04:33:35] Ox0dea: Alternatively, consider not inflicting upon yourself so complex a setter. :P
[04:33:44] lxsameer: has joined #ruby
[04:33:46] craysiii: hm interesting, that send method is.
[04:33:52] Saloaty: has joined #ruby
[04:34:00] michas: Ox0dea, ok, so simply assigning will always call the method with a single argument and this kind of definition therefore does not make sense at all?
[04:34:23] GriffinHeart: has joined #ruby
[04:34:32] deepu: has joined #ruby
[04:34:34] jbw: has joined #ruby
[04:34:55] Saloaty: has left #ruby: ()
[04:35:02] Oog: has joined #ruby
[04:35:42] marsjaninzmarsa: has joined #ruby
[04:37:42] keen__________32: has joined #ruby
[04:39:17] Ox0dea: michas: foo=(1, 2) could be a call to method `foo=` with two arguments, or it could be assigning the result of the expression `(1, 2)` to the local variable `foo`; alas, the language does not disambiguate as you might wish in this case.
[04:40:42] michas: ok, makes sense. thx
[04:40:48] Ox0dea: Sure thing.
[04:40:58] rickmasta: has joined #ruby
[04:41:11] Ox0dea: Note well that you can still invoke the method with #send if you simply must.
[04:41:30] yfeldblum: has joined #ruby
[04:42:05] Oog: has joined #ruby
[04:44:25] {756d6f}: has joined #ruby
[04:45:33] havenwood: has joined #ruby
[04:48:59] schaerli: has joined #ruby
[04:50:53] Axy: has joined #ruby
[04:50:53] Axy: has joined #ruby
[04:54:12] triangles: has joined #ruby
[04:54:24] s1kx-: has joined #ruby
[04:54:38] sphex: has joined #ruby
[04:57:33] valetudo: has joined #ruby
[04:57:52] brainslug: has joined #ruby
[04:58:00] woodruffw: has joined #ruby
[04:59:14] PlasmaStar: has joined #ruby
[04:59:47] Mendenhall: has joined #ruby
[05:00:18] jackjackdripper: has joined #ruby
[05:00:29] riotjones: has joined #ruby
[05:00:31] iWaffles: has joined #ruby
[05:01:20] riotjones: has joined #ruby
[05:03:52] lkba_: has joined #ruby
[05:04:27] n_blownapart: has joined #ruby
[05:04:30] astrobunny: has joined #ruby
[05:05:54] j4cknewt: has joined #ruby
[05:06:17] Guest32: has joined #ruby
[05:07:34] qiukun: has joined #ruby
[05:07:49] Radar: +q *!*@tgn.188.23.73.dts.mg
[05:08:04] ips|malc: has joined #ruby
[05:08:52] GriffinHeart: has joined #ruby
[05:08:53] davedev24: has joined #ruby
[05:10:16] hahuang65: has joined #ruby
[05:10:53] SOLDIERz: has joined #ruby
[05:13:40] sevenseacat: has joined #ruby
[05:14:30] yardenbar: has joined #ruby
[05:14:55] GriffinHeart: has joined #ruby
[05:14:55] workmad3: has joined #ruby
[05:15:36] eggoez: has joined #ruby
[05:17:46] konsolebox: has joined #ruby
[05:18:27] blueOxigen: has joined #ruby
[05:18:54] theery: has joined #ruby
[05:19:52] aaeron: has joined #ruby
[05:21:36] Ox0dea: has joined #ruby
[05:22:54] arup_r: has joined #ruby
[05:24:04] platosha: has joined #ruby
[05:25:25] Musashi007: has joined #ruby
[05:26:06] devdazed: has joined #ruby
[05:28:03] aganov: has joined #ruby
[05:28:05] Musashi007: has joined #ruby
[05:29:38] dented42: has joined #ruby
[05:31:06] arup_r: I have set of packages.. Now when a user select start and end date, I would like to show the user the minimum price by doing all combination of packages. No package can be taken as a half package. Any idea how to approach it? I was trying something, but not seems a way to solve it. https://gist.github.com/aruprakshit/d3833e654ca04da8340d
[05:31:25] Contigi: has joined #ruby
[05:31:58] user1138: has joined #ruby
[05:32:37] omegamike: has joined #ruby
[05:33:22] MasterPiece: has joined #ruby
[05:35:06] leesharma: has joined #ruby
[05:37:50] _blizzy_: has joined #ruby
[05:38:26] jackjackdripper: has joined #ruby
[05:38:47] _blizzy_: has joined #ruby
[05:38:56] shock_one: has joined #ruby
[05:40:12] tagrudev: has joined #ruby
[05:43:51] mary5030: has joined #ruby
[05:44:33] Averna: has joined #ruby
[05:44:45] _blizzy_: has joined #ruby
[05:45:01] juanpablo____: has joined #ruby
[05:45:16] psye: has joined #ruby
[05:47:34] andikr: has joined #ruby
[05:48:16] jcake: has joined #ruby
[05:49:09] _cake_: has joined #ruby
[05:49:11] mary5030: has joined #ruby
[05:49:20] _cake_: has left #ruby: ()
[05:51:43] RobertBirnie: has joined #ruby
[05:53:17] RobertBi_: has joined #ruby
[05:53:32] Ox0dea: shock_one: I've been thinking of how best to add Uberscore.no_conflict(:it).
[05:54:02] ferr: has joined #ruby
[05:54:04] Ox0dea: The magic would have to happen right before the first _ is needed, which is tricky.
[05:54:45] atmosx: has joined #ruby
[05:55:42] shock_one: Ox0dea: should it undefine itself after usage or how is it no conflict?
[05:55:50] havenwood: has joined #ruby
[05:56:21] atmosx: has joined #ruby
[05:56:27] Ox0dea: shock_one: Ideally, Kernel._ shouldn't come into existence until it's actually used the first time.
[05:56:52] bruno-: has joined #ruby
[05:56:53] timonv: has joined #ruby
[05:56:57] mercwithamouth: has joined #ruby
[05:57:11] Ox0dea: Anything else is open to potential conflict.
[05:57:19] ohaibbq: has joined #ruby
[05:57:42] sypheren: has joined #ruby
[05:57:50] Ox0dea: It'd be easy enough to just call it something else if either of the IRB or Pry constants exist, but that's not very general.
[05:57:51] shock_one: Ox0dea: what if we allowed to choose the name?
[05:58:34] Ox0dea: shock_one: Aye, I think Uberscore.no_conflict should take an argument that defaults to :it, but _ should just automagically work if and where appropriate.
[05:59:00] sepp2k: has joined #ruby
[05:59:21] shock_one: I don't get why there should be two names: it and _.
[06:00:21] Ox0dea: Only one or the other should exist, depending on the environment.
[06:00:57] Ox0dea: Non-_ in REPLs where _ already has a more useful definition, and non-_ if no_conflict has been explicitly requested.
[06:01:18] mbeasley_: has joined #ruby
[06:02:40] rht: has joined #ruby
[06:04:43] sypheren: has joined #ruby
[06:05:37] riotjones: has joined #ruby
[06:05:45] Stratege: has joined #ruby
[06:05:48] craysiii: has left #ruby: ()
[06:06:44] sargas: has joined #ruby
[06:07:30] riffraff: has joined #ruby
[06:08:23] acke: has joined #ruby
[06:09:59] allomov: has joined #ruby
[06:12:18] michas: I currently have a hash mapping one number to another and I want to persist it between different executions of the application. I probably want some very simple key-valu store. Any recomendation for that?
[06:12:34] Aeyrix: Hardcode it?
[06:12:53] michas: Aeyrix, no it will change during the run.
[06:13:55] {756d6f}: has joined #ruby
[06:14:22] tkuchiki: has joined #ruby
[06:14:41] sypheren: has joined #ruby
[06:14:57] j4cknewt: has joined #ruby
[06:15:18] michas: Aeyrix, daybreak looks good. did not know about this yet. thx.
[06:17:32] sinkensabe: has joined #ruby
[06:19:22] fedexo: has joined #ruby
[06:20:18] safeforge: has joined #ruby
[06:20:46] sdwrage: has joined #ruby
[06:23:18] shock_one: Ox0dea: I'd make a constant UBERSCORE_GLOBAL_NAME or something, it would be much more straightforward. Or had another import, like here. https://github.com/hexorx/countries/blame/master/README.markdown#L21-L24
[06:24:02] Musashi007: has joined #ruby
[06:24:53] astrobunny: has joined #ruby
[06:24:53] shock_one: I like another import more. If the user chooses to import the second file, we don't create the method automatically, but she has to call the no_conflict method by herself.
[06:26:24] tubuliferous_: has joined #ruby
[06:28:03] chuckrock: has joined #ruby
[06:29:15] Ox0dea: shock_one: Eh, _ and it are the only names really worth considering, I think, in which case `defined?(_) ? :it : :_` suffices.
[06:29:48] shock_one: Ox0dea: the thing is, the user never knows what to use.
[06:30:27] shock_one: Ox0dea: I'll propose it again: let's go with it and forget about the underscore.
[06:32:35] timonv: has joined #ruby
[06:32:47] howdoi_: has joined #ruby
[06:34:03] shock_one: https://dl.dropboxusercontent.com/spa/dlqheu39w0arg9q/c7e_ujik.png
[06:34:18] roolo: has joined #ruby
[06:37:06] solars: has joined #ruby
[06:38:30] Ox0dea: shock_one: I think the overline (??) best lives up to the name "uberscore". :P
[06:39:41] chuckrock: has joined #ruby
[06:40:41] Ox0dea: >> '' << 0xAF # Bonus points for being in extended ASCII?
[06:40:42] ruboto: Ox0dea # => "??" (https://eval.in/407175)
[06:41:33] qiukun: has joined #ruby
[06:43:31] dfockler: has joined #ruby
[06:43:41] shock_one: Ox0dea: I'll just remind you that my keyboard isn't extended ASCII.
[06:47:02] craysiii: has joined #ruby
[06:48:28] codecop: has joined #ruby
[06:48:35] Timba-as: has joined #ruby
[06:49:04] RonRichie: has joined #ruby
[06:49:26] safeforge: has joined #ruby
[06:50:52] michael_mbp: has joined #ruby
[06:51:17] troulouliou_div2: has joined #ruby
[06:52:22] bayed: has joined #ruby
[06:52:45] xkickflip: has joined #ruby
[06:53:23] Philipp__: has joined #ruby
[06:54:23] fabrice31: has joined #ruby
[06:55:28] dumdedum: has joined #ruby
[06:56:16] qiukun: has joined #ruby
[06:56:25] werelivinginthef: has joined #ruby
[06:59:37] dtcristo: has joined #ruby
[06:59:47] mary5030: has joined #ruby
[07:00:25] strixd: has joined #ruby
[07:01:15] strixd: has joined #ruby
[07:01:35] arup_r: Say i have [11,22,33,4,5,9,11] and I want to find the distance an element from first index. for example for 4 the distance is 3
[07:01:36] Oog: has joined #ruby
[07:01:45] arup_r: how to do it.. I have done as
[07:02:09] strixd: has joined #ruby
[07:02:11] arup_r: >> [11,22,33,4,5,9,11].index(4)
[07:02:12] ruboto: arup_r # => 3 (https://eval.in/407179)
[07:02:55] arup_r: I am trying to find the distance of first occurance ofcourse
[07:02:55] bnagy: >> [11,22,33,4,5,9,11].index(11)
[07:02:56] ruboto: bnagy # => 0 (https://eval.in/407180)
[07:03:10] strixd: has joined #ruby
[07:03:26] bnagy: if you want a general solution you can't use index
[07:03:42] arup_r: yes.. bnagy that's what I am going to ask..
[07:03:47] arup_r: how to do it genrally
[07:03:48] workmad3: has joined #ruby
[07:03:52] magnificrab: has joined #ruby
[07:03:55] krz: has joined #ruby
[07:03:55] magnificrab: has left #ruby: ()
[07:04:36] craysiii: what do you want the defined behavior to be when there are two elements in an array, of equal value in both the first and last position
[07:04:47] fabrice31: has joined #ruby
[07:04:51] jenrzzz: has joined #ruby
[07:05:03] Stan: has joined #ruby
[07:07:32] GriffinHeart: has joined #ruby
[07:09:04] arup_r: bnagy, any idea ?
[07:09:40] bnagy: arup_r: you didn't answer craysiii's question, so nobody knows
[07:09:53] dtcristo: has joined #ruby
[07:09:59] rdark: has joined #ruby
[07:10:01] arup_r: ok.. I thought it is his question.. didn't follow him
[07:10:42] Timba-as: has joined #ruby
[07:10:46] tsujp: has joined #ruby
[07:10:56] bnagy: I suspect an xy problem here anyway
[07:11:13] arup_r: no.. I am writing more specifically
[07:11:41] arup_r: craysiii, then I would like to return the distance between each of them. For my example the output should be
[07:12:27] craysiii: what if there are more than 2? an arbitrary amount? should it take an average of the distances?
[07:13:01] craysiii: or maybe a list of distances.
[07:13:07] robbyoconnor: has joined #ruby
[07:13:28] arup_r: { 1 => 11, 6 => 11 }
[07:13:31] sevenseacat: or maybe it should just return 42 and change the array to make it always correct.
[07:13:43] arup_r: this is the output of as per my input
[07:14:08] arup_r: I just need to count how many elements before the `11`
[07:14:28] bnagy: >> [11,22,33,4,5,9,11].each_with_index.to_a.map(&:reverse).to_h
[07:14:29] arup_r: as first element is `11` in this case, it is `1`.
[07:14:29] ruboto: bnagy # => {0=>11, 1=>22, 2=>33, 3=>4, 4=>5, 5=>9, 6=>11} (https://eval.in/407181)
[07:14:30] sevenseacat: i have no idea how you get "1" then
[07:14:38] sevenseacat: there are no elements befor ethe first 11
[07:14:49] bnagy: looks useless to me
[07:14:57] arup_r: sorry it is `0`
[07:14:59] ruboto: I don't know anything about example
[07:15:07] bnagy: dammit :)
[07:15:16] ruboto: I don't know anything about roboto
[07:15:25] craysiii: spelled it wrong >.>
[07:15:34] arup_r: bnagy, [11,22,33,4,5,9,11] is example
[07:15:39] bnagy: why don't you explain what you're actually trying to do instead of give imprecise coding exercises
[07:16:04] j4cknewt: has joined #ruby
[07:16:07] arup_r: I am trying to solve a problem ... where this is one part
[07:16:15] sevenseacat: and that problem is?
[07:16:26] rbowlby: has joined #ruby
[07:16:27] craysiii: [11, 22, 33, 11, 4, 5, 9, 11] what would you want here
[07:17:50] lala: has left #ruby: ()
[07:18:34] arup_r: sevenseacat, https://gist.github.com/aruprakshit/d324aa6a107e223d76c7
[07:18:47] arup_r: That's a actual problem
[07:19:29] arup_r: craysiii, { 0=>11, 3 => 11, 7 => 11}
[07:19:51] bnagy: arup_r: then my dumb solution above "works"
[07:20:00] arup_r: I have an intention of finding this out..
[07:20:20] arup_r: bnagy, no it wouldn't when the input date range will be too long..
[07:20:41] zenspider: suuure looks like some sort of interview question
[07:20:44] qiukun: has joined #ruby
[07:20:46] arup_r: there can be many sundays.. and
[07:20:47] livathinos: has joined #ruby
[07:21:10] arup_r: zenspider, no it is not.. It is my application problem.. I am trying to solve it
[07:21:18] arup_r: Better way
[07:21:59] zenspider: poorly defined either way
[07:22:00] Iskarlar: has joined #ruby
[07:22:17] Musashi007: has joined #ruby
[07:22:53] bnagy: this looks like some kind of knapsack problem
[07:23:02] bnagy: although I don't really get your description
[07:23:24] zenspider: neither do I
[07:23:32] fabrice31_: has joined #ruby
[07:23:44] bnagy: knapsack is np hard, although that's not a big deal if your domain is small
[07:24:12] fabrice31_: has joined #ruby
[07:24:19] bnagy: if a heuristic is allowed I would probably just do some kind of greedy approach
[07:24:37] bnagy: but it won't always produce the best solution
[07:25:53] arup_r: thing is I have some predefined packages.. if user selects any predefined package then price is ready. If they choose their custom dates.. I'll try to find out the minimum price by doing all combination of packages and give them the minimum price
[07:25:54] robbyoconnor: has joined #ruby
[07:26:01] arup_r: Don't know if it makes sense or not
[07:26:03] craysiii: def distance(arr, num)
[07:26:03] craysiii: arr.each_with_index.to_a.map(&:reverse).to_h.select { |k,v| v == num }
[07:26:44] craysiii: dont know why my client sent that as three messages.
[07:27:37] serivich: has joined #ruby
[07:28:32] schaerli: has joined #ruby
[07:29:09] craysiii: anyway arup_r that works as intended. thanks to bnagy
[07:29:19] arup_r: Ok.. I am writing it.. then I'll show you people.. if it can be improved
[07:29:23] bnagy: arup_r: https://en.wikipedia.org/wiki/Knapsack_problem
[07:29:31] arup_r: Let me write it first what I have in my mind
[07:30:13] arup_r: give me some 15 mins or so
[07:31:15] craysiii: bnagy know of any way to shorten that select block?
[07:31:23] bnagy: start from day 1 of the custom range, apply the longest package that fits, check any other ways to fill that range, then iterate
[07:31:31] vdamewood: has joined #ruby
[07:31:43] n008f4g_: has joined #ruby
[07:32:23] arup_r: bnagy, humm doing that way
[07:33:51] juanpablo____: has joined #ruby
[07:33:52] vdamewood: has joined #ruby
[07:35:10] ndrei: has joined #ruby
[07:35:29] EminenceHC: has joined #ruby
[07:35:54] Guest32: has joined #ruby
[07:36:13] robbyoconnor: has joined #ruby
[07:36:27] neanderslob: has joined #ruby
[07:37:35] kraljev11: has joined #ruby
[07:38:45] bnagy: >> [11, 22, 33, 11, 4, 5, 9, 11].map.with_index {|n,i| [i,n] if n==11}.compact.to_h
[07:38:46] ruboto: bnagy # => {0=>11, 3=>11, 7=>11} (https://eval.in/407186)
[07:38:59] bnagy: craysiii: ^^ :`(
[07:39:15] robin_: has joined #ruby
[07:39:34] BeatzKilla: has joined #ruby
[07:40:53] craysiii: wow nice bnagy
[07:40:59] zenspider: you just want the indicies of the things that match 11?
[07:41:04] bnagy: no, it's not
[07:41:10] ruurd: has joined #ruby
[07:41:41] bnagy: zenspider: I don't know, I'm just golfing the given format, which is idx=>item
[07:41:50] calleerlandsson: has joined #ruby
[07:41:51] bnagy: not even golfing otherwise I'd ternary :|
[07:42:13] antgel: has joined #ruby
[07:42:55] Violentr: has joined #ruby
[07:44:32] arup_r: Array#take(n) is order of N right ?
[07:44:37] c0m0: has joined #ruby
[07:44:54] bakednotfried: has joined #ruby
[07:44:54] bakednotfried: has joined #ruby
[07:45:11] vdamewood: has joined #ruby
[07:45:19] neanderslob: has joined #ruby
[07:46:13] Ox0dea: arup_r: Not really. Ruby uses shared memory for #take.
[07:46:14] {756d6f}: has joined #ruby
[07:46:16] senayar: has joined #ruby
[07:46:16] joonty: has joined #ruby
[07:46:27] Ox0dea: >> [11, 22, 33, 11, 4, 5, 9, 11].each_with_index.with_object({}) { |(o, i), m| m[i] = o if o == 11 }
[07:46:28] ruboto: Ox0dea # => {0=>11, 3=>11, 7=>11} (https://eval.in/407191)
[07:46:31] arup_r: And #first ?
[07:46:37] Ox0dea: Do we need #each_with_index_and_object?
[07:47:30] Ox0dea: arup_r: #first is very hard to implement efficiently. It's probably O(n^3) in Ruby.
[07:47:31] craysiii: how do you enter multiline into ruboto
[07:47:42] bnagy: craysiii: ;
[07:48:39] arup_r: Ox0dea, ok.. then #take is better
[07:48:57] zenspider: Ox0dea: why are you fucking with him?
[07:49:20] davedev24: has joined #ruby
[07:49:20] Ox0dea: arup_r: Sorry, I didn't realize you were asking about Array#first with an argument.
[07:49:24] Ox0dea: It also uses shared memory.
[07:52:51] craysiii: >> h = {}; [11, 22, 33, 11, 4, 5, 9, 11].each_with_index { |n, i| h.merge!(i => n) if n == 11}; puts h
[07:52:52] ruboto: craysiii # => {0=>11, 3=>11, 7=>11} ...check link for more (https://eval.in/407197)
[07:53:11] ruurd: has joined #ruby
[07:53:15] adaedra: what are you doing
[07:53:41] GriffinHeart: has joined #ruby
[07:53:43] craysiii: magic apparently
[07:54:01] doerteDev: has joined #ruby
[07:54:06] Ox0dea: >> Foo = Class.new(Array); a = b = Foo.new [1, 2, 3]; [a.take(2).class, a.first(2).class] # arup_r
[07:54:07] ruboto: Ox0dea # => [Foo, Array] (https://eval.in/407198)
[07:54:16] Ox0dea: That's probably the only distinction worth concerning yourself with.
[07:54:21] adrianpacala: has joined #ruby
[07:54:31] DefV: Is there still no better way to do initilization values then this: def initialize(a, b); @a, @b = a, b; end ?
[07:54:38] zenspider: subclassing Array is _almost_ always a mistake
[07:54:46] Ox0dea: Demonstration purposes only.
[07:54:55] DefV: Maybe smth like coffeescript initialize: (@a, @b) ->
[07:54:59] zenspider: DefV: what's wrong with that? define "better"
[07:55:05] Ox0dea: DefV: That might be coming in Ruby 3.
[07:55:17] arup_r: Ox0dea, didn't get you.. Give me some mins..I am writing something..
[07:55:27] zenspider: I hope not too
[07:55:32] TheHodge: has joined #ruby
[07:55:40] DefV: why not, what's wrong with it in your opinion?
[07:55:56] Ox0dea: DefV: https://bugs.ruby-lang.org/issues/11105
[07:56:38] Ox0dea: It's not the same thing, but you should get a relevant vibe. :)
[07:57:04] mikecmpbll: has joined #ruby
[07:57:05] sevenseacat: For example, {x, y} is equivalent to: {x: x, y: y} <--- waaaaat
[07:57:17] craysiii: ya i dont know why i'd want that
[07:57:41] sevenseacat: ACTION is over here nononononononononoing at that issue
[07:57:41] Ox0dea: I don't know why you'd *want* to have to type @foo = far, @bar = bar either, to be honest.
[07:57:57] Ox0dea: sevenseacat: Note well matz's outright rejection of the thing.
[07:58:05] sevenseacat: and sanity prevails.
[07:58:09] Ox0dea: > foo = far
[07:58:23] ecksit: has joined #ruby
[07:59:04] adaedra: That doesn't really tell why `def initialize(@a, @b)` whould be bad.
[07:59:14] bmcginty: has joined #ruby
[07:59:23] Ox0dea: (It's because parse.y is scary.)
[07:59:39] sevenseacat: `initialize` is not some sacred method, so you cant define special notation like that for it
[07:59:52] craysiii: what if you're given malformed input or want to validate before assignment
[07:59:53] schaerli: has joined #ruby
[07:59:55] sevenseacat: and if you want to apply it to all methods, you just want to blindly reassign instance variable methods?
[08:00:09] texasmade: has joined #ruby
[08:00:24] adaedra: craysiii: then you use the old style
[08:00:40] Ox0dea: Sanity 2 | 0 Madness
[08:00:41] abdulrehman: guys any idea how to formate/convert scientific exponential to float
[08:00:45] Ox0dea: DefV: Struct too heavy?
[08:00:59] zenspider: old-style hash in <=1.8 is my reason to reject that. ... also... horrible idea
[08:01:06] zenspider: gah. we need LESS syntax, not more.
[08:01:17] Ox0dea: abdulrehman: Kernel.Float or String#to_f should do.
[08:01:26] Ox0dea: ?guys abdulrehman
[08:01:26] ruboto: abdulrehman, You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folk", "y'all" or "everyone" instead?
[08:01:29] bnagy: zenspider: that ship has sailed
[08:01:32] DefV: Ox0dea: not always possible to inherit from Struct
[08:01:33] sevenseacat: to be fair I still do not like ruby 1.9 hash syntax, i believe it should be consistent no matter what the key type.
[08:01:39] abdulrehman: Ox0dea: thanks I'll try that
[08:01:45] craysiii: >> "%f" % "1.0e-05"
[08:01:46] ruboto: craysiii # => "0.000010" (https://eval.in/407205)
[08:01:46] zenspider: bnagy: wish I were on it
[08:01:52] sevenseacat: from what I've seen, it's also a tad confusing for newbies also.
[08:01:56] bnagy: I am, mostly
[08:02:17] bnagy: I'm only using ruby as a bash script replacement now :`(
[08:02:33] Ox0dea: >> {'1': 2} # This is indeed confusing.
[08:02:34] ruboto: Ox0dea # => {:"1"=>2} (https://eval.in/407206)
[08:02:44] zenspider: format will auto-to_f ?
[08:02:49] leafybasil: has joined #ruby
[08:02:58] sevenseacat: people see {foo: :bar} and think that the symbols are foo: and :bar.
[08:03:03] sevenseacat: well, newbies anyway.
[08:03:12] Ox0dea: Which is kind of silly, though.
[08:03:39] sevenseacat: hashrockets remove all that ambiguity.
[08:03:49] zenspider: AND are alignable
[08:04:07] abdulrehman: ruboto: sure my bad, sorry
[08:04:31] Timba-as: has joined #ruby
[08:04:34] Ox0dea: Did ruboto just pass the Turing test?
[08:04:56] ruboto: I don't know anything about bot
[08:05:07] ruboto: I don't know anything about anything
[08:05:09] adaedra: rah, I never remember which is it
[08:05:36] sypheren: has joined #ruby
[08:05:54] tvw: has joined #ruby
[08:07:21] senayar: has joined #ruby
[08:09:12] allomov: has joined #ruby
[08:10:22] shevy: ruboto is rather often assumed to be a genuine people by newcomers
[08:10:40] ramfjord: has joined #ruby
[08:11:10] krz: has joined #ruby
[08:11:25] craysiii: i thought ruboto was a person when they said the guy thing to me as well
[08:11:37] aevitas: has joined #ruby
[08:12:08] ruboto: I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[08:12:55] sevenseacat: mmm banhammers.
[08:13:54] shevy: craysiii hehe I found that interesting, people look at the message that is put to them, but barely ever at the line with the ? above
[08:14:14] Ox0dea: Highlights have a way of drawing one's attention, it seems.
[08:14:16] craysiii: yes exactly. upon further inspection i figured it out
[08:14:19] adaedra: because people will look at the hl message
[08:15:04] tubuliferous_: has joined #ruby
[08:15:17] Ox0dea: OnePlus should've called their new phone The 3.
[08:15:43] iloverubynoob: has joined #ruby
[08:15:44] pecopeco: has joined #ruby
[08:15:55] polyrob: has joined #ruby
[08:16:16] khebbie: has joined #ruby
[08:16:30] anisha: has joined #ruby
[08:17:01] Ox0dea: In any case, they're doomed to committing semantic OBOEs for the foreseeable future.
[08:18:17] adaedra: They can't, as 3 is also a phone services provider.
[08:18:46] craysiii: damn companies taking up all the numbers
[08:19:09] adaedra: craysiii: or colors (I'm looking at you, Orange)
[08:19:26] Ox0dea: And Level 3.
[08:19:32] pecopeco: has left #ruby: ()
[08:20:05] craysiii: the should follow suit and skip to 11
[08:20:08] shevy: it's the end of the world
[08:20:22] craysiii: in line with microsoft and the like
[08:20:30] shevy: don't worry craysiii windows 42 will have all the answers
[08:20:40] adaedra: ACTION slaps shevy
[08:21:16] glennt: has joined #ruby
[08:21:40] Ox0dea: shevy: And no questions.
[08:21:41] krz: has joined #ruby
[08:21:47] Zai00: has joined #ruby
[08:22:14] shevy: a world without questions ... :(
[08:22:29] craysiii: windows 42 auto configures your every liking. it has no need for questions
[08:22:41] craysiii: and the world does not revolve around windows anymore ;)
[08:23:06] schaerli: has joined #ruby
[08:23:12] shevy: is it year of the linux desktop already?
[08:23:24] Ox0dea: We mainstream yet?
[08:23:34] craysiii: just. one. more. year
[08:23:57] adaedra: ahah, year of the linux desktop.
[08:24:07] adaedra: we will have nuclear war before, at this speed.
[08:24:43] Ox0dea: yorickpeterse: Nice timing. We were just about to get sociopolitical.
[08:25:22] sevenseacat: ACTION takes off sjw hat
[08:26:26] ruurd: has joined #ruby
[08:27:23] unshadow: has joined #ruby
[08:27:33] Ox0dea: "I know not with what operating system World War III will be initiated..."
[08:28:10] craysiii: world war V will be run from a FORTRAN mainframe.
[08:29:34] ta: has joined #ruby
[08:29:37] wpp: has joined #ruby
[08:29:38] apeiros: world war V will be fought with bows and spears because wwiv destroyed everything
[08:30:25] craysiii: no we skip IV.
[08:30:39] unshadow: So, I'm trying to figure out what is happening here: https://github.com/ruby/ruby/blob/c8b3f1b470e343e7408ab5883f046b1056d94ccc/lib/webrick/httprequest.rb#L529 What is this size=4096 doing ? who is using it ? from what I'm seeing a few lines up this creates a IO.gets(LF, 4096) ... looking at the documents for IO.gets this seems like a missuse
[08:30:42] Ox0dea: Presuming there'll be a fifth world war is remarkably optimistic.
[08:31:18] white_bear: has joined #ruby
[08:31:44] adrianpacala: has joined #ruby
[08:32:31] shevy: tis not be very pretty code
[08:32:39] shevy: def _read_data
[08:32:48] shevy: pythonic!
[08:32:49] Ox0dea: unshadow: IO#gets will attempt to read a complete line; supplying it with an argument prevents it reading off into infinity.
[08:33:00] shock_one: has joined #ruby
[08:33:12] T3: has joined #ruby
[08:33:21] Ox0dea: 4096 is a pretty standard maximum buffer size.
[08:33:42] busterarm: has joined #ruby
[08:34:44] luyao: has joined #ruby
[08:34:46] Ox0dea: Did I retarded?
[08:34:47] unshadow: Ox0dea: this was my feeling too, but, looking at the IO.gets dosuments, I dont see how this 4096 is playing
[08:34:51] unshadow: http://ruby-doc.org/core-2.2.2/IO.html#method-i-gets
[08:35:16] bustrarm: has joined #ruby
[08:35:19] Ox0dea: unshadow: #gets is a method on instances of IO, not IO itself.
[08:35:35] CustosLimen: has joined #ruby
[08:35:59] riffraff: has joined #ruby
[08:36:17] GriffinHeart: has joined #ruby
[08:37:09] shock_one: has joined #ruby
[08:37:18] Ox0dea: unshadow: Consider what would happen if a malicious entity just started firing data at your thing, careful to never include a line terminator.
[08:37:24] bumbar_: has joined #ruby
[08:37:25] bumbar_: has joined #ruby
[08:37:29] Ox0dea: In such a case, #gets would just keep reading and reading.
[08:37:50] Hounddog: has joined #ruby
[08:37:51] dtcristo: has joined #ruby
[08:37:58] Ox0dea: Giving it an argument (4096, in this case) tells #gets to stop after that many bytes have been read.
[08:38:14] unshadow: Ox0dea: I know, gets alone, will read untill it sees "\n", using gets("bla"), will make it read untill it reads the word "bla", looking at the documents, if I'll use a gets("\n", 4096) that means it will read "\n" or untill it sees 4096 ?
[08:38:35] Ox0dea: Yes, that's right.
[08:39:22] Siyfion: has joined #ruby
[08:39:43] unshadow: So here is my wierd issue, when using this, gets("\r\n". 4096) I get this error: comparison of Fixnum with nil failed
[08:39:45] axl_: has joined #ruby
[08:40:03] Ox0dea: Is that period a typo?
[08:40:08] sevenseacat: thats a . there?
[08:40:23] unshadow: it shoud be a ,
[08:40:30] marr: has joined #ruby
[08:40:42] Ox0dea: unshadow: Are you able to post code?
[08:40:46] Hanmac1: has joined #ruby
[08:41:19] Ox0dea: That call to #gets is certainly not the thing introducing the unexpected nil.
[08:41:35] Ox0dea: Well, shit, I suppose it could be if there's no data left to be read.
[08:42:16] Ox0dea: All things in moderation.
[08:42:17] adaedra: Hello Lucy
[08:42:25] unshadow: Ox0dea: https://gist.github.com/bararchy/0c23c3a7badb2eebe9af
[08:42:43] unshadow: the socket is a SSLSocket
[08:43:38] craysiii: that was short.
[08:43:56] bodgix: has joined #ruby
[08:44:18] adaedra: This WeeChat is outdated.
[08:44:31] yorickpeterse: get a newer one
[08:44:32] ruurd: has joined #ruby
[08:44:46] adaedra: Tell that to luyao
[08:45:54] unshadow: Ox0dea: also, the error reads "comparison of Fixnum with nil failed" is that means it tries to compare 4096 to nil ?
[08:46:40] Ox0dea: unshadow: I wonder why you're not getting an error for passing a Regexp to #gets.
[08:47:12] unshadow: Ox0dea: Passing a regex to gets while it used with an SSLSocket is acceptable ;) (ruby hacks )
[08:50:11] ruurd: has joined #ruby
[08:50:29] Ox0dea: unshadow: I'm reasonably sure it's to do with #gets returning nil on a non-read and you subsequently putting it in `http_response`.
[08:51:29] Ox0dea: I can't say where it ends up being compared with a Fixnum, of course.
[08:52:02] unshadow: Ox0dea: Well, that error is printed from line 9-10, so the error comes from this begin rescue block
[08:52:26] workmad3: has joined #ruby
[08:52:51] unshadow: Ox0dea: http_response is just a hash, it can accept nil vlaues so I dont think the issue if from there
[08:53:28] Ox0dea: Line numbers are largely meaningless in isolation.
[08:53:31] timonv: has joined #ruby
[08:54:01] unshadow: Ox0dea: I mean the error is printed by the rescue in like 9-10 :)
[08:54:05] senayar: has joined #ruby
[08:54:30] Mendenhall: has joined #ruby
[08:54:47] craysiii: would be nice to see the source code for IO#gets
[08:54:53] Ox0dea: unshadow: I thought we were trying to figure out where you were comparing nil with a Fixnum?
[08:55:05] Ox0dea: craysiii: It's in io.c?
[08:55:11] tjbiddle: has joined #ruby
[08:55:23] unshadow: Ox0dea: Yes, but I dont, thats the issue, the "compare" is coming from gets
[08:55:31] unshadow: at least this is my feeling
[08:55:38] craysiii: im feeling that way as well.
[08:56:07] sevenseacat: without an actual error message, I wouldn't feel any kind of inclination.
[08:56:11] unshadow: craysiii: this is the source code for gets http://ruby-doc.org/core-2.2.2/IO.html#method-i-gets
[08:56:25] kannan4k: folks, what is this line does? o.send "#{k}=", casted
[08:56:48] sevenseacat: kannan4k: look up the ruby method "send" and see
[08:57:24] kannan4k: sevenseacat: I am confused of this -> "#{k=}"
[08:57:35] sevenseacat: well thats not what you posted before
[08:57:41] ruurd: has joined #ruby
[08:57:46] Ox0dea: unshadow: You should check your link. :P
[08:57:49] sevenseacat: what is the value of k there?
[08:57:49] codex: has joined #ruby
[08:58:00] kannan4k: k is a hash key "#{k}="
[08:58:08] sevenseacat: that doesnt answer the question
[08:58:10] pyon: has joined #ruby
[08:58:11] sypheren: has joined #ruby
[08:58:53] Ox0dea: > I know about Object#send, but what is string interpolation?
[08:58:56] shevy: kannan4k it is as if you would call a method with that name, and the last character of the method is '=', so a setter like: object.foo = value
[08:58:58] nsuke: has joined #ruby
[08:59:07] unshadow: craysiii: https://gist.github.com/bararchy/0c23c3a7badb2eebe9af#file-rb_io_gets_m-c
[08:59:24] craysiii: we must go deeper.
[08:59:29] craysiii: rb_io_getline
[08:59:32] unshadow: Ox0dea: craysiii : It seems the underlying call is to getline
[08:59:50] Ox0dea: craysiii: It goes way deeper than rb_io_getline().
[09:00:02] craysiii: ive never even looked at the source
[09:00:05] Igorshp: has joined #ruby
[09:00:05] craysiii: like i said im month 1
[09:00:13] Ox0dea: Dig in, man.
[09:00:21] craysiii: lifes a garden :)
[09:00:49] Ox0dea: So's death, after a fashion.
[09:01:14] kannan4k: sevenseacat, shevy here is the method -> https://gist.github.com/kannan4k/62c0e455f83ba6016eaf
[09:02:08] shevy: I don't like this code at all :P
[09:02:25] yeticry: has joined #ruby
[09:02:38] kannan4k: shevy: what's wrong :(
[09:03:08] shevy: it does not seem simple code
[09:04:06] unshadow: Ox0dea: craysiii: so https://github.com/ruby/ruby/blob/trunk/io.c#L3256 which passes to https://github.com/ruby/ruby/blob/trunk/io.c#L3150
[09:04:56] kannan4k: shevy, k is a method or a variable?
[09:05:16] quimrstorres: has joined #ruby
[09:05:23] Ox0dea: But variables can be used as methods, and methods can be used as variables!
[09:05:27] shevy: you can see where it is assigned kannan4k
[09:05:30] shevy: instance = hash.inject self.new(cache) do |o, p|
[09:05:37] ljarvis: ACTION grumbles
[09:05:52] craysiii: you mean like function pointers? lol
[09:05:58] adaedra: hi ljarvis
[09:06:12] Ox0dea: craysiii: Something along those lines, sure.
[09:06:19] shevy: and then lateron it is called via a .send call: o.send "#{k}=", casted
[09:06:24] craysiii: i forgot what its called in ruby.
[09:06:28] ljarvis: if i could have any feature in ruby it would be first-class functions
[09:06:33] fabrice31: has joined #ruby
[09:06:39] Ox0dea: craysiii: Method and UnboundMethod, more or less.
[09:06:43] ljarvis: ACTION doesn't hate parenthesis
[09:06:51] Ox0dea: ljarvis: Left or right?
[09:07:00] ljarvis: Ox0dea: I love them all
[09:07:29] zeroDivisible: has joined #ruby
[09:07:48] craysiii: can be assigned to variable
[09:07:59] Ox0dea: As can be Methods and UnboundMethods, for what that's worth.
[09:08:05] ljarvis: any method can be assigned to a variable
[09:08:23] ljarvis: methods are objects too
[09:08:44] craysiii: a block can't be assigned though, because it's not an object :)
[09:09:01] craysiii: that's what ive read
[09:09:10] ljarvis: what do you mean by "a block"?
[09:09:21] ljarvis: that's a hash
[09:09:32] ljarvis: and of course a method block can be assigned
[09:09:43] Ox0dea: But then it's a Proc.
[09:09:55] ljarvis: so that means it's not assigned?
[09:10:01] Ox0dea: No, it means it's not a block.
[09:10:24] ljarvis: well that's pedantic
[09:10:31] Ox0dea: Then why do we have two names?
[09:10:48] ljarvis: this is Ruby, there's five names for everything
[09:11:26] mikecmpb_: has joined #ruby
[09:11:38] ljarvis: sure semantics are different, but i wouldn't say you're not assigning that block to a variable, just because it's now a proc, it still works as expected from a logical sense
[09:12:16] Ox0dea: ljarvis: You sort of started that debate by and with yourself.
[09:12:38] ljarvis: "a block can't be assigned though" is what I debated
[09:12:44] tennis: has joined #ruby
[09:12:55] Ox0dea: In that case, I believe you must admit defeat.
[09:13:52] Ox0dea: It is indeed the case that a Ruby variable cannot contain a Ruby block.
[09:14:07] ruurd: has joined #ruby
[09:14:08] Ox0dea: Block != Proc, since we can pass n Procs to a method, but only at most one block.
[09:14:14] Ox0dea: They are simply (slightly) different things.
[09:14:21] zenspider: ljarvis: this whole block vs proc are not equivalent debate? imho, you can ignore Ox0dea on this one
[09:14:34] Ox0dea: Get 'im, tiger.
[09:14:42] mikecmpbll: has joined #ruby
[09:14:52] michael_mbp: has joined #ruby
[09:15:32] yorickpeterse: Blocks and procs are identical
[09:15:43] yorickpeterse: blocks is just the name for the syntax of `foo do ... end`
[09:15:43] sypheren: has joined #ruby
[09:15:54] yorickpeterse: and technically there's nothing stopping you from passing multiple Procs to a method
[09:16:21] yorickpeterse: It's the syntax that doesn't allow multiple ones
[09:16:25] adaedra: That's what Ox0dea said?
[09:16:33] schaerli: has joined #ruby
[09:16:34] yorickpeterse: Ox0dea | Block != Proc, since we can pass n Procs to a method, but only at most one block.
[09:17:05] Oog: has joined #ruby
[09:17:07] ruurd: has joined #ruby
[09:17:19] gwendall: has joined #ruby
[09:17:46] craysiii: can a block be passed as an argument or only yielded to?
[09:18:13] yorickpeterse: `foo do ... end` is nothing more than `foo(proc { ... })`
[09:18:21] zenspider: you can use the &syntax to reify the block to a var: def a_method(&block),
[09:18:42] lkba: has joined #ruby
[09:18:45] zenspider: then you can either block.call, block[], or iirc, still yield
[09:18:54] zenspider: prolly more :)
[09:19:11] f4cl3y: has joined #ruby
[09:19:28] Silox|: has joined #ruby
[09:19:31] Ox0dea: .(), ::(), and ===().
[09:19:52] Musashi007: has joined #ruby
[09:20:03] zenspider: :: just means . in that context
[09:20:13] apfeluser: has joined #ruby
[09:20:26] adaedra: >> def foo(&bar); yield; end; foo { puts ":D" }
[09:20:27] ruboto: adaedra # => :D ...check link for more (https://eval.in/407253)
[09:20:40] Ox0dea: adaedra: The &bar is superfluous.
[09:20:46] RegulationD: has joined #ruby
[09:21:05] adaedra: Ox0dea: I know, was just checking for zenspider "iirc"
[09:21:23] Ox0dea: adaedra: You... enjoy typing more than is necessary? :P
[09:21:59] Ox0dea: zenspider: .() as an alias for #call is different from ., the method invocation "operator", for what that's worth.
[09:22:08] adaedra: It's not because it's possible that I do it
[09:22:12] Hanmac1: has left #ruby: ()
[09:22:25] ruurd: has joined #ruby
[09:22:31] juanpablo____: has joined #ruby
[09:23:15] craysiii: >> def foo(&bar); bar.(); end; foo { puts "bar" }
[09:23:16] ruboto: craysiii # => bar ...check link for more (https://eval.in/407254)
[09:23:22] vdamewood: has joined #ruby
[09:23:27] Ox0dea: Why are you people using #puts on ruboto?!
[09:24:38] bronson: has joined #ruby
[09:24:41] craysiii: ACTION scurries to bed
[09:24:44] adaedra: because it works
[09:25:27] Ox0dea: It's the "check link for more" bit that does it; we shouldn't force the machines to lie to us.
[09:25:44] craysiii: but theres a whole \n were missing
[09:25:55] craysiii: think of the children.
[09:26:50] senayar: has joined #ruby
[09:27:15] shevy: one day the world may run out of \n
[09:27:53] yorickpeterse: Then we'll need \nv6
[09:28:43] dtcristo: has joined #ruby
[09:30:38] rikkipitt: has joined #ruby
[09:31:26] mdih: has joined #ruby
[09:32:24] platzhirsch: has joined #ruby
[09:32:57] mdih: hello, i understand that this is kinda off topic..but since openproject is based on ruby, ill just ask here hehe...do you guys know whats its irc channel? cant find it :(
[09:32:58] abdulrehman: welcome back adaedra
[09:33:15] adaedra: back? I'm always here.
[09:33:31] schaerli: has joined #ruby
[09:33:49] yorickpeterse: mdih: https://community.openproject.org/projects/openproject/boards they have a forum, not sure if they have an IRC channel
[09:34:34] banister: has joined #ruby
[09:34:44] Vile`: has joined #ruby
[09:34:52] workmad3: has joined #ruby
[09:35:02] zenspider: how many times can we get "open" and "project" into a url?
[09:35:28] fabrice31: has joined #ruby
[09:35:41] mdih: @yorickpeterse: thanks, yeah found the forum..and apparently no irc..thanx anyway hehe
[09:35:58] Kilo`byte: has joined #ruby
[09:36:06] shevy: it sure is one open project
[09:37:05] Oog: has joined #ruby
[09:37:08] ruboto: Badum-Tshh! https://www.youtube.com/watch?v=oShTJ90fC34
[09:37:12] auzty: has joined #ruby
[09:37:33] senayar: has joined #ruby
[09:38:51] Ox0dea: zenspider: Playing it safe, 4o + 7p should not exceed 2047.
[09:40:14] quimrstorres: has joined #ruby
[09:40:44] Oog: has joined #ruby
[09:40:47] Ropeney: has joined #ruby
[09:41:08] abdulrehman: adaedra: then I'm the one who returned hahahaha
[09:41:17] abdulrehman: welcome back me
[09:41:22] dionysus69: has joined #ruby
[09:41:41] fabrice31: has joined #ruby
[09:42:05] adaedra: I see your access to IRC is still not blocked.
[09:42:41] Musashi007: has joined #ruby
[09:44:12] leafybasil: has joined #ruby
[09:44:57] unshadow: craysiii: Ox0dea: well, I just opened an issue, hope someone at RubyCorp can help https://bugs.ruby-lang.org/issues/11400
[09:44:58] zeroDivisible: has joined #ruby
[09:45:15] franckverrot: has joined #ruby
[09:45:32] abdulrehman: hahaha not yet
[09:45:36] Ox0dea: unshadow: Hey, you got a double-ought!
[09:46:03] unshadow: Ox0dea: double-ought ?
[09:48:05] Ox0dea: unshadow: A centurion.
[09:48:13] sypheren: has joined #ruby
[09:48:18] Ox0dea: Why the misleading title?
[09:48:28] nofxx: has joined #ruby
[09:48:45] nofxx: has joined #ruby
[09:48:46] unshadow: Ox0dea: Oh, I'll re-write
[09:49:36] DLSteve_: has joined #ruby
[09:50:05] unshadow: Ox0dea: better ?
[09:50:26] Ox0dea: unshadow: What happens if you remove the timeout block and/or storage into the Hash?
[09:50:42] unshadow: Ox0dea: Tried , nothing changes
[09:50:51] schaerli: has joined #ruby
[09:51:34] fabrice31_: has joined #ruby
[09:51:54] tvw: has joined #ruby
[09:51:55] Ox0dea: It's immaterial to the problem, but why are you using hexadecimal notation for \r and \n?
[09:52:30] kannan4k: folks, one more question self.new() does what?
[09:52:33] unshadow: Ox0dea: no real reason
[09:52:34] spider-mario: has joined #ruby
[09:53:00] fabrice31: has joined #ruby
[09:53:11] ddv: kannan4k: what does Class.new do?
[09:53:14] unshadow: Ox0dea: I was thinking that maybe that would help in some "encoding" realted stuff
[09:53:37] kannan4k: ddv, no idea. I am new to Ruby :(
[09:53:47] yorickpeterse: kannan4k: it sends the "new" message to self
[09:54:22] yorickpeterse: if "self" here is a class (as in String.new) it will create a new instance of said class (unless overwritten)
[09:54:43] felixr: has joined #ruby
[09:55:13] kannan4k: yorickpeterse, so it will create an instance inside an instance?
[09:55:31] yorickpeterse: That depends on what "self" is here
[09:55:36] yorickpeterse: Do you have some example code?
[09:55:58] kannan4k: yeah, let me paste in gist
[09:58:48] kannan4k: 1) https://gist.github.com/kannan4k/62c0e455f83ba6016eaf -> called from here
[09:58:56] dtcristo: has joined #ruby
[09:59:17] qiukun: has joined #ruby
[09:59:17] kannan4k: 2) https://gist.github.com/kannan4k/4ccb4dd1a30496fd56b6 -> self.new is here
[09:59:17] Trynemjoel: has joined #ruby
[09:59:38] yorickpeterse: In that case "self.new" creates a new instance of "TSheets::Model"
[09:59:46] yorickpeterse: because the "from_raw" method is a class method
[09:59:51] yorickpeterse: (note the "def self.from_row")
[10:00:00] yorickpeterse: The "self." isn't needed though
[10:00:08] yorickpeterse: just "new(cache)" would've been fine as well
[10:00:37] kannan4k: oh from_raw is a class method?
[10:00:47] Zai00: has joined #ruby
[10:01:28] kannan4k: how can i differenciate bw the class method and an instance method?
[10:01:31] zenspider: kannan4k: ugh
[10:01:56] zenspider: generally the class method is "def self.xxx"
[10:02:16] yorickpeterse: kannan4k: https://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/45-more-classes/lessons/113-class-variables
[10:02:17] zenspider: douchier ways are "class << self; def xxx; ...; end; end"
[10:02:28] kannan4k: in python self will be used in the instance method
[10:02:31] zenspider: that code is bad. and probably relatively untested
[10:02:33] yorickpeterse: and what zenspider said
[10:02:48] yorickpeterse: "self" in Ruby just refers to the context/scope of sorts
[10:02:54] zenspider: you can also do "def ClassName.xxx", but almost nobody does (or should)
[10:03:01] kannan4k: zenspider, I have pasted a part of the big chunk of code
[10:03:04] yorickpeterse: and since basically everything is an instance of something that usually means it refers to an object of sorts
[10:03:10] zenspider: kannan4k: yes, you did.
[10:03:12] tubuliferous_: has joined #ruby
[10:03:28] workmad3: yorickpeterse: I'm not sure you can get a context where 'self' doesn't refer to an object
[10:03:37] kannan4k: zenspider, what's bad
[10:03:46] lkba_: has joined #ruby
[10:04:31] yorickpeterse: workmad3: practically speaking probably not
[10:05:05] TheBrayn: I have a string like "begin\nitem1\nitem2\nbegin\n\item1\item2", how can I split it by the \n after begin?
[10:05:09] yorickpeterse: zenspider: there's a chance they didn't even write the code themselves
[10:05:25] yorickpeterse: especially considering they're apparently not sure what it does
[10:05:36] yorickpeterse: it being bad or not isn't really relevant to the question at hand
[10:05:49] yorickpeterse: TheBrayn: String#split
[10:05:56] Ox0dea: TheBrayn: With a second argument.
[10:05:57] yorickpeterse: &ri String#split
[10:05:57] `derpy: http://www.rubydoc.info/stdlib/core/String#split-instance_method
[10:06:01] zenspider: TheBrayn: The question is the answer
[10:06:07] workmad3: yorickpeterse: I guess you could probably write a C extension that grabbed a method from an object and then invoked it with self as NULL...
[10:06:46] zenspider: don't really need a c-ext for that. that's what instance_eval does
[10:07:08] yorickpeterse: workmad3: yeah and probably segfault the shit out of it
[10:07:08] workmad3: zenspider: you can't get NULL inside ruby though... nil is still an object :)
[10:07:12] kannan4k: yorickpeterse, I am tring to understand the ruby code to know how it works
[10:07:29] yorickpeterse: kannan4k: I got that much
[10:07:31] symm-: has joined #ruby
[10:08:05] Ox0dea: workmad3: Ruby uses the null pointer for false.
[10:08:10] zenspider: workmad3: well... NULL in C is 0, and that's false in ruby
[10:08:14] kannan4k: thank you so much for your answers yorickpeterse
[10:08:17] zenspider: >> false.object_id
[10:08:18] ruboto: zenspider # => 0 (https://eval.in/407278)
[10:08:29] Ox0dea: >> require 'fiddle'; Fiddle::Pointer.new(0).to_value
[10:08:30] ruboto: Ox0dea # => false (https://eval.in/407279)
[10:08:33] Zai00: has joined #ruby
[10:08:33] Zort0n: has joined #ruby
[10:08:36] workmad3: Ox0dea: oh, I wasn't aware of that... so even if you used NULL in C, ruby would see it as an object...
[10:08:44] Ox0dea: That's right.
[10:08:51] Ox0dea: Well, it'd be context-dependent.
[10:09:03] fabrice31_: has joined #ruby
[10:09:57] quimrstorres: has joined #ruby
[10:10:03] marius: has joined #ruby
[10:10:09] sankaber: has joined #ruby
[10:11:05] Ox0dea: Hm, can self ever be nil outside of nil's singleton class?
[10:11:14] TheBrayn: >> "begin\nitem1\nitem2\nbegin\n\item1\nitem2".split(/begin(\n)/)
[10:11:15] ruboto: TheBrayn # => ["", "\n", "item1\nitem2\n", "\n", "item1\nitem2"] (https://eval.in/407281)
[10:11:26] TheBrayn: hm, that's not working
[10:11:27] Ox0dea: This guy.
[10:11:53] yorickpeterse: >> "begin\nitem1\nitem2\nbegin\n\item1\nitem2".split("\n")
[10:11:54] ruboto: yorickpeterse # => ["begin", "item1", "item2", "begin", "item1", "item2"] (https://eval.in/407282)
[10:12:01] TheBrayn: and that's not what I want
[10:12:03] Ox0dea: "begin\nitem1\nitem2\nbegin\n\item1\nitem2".split(/\n/, 2) # TheBrayn
[10:12:07] Ox0dea: >> "begin\nitem1\nitem2\nbegin\n\item1\nitem2".split(/\n/, 2) # TheBrayn
[10:12:08] ruboto: Ox0dea # => ["begin", "item1\nitem2\nbegin\nitem1\nitem2"] (https://eval.in/407283)
[10:12:30] TheBrayn: and that only splits after the first begin
[10:12:37] sypheren: has joined #ruby
[10:13:08] TheBrayn: maybe I should just split it by \n and then do the grouping some other way
[10:13:21] yorickpeterse: you can also just nuke everything leading up to the "begin\n"
[10:14:33] Zort0n: Which result do you need?
[10:16:11] Ox0dea: TheBrayn: There's a #chunk_while method in 2.3 that you could really use right about now.
[10:16:31] abdulrehman: adaedra: is there a way I can do this; DateTime.parse(someString).formate(YYYYMMDD)?
[10:16:51] abdulrehman: where somestring is a date
[10:17:24] khebbie: has joined #ruby
[10:17:59] adaedra: &ri Date.strptime
[10:17:59] `derpy: http://www.rubydoc.info/stdlib/date/Date#strptime-class_method
[10:18:01] Zai00: has joined #ruby
[10:18:14] adaedra: Also, don't address to me directly, everyone is here to help!
[10:18:27] adaedra: well, except ruboto
[10:18:28] arup_r: now I am thinking how to handle where these is more than one packages can be fit.. :/ https://gist.github.com/aruprakshit/d324aa6a107e223d76c7
[10:18:39] fabrice31: has joined #ruby
[10:18:43] abdulrehman: just thought to keep you on your toes :p
[10:18:45] yorickpeterse: &ri Date#strftime
[10:18:46] `derpy: http://www.rubydoc.info/stdlib/date/Date#strftime-instance_method
[10:18:48] yorickpeterse: for formatting
[10:19:18] quimrstorres: has joined #ruby
[10:19:35] workmad3: >> "begin\nitem1\nitem2\nbegin\n\item1\nitem2".split("\n").slice_before { |item| item == "begin" }.to_a
[10:19:37] ruboto: workmad3 # => [["begin", "item1", "item2"], ["begin", "item1", "item2"]] (https://eval.in/407289)
[10:19:41] workmad3: TheBrayn: ^ that close enough?
[10:20:04] abdulrehman: yorickpeterse: thanks, and done!! I knew of it, I was just using it wrong
[10:20:24] abdulrehman: adaedra: thanks, and I won't dress you any more buddy!! I'll dress ruboto :-p
[10:20:26] rickmasta: has joined #ruby
[10:20:34] Ox0dea: abdulrehman: Please let people choose their own outfits.
[10:20:55] workmad3: adaedra: aww, you just lost your personal fashion assistant :(
[10:21:39] Ox0dea: Fella's over there puttin' clothes on machines now.
[10:21:43] adaedra: I'll code a plugin to `derpy to do that.
[10:21:49] abdulrehman: hey, obama didn't give you guys care health options, why should I give you fashion options!!!
[10:21:56] Ox0dea: ?ot abdulrehman
[10:21:56] ruboto: abdulrehman, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[10:22:08] adaedra: we're not all guys, and not all americans.
[10:22:12] schaerli: has joined #ruby
[10:22:12] sypheren: has joined #ruby
[10:22:38] Zai00: has joined #ruby
[10:23:50] abdulrehman: ruboto: sorry, yah no more off topics, adaedra also yes I know, I was just kidding....
[10:24:07] adaedra: workmad3 is american, ask him.
[10:25:06] arup_r: abdulrehman, ruboto has no sense of humour,, don't call :)
[10:25:57] tvw: has joined #ruby
[10:27:03] workmad3: adaedra: I'm trying not to take offence at that...
[10:27:34] workmad3: adaedra: calling me ... american... *shudder*
[10:27:36] felixr: has joined #ruby
[10:27:39] adaedra: british, american, all the same
[10:28:52] mathie: has joined #ruby
[10:29:35] shevy: le french
[10:29:48] adaedra: le autrichien
[10:30:50] Trynemjoel: has joined #ruby
[10:32:54] ljarvis: baguette fromage
[10:33:38] adaedra: I could also do a list of all French words I know
[10:33:48] stamina: has joined #ruby
[10:36:08] unshadow: Ox0dea: So, it seems the non-ssl version (the one without the Regexp support) wont return fixnum error
[10:38:30] marius: has joined #ruby
[10:38:42] zeeraw: has joined #ruby
[10:41:32] abdulrehman: arup_r: well, he works with ruby, I am sure he has some sense of humour hahaha
[10:41:53] acke: has joined #ruby
[10:42:13] ruboto: nomnomnomnom
[10:42:23] arup_r: bnagy, you there ?
[10:42:32] quimrstorres: has joined #ruby
[10:43:07] fabrice31: has joined #ruby
[10:44:20] rdark: has joined #ruby
[10:44:25] fabrice31: has joined #ruby
[10:45:59] tvw: has joined #ruby
[10:46:59] arup_r: I wrote it for simple scenario.. Now not able to decide how to approach when I have a input date ranges where more than 1 same or different packge will exist...
[10:47:01] arup_r: https://gist.github.com/aruprakshit/d324aa6a107e223d76c7
[10:47:01] zeeraw: has joined #ruby
[10:47:52] Trynemjoel: has joined #ruby
[10:48:49] tvw: has joined #ruby
[10:49:55] bnagy: ACTION shrugs
[10:50:04] bnagy: I can't read your code
[10:50:28] arup_r: i know it is too bad..
[10:50:37] arup_r: if-else killed it
[10:51:27] senayar: has joined #ruby
[10:52:41] sdothum: has joined #ruby
[10:53:44] bnagy: you can usually refactor if test blah else next as next unless test; blah
[10:53:49] yardenbar: has joined #ruby
[10:53:57] anisha: has joined #ruby
[10:54:22] bnagy: but that's kind of a tiny part of a gigantic mural of code I don't like
[10:56:34] arup_r: Ok.. I'll refactor it.. But looking for the idea.. of how to get out the minimum from mix of packages.
[10:56:36] zeeraw: has joined #ruby
[10:58:39] i: has joined #ruby
[10:59:12] Oog: has joined #ruby
[10:59:25] fabrice31_: has joined #ruby
[11:00:01] werelivinginthef: has joined #ruby
[11:02:18] quimrstorres: has joined #ruby
[11:02:42] bigmac_: has joined #ruby
[11:02:52] rodfersou: has joined #ruby
[11:04:25] despai: has left #ruby: ("Leaving")
[11:04:31] despai: has joined #ruby
[11:04:46] [k-: has joined #ruby
[11:04:56] j4cknewt: has joined #ruby
[11:05:28] quimrsto_: has joined #ruby
[11:07:04] despai: hello guys. I'm having a weird problem when pushing an application to heroku. It works perfectly on local but when pushing it to heroku... Error: https://gist.github.com/DavidValin/5e8eb89215d317fea7ef Rakefile line 25: https://gist.github.com/DavidValin/45a1b6564ef03338a42a database.yml https://gist.github.com/DavidValin/84d963dc7d3ab884c95b I really don't see any syntax problem in the yml file. Does anyone, please, have an idea of what can be causing th
[11:07:05] despai: is issue?
[11:08:16] ddv: despai: do your editor support showing invisibles? turn it on and look
[11:08:44] despai: Let's see
[11:09:15] ddv: despai: remove trailing whitespace, convert tabs to spaces
[11:09:20] allcentury: has joined #ruby
[11:10:46] chills42: has joined #ruby
[11:11:17] juanpablo____: has joined #ruby
[11:11:32] chills42: has joined #ruby
[11:11:44] despai: no weird stuff there.. I'm reading that heroku overrides the databases.yml
[11:12:16] despai: I knew that but I though I can also read it using YAML.load_file. Maybe thats the issue
[11:12:18] despai: will check
[11:12:20] despai: thanks ddv
[11:13:52] sarkyniin: has joined #ruby
[11:15:09] jimms: has joined #ruby
[11:17:03] rickmasta: has joined #ruby
[11:18:46] dorei: has joined #ruby
[11:20:58] DaniG2k: has joined #ruby
[11:21:19] DaniG2k: when making a ruby gem, what's a good location to put config files (text or yaml or whatever)
[11:21:55] aevitas: has joined #ruby
[11:22:37] Radar: DaniG2k: config/
[11:22:56] jhass: DaniG2k: I'd say depends on what the gem is for
[11:23:21] bruno-: has joined #ruby
[11:23:24] DaniG2k: jhass: im making a small full-text search and just want to define where the index file will be
[11:23:38] Papierkorb: has joined #ruby
[11:23:39] jhass: so a CLI tool?
[11:24:12] DaniG2k: erm....could be, but it's meant to hook into Rails via Railties
[11:24:50] rdark: has joined #ruby
[11:24:57] jhass: then I'd go for in code configuration, SuperSearch.configure do |config| and have the user call that before using the gem
[11:25:09] ynroot: has joined #ruby
[11:25:10] jhass: in a rails app in a config/initializer typically
[11:25:18] fgo: has joined #ruby
[11:26:00] DaniG2k: jhass: ok...I have something like that now: https://github.com/DaniG2k/rankrb/blob/master/lib/rankrb.rb
[11:26:00] Igorshp: has joined #ruby
[11:26:10] DaniG2k: jhass: check the self.configure method :D
[11:26:34] DaniG2k: also, pay special attention to the self.??????????????????????????????? method
[11:26:51] jhass: shamelessly stolen from sidekiq
[11:26:58] jhass: but yeah, like that
[11:27:35] sypheren: has joined #ruby
[11:27:47] jhass: and then have Configuration have good defaults or raise on missing values
[11:27:54] dgutierrez1287: has joined #ruby
[11:27:57] DaniG2k: ok so, excuse the ignorance but if someone were to define the index file like that, I'd need to have some logic to create that file. I'm thinking that it might actually be best to just create the index file without prompting the user at all :S
[11:28:01] ynroot: has joined #ruby
[11:28:06] tbuehlmann: I also like this one: https://github.com/mperham/sidekiq/blob/f75c91a5f4a295a4565ae55140f028d1d096fc40/lib/sidekiq/manager.rb#L162-L184
[11:28:14] DaniG2k: Configuration should probably just have it by default
[11:28:46] TvL2386: has joined #ruby
[11:29:25] jhass: so you're actually asking what a good default location for the index file would be?
[11:29:42] DaniG2k: basically all I want is for the index file to be found if it's already there or be created anew if it's not. I don't think prompting the user is actually a good idea now that I think of it
[11:29:59] j4cknewt: has joined #ruby
[11:30:04] DaniG2k: jhass: that was my initial idea yes. Probably just /config would be ok
[11:30:41] jhass: well, I'm not sure what your index file does but depending on how persistent it needs to be, in the context of a rails app I'd go for tmp/ or vendor/
[11:31:17] jhass: or even db/
[11:31:34] DaniG2k: jhass: good point
[11:31:41] jhass: (which is where eg sqlite DBs live iirc)
[11:31:43] DaniG2k: db/ is probably a good starting point
[11:32:34] DaniG2k: jhass: if I create a db directory....does it appear in the Rails app's same db directory? how would that work?
[11:32:44] DaniG2k: i mean, if I create a db directory within my gem.
[11:32:56] jhass: Rails.root should be available in a rails engine
[11:33:07] strixd: has joined #ruby
[11:33:43] DaniG2k: I'm making a gem not an Engine :\ not sure if that makes a difference.
[11:34:23] jhass: you blabbered something about a railtie, sounds quite a bit like an engine to me
[11:34:44] luckyno7: has joined #ruby
[11:34:59] DaniG2k: I have this litte baby here, taht's all: https://github.com/DaniG2k/rankrb/blob/master/lib/rankrb/railtie.rb
[11:35:07] nveselinov: has joined #ruby
[11:35:46] DaniG2k: so if all one needs to make an engine is class Railtie < Rails::Railtie then yes, my gem's an engine :)
[11:35:56] workmad3: DaniG2k: you're about 99% of the way to making that into a gem that mounts as an engine if rails is present
[11:36:13] workmad3: DaniG2k: you'd just need to change Rails::Railtie to Rails::Engine
[11:36:19] ldnunes: has joined #ruby
[11:36:30] DaniG2k: didn't know that
[11:37:58] workmad3: DaniG2k: you probably don't need that though... the configuration, generator setup, rake tasks & initializer hooks are all accessed through Railtie (which Engine inherits)
[11:38:24] y0da: has joined #ruby
[11:40:18] DaniG2k: workmad3: ok
[11:40:28] DaniG2k: I'll try doing things simply for now
[11:40:34] d10n-work: has joined #ruby
[11:40:42] DaniG2k: if I need the engine I'll use the rails plugin command :D
[11:41:05] devyn: has joined #ruby
[11:41:36] Zai00: has joined #ruby
[11:41:47] workmad3: DaniG2k: looking @ what you're trying btw, I'd personally suggest that you pass in a path to an index file when creating an Index, and the Index will create the file if it doesn't exist... you can then use your Railtie to set up a default path based on Rails.root that allows users to override it, and then use a Rails initializer to create an index on rails app bootup
[11:42:33] pyon: has joined #ruby
[11:42:33] ips|malc: has joined #ruby
[11:43:01] sypheren: has joined #ruby
[11:43:16] DaniG2k: workmad3: I'd love to do that. Unfortunately I don't think I know how to :(
[11:43:20] jhass: also this starts to get very Rails specific, maybe head over to #RubyOnRails ;)
[11:43:43] jhass: DaniG2k: I don't think you tried yet, you can make that claim in half an hour
[11:44:10] workmad3: ^^ maybe an hour... you need to find and read the guide on rails initializers too ;)
[11:44:17] DaniG2k: jhass: I'm stuck on point #0: I created a db directory but git isn't picking it up
[11:44:25] DaniG2k: probably the gemspec file
[11:44:28] bruno-: has joined #ruby
[11:45:41] jhass: git doesn't commit empty directories since it only tracks files
[11:45:50] DaniG2k: ah that must be why
[11:45:58] jhass: and the db/ directory should be the one of your app
[11:46:01] jhass: not inside the gem
[11:46:11] jhass: where you probably can't even write to when installed
[11:46:35] iloverubynoob: has joined #ruby
[11:46:44] DaniG2k: ah that's the problem I've been having then
[11:46:53] DaniG2k: I created a file but it was looking within the installed gem
[11:47:04] _blizzy_: has joined #ruby
[11:49:25] senayar: has joined #ruby
[11:49:37] shortCircuit__: has joined #ruby
[11:50:16] TheBrayn: workmad3: thanks, that works great
[11:50:43] shortCircuit__: A closure can be made with lambda and proc .. But is there any way to use only methods and maybe blocks and make a closure
[11:51:07] jhass: shortCircuit__: yes, blocks closure too
[11:51:18] jhass: methods don't
[11:51:23] tubuliferous_: has joined #ruby
[11:51:29] jhass: but hint: you pass a block to define_method
[11:51:44] [k-: DaniG2k: we usually name the file .keep
[11:51:51] anisha: has joined #ruby
[11:52:07] shortCircuit__: I actually tried , def foo(a,&b); b.call(a); end .. ;D bt that's not closure .
[11:52:12] chipotle: has joined #ruby
[11:53:52] schaerli: has joined #ruby
[11:54:48] _blizzy_: has joined #ruby
[11:55:33] cornerma1: has joined #ruby
[11:55:35] jhass: shortCircuit__: just curious or have some real problem to solve?
[11:56:07] s00pcan: has joined #ruby
[11:56:53] shortCircuit__: And also curious if lambda and proc are there then why would one do that :P
[11:57:32] Papierkorb: has joined #ruby
[11:57:37] jhass: hard to argue in the general
[11:57:42] jhass: each have their usecases
[11:57:50] yorickpeterse: a lambda is nothing but a proc with required arguments and having its own "return" context
[11:58:02] yorickpeterse: a proc is a closure, or as close as you can get
[11:58:15] omegamike: has joined #ruby
[11:59:39] dimasg: has joined #ruby
[12:01:06] jhass: [k-: I've seen .gitkeep to be more common
[12:02:02] aevitas_: has joined #ruby
[12:02:23] livcd: yorickpeterse: what can you do with proc ? you can save a block with it and pass it around
[12:02:27] livcd: anything else ?
[12:03:18] shortCircuit__: define_method(:foobar); do |block|; block.call(some_variable); end ?
[12:03:53] shpoont: has joined #ruby
[12:04:05] [k-: jhass: let's follow yours then
[12:04:15] [k-: remember, i dont read much :P
[12:04:21] ips|malc: has joined #ruby
[12:05:11] jhass: shortCircuit__: you're sure you understand what a closure is?
[12:05:30] Igorshp: has joined #ruby
[12:06:13] jhass: >> a = 5; define_method(:foo) { a * 3 }; b = foo; a = 10; [b, foo]
[12:06:14] ruboto: jhass # => [15, 30] (https://eval.in/407353)
[12:06:39] jhass: ^ don't ever do prod code depending on such behavior though
[12:07:01] shortCircuit__: Yeah, in JavaScript terms if an inner method has a reference to a free variable in its parent scope , then it creates a closure .. So if we call the parent method, until and unless the child is called the context retains all env props of its parent ..
[12:07:07] shortCircuit__: Something like that!!
[12:07:21] [k-: time to use this for throwing people off!
[12:07:30] shpoont: has joined #ruby
[12:07:50] ChanServ: -b ihatenigggers!*@*
[12:07:56] shortCircuit__: Free variable meaning one that isn't in the parameter list or a local variable
[12:08:27] yorickpeterse: livcd: blocks _are_ procs
[12:08:39] [k-_: has joined #ruby
[12:08:54] jhass: shortCircuit__: not sure why you try to receive and pass parameters then :/
[12:09:06] j4cknewt: has joined #ruby
[12:10:05] shortCircuit__: Have to use yield?
[12:10:18] mikecmpb_: has joined #ruby
[12:11:09] j4cknewt: has joined #ruby
[12:12:02] juanpablo____: has joined #ruby
[12:12:07] shortCircuit__: like; def foo; bat=1; yield bat; end.
[12:12:15] chills42: has joined #ruby
[12:12:30] aevitas: has joined #ruby
[12:12:40] workmad3: shortCircuit__: that passes an argument into the provided block
[12:12:42] shortCircuit__: Now foo{|a| a+5}
[12:13:58] workmad3: shortCircuit__: a closure is more like; `def foo; bar = yield; puts bar; end; a = 20; foo { a }` <-- (take a guess as to what that will do before running it)
[12:14:39] devyn: has joined #ruby
[12:19:35] rickmasta: has joined #ruby
[12:21:37] sinkensabe: has joined #ruby
[12:23:26] rideh: has joined #ruby
[12:24:50] yardenbar: has joined #ruby
[12:25:55] bronson: has joined #ruby
[12:27:52] shortCircuit__: has joined #ruby
[12:28:51] felixr: has joined #ruby
[12:29:51] Xiti: has joined #ruby
[12:32:07] Fraeon: I'm surprised nobody has come up with the idea of a malware that turns your computer part of a cloud that runs RoR apps
[12:32:18] j4cknewt: has joined #ruby
[12:32:33] skyrocker: has joined #ruby
[12:32:49] skyrocker: has left #ruby: ()
[12:33:51] zeeraw: has joined #ruby
[12:34:18] centrx: has joined #ruby
[12:34:39] centrx: Hi shevys
[12:35:08] joneshf-laptop: has joined #ruby
[12:36:07] shortCircuit__: workmad3 it should be 20 .. It's a closure because it can remember the value of bar when executed from outside like foo{a}
[12:36:45] unshadow_: has joined #ruby
[12:38:30] workmad3: shortCircuit__: right answer, wrong explanation
[12:38:31] dimasg: has joined #ruby
[12:38:59] ruurd: has joined #ruby
[12:39:40] but3k4: has joined #ruby
[12:39:46] centrx: has joined #ruby
[12:39:46] zeeraw: has joined #ruby
[12:39:55] sdwrage: has joined #ruby
[12:40:11] acovrig: has joined #ruby
[12:40:58] iateadonut: has joined #ruby
[12:42:02] TheHodge: has joined #ruby
[12:43:03] unshadow: has joined #ruby
[12:43:20] manila90: has joined #ruby
[12:43:35] sypheren: has joined #ruby
[12:44:31] omegamike: has joined #ruby
[12:44:59] ruby-lang600: has joined #ruby
[12:45:29] syath: has joined #ruby
[12:45:40] manila90: hi, i am curious if anyone knows a clean way to save the second IP of a subnet to a string, I am now using the ipaddress gem, where I save the subnet 10.1.1.0/24 into a IPAddress
[12:45:41] manila90: irb(main):029:0> ip
[12:45:41] manila90: => #<IPAddress::IPv4:0x007fb423ae5810 @address="192.168.1.0", @prefix=24, @octets=[192, 168, 1, 0], @u32=3232235776>
[12:45:52] manila90: irb(main):030:0> ip.first.address
[12:45:52] manila90: => "192.168.1.1"
[12:46:15] manila90: is could mess with the last characters of the string to select the 192.168.1.2
[12:46:18] manila90: i could mess with the last characters of the string to select the 192.168.1.2
[12:46:37] manila90: but maybe there is a better way to select this from a function?
[12:46:50] victortyau: has joined #ruby
[12:47:02] codecop: has joined #ruby
[12:48:16] manila90: https://github.com/bluemonk/ipaddress this documentation is not very helpful in this
[12:48:24] yardenbar: has joined #ruby
[12:48:32] workmad3: manila90: ip.to_a[2]
[12:48:56] victortyau: has joined #ruby
[12:48:56] workmad3: manila90: ip.to_enum.take(3).last
[12:49:16] sgambino: has joined #ruby
[12:49:30] schaerli: has joined #ruby
[12:49:40] workmad3: (the to_enum should be lazy, afaict, so it won't create millions or billions of ipaddress objects if you have a larger subnet range)
[12:50:28] Kully3xf: has joined #ruby
[12:50:45] workmad3: yeah... when using "192.0.0.0/8" as the subnet, to_a starts to take a long time, but to_enum is still nice and snappy :)
[12:51:36] manila90: ah yes, indeed it is
[12:52:34] workmad3: manila90: so yeah... to_enum gives you an enumerator over all the addresses in the range
[12:52:41] workmad3: use as you see fit :)
[12:53:22] unshadow_: has joined #ruby
[12:54:44] workmad3: (with large subnets, I'd highly recommend looking @ ruby's lazy enumerators and using ip.to_enum.lazy to work with the collection)
[12:54:58] droidburgundy: has joined #ruby
[12:55:14] uris: has joined #ruby
[12:56:38] sypheren: has joined #ruby
[12:58:53] manila90: ty! good tip
[12:59:34] khebbie: has joined #ruby
[12:59:43] khebbie_: has joined #ruby
[12:59:44] manila90: irb(main):014:0> b.to_enum.take(10000).count
[12:59:45] manila90: irb(main):015:0> b.to_a.take(10000).count
[12:59:47] manila90: waiting ;-)
[13:00:16] chinmay_dd: has joined #ruby
[13:00:24] j4cknewt: has joined #ruby
[13:00:47] chills42: has joined #ruby
[13:01:48] IrishGringo: has joined #ruby
[13:02:08] c0m0: has joined #ruby
[13:03:06] Yiota: has joined #ruby
[13:05:05] jrz: has joined #ruby
[13:05:45] jrz: has joined #ruby
[13:05:49] Scripore: has joined #ruby
[13:05:55] j4cknewt: has joined #ruby
[13:06:14] manila90: has joined #ruby
[13:06:25] jrz: has joined #ruby
[13:07:05] jrz: has joined #ruby
[13:07:42] jrz: has joined #ruby
[13:07:50] dumdedum: has joined #ruby
[13:08:09] sdwrage: has joined #ruby
[13:08:22] jrz: has joined #ruby
[13:08:43] Polysics: has joined #ruby
[13:09:05] jrz: has joined #ruby
[13:09:43] rickmasta: has joined #ruby
[13:09:46] serivich: has joined #ruby
[13:09:54] jrz: has joined #ruby
[13:10:34] jrz: has joined #ruby
[13:11:12] jrz: has joined #ruby
[13:11:48] bmurt: has joined #ruby
[13:11:52] jrz: has joined #ruby
[13:12:19] c0m0: has joined #ruby
[13:12:32] jrz: has joined #ruby
[13:12:46] pyrotecnix: has joined #ruby
[13:13:14] jrz: has joined #ruby
[13:13:18] quimrstorres: has joined #ruby
[13:13:53] jrz: has joined #ruby
[13:14:03] sevenseacat: has joined #ruby
[13:14:29] jrz: has joined #ruby
[13:15:19] jrz: has joined #ruby
[13:15:36] werelivinginthef: has joined #ruby
[13:16:01] jrz: has joined #ruby
[13:16:41] jrz: has joined #ruby
[13:16:56] yardenbar: has joined #ruby
[13:16:58] banister: has joined #ruby
[13:17:01] A124: has joined #ruby
[13:17:26] jrz: has joined #ruby
[13:18:06] jrz: has joined #ruby
[13:18:19] senayar: has joined #ruby
[13:18:43] umgrosscol: has joined #ruby
[13:18:45] senayar: has joined #ruby
[13:18:47] yaroslav: has joined #ruby
[13:18:51] jrz: has joined #ruby
[13:19:01] shevy: long live ruby \o/
[13:19:06] conta: has joined #ruby
[13:19:29] jrz: has joined #ruby
[13:20:11] jrz: has joined #ruby
[13:20:27] chinmay_dd: has joined #ruby
[13:20:50] jrz: has joined #ruby
[13:20:59] unshadow: has joined #ruby
[13:21:30] jrz: has joined #ruby
[13:22:09] jrz: has joined #ruby
[13:22:10] RegulationD: has joined #ruby
[13:22:37] apeiros: +b Jrz!*@*$#ruby-fix-your-connection
[13:22:39] apeiros: -o apeiros
[13:23:18] quimrstorres: has joined #ruby
[13:25:42] senayar: has joined #ruby
[13:27:26] dblessing: has joined #ruby
[13:28:50] yeticry: has joined #ruby
[13:32:17] nateberkopec: has joined #ruby
[13:32:40] alex88: has joined #ruby
[13:33:27] charliesome: has joined #ruby
[13:33:52] bruno-: has joined #ruby
[13:34:55] sha89: has joined #ruby
[13:35:14] duggiefresh: has joined #ruby
[13:35:22] yeticry: has joined #ruby
[13:35:44] davejlong: has joined #ruby
[13:36:03] whippythellama: has joined #ruby
[13:36:07] devdazed: has joined #ruby
[13:36:08] arup_r: has joined #ruby
[13:38:03] nertzy: has joined #ruby
[13:38:36] aryaching: has joined #ruby
[13:38:42] yardenbar: has joined #ruby
[13:38:46] platzhirsch: has joined #ruby
[13:38:49] zeeraw: has joined #ruby
[13:39:33] tubuliferous_: has joined #ruby
[13:40:16] snockerton: has joined #ruby
[13:40:35] schaerli: has joined #ruby
[13:40:52] yeticry: has joined #ruby
[13:41:13] sypheren: has joined #ruby
[13:41:16] vyorkin: has joined #ruby
[13:41:17] DaniG2k: has joined #ruby
[13:41:18] alex88: hi guys, with an hash resulting of a group_by so an hash of arrays of hashes, what's the shorter way to set the group_by hash values to the sum of a property of the hashes in the array?
[13:41:27] ruboto: You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folk", "y'all" or "everyone" instead?
[13:42:14] adaedra: also, do you have an example of what you want?
[13:42:32] symbol: has joined #ruby
[13:42:33] alex88: shouldn't be "folks" instead of folk?
[13:42:36] alex88: anyway, let me gist
[13:42:51] juanpablo____: has joined #ruby
[13:42:58] adaedra: jhass, apeiros: ^
[13:43:23] aryaching: has joined #ruby
[13:43:25] ljarvis: !fact ed guys You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
[13:43:25] ruboto: ljarvis, I stand corrected that guys is You probably don't mean to exclude, but not everyone relates to being "one of the guys". Maybe consider using "folks", "y'all" or "everyone" instead?
[13:43:45] shevy: has joined #ruby
[13:45:39] alex88: adaedra: https://gist.github.com/alex88/37c18a5fbe4353e2a43e
[13:46:15] alex88: basically group by date and set the hash value of the corresponding date the sum of the `value` key of the hashes in the array corresponding to that date
[13:46:29] alex88: so a group_by date and sum the values
[13:46:55] adaedra: just the sum of values element as value in your root hash then?
[13:46:58] krz: has joined #ruby
[13:47:37] ljarvis: values.inject(0) { |total, hash| total + hash[:value] }
[13:47:41] n008f4g_: has joined #ruby
[13:47:44] y0da: has joined #ruby
[13:48:03] alex88: so it will be an hash of values which are the sum of the value key in the array
[13:49:08] theery: has joined #ruby
[13:49:18] ljarvis: changes.each_with_object(Hash.new(0)) { |charge, all| all[Time.at(charge.create).to_date] += charge[:value] }
[13:49:21] ljarvis: or something
[13:49:44] acovrig: has joined #ruby
[13:50:55] mary5030: has joined #ruby
[13:51:29] serivichi: has joined #ruby
[13:51:45] prefixed: has joined #ruby
[13:51:52] tkuchiki: has joined #ruby
[13:51:59] alex88: oh awesome! charges.each_with_object(Hash.new(0)) { |charge, all| all[Time.at(charge[:created]).to_date] += charge[:value] }
[13:52:02] alex88: ljarvis: thanks!
[13:52:46] prefixed: has joined #ruby
[13:53:55] mercwithamouth: has joined #ruby
[13:53:59] Violentr: has joined #ruby
[13:54:47] chinmay_dd: has joined #ruby
[13:55:13] snophey: has joined #ruby
[13:55:43] willywos: has joined #ruby
[13:56:24] CloCkWeRX: has joined #ruby
[13:56:50] Scripore: has joined #ruby
[13:57:08] adaedra: shevy: [k-_ is coding but not in Ruby!
[13:57:45] [k-_: you tipper!
[13:58:17] shevy: adaedra damn haskell
[13:58:30] christiandsg: has joined #ruby
[13:59:04] malconis: has joined #ruby
[13:59:10] dfockler: has joined #ruby
[14:01:53] havenwood: has joined #ruby
[14:02:04] freerobby: has joined #ruby
[14:02:05] werelivinginthef: has joined #ruby
[14:03:24] Igorshp: has joined #ruby
[14:04:32] Zai00: has joined #ruby
[14:07:00] bustrarm: has joined #ruby
[14:07:18] melter: has joined #ruby
[14:07:19] fabrice31: has joined #ruby
[14:08:14] deepu: has joined #ruby
[14:09:51] arturmartins: has joined #ruby
[14:10:05] zeeraw: has joined #ruby
[14:10:25] JoshL: has joined #ruby
[14:10:45] juanpablo____: has joined #ruby
[14:10:50] John63: has joined #ruby
[14:10:53] John63: 84 http://www.n-games-dev.net/black-fps/
[14:11:16] apeiros: !kick John63 no spam
[14:11:16] helpa: apeiros: No.
[14:11:17] ruboto: ruboto kicked John63: spam
[14:11:17] ruboto: -o ruboto
[14:11:34] kokoleavia: has joined #ruby
[14:12:13] ddv: looks like a shit game anyways, good job apeiros
[14:12:19] Igorshp: has joined #ruby
[14:12:29] TheBrayn: Any sequel users her? How can I use the pg_array method from here? http://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/pg_array_rb.html the documentation mentions calling ???Sequel.extension :core_extensions??? but it does not say where to call it
[14:14:30] fractalis: has joined #ruby
[14:15:38] fabrice31: has joined #ruby
[14:16:07] ljarvis: TheBrayn: call it to load the extension (i.e when your code loads, before you use it)
[14:16:56] ljarvis: i.e I would probably call it right before connecting to the DB
[14:18:05] TheBrayn: I have called it in my constructor but I still get an undefined method exception for pg_array
[14:18:07] sdwrage: has joined #ruby
[14:18:24] ljarvis: TheBrayn: maybe show your code? but a constructor sounds like a bad place to load it
[14:19:13] momomomomo: has joined #ruby
[14:19:29] but3k4: has joined #ruby
[14:20:49] dopie: has joined #ruby
[14:20:55] TheBrayn: https://gist.github.com/mmerfort/5b054373d89e23b8acb6
[14:21:08] hinbody: has joined #ruby
[14:21:30] podman: has joined #ruby
[14:21:31] TheBrayn: updated it with the error message
[14:22:06] paulcsmith: has joined #ruby
[14:22:38] dtzitz: has joined #ruby
[14:25:04] NeverDie: has joined #ruby
[14:25:22] ljarvis: TheBrayn: you said "but I still get an undefined method exception for pg_array"
[14:25:28] ljarvis: but that's not the error?
[14:25:41] TheBrayn: right: configmanager_converter.rb:37:in `block (2 levels) in update_tables': undefined method `pg_array' for Sequel:Module (NoMethodError)
[14:25:50] ljarvis: ... that's not in the gist
[14:26:14] TheBrayn: yeah I copied the wrong line
[14:26:44] ljarvis: I'd ask in #sequel
[14:27:08] kb3ien: has joined #ruby
[14:28:32] senayar: has joined #ruby
[14:28:32] senayar: has joined #ruby
[14:28:49] abdulrehman: guys/gals is there a way to embed ruby logic in a sql? so instead of using case statement use some if statement or unless statement to select one coloumn over the otehr i some conditions are met? or I am dead down to use sql?
[14:28:54] kb3ien: trying to change a string '{"foo" => "bar"}' into something safe for an html string. I tried to use tmp.gsub(/\"/,'%22'); or tmp.gsub(/"/,'%22'); but nothing changed
[14:29:14] ljarvis: ?code abdulrehman
[14:29:14] ruboto: abdulrehman, We can't help you without your code, please post it to https://gist.github.com
[14:29:25] abdulrehman: cool one minuite
[14:29:27] Scripore: has joined #ruby
[14:29:38] sypheren: has joined #ruby
[14:30:00] momomomomo: has joined #ruby
[14:30:13] chills42: has joined #ruby
[14:30:32] safeforge: has joined #ruby
[14:30:44] ljarvis: kb3ien: CGI.escapeHTML
[14:31:23] CustosLimen: has joined #ruby
[14:31:54] christiandsg: has joined #ruby
[14:32:22] abdulrehman: ljarvis: along these lines, https://gist.github.com/AbdulR3hman/2468e54f266dd9b90b61
[14:32:32] prefixed: has joined #ruby
[14:32:35] quimrstorres: has joined #ruby
[14:32:37] tjbiddle: has joined #ruby
[14:32:48] kies^: has joined #ruby
[14:32:50] ljarvis: abdulrehman: right, no; you need to use sql
[14:33:02] abdulrehman: the reason behing this, is that the statement is gonna be very long and I'd rather customise it using ruby but I think it wont be possible this might be sql cause it needs to be done on the server side
[14:33:26] ljarvis: abdulrehman: SQL is extremely powerful, you should embrace it in your toolset
[14:33:34] codecop: has joined #ruby
[14:33:40] UukGoblin: has joined #ruby
[14:33:49] UukGoblin: has left #ruby: ()
[14:34:22] abdulrehman: ljarvis: I guess you are right, I try to avoid doing just because it looks ugly in the ruby code, I wish I can kinda sperate them in different places where the sql is in different place and the call (logic) of calling the sql is in the main function
[14:34:37] rideh: has joined #ruby
[14:34:41] abdulrehman: I guess I can use prepared statements and simply require them from different files
[14:34:46] ljarvis: abdulrehman: well you should use something like sequel to build your query so you don't have to hand write it
[14:35:00] ljarvis: which means you get to write more ruby-esque code
[14:35:28] ljarvis: but I'm of the opinion that having SQL strings in your code is absolutely fine, though I am probably not in the majority
[14:35:53] abdulrehman: ljarvis: the problem is in the project I am working with I am using three different database, orcale sybase and sql server.
[14:36:08] darix: ljarvis: it is much better to obfuscate them with some DSL which will probably be a ton of lines longer
[14:36:11] abdulrehman: ljarvis: I guess you are right
[14:36:29] bruno-: has joined #ruby
[14:36:51] DaniG2k_: has joined #ruby
[14:37:01] abdulrehman: koolio, thanks folks
[14:37:13] charliesome: has joined #ruby
[14:38:01] danman: has joined #ruby
[14:38:31] sinkensabe: has joined #ruby
[14:38:45] tjbiddle: has joined #ruby
[14:38:48] lannonbr: has joined #ruby
[14:39:22] senayar: has joined #ruby
[14:40:25] nzst: has joined #ruby
[14:40:50] lolmaus: has joined #ruby
[14:40:51] nzst: Hello, How can I assert that variable is valid iso8601?
[14:40:57] jobewan: has joined #ruby
[14:41:08] nzst: *contains
[14:41:12] ljarvis: ?context nzst
[14:41:12] ruboto: nzst, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
[14:41:57] kb3ien: has left #ruby: ()
[14:41:59] christiandsg: has joined #ruby
[14:42:03] nzst: I have an api with dates that have iso8601 formatting, I want to verify that this remains true in a functional test
[14:42:07] Sypheren_: has joined #ruby
[14:42:27] ljarvis: a functional test which hits the API every time?
[14:43:06] ljarvis: that's a bad test
[14:43:10] nzst: it's my api
[14:43:29] ljarvis: this test is part of the api or part of something which consumes the api?
[14:43:34] ljarvis: i.e are you making a http request?
[14:44:30] Scripore: has joined #ruby
[14:44:35] tennis: has joined #ruby
[14:44:37] nzst: that's besides the point, how do I use ruby's built in minitest to validate iso8601 formatting?
[14:44:47] Igorshp: has joined #ruby
[14:44:54] bruno-: has joined #ruby
[14:45:06] fabrice31: has joined #ruby
[14:45:36] sinkensabe: has joined #ruby
[14:46:00] turb0: has joined #ruby
[14:46:02] adaedra: wat wat wat
[14:46:07] lapide_viridi: has joined #ruby
[14:46:18] ljarvis: nzst: assert_equal time_str, Time.parse(time_str).iso8601
[14:46:19] jobewan: has joined #ruby
[14:46:34] nzst: ljarvis: gratzi
[14:46:49] arup_r: has joined #ruby
[14:46:59] turb0: has left #ruby: ()
[14:47:44] sypheren: has joined #ruby
[14:47:45] tennis: has joined #ruby
[14:48:02] Ropeney: has joined #ruby
[14:48:51] tennis: has joined #ruby
[14:49:35] theery: has joined #ruby
[14:50:10] DaniG2k: has joined #ruby
[14:50:42] tjbiddle: has joined #ruby
[14:51:46] RegulationD: has joined #ruby
[14:53:26] decoponio: has joined #ruby
[14:54:45] dabradley: has joined #ruby
[14:55:35] ninin: has joined #ruby
[14:55:48] leesharma: has joined #ruby
[14:56:06] JohnBat26: has joined #ruby
[14:56:11] ninin: has left #ruby: ()
[14:58:18] JoshL: has joined #ruby
[14:58:52] theery: has joined #ruby
[14:59:39] rippa: has joined #ruby
[15:00:08] ljarvis: when you grep for a method call but some metaprogramming adds a million layers and you can't find it SIGH
[15:00:25] programmerq: has joined #ruby
[15:00:33] shpoont: has joined #ruby
[15:00:36] lolmaus_: has joined #ruby
[15:00:56] paulcsmith: has joined #ruby
[15:02:53] michael_mbp: has joined #ruby
[15:02:56] adaedra: metaprogramming is your friend
[15:03:12] sypheren: has joined #ruby
[15:03:16] adaedra: a psycopath friend
[15:03:26] sevenseacat: has left #ruby: ("Me dun like you no more.")
[15:03:32] Rollabunna: has joined #ruby
[15:04:05] shevy: like adaedra :)
[15:04:39] j4cknewt: has joined #ruby
[15:05:04] shevy: I once went crazy with method_missing and dynamically creating methods that were not existing, passing things up and down to different classes
[15:05:11] shevy: since that day I have become a sceptic!
[15:05:37] ta: has joined #ruby
[15:05:39] ccooke: shevy: there are definite ways in which that can go wrong
[15:05:59] casadei_: has joined #ruby
[15:08:13] Vile`: has joined #ruby
[15:08:44] rideh: has joined #ruby
[15:08:51] workmad3: shevy: I think anyone who's used metaprogramming in anger is skeptical of a lot of possible uses afterwards :) it's most definitely a double-edged sword
[15:09:29] ccooke: ACTION uses a fair bit of metaprogramming, but mostly for purely personal code
[15:09:58] zeeraw: has joined #ruby
[15:10:31] bruno-: has joined #ruby
[15:10:50] workmad3: ccooke: I'll use it... but not generally as a first stage in coding, I'll get something working without metaprogramming and then use it if a metaprogramming solution looks simple, neat and readable
[15:11:26] fabrice31_: has joined #ruby
[15:11:47] dgutierrez1287: has joined #ruby
[15:11:49] ccooke: I probably reach for it a little early - it's something that I look at when I write code for work, to avoid using it too much
[15:12:03] ccooke: but on the other hand, I love the ability to write useful DSLs in Ruby
[15:12:13] paulcsmith: has joined #ruby
[15:13:04] ccooke: (Although the system that uses a DSL define a config DSL is... probably pushing it)
[15:13:25] j4cknewt: has joined #ruby
[15:14:46] baroquebobcat: has joined #ruby
[15:15:07] luckyno7: has joined #ruby
[15:15:34] bruno-: has joined #ruby
[15:15:35] Rollabun_: has joined #ruby
[15:16:06] sypheren: has joined #ruby
[15:17:56] shpoont: has joined #ruby
[15:18:10] tkuchiki: has joined #ruby
[15:18:11] zeeraw: has joined #ruby
[15:18:37] tuxtgz: has joined #ruby
[15:21:55] khebbie: has joined #ruby
[15:22:06] sypheren: has joined #ruby
[15:22:14] polly_wog: has joined #ruby
[15:22:26] fenjamin: has joined #ruby
[15:24:30] arturmartins: has joined #ruby
[15:25:19] allomov: has joined #ruby
[15:25:29] mollymorphic: has joined #ruby
[15:28:09] tubuliferous: has joined #ruby
[15:28:10] bruno-_: has joined #ruby
[15:30:08] senayar: has joined #ruby
[15:30:40] shpoont: has joined #ruby
[15:31:26] zeeraw: has joined #ruby
[15:32:16] gion: has joined #ruby
[15:32:23] chills42: has joined #ruby
[15:32:34] j4cknewt: has joined #ruby
[15:32:53] _blizzy_: has joined #ruby
[15:33:09] bruno-: has joined #ruby
[15:33:35] EminenceHC: has joined #ruby
[15:33:53] michaeldeol: has joined #ruby
[15:34:32] blue_deref: has joined #ruby
[15:35:09] icebourg: has joined #ruby
[15:36:40] danman: has joined #ruby
[15:36:44] fenjamin: hi, i am destructively modifying an array with the array, min_value, and value passed a parameters
[15:36:55] fenjamin: def pad!(array, min_value, value = nil)
[15:38:05] fenjamin: placing blocks and objects in the body of the method, what is the object?
[15:38:11] bruno-: has joined #ruby
[15:38:22] araujo: has joined #ruby
[15:38:22] araujo: has joined #ruby
[15:38:24] ljarvis: fenjamin: I'm sorry, what?
[15:38:26] gion: I have an issue with escaping some command line parameters when using Open3
[15:38:29] gion: http://pastebin.com/4JvR531C
[15:38:30] ruboto: gion, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/59a48f495a99015f2515
[15:38:30] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[15:38:48] shevy: has joined #ruby
[15:39:04] fenjamin: there is an rspec however I'm unsure if i call the array in the body or outside the body
[15:39:26] fenjamin_: has joined #ruby
[15:39:29] araujo: has joined #ruby
[15:39:37] ljarvis: ?code fenjamin
[15:39:37] ruboto: fenjamin, We can't help you without your code, please post it to https://gist.github.com
[15:39:54] ljarvis: gion: did you try adding quotes into the concat string?
[15:40:01] fenjamin: write two methods `pad` and `pad!`. Each method accepts an array, a minimum size (non-negative integer) for the array, and an optional argument of what the array should be "padded" with (see the example with "apple" below).
[15:40:01] fenjamin: If the array's length is less than the minimum size, `pad` should return a new array padded with the pad value up to the minimum size.
[15:40:08] gion: yes, no avail, it escapes them, they appear as \"
[15:40:10] ruurd: has joined #ruby
[15:40:11] _blizzy_: has joined #ruby
[15:41:02] fenjamin: https://gist.github.com/papermache/06887b330c54b9e694b2
[15:41:02] araujo: has joined #ruby
[15:41:04] fenjamin: get the gist?
[15:41:36] ljarvis: fenjamin: yes, so what do you need help with?
[15:41:41] ljarvis: nobody is writing the code for you
[15:41:55] riotjones: has joined #ruby
[15:42:12] ljarvis: gion: sorry I'm not sure, hopefully someone else can help
[15:42:14] apeiros: indeed, I'm not writing code for them
[15:42:26] j4cknewt: has joined #ruby
[15:42:28] fenjamin_: my question is using blocks and objects inside the method body
[15:42:35] ljarvis: what about it?
[15:42:53] bronson: has joined #ruby
[15:43:29] theery: has joined #ruby
[15:43:31] araujo: has joined #ruby
[15:44:42] fenjamin_: how does the block or object in the method body pass additional elements into the array?
[15:44:48] gion: ljarvis: thank you anyway - might go on `` approach and I escape manually
[15:45:03] dgutierrez1287: has joined #ruby
[15:45:16] mdavid613: has joined #ruby
[15:45:23] ljarvis: fenjamin: you should look at the documentation for Array.new and Array#push
[15:45:25] darithorn: has joined #ruby
[15:45:36] xxneolithicxx: has joined #ruby
[15:45:46] davedev24: has joined #ruby
[15:45:55] ljarvis: maybe show us what you've tried too
[15:45:59] alex88: gion: how you know command has \"?
[15:46:06] hinbody: has joined #ruby
[15:46:20] Cache_Money: has joined #ruby
[15:46:46] xxneolithicxx: has joined #ruby
[15:46:51] gion: alex88: I do not understand your question
[15:47:06] fenjamin_: this appears to be non-destructive - '
[15:47:16] rehat: has joined #ruby
[15:47:25] alex88: gion: if you set -i to "\"concat:#{@input.join('|')}\"", does it work?
[15:47:41] alex88: the issue you have is to have quotes around the -i value
[15:48:14] xxneolithicxx: has joined #ruby
[15:48:52] rcvalle: has joined #ruby
[15:49:13] weemsledeux: has joined #ruby
[15:49:24] dfockler: has joined #ruby
[15:49:28] gion: alex88: does not work, already answered to ljarvis
[15:49:30] ips|malc: has joined #ruby
[15:49:42] alex88: gion: how you know it doesn't work?
[15:49:57] gion: alex88: ffmpeg receives a string that has escaped quotes in it
[15:50:14] sypheren: has joined #ruby
[15:50:15] alex88: tried Open3.capture3(command.join(' '))?
[15:50:23] gion: alex88: instead of receiving " in ffmpeg I get \"
[15:50:38] christiandsg: has joined #ruby
[15:51:23] xxneolithicxx: has joined #ruby
[15:51:47] CustosLimen: has joined #ruby
[15:52:14] gambl0re: has joined #ruby
[15:52:45] shevy: it is possible to use ffmpeg concat from ruby fine, I do this in some script
[15:53:13] khebbie: has joined #ruby
[15:53:17] khebbie_: has joined #ruby
[15:53:19] gion: alex88: now I am even more confused -> this is the command ffmpeg -y -f mpegts -i "concat:chunks\1.ts|chunks\2.ts|chunks\3.ts" -c copy -bsf:a aac_adtstoasc -bsf:v h264_mp4toannexb path.mp4
[15:53:43] gion: alex88: and it works, but something happens when it meets the pipe charc
[15:53:57] gion: alex88: which is not a pipe, just a separator
[15:54:16] sdothum: has joined #ruby
[15:54:18] alex88: gion: the \\ has been escaped
[15:54:33] shevy: ffmpeg -i concat:foo.mp3\|bar.mp3 -acodec copy output.mp3
[15:55:00] shevy: is \1 valid there gion?
[15:55:17] alex88: try to use '-i', '"concat:' + @input.join('|') + '"'
[15:55:22] shevy: that chunks\1.ts part
[15:55:33] mlangenberg: has joined #ruby
[15:55:55] shevy: I am often lazy and try to have simple filenames before working on files
[15:56:01] paulcsmith_: has joined #ruby
[15:56:05] aevitas: has joined #ruby
[15:56:06] ruurd: has joined #ruby
[15:56:20] adaedra: that's a good thing to do, have simple file names
[15:56:51] iWaffles: has joined #ruby
[15:56:55] shevy: yay! adaedra is on my side
[15:57:07] mercwithamouth: has joined #ruby
[15:57:23] abdulrehman: good night peeps, thanks for the help again..... see you tomorrow ( adaedra if they don't block the channel by then hahaha)
[15:57:45] JoshL: has joined #ruby
[15:58:19] zeeraw: has joined #ruby
[15:58:34] adaedra: this day is intense
[15:58:58] gion: alex88: just before calling capture3 I join and print the command: ffmpeg -y -f mpegts -i "concat:chunks\1.ts|chunks\2.ts|chunks\3.ts" -c copy -bsf:a aac_adtstoasc -bsf:v h264_mp4toannexb
[15:59:34] alex88: gion: the issue seems to be in chunks filename, you expect themt o be chunks\\1 not chunks\1
[16:00:01] gion: alex88: i think you are right, this is bloody windows
[16:00:03] xxneolithicxx: has joined #ruby
[16:00:21] alex88: it's just maybe string escaping since you're joining inside ""
[16:00:36] alex88: that's why I told you to try to use single quotes and concat with +
[16:00:47] christiandsg: has joined #ruby
[16:01:08] snockerton: has joined #ruby
[16:01:14] sypheren: has joined #ruby
[16:01:18] gion: alex88: nope, it is not this, changed to fwd slashes and same behavior
[16:01:44] lolmaus: has joined #ruby
[16:02:08] gion: alex88: if i copy the command that puts outputs, and run it manually in the shell, all works, only when it goes through capture3 it fails
[16:02:10] amclain: has joined #ruby
[16:02:34] gion: alex88: ffmpeg -y -f mpegts -i "concat:chunks/1.ts|chunks/2.ts|chunks/3.ts" -c copy -bsf:a aac_adtstoasc -bsf:v h264_mp4toannexb output.mp4
[16:02:48] deepu: has joined #ruby
[16:03:22] alex88: try to pass that string directly in capture3 to see if it runs
[16:04:01] allomov: has joined #ruby
[16:04:21] skyrocker: has joined #ruby
[16:04:29] skyrocker: has left #ruby: ()
[16:04:39] gion: alex88: did it, passed as above or as array
[16:04:58] acovrig: has joined #ruby
[16:05:08] gion: alex88: something is discarded, i see only chunks/1.ts being used in the end
[16:06:48] rideh: has joined #ruby
[16:07:31] Mon_Ouie: has joined #ruby
[16:07:55] Alayde: has joined #ruby
[16:09:16] jackjackdripper: has joined #ruby
[16:09:18] pietr0: has joined #ruby
[16:09:53] CorySimmons: has joined #ruby
[16:10:06] bendiken: has joined #ruby
[16:10:30] CorySimmons: has joined #ruby
[16:10:53] RobertBirnie: has joined #ruby
[16:11:12] gambl0re: has joined #ruby
[16:11:35] Hanmac: has joined #ruby
[16:12:00] shevy: doesn't a / have to be escaped?
[16:12:12] banister: has joined #ruby
[16:12:18] paulcsmith_: has joined #ruby
[16:12:44] shevy: and the | as well?
[16:13:09] xxneolithicxx: has joined #ruby
[16:14:14] [k-_: look shevy: ruby: http://exercism.io/submissions/ab7f525ad1524f82b03593ba706d33c2
[16:14:18] [k-_: lots even
[16:14:44] shevy: huh why do you do bio stuff in ruby?
[16:15:10] [k-_: exercism?
[16:15:32] shevy: yeah the example there
[16:15:42] sarkyniin: has joined #ruby
[16:15:46] shevy: require_relative 'RNA/Nucleotides/nucleotide'
[16:15:56] [k-_: thats the task!
[16:16:08] ruboto: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[16:16:29] Hanmac: shevy did you see the trailer / poster for the new Fantastic Four Movie? HumanTorch is black now ... oO
[16:17:11] shevy: not really, I kinda stopped following movie-things for some years now :(
[16:17:52] workmad3: hanmac: that trailer is really underwhelming, IMO
[16:18:30] gion: shev: fwd slash no, the pipe i don't know, the pipe is inside a string, so it shouldn't be touched
[16:18:51] zeeraw: has joined #ruby
[16:19:09] sarkyniin: has joined #ruby
[16:19:12] Hanmac: workmad3: i only did see the poster yet, i am still confused how the brother of the blond chick is black now ... was he to long in the sun? maybe he did burnt himself and now is crispy like a roasted chicken ...
[16:19:35] workmad3: hanmac: they're no longer a family
[16:20:21] bricker: has joined #ruby
[16:20:25] bruno-: has joined #ruby
[16:20:52] benlieb: has joined #ruby
[16:21:04] j4cknewt: has joined #ruby
[16:21:09] Hanmac: workmad3: hm what do you say to the new (Peter)Pan movie? imo it looks interesting
[16:21:21] pengin: has joined #ruby
[16:21:22] workmad3: not seen much for that yet
[16:21:34] _blizzy_: has joined #ruby
[16:21:40] MatthewsFace: has joined #ruby
[16:23:06] paulcsmith_: has joined #ruby
[16:23:13] banister: hanmac hollywood is just on a major "remake everything" buzz for the last 3-4 years, it's annoying
[16:23:21] pengin_: has joined #ruby
[16:23:23] banister: they already remade spiderman about 5 times in the last few years
[16:24:11] [Butch]: has joined #ruby
[16:24:12] pipework: They're going for more fantastic four and stuff too.
[16:24:27] Hanmac: banister: yeah ... i want to see some new heroes ... while Ant-man movie does look good, its not so new ... hmm for sample the BlueBeetle looks funny
[16:24:34] adaedra: more than four isn't four.
[16:24:41] pipework: I'd rather remake good superhero movies than make antman-like movies.
[16:25:01] sanguisdex: has joined #ruby
[16:25:02] wprice: has joined #ruby
[16:25:11] nobitanobi: has joined #ruby
[16:25:17] workmad3: hanmac: ant-man is pretty good... and marvel is doing a dr strange film either next year or the year after in the MCU... all the reboots are with the non-marvel studios that bought up marvel superheros :(
[16:25:30] lannonbr: has joined #ruby
[16:25:44] sypheren: has joined #ruby
[16:25:58] drew0: has joined #ruby
[16:25:59] workmad3: spiderman films are done by sony, iirc, and I think f4 is 20th century fox or universal...
[16:26:45] bendiken: has left #ruby: ()
[16:27:01] Miphix: has joined #ruby
[16:28:35] yqt: has joined #ruby
[16:29:02] mleung: has joined #ruby
[16:29:40] xxneolithicxx1: has joined #ruby
[16:29:40] Zai00: has joined #ruby
[16:30:03] Hanmac: workmad3: i lolled so hard recently that in the Spiderman series, Spiderman got the powers of Dr Strange for the episode ;P he did call himself the "highest spider" or something like that ;P
[16:30:58] adaedra: It's the writers that were really high
[16:31:27] pengin: has joined #ruby
[16:32:22] mercwithamouth: has joined #ruby
[16:32:53] aaeron: has joined #ruby
[16:33:08] bruno-: has joined #ruby
[16:35:29] Ilyas: has joined #ruby
[16:36:25] paulcsmith_: has joined #ruby
[16:37:13] neanderslob: has joined #ruby
[16:37:31] aphprentice: has joined #ruby
[16:38:11] bruno-: has joined #ruby
[16:39:15] kapowaz: hey there. I'm trying to diagnose an issue with rbenv. Is this a decent place to ask, or is there a dedicated rbenv channel?
[16:40:16] sarkyniin: has joined #ruby
[16:40:24] lolmaus_: has joined #ruby
[16:40:33] kapowaz: I'll ask anyway. Basically I'm getting the standard error: ???You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.??? whilst trying to `gem install` something, in spite of having rbenv installed.
[16:41:14] kapowaz: I ran the rbenv doctor script from https://gist.githubusercontent.com/mislav/4728286/raw/rbenv-doctor.sh and it suggests that the standard system ruby gems path is before my rbenv gems path in my $PATH
[16:41:16] jaequery: has joined #ruby
[16:41:26] kapowaz: but I can't see how come based on my .profile
[16:41:56] adaedra: what does which ruby and which gem outputs?
[16:42:03] bronson: has joined #ruby
[16:42:07] adaedra: `which ruby` and `which gem`*
[16:42:11] kapowaz: which ruby => /Users/bdarlow/.rbenv/shims/ruby
[16:42:22] kapowaz: which gem => /Users/bdarlow/.rbenv/shims/gem
[16:42:58] adaedra: and which rbenv?
[16:43:10] adaedra: no wait, should be ok too, I'm doing things in reverse
[16:43:13] j4cknewt: has joined #ruby
[16:43:48] adaedra: that's `gem env` that should be interesting
[16:43:51] KinderSpiel: has joined #ruby
[16:44:25] kapowaz: output from gem env is here: https://gist.github.com/anonymous/58f63f39b942615a20fa
[16:44:36] zeeraw: has joined #ruby
[16:44:55] mdih: has joined #ruby
[16:45:31] segfalt: has joined #ruby
[16:45:53] adaedra: er, what about rbenv version
[16:45:57] djstorm: has joined #ruby
[16:46:17] KinderSpiel: adaedra oye oye
[16:46:44] adaedra: Looks like rbenv is using system ruby here
[16:46:52] last_staff: has joined #ruby
[16:48:31] adaedra: kapowaz: ?
[16:49:12] KinderSpiel: adaedra you know something about clevertech?
[16:49:17] Jackneill: has joined #ruby
[16:49:54] adaedra: KinderSpiel: no
[16:50:34] despai: has joined #ruby
[16:50:38] carlosoliveira: has joined #ruby
[16:50:55] AckZ: has joined #ruby
[16:50:58] KinderSpiel: has anyone applied to a job that made you log in with google?
[16:51:12] bluOxigen: has joined #ruby
[16:53:03] AckZ: has anyone here ever used set_notice_receiver with the pg gem? i can't really get it to do anything
[16:53:10] khebbie: has joined #ruby
[16:53:10] 17WAABZFQ: has joined #ruby
[16:53:27] pullphinger: has joined #ruby
[16:53:55] Antiarc: Keeper of the Trove is a weird-ass mod
[16:54:00] Antiarc: whoops, wrong channel
[16:54:16] adaedra: A weird-ass channel
[16:54:23] adaedra: Anyway, time to go
[16:54:26] kapowaz: adaedra: irccloud is being weird.
[16:54:29] tubuliferous: has joined #ruby
[16:54:36] blueOxigen: has joined #ruby
[16:54:40] kapowaz: you were right though, because it's defaulting to system ruby, it's also defaulting to system gems location
[16:54:52] kapowaz: as soon as I changed rbenv to use a user-installed ruby version globally, it fixed the issue
[16:55:10] dfockler: AckZ: do you have code?
[16:55:17] adaedra: kapowaz: ah good.
[16:55:21] adaedra: just in time :)
[16:55:47] yeticry: has joined #ruby
[16:56:06] yfeldblum: has joined #ruby
[16:57:02] rbowlby: has joined #ruby
[16:57:25] _djbkd: has joined #ruby
[16:58:43] snockerton1: has joined #ruby
[16:59:05] nzst: has joined #ruby
[16:59:35] snockerton1: has joined #ruby
[16:59:45] rideh: has joined #ruby
[16:59:51] snockerton1: has left #ruby: ()
[17:00:11] paulcsmith_: has joined #ruby
[17:00:21] afd: has joined #ruby
[17:00:51] allomov: has joined #ruby
[17:01:39] ixti: has joined #ruby
[17:01:55] snockerton1: has joined #ruby
[17:02:14] zeeraw: has joined #ruby
[17:02:45] apt-get_: has joined #ruby
[17:02:59] ips|malc: has joined #ruby
[17:04:49] banister: has joined #ruby
[17:05:39] quimrstorres: has joined #ruby
[17:06:13] iloverubynoob: has joined #ruby
[17:07:51] mikecmpbll: has joined #ruby
[17:08:12] fluchtreflex: has joined #ruby
[17:08:12] fluchtreflex: has joined #ruby
[17:10:21] IrishGringo_: has joined #ruby
[17:10:40] polpak: has joined #ruby
[17:10:49] acke: has joined #ruby
[17:11:07] fractalis: has joined #ruby
[17:13:31] GnuYawk: has joined #ruby
[17:13:31] GnuYawk: has joined #ruby
[17:13:39] sepp2k: has joined #ruby
[17:14:25] Muhannad: has joined #ruby
[17:15:27] Alina-malina: has joined #ruby
[17:15:40] wallerdev: has joined #ruby
[17:15:41] AckZ: dfockler: nm, i can make it work correctly from a simple script, but under rails it just doesn't do anything for some reason.. i'll see if I can come up with a rails example
[17:16:05] shadoi: has joined #ruby
[17:16:07] yardenbar: has joined #ruby
[17:17:43] craysiii: AckZ have you tried asking #rubyonrails
[17:17:55] craysiii: oh i see you there now :)
[17:17:56] fantazo: has joined #ruby
[17:20:11] klingeldraht: has joined #ruby
[17:20:18] wallerdev: has joined #ruby
[17:20:41] towski_: has joined #ruby
[17:21:07] zick: has joined #ruby
[17:21:56] Eiam: has joined #ruby
[17:22:51] kokoleavia: has joined #ruby
[17:26:01] Scripore: has joined #ruby
[17:26:15] zick: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[17:27:04] msnyon: has joined #ruby
[17:29:59] Synthead: has joined #ruby
[17:31:28] klingeldraht: has joined #ruby
[17:31:41] kol: has joined #ruby
[17:31:45] moredhel: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[17:33:07] IrishGringo: has joined #ruby
[17:33:31] i: has joined #ruby
[17:34:32] aevitas_: has joined #ruby
[17:34:56] renderful: has joined #ruby
[17:35:37] wldcordeiro: has joined #ruby
[17:36:38] Igorshp: has joined #ruby
[17:37:02] Musashi007: has joined #ruby
[17:38:36] chills42: has joined #ruby
[17:38:49] ramfjord: has joined #ruby
[17:39:05] drewo: has joined #ruby
[17:42:21] Igorshp: has joined #ruby
[17:42:24] theery: has joined #ruby
[17:44:23] felixrsmith: has joined #ruby
[17:45:50] eichenwald: has joined #ruby
[17:45:52] j4cknewt: has joined #ruby
[17:46:44] roolo: has joined #ruby
[17:47:30] Eiam: has joined #ruby
[17:48:06] Narzew: has joined #ruby
[17:49:26] lwu: has joined #ruby
[17:49:26] kol: i l u ruby
[17:50:09] lwu: has joined #ruby
[17:50:22] Eiam_: has joined #ruby
[17:50:31] shevy: is it weird if I do use something such as:
[17:50:38] shevy: module Foo; def self.new
[17:50:50] lwu: has joined #ruby
[17:51:26] lwu: has joined #ruby
[17:51:42] Saloaty: has joined #ruby
[17:51:47] Narzew: Is that channel also for Shoes framework ? #shoes have only 7 users with me..
[17:51:55] eichenwald: has left #ruby: ("WeeChat 1.0.1")
[17:52:13] lwu: has joined #ruby
[17:52:14] shevy: you can try your luck, I don't think that many people use shoes though
[17:52:20] shevy: I used it back in the days when _why was in charge
[17:52:27] Aria: Aww. Same.
[17:52:48] lwu: has joined #ruby
[17:53:00] banister: has joined #ruby
[17:53:21] lwu: has joined #ruby
[17:53:24] Narzew: I have completed Shoes bases app but I need help packaging it into .exe (i get no of errors that haven't been on stack yet)
[17:53:42] iWaffles: has joined #ruby
[17:53:44] dseitz: has joined #ruby
[17:53:55] lwu: has joined #ruby
[17:54:29] _blizzy_: has joined #ruby
[17:54:35] lwu: has joined #ruby
[17:55:35] khebbie: has joined #ruby
[17:56:04] khebbie_: has joined #ruby
[17:56:11] aryaching: has joined #ruby
[17:56:12] mlangenberg: has joined #ruby
[17:56:26] Synthead: can I define at_exit a second time to redefine it?
[17:57:01] hinbody_: has joined #ruby
[17:57:04] platzhirsch: has left #ruby: ()
[17:57:24] pipework: Synthead: try!
[17:57:44] davejlong: has joined #ruby
[17:58:49] mlue: has joined #ruby
[17:59:23] Synthead: pipework: This seems to subscribe both blocks when ctrl-c is hit http://pastie.org/10316857
[17:59:36] pengin: has joined #ruby
[18:00:03] Narzew: Can anyone recommend mi a GUI toolkit for Ruby that can be easily packaged to .exe and Linux binary programs ?
[18:00:37] Muhannad: has joined #ruby
[18:01:08] benlieb: has joined #ruby
[18:01:23] craysiii: a quick google search turned up http://shoesrb.com/
[18:01:39] aaeron: has joined #ruby
[18:02:23] _blizzy_: has joined #ruby
[18:04:01] shevy: Narzew not sure any such exists, after all ruby is interpreted not compiled
[18:04:02] banister: has joined #ruby
[18:04:10] shevy: there should be some one click installers
[18:04:32] pipework: shevy: That's not quite true.
[18:04:42] craysiii: from what ive read you can use something called rubinius
[18:04:52] shevy: you know of an .exe creator for ruby files then pipework?
[18:05:10] pipework: shevy: No, I meant the "after all ruby is interpreted not compiled" part.
[18:06:55] Scripore: has joined #ruby
[18:07:48] Narzew: hmm "shoes script.rb" works, but generated "script.shy" have errors with file options
[18:08:03] Narzew: and ocra ? Is the way to use it on Linux to compile program for win ?
[18:08:14] quimrstorres: has joined #ruby
[18:08:46] shevy: Narzew people can just download a .gem even on windows
[18:09:31] towski_: has joined #ruby
[18:09:55] treehug88: has joined #ruby
[18:10:38] tsvenson: has joined #ruby
[18:10:47] craysiii: also check out traveling-ruby. though I guess you can't build with native extensions on windows.
[18:10:48] Musashi007: has joined #ruby
[18:10:58] Ox0dea: shevy: OCRA creates .exes.
[18:11:00] Narzew: if I use sudo gem install x is that gem installed only to root (and not to current user) ?
[18:11:04] Frem: has joined #ruby
[18:11:40] _blizzy_: has joined #ruby
[18:11:47] nkts: has joined #ruby
[18:12:05] shevy: Ox0dea do you use OCRA?
[18:12:07] Mon_Ouie: has joined #ruby
[18:12:51] j4cknewt_: has joined #ruby
[18:12:57] A-ron: has joined #ruby
[18:13:17] Mendenhall: has joined #ruby
[18:16:42] anisha: has joined #ruby
[18:17:14] Rollabunna: has joined #ruby
[18:17:45] lolmaus: has joined #ruby
[18:17:50] Rollabunna: has joined #ruby
[18:18:28] Saloaty: has left #ruby: ()
[18:18:30] sysanthrope: has joined #ruby
[18:18:58] ramfjord: has joined #ruby
[18:20:16] Ox0dea: shevy: I last used it in 2011 or so to put a (very thin) graphical layer over some scripts I'd written to automate some things.
[18:20:50] shevy: Narzew finally someone who knows windows :)
[18:20:53] Zai00: has joined #ruby
[18:20:54] Ox0dea: The target audience weren't particularly tech-unsavvy, but they were all Windows users. :/
[18:21:40] Polysics: has joined #ruby
[18:21:51] platosha: has joined #ruby
[18:23:31] iloverubynoob: has joined #ruby
[18:23:35] HoppingMadMan: has joined #ruby
[18:24:05] iateadonut: has left #ruby: ()
[18:24:09] banister: has joined #ruby
[18:26:16] radgeRayden: has joined #ruby
[18:26:55] Igorshp: has joined #ruby
[18:26:57] mlangenberg: I am comparing ways to generate unique 64bit integers (long type). Would there be any difference between SecureRandom.random_number(2**63) and SecureRandom.random_bytes(16).unpack('q')[0].abs ?
[18:28:04] {756d6f}: has joined #ruby
[18:28:29] Ox0dea: mlangenberg: The latter is needlessly involved.
[18:29:52] rideh: has joined #ruby
[18:29:56] beef-wellington: has joined #ruby
[18:30:20] weemsledeux: has joined #ruby
[18:31:07] aaeron: Hey. I am using multipart-post to post a file. I am also posting only parameters to another API. multipart-post is not working for normal http post
[18:31:50] mlangenberg: Ox0dea: lol okay, will go for the first one.
[18:32:02] krz: has joined #ruby
[18:32:08] Nuru: has joined #ruby
[18:32:50] gizmore: has joined #ruby
[18:32:58] lwu: has joined #ruby
[18:34:43] jackjackdripper: has joined #ruby
[18:35:14] Ox0dea: aaeron: Just use Net::HTTP::Post for non-multipart requests?
[18:35:58] jackjackdripper: has joined #ruby
[18:36:24] Trynemjoel: has joined #ruby
[18:36:26] aaeron: I was wondering if there one library I could use for doing both
[18:37:32] Ox0dea: Well, Net::HTTP::Post is in the standard library, so it's not like you'd need to bring in another dependency.
[18:37:33] _blizzy_: has joined #ruby
[18:38:01] banister: has joined #ruby
[18:38:48] dented42: has joined #ruby
[18:39:03] shevy: who is actually deciding when a new ruby release will happen? does matz do so or the core team together?
[18:39:25] einarj: has joined #ruby
[18:39:33] Ox0dea: matz assigns a release manager.
[18:39:40] selva: has left #ruby: ()
[18:39:46] kristian_on_linu: has joined #ruby
[18:40:01] aaeron: Ox0dea: doing it
[18:40:04] aaeron: going with ur advice
[18:40:11] havenwood: aaeron: Maybe take a look at Curb, Faraday and HTTPClient's multipart post support.
[18:40:27] havenwood: aaeron: Or yeah, do it manually with net/http
[18:40:42] Ox0dea: aaeron: I'd imagine multipart-post doesn't violate LSP too badly, so switching between Post and Post::Multipart shouldn't be too painful.
[18:41:06] havenwood: aaeron: Mechanize and RestClient are Net::HTTP wrappers that add better multipart post support as well.
[18:41:30] lkba: has joined #ruby
[18:42:58] rideh: has joined #ruby
[18:43:55] j4cknewt: has joined #ruby
[18:44:07] jenrzzz: has joined #ruby
[18:44:18] bruno-: has joined #ruby
[18:44:44] havenwood: shevy: Ruby 2.3.0 on December 25, 2015.
[18:45:28] EminenceHC: has joined #ruby
[18:45:43] shevy: damn that's still far away
[18:48:05] s00pcan: has joined #ruby
[18:49:15] HoppingMadMan: has joined #ruby
[18:49:41] Skelz0r: has joined #ruby
[18:51:28] moredhel: has joined #ruby
[18:51:47] whiteline: has joined #ruby
[18:52:04] kirun: has joined #ruby
[18:52:05] davejlong: has joined #ruby
[18:53:06] _blizzy_: has joined #ruby
[18:53:34] polpak: has joined #ruby
[18:54:26] baweaver: has joined #ruby
[18:54:39] aevitas: has joined #ruby
[18:55:18] towski_: has joined #ruby
[18:55:26] Narzew: has joined #ruby
[18:58:17] last_staff: has joined #ruby
[18:58:20] anisha: has joined #ruby
[19:00:11] benlieb: has joined #ruby
[19:00:34] jrochkind: has joined #ruby
[19:01:06] jrochkind: I'm wondering if it's save to share a OpenSSL::PKey::RSA obj accross threads, have it concurrently doing encrypt operations. And I'm thinking there's probably no way to know.
[19:02:28] Rutix: has joined #ruby
[19:02:28] Rutix: has joined #ruby
[19:02:56] MatrixBridge: has joined #ruby
[19:03:14] Ox0dea: > Why just 1? Because Ruby itself isn't thread safe, we don't need to care about threads
[19:03:19] Ox0dea: jrochkind: That's a comment from ossl_bn.c.
[19:04:06] jrochkind: Ox0dea: nice catch. So that's probably an indicator that it _ain't_ thread-safe, although might be accidentally in MRI as per usual. Would you agree?
[19:04:10] nobitanobi: has joined #ruby
[19:04:43] Ox0dea: jrochkind: Well, you'll have to make of it what you will. There are plenty of attempts at thread safety in ext/openssl.
[19:04:44] jrochkind: Of course, the JRuby is probably a different implementation, that also may or may not be threadsafe too. Def seems safest to just avoid sharing an instance between threads, alas.
[19:04:57] allomov: has joined #ruby
[19:05:09] jackjackdripper: has joined #ruby
[19:05:49] jrochkind: makes the code either a lot more complicated or less efficient, but so it goes. I'm writing an object that may be used across threads. Instead of caching an OpenSSL::PKey::RSA in an iVar, I'll just go ahead and create one every time I need it, oh wells.
[19:06:08] noethics: has joined #ruby
[19:06:28] Ox0dea: jrochkind: Better redundant than owned, I reckon.
[19:07:22] RonRichie: has joined #ruby
[19:07:24] jrochkind: even if not owned, I don't want code that, say, messes up and doesn't produce a value that can be properly decrypted/verified either.
[19:07:44] Timba-as: has joined #ruby
[19:08:04] jackjackdripper1: has joined #ruby
[19:08:33] higuys: has joined #ruby
[19:09:25] Ox0dea: There's lots of /* NO NEED TO DUP */ throughout the code, which would seem to indicate that duping does occur where necessary. Still, that OpenSSL::BN isn't thread-safe seems to put the whole thing on shaky foundations.
[19:09:51] Ox0dea: Alas, thread-safety is generally all-or-nothing.
[19:10:03] jrochkind: What's OpenSSL::BN, and how do you know it's not threadsafe, was there a widely known issue or something?
[19:10:13] Ox0dea: It's OpenSSL's implementation of Bignums.
[19:10:43] Ox0dea: The code uses a single BN_CTX wherever Bignum operations are required.
[19:10:53] Narzew: has joined #ruby
[19:13:22] j4cknewt_: has joined #ruby
[19:13:53] f4cl3y: has joined #ruby
[19:14:15] mercwithamouth: has joined #ruby
[19:15:31] redondos: is it possible to add a bundle config to a Gemfile? (e.g. I want the Gemfile to reflect `bundle config build.nokogiri --use-system-libraries' without having to actually run that command)
[19:16:53] jrochkind: redondos: hmm, good question.
[19:17:09] JoshL: has left #ruby: ()
[19:17:12] cball: has joined #ruby
[19:17:22] leafybasil: has joined #ruby
[19:17:40] redondos: I've noticed what the command does is very simple:
[19:17:48] redondos: $GEM_HOME $ cat build_info/nokogiri-1.6.6.2.info
[19:17:49] redondos: --use-system-libraries
[19:17:54] gix: has joined #ruby
[19:18:13] redondos: but I don't want to have to maintain that file, I'd rather have bundle do that for me if possible
[19:18:19] jrochkind: redondos: I can't figure out if there is a way to do that. But can you pass the same thing for nokogiri in an ENV variable instead? If so, I wonder if simply setting ENV['whatever'] at the top of the gemfile would work, although it may not.
[19:18:35] blaines: has joined #ruby
[19:18:41] jrochkind: redondos: also, not what you asked, but making sure you know you can `bundle config ???global`, and it'll save it in your ~/.bundle/config, and use it every time.
[19:19:25] redondos: this is not for my workstation, but a production server (whether or not it's a good idea to build libraries on the box is a topic for another day)
[19:20:07] blaines_: has joined #ruby
[19:20:24] redondos: i am trying to get my configuration management or deployment script to inject that so bundler does the Right Thing
[19:20:56] jrochkind: most of us do, with standard capistrano deploys, whether or not it's a good idea. :) There's no reason you _can't_ set a `bundle config ???global` for the account that's doing the building on the production server ??? even have your deployment set it. Or if this one can be triggered in an ENV, which I seem to recall it can be, setting the ENV in an .rc on the proper account on the production server might make a lot of sense.
[19:21:02] redondos: I can just run the command from the deployment script I suppose... just not neat
[19:22:05] jrochkind: Looks like NOKOGIRI_USE_SYSTEM_LIBRARIES=1 . How do you feel about setting an ENV variable in the proper account on your production machine?
[19:22:42] redondos: that'll work!
[19:22:58] jrochkind: If that fits into your setup, I think that's actually better than hard-coding it into your Gemfile, as the setting is, after all, more server-specific than project-specific. Some servers have a usable LibXML some don't.
[19:24:37] dfockler: has joined #ruby
[19:24:39] redondos: that's very true
[19:24:44] redondos: thanks for the insight
[19:24:59] jrochkind: on the ohter hand, if I stuck it in a .bashrc or something, I'd probably forget what i did and never be able to figure out what was going on, ha.
[19:25:44] jrochkind: (fwiw, I saw a nokogiri ticket on trying to make it auto-discover whether to use system libraries or not, maybe some day that'll land)
[19:26:16] shinnya: has joined #ruby
[19:26:29] redondos: that worked beautifully, thanks again
[19:26:45] redondos: I stuck it into my fabfile (shoot me, we got rid of capistrano here)
[19:27:10] drewo: has joined #ruby
[19:27:26] kadoppe: has joined #ruby
[19:27:26] CustosLimen: has joined #ruby
[19:27:46] ZeeNoodleyGamer: has joined #ruby
[19:27:50] ramfjord: has joined #ruby
[19:29:23] michael_mbp: has joined #ruby
[19:35:58] charliesome: has joined #ruby
[19:37:12] Scripore: has joined #ruby
[19:37:15] texasmade: has joined #ruby
[19:38:34] tkuchiki: has joined #ruby
[19:39:10] weemsledeux: has joined #ruby
[19:39:28] Muhannad: has joined #ruby
[19:40:59] dgutierrez1287: has joined #ruby
[19:41:09] dagda1: has joined #ruby
[19:42:47] Dreamer3: has joined #ruby
[19:42:58] Musashi007: has joined #ruby
[19:44:36] Pupeno: has joined #ruby
[19:44:36] Pupeno: has joined #ruby
[19:45:24] blaines: has joined #ruby
[19:45:45] svdb64: has joined #ruby
[19:45:46] j4cknewt: has joined #ruby
[19:46:25] yqt: has joined #ruby
[19:46:32] bluOxigen: has joined #ruby
[19:46:42] Rollabun_: has joined #ruby
[19:46:53] ruurd: has joined #ruby
[19:48:02] curses: has joined #ruby
[19:48:52] whiteline: has joined #ruby
[19:50:10] user1138: has joined #ruby
[19:50:14] shock_one: has joined #ruby
[19:50:16] gambl0re: has joined #ruby
[19:50:51] Mendenhall: has joined #ruby
[19:51:05] pyon: has joined #ruby
[19:51:49] chouhoul_: has joined #ruby
[19:52:47] swgillespie: has joined #ruby
[19:54:06] hahuang65: has joined #ruby
[19:55:21] ivanskie: has joined #ruby
[19:55:54] Papierkorb: has joined #ruby
[19:56:27] sdwrage: has joined #ruby
[19:58:06] voker57: has joined #ruby
[19:59:20] hololeap: has joined #ruby
[20:01:24] r_baron: has joined #ruby
[20:01:34] dblessing: has joined #ruby
[20:02:15] paulcsmith_: has joined #ruby
[20:02:16] Pupeno: has joined #ruby
[20:02:17] Pupeno: has joined #ruby
[20:02:53] khebbie: has joined #ruby
[20:03:05] khebbie_: has joined #ruby
[20:03:14] xkickflip: has joined #ruby
[20:05:15] rideh: has joined #ruby
[20:05:49] bruno-: has joined #ruby
[20:06:28] anthony__: has joined #ruby
[20:07:08] yfeldblum: has joined #ruby
[20:08:23] yfeldblum: has joined #ruby
[20:08:57] deepu: has joined #ruby
[20:09:02] platosha_: has joined #ruby
[20:09:32] deepu: has joined #ruby
[20:09:51] einarj: has joined #ruby
[20:09:58] ledestin: has joined #ruby
[20:10:54] leesharma: has joined #ruby
[20:11:02] chipotle: has joined #ruby
[20:11:04] k3asd`: has joined #ruby
[20:11:08] xtsee: has left #ruby: ()
[20:12:46] pyon: has joined #ruby
[20:13:09] Pupeno: has joined #ruby
[20:14:24] rideh: has joined #ruby
[20:16:20] deepu: has joined #ruby
[20:16:36] mdavid613: has joined #ruby
[20:17:41] Rollabunna: has joined #ruby
[20:18:08] Rollabunna: has joined #ruby
[20:18:34] shevy: does one of you happen to have an example for ruby readline completion to the second argument, not the first?
[20:18:43] sypheren: has joined #ruby
[20:18:53] ttilley: has joined #ruby
[20:18:54] ttilley: has joined #ruby
[20:19:05] shevy: I need something like: "english cat<TAB>" and completion to occur on cat, but retain the leading keyword ("english" in this case)
[20:19:16] gambl0re: has joined #ruby
[20:19:29] deepu: has joined #ruby
[20:19:53] pandaant: has joined #ruby
[20:19:55] mary5030: has joined #ruby
[20:19:57] A-ron: has joined #ruby
[20:20:50] rideh: has joined #ruby
[20:22:29] paulcsmith_: has joined #ruby
[20:23:08] Musashi007: has joined #ruby
[20:24:28] deepu: has joined #ruby
[20:24:54] scpike: has joined #ruby
[20:25:23] symm-: has joined #ruby
[20:26:19] RonRichie: has joined #ruby
[20:27:37] solars: has joined #ruby
[20:28:21] Ox0dea: shevy: The existence of "english" should change the completion behavior, right?
[20:28:31] deepu: has joined #ruby
[20:28:41] davedev24: has joined #ruby
[20:28:42] shevy: well, in regular shell scripts, one can use an array of completable-words rather easily
[20:28:51] shevy: for some reason I am not understanding how to do the same in ruby readline
[20:29:39] shevy: This is how I do it in bash: https://goo.gl/uu3nSt
[20:29:56] shevy: the array is in: all_program
[20:30:02] shevy: erm, *all_programs
[20:30:26] shevy: and the completion-support is enabled through: complete -F name_of_the_function the_command_to_invoke it
[20:30:39] sypheren: has joined #ruby
[20:30:39] shevy: somehow this is much easier to use than that weird Readline completion proc :\
[20:31:23] ruurd: has joined #ruby
[20:31:29] guest1241234: has joined #ruby
[20:31:30] Ox0dea: shevy: https://gist.github.com/0x0dea/ddc8eb0f8ae077ea7afa
[20:31:33] Ox0dea: It's really not that hard?
[20:31:40] Ox0dea: s/ha/wei/
[20:31:49] sdwrage: has joined #ruby
[20:32:47] shevy: I can't seem to get that to run
[20:33:16] dblessing: has joined #ruby
[20:34:32] Ox0dea: shevy: Whoops! That should be start_with?(partial), not input.
[20:35:16] jenrzzz: has joined #ruby
[20:35:33] Ox0dea: But it does still discard the first part. :/
[20:36:40] shadoi: has joined #ruby
[20:37:54] leafybasil: has joined #ruby
[20:39:42] gambl0re: has joined #ruby
[20:39:50] symbol: has joined #ruby
[20:41:43] Ox0dea: shevy: It's not great, but It Works: https://gist.github.com/0x0dea/46f35e5712550f649b33
[20:42:24] shevy: cool, thanks
[20:42:32] shevy: now let me try to understand how you did it...
[20:42:34] NeverDie: has joined #ruby
[20:42:36] dblessing: has joined #ruby
[20:43:24] Ox0dea: Prepended "subcommands" everywhere.
[20:43:28] Ox0dea: There is surely a better way.
[20:43:36] shevy: I think I understand
[20:43:42] ivanskie: has joined #ruby
[20:43:50] shevy: well that is actually clever because it is very simple
[20:46:04] Ox0dea: We've been here. Simple != clever. It is, in fact, just about the dumbest way to do it.
[20:46:47] Ox0dea: Then again, Readline doesn't seem to support anything but whole-line completion out of the box. :/
[20:47:52] Ox0dea: That is, if you set the break character to something other than whitespace, you complete on the whole line and must return whole lines.
[20:48:04] mary5030: has joined #ruby
[20:48:13] Ox0dea: So maybe the prepended "subcommands" really is the best approach, but that's a tragedy more than a triumph.
[20:48:25] shevy: it works \o/
[20:48:35] shevy: and it is simple!
[20:48:47] Ox0dea: I'm making a note here.
[20:49:55] mase-chatter: has joined #ruby
[20:50:10] safeforge: has joined #ruby
[20:53:04] prefixed: why is the "to lowercase" method called "downcase?" did the inventor of the method have down syndome or something?
[20:53:13] prefixed: ACTION ducks
[20:53:14] craysiii: ouch thats kinda rude.
[20:53:20] Synthead: can I print an object via pry without calling a shell?
[20:53:38] jhass: Synthead: you mean without the pager?
[20:53:45] prefixed: realtalk though: terrible method name choice
[20:53:48] Synthead: jhass: is the pager the prompt?
[20:54:04] jhass: no, the think that let's you scroll in the output
[20:54:11] craysiii: not really. #upcase, #downcase. makes sense to me
[20:54:53] craysiii: if it was #uppercase, i could see #lowercase.
[20:54:54] jhass: prefixed: downcase is the action, lowercase is the result
[20:55:45] Synthead: jhass: pry does a great job at making objects look pretty. I want to just display it without getting a prompt if possible
[20:55:52] jhass: Synthead: https://github.com/michaeldv/awesome_print ?
[20:56:32] Synthead: jhass: yeah I love awesome print, but it doesn't display it the same way
[20:57:12] Ox0dea: Synthead: When did you realize you were a masochist?
[20:57:28] jhass: Synthead: https://github.com/pry/pry/blob/master/lib/pry/color_printer.rb ?
[20:57:45] Ox0dea: prefixed: As jhass points out, #downcase makes sense as the name of a "message".
[20:57:46] jhass: (that took < 1 min of peeking into the source)
[20:57:48] Synthead: Ox0dea: awesome_print happens to print a wall-o-text for this specific object, heh
[20:57:55] Sou|cutter: using pry to print objects is funny
[20:58:07] Synthead: Sou|cutter: :)
[20:58:10] Ox0dea: Synthead: How about pretty_print?
[20:58:23] shadoi: has joined #ruby
[20:58:29] Ox0dea: Invoking a REPL for its output format is... well, I'll refrain from saying anything untoward.
[20:59:19] Synthead: Ox0dea: hahaha, yeah. just being curious
[20:59:26] Jarboe: has joined #ruby
[20:59:39] Synthead: jhass: Pry::ColorPrinter.pp() is perfect :)
[21:00:09] banister: has joined #ruby
[21:00:10] deavid: has joined #ruby
[21:00:14] Ox0dea: Synthead: You should totally use Open3 to drive a Pry process.
[21:00:59] sinkensabe: has joined #ruby
[21:01:09] einarj: has joined #ruby
[21:01:13] havenn: has joined #ruby
[21:01:22] wprice: has joined #ruby
[21:01:34] sdwrage: has joined #ruby
[21:02:07] jhass: ... using non-alphanumeric coding?
[21:02:10] hahuang65: has joined #ruby
[21:02:26] swgillespie: has joined #ruby
[21:03:20] Soda: has joined #ruby
[21:03:29] Ox0dea: Who would do such a thing?
[21:03:46] jhass: mirror.png
[21:05:05] bustrarm: that moment when you find out that the last week you struggled to get something working was caused by a bug in a minorly-related piece of code that didn't have a test-case for the error
[21:05:55] towski_: has joined #ruby
[21:06:02] craysiii: busterarm why do you always change your name
[21:06:04] busterarm: hours of work spinning my wheels going nowhere. lol
[21:06:20] busterarm: nickserv does it
[21:06:35] busterarm: my client errored and reconnected 7 hours ago and my nick has protection on
[21:06:38] busterarm: I never bothered to regain
[21:07:03] jhass: busterarm: https://freenode.net/sasl/
[21:07:10] busterarm: 10:06:31 =!= | irc: reading data on socket: error -54 Error in the pull function.
[21:07:12] busterarm: i have sasl on
[21:07:26] jhass: uh, then you wouldn't have to regain
[21:07:32] busterarm: i dunno what to tell you
[21:07:59] craysiii: i couldnt connect to freenode with ssl on
[21:08:12] busterarm: i'm using sasl. i don't have to identify on signin. It even signs me in as busterarm, just the nick is locked when my client disconnects
[21:08:24] craysiii: oh i thought that was a typo.
[21:08:32] busterarm: doesn't happen all the time - just sometimes. It's probably a weechat issue
[21:08:44] Scripore: has joined #ruby
[21:09:09] gambl0re: has joined #ruby
[21:10:08] symm-: has joined #ruby
[21:10:20] ruurd: has joined #ruby
[21:11:21] craysiii: busterarm today in the mail i got a package from bloc. had a notebook and a hack the planet! sticker. pretty happy :)
[21:12:05] safeforge: has joined #ruby
[21:12:28] ellisTAA: has joined #ruby
[21:12:33] roolo: has joined #ruby
[21:12:35] adaedra: craysiii: used a SSL port?
[21:14:12] fabrice31: has joined #ruby
[21:15:23] adaedra: that's HTTPS
[21:15:33] adaedra: I use 7000 iirc
[21:15:53] gambl0re: has joined #ruby
[21:16:13] stopbyte: has left #ruby: ("Leaving.")
[21:16:31] adaedra: my memory was correct
[21:17:30] cout: as far as I can remember, my memory is never correct
[21:18:06] rickmasta: has joined #ruby
[21:18:08] deavid: has joined #ruby
[21:18:23] yaroslav: has joined #ruby
[21:18:26] jhass: mmh, 6697 over here
[21:19:03] shevy: cout perhaps you merely forget the moments in time when your memory was correct
[21:20:14] lkba_: has joined #ruby
[21:20:30] deepu: has joined #ruby
[21:20:53] marr: has joined #ruby
[21:22:14] dimasg: has joined #ruby
[21:22:40] bruno-: has joined #ruby
[21:24:42] agent_white: has joined #ruby
[21:25:55] JCOE: has joined #ruby
[21:28:12] Kilo`byte: has joined #ruby
[21:29:36] Igorshp: has joined #ruby
[21:29:50] quimrstorres: has joined #ruby
[21:30:24] Igorshp: has joined #ruby
[21:31:29] shock_one: has joined #ruby
[21:33:27] nofxx: has joined #ruby
[21:33:46] nofxx: has joined #ruby
[21:34:03] aaeron: has joined #ruby
[21:34:08] pengin: has joined #ruby
[21:34:25] arooni-mobile: has joined #ruby
[21:36:34] kokoleavia: has joined #ruby
[21:36:44] Pupeno: has joined #ruby
[21:38:04] devdazed: has joined #ruby
[21:38:11] jtdowney: has joined #ruby
[21:39:24] platzhirsch: has joined #ruby
[21:39:36] platzhirsch: has left #ruby: ()
[21:40:41] Vile`: has joined #ruby
[21:40:48] paulcsmith: has joined #ruby
[21:40:53] ellisTAA: has joined #ruby
[21:42:15] gamename: has joined #ruby
[21:42:50] pocketprotector: has joined #ruby
[21:42:53] luckyno7: has joined #ruby
[21:45:24] ruby-lang235: has joined #ruby
[21:46:05] bigmac_: has joined #ruby
[21:47:59] mlangenberg: has left #ruby: ()
[21:48:14] jgpawletko: has joined #ruby
[21:48:37] davedev24: has joined #ruby
[21:50:46] robbyoconnor: has joined #ruby
[21:51:15] yosafbridge: has joined #ruby
[21:52:22] JCOE: has joined #ruby
[21:52:33] snath: has joined #ruby
[21:53:36] unshadow_: has joined #ruby
[21:53:49] snath: has left #ruby: ()
[21:55:11] pengin: has joined #ruby
[22:00:50] PaulCapestany: has joined #ruby
[22:01:04] Musashi007: has joined #ruby
[22:01:08] khebbie: has joined #ruby
[22:02:31] pengin: has joined #ruby
[22:02:36] gheegh: has joined #ruby
[22:03:15] gambl0re: has joined #ruby
[22:04:17] polpak: has joined #ruby
[22:04:20] ruurd: has joined #ruby
[22:05:05] Trynemjoel: has joined #ruby
[22:05:16] ruby-lang235: chat sleeping zzz
[22:05:21] leesharma: has joined #ruby
[22:05:37] vyorkin: has joined #ruby
[22:06:07] jud: has joined #ruby
[22:06:15] vyorkin: want smth like Array#unshift but for Set
[22:06:27] Ox0dea: vyorkin: That's not a very reasonable operation.
[22:06:31] wldcordeiro_: has joined #ruby
[22:07:42] omegamike: has joined #ruby
[22:07:47] adaedra: Sets are unordered, no?
[22:08:02] vyorkin: omg, you're right :)
[22:08:16] dymk: adaedra: correct
[22:08:20] vyorkin: ok, I just need an array
[22:08:21] freerobby: has joined #ruby
[22:08:34] apeiros: ruby's sets are ordered, though
[22:08:47] vyorkin: the reason is that I need smth like "sized window"
[22:08:48] dymk: apeiros: wait what? Really?
[22:08:49] apeiros: given that they're backed by Hash, which is ordered too
[22:08:49] ScriptGeek1: has joined #ruby
[22:08:55] s00pcan: has joined #ruby
[22:09:08] apeiros: it's not part of the contract, though, so IMO don't rely on it
[22:09:11] vyorkin: from docs Set implements a collection of unordered values with no duplicates
[22:09:26] apeiros: also Array has plenty of set operations
[22:11:18] snath: has joined #ruby
[22:12:02] danman: has joined #ruby
[22:12:47] ruby-lang498: has joined #ruby
[22:12:56] snath: has left #ruby: ()
[22:14:13] Ox0dea: vyorkin: Set's being ordered in Ruby 1.9+ is an implementation detail, but it's very unlikely to go away in any future version.
[22:14:36] sotosoto: has joined #ruby
[22:14:36] HoppingMadMan: has joined #ruby
[22:15:46] ruby-lang498: @rob_ are you around?
[22:16:02] rob_: ruby-lang498: ..hello?
[22:16:19] ecksit: has joined #ruby
[22:16:48] ruby-lang498: has left #ruby: ()
[22:16:56] JCOE: has joined #ruby
[22:17:09] sargas: has joined #ruby
[22:17:26] vyorkin: 0x0dea: thanks, didn't know that
[22:17:32] Channel6: has joined #ruby
[22:17:37] Muhannad: has joined #ruby
[22:18:52] woodruffw: has joined #ruby
[22:19:15] vyorkin: 0x0dea: what do you think about smth like this: https://gist.github.com/vyorkin/971b25739790b3dfffca ?
[22:19:44] vyorkin: can I do better?
[22:19:52] HoppingMadMan: has joined #ruby
[22:20:12] Ox0dea: vyorkin: Well, it's certainly not the most performant approach.
[22:20:32] Ox0dea: You're creating a new Array every single time.
[22:20:48] sdwrage2: has joined #ruby
[22:21:05] ellisTAA: has joined #ruby
[22:21:18] Ox0dea: Then again, Ruby uses shared memory for methods like #[], #first, and #take, so it's not terrible.
[22:21:35] adaedra: thank god for shared memory
[22:21:52] whiteline: has joined #ruby
[22:22:32] Rollabunna: has joined #ruby
[22:23:23] lwu: anyone here
[22:23:24] bruno-: has joined #ruby
[22:23:42] ruboto: Just ask your question, if anyone has or can, they will respond.
[22:25:54] GPrime: has joined #ruby
[22:26:13] EminenceHC: has joined #ruby
[22:26:39] Ox0dea: vyorkin: Do you actually want elements pushed onto the front?
[22:28:32] vyorkin: 0x0dea: yes, thats right, I want it to "slide"
[22:28:43] craysiii: sounds like you want a queue
[22:28:44] Ox0dea: Right, but it can "slide" left or right.
[22:28:57] vyorkin: actually I'm going to use it to keep recent items
[22:29:06] adaedra: Meanwhile, I'll slide into my bed
[22:29:31] vyorkin: adaedra: good night :)
[22:29:37] WHATDOYOUNEED: has joined #ruby
[22:30:32] vyorkin: 0x0dea: I want it to slide right
[22:30:39] Contigi: has joined #ruby
[22:31:14] Igorshp: has joined #ruby
[22:31:16] quimrstorres: has joined #ruby
[22:32:15] shock_one: has joined #ruby
[22:32:28] nawak: has joined #ruby
[22:32:35] gamename: has joined #ruby
[22:32:42] Ox0dea: vyorkin: Such that most recent items are at the front, then, yes?
[22:33:06] hololeap: has joined #ruby
[22:33:47] vyorkin: 0x0dea: yeah, correct
[22:35:12] Ox0dea: vyorkin: I tried to get something clever going with the two-argument form of Array#[] and Comparable#<=>, but it ends up being overly intricate.
[22:35:28] vyorkin: 0x0dea: here is what i've got for now https://gist.github.com/vyorkin/2e9213b73043905ab110
[22:35:29] robbyoconnor: has joined #ruby
[22:35:40] Ox0dea: A #pop in the case of @source.size == @limit and then an #unshift is probably the cleanest approach.
[22:36:38] vyorkin: 0x0dea: got it, thanks!
[22:36:54] Ox0dea: vyorkin: Happy to help.
[22:37:07] Ox0dea: No need to #dup before #take, for what that's worth.
[22:37:13] _blizzy_: has joined #ruby
[22:37:32] Musashi007: has joined #ruby
[22:39:31] vyorkin: 0x0dea: thanks again :)
[22:39:42] _nowak_: has joined #ruby
[22:40:18] HoppingMadMan: has joined #ruby
[22:40:22] shevy: if I do: module Foo; end, Foo becomes available via a "Object.const_defined? :Foo" query. Who or what registers it there though? I notice that I can do Object::Foo but I am not sure why
[22:41:08] dgutierrez1287: has joined #ruby
[22:41:31] Ox0dea: shevy: The interpreter does. Are you trying to hook constant definition?
[22:41:33] bricker: has joined #ruby
[22:42:23] shevy: no, I am trying to understand things. I had to change some queries earlier today, where I used Object.const_defined? towards a NamespaceBla.const_defined?, and I spread them out all over everywhere (it was old code)
[22:43:06] Ox0dea: Well, constant resolution starts at Object, so it makes sense that a module defined at the top level would be accessible from Object.
[22:43:17] Ox0dea: >> module A; module B end end; Object::B rescue $!
[22:43:18] ruboto: Ox0dea # => #<NameError: uninitialized constant B> (https://eval.in/407632)
[22:44:46] dudoom: has joined #ruby
[22:45:21] hithisisde: has joined #ruby
[22:48:02] GPrime: has joined #ruby
[22:48:21] ellisTAA: has joined #ruby
[22:49:15] Musashi007: has joined #ruby
[22:49:54] weemsledeux: has joined #ruby
[22:50:37] ellisTAA: has joined #ruby
[22:50:39] nym: has joined #ruby
[22:52:28] GPrime: has joined #ruby
[22:54:11] swgillespie: has joined #ruby
[22:54:26] robbyoconnor: has joined #ruby
[22:55:47] dimasg: has joined #ruby
[22:56:43] _nawak_: has joined #ruby
[22:58:58] ismaelga: has joined #ruby
[23:00:57] shock_one: has joined #ruby
[23:01:56] swgillespie: has joined #ruby
[23:02:16] Kyuujitsu: has joined #ruby
[23:02:23] sphex: has joined #ruby
[23:03:16] Kalov: has joined #ruby
[23:05:07] ruurd: has joined #ruby
[23:05:16] dudoom: has joined #ruby
[23:06:52] mleung_: has joined #ruby
[23:08:23] mpistone: has joined #ruby
[23:08:32] hays: so what's the deal with this :foo business
[23:09:09] omegamike: has joined #ruby
[23:09:29] dfockler: hays: you mean like symbols or foo itself?
[23:09:53] skade: has joined #ruby
[23:09:54] dfockler: they're immutable strings
[23:10:10] dfockler: ACTION waits for better rubyists to correct
[23:10:15] texasmade: has joined #ruby
[23:10:33] dfockler: to correct me
[23:11:36] Ropeney: has joined #ruby
[23:12:08] workmad3: dfockler: it's one of those annoying things... Symbols are a completely distinct type from strings, so 'immutable string' isn't really correct... they're also not usually implemented as strings in an interpreter... they can be converted to strings, but comparison-wise they're closer to integers... but 'immutable string' gets the idea across nicely as a first-stage approximation to people who've not encounte
[23:12:13] jhass: hays: any background we can relate to?
[23:12:14] workmad3: red them before
[23:12:20] neoseeker: has joined #ruby
[23:13:45] juanpablo____: has joined #ruby
[23:13:51] hays: is it fair to say that a symbol is an object whose uniqueness is guaranteed?
[23:14:01] hays: maybe thats the first question.. is a symbol an object
[23:14:09] dfockler: everything is an object
[23:14:13] workmad3: hays: you can always check that ;)
[23:14:15] workmad3: >> :foo.class
[23:14:17] ruboto: workmad3 # => Symbol (https://eval.in/407637)
[23:14:36] robbyoconnor: has joined #ruby
[23:14:37] workmad3: dfockler: (nearly) everything is an object
[23:15:36] michaeldeol: has joined #ruby
[23:15:36] hays: in python you can instantiate object() and you get something that is unique but doesn't do much else
[23:15:36] hays: in python you can instantiate object() and you get something that is unique but doesn't do much else
[23:15:41] hays: ack sorry about that
[23:15:52] workmad3: hays: you can do similar in ruby... Object.new
[23:16:47] swgillespie: has joined #ruby
[23:16:58] hays: so i guess symbols are not just Object.new
[23:17:12] hays: unless its just syntactic sugar for that
[23:17:20] workmad3: no, symbols are not Object.new
[23:17:22] jaequery: has joined #ruby
[23:17:27] hays: how do I see the methods for :foo
[23:17:38] workmad3: hays: same as with anything else... call .methods on it ;)
[23:17:47] workmad3: hays: also take a look at .object_id
[23:17:52] hays: :foo.methods hah
[23:18:04] juanpablo_____: has joined #ruby
[23:18:26] Kyuujitsu: has joined #ruby
[23:18:26] workmad3: hays: if you do that, you should notice that you'll always get the same object_id back for the same symbol
[23:18:28] dfockler: symbols are more like pointers, right?
[23:18:32] dfockler: named pointers
[23:18:43] theery: Any idea why the before filter in the parent class doesn't get executed when a route in the child class is hit? It gets executed if I move it into the child class: https://gist.github.com/macmartine/585fb3d6ab244ce605a7
[23:18:45] workmad3: dfockler: not really...
[23:18:51] jgpawletko: has joined #ruby
[23:19:01] theery: It's in a Sinatra app, fwiw
[23:19:25] dfockler: theery: you may need to call super
[23:19:41] hays: workmad3: that would be similar to Object.new
[23:19:55] polpak: dfockler: they are more like immutable strings
[23:19:56] workmad3: hays: no, Object.new.object_id will always be a different object
[23:20:06] dfockler: polpak: haha that's what I said before
[23:20:13] Lamarus: has joined #ruby
[23:20:17] theery: dfockler: I shouldn't have to put it in every child, though, theoretically. That's the point of inheritance.
[23:20:33] hays: workmad3: right, but foo= Object.new would have a unique object_id just like :foo
[23:20:34] [H]unt3r: has joined #ruby
[23:20:45] hays: i suppose every object has a unique object id
[23:20:51] mesamoo: has joined #ruby
[23:20:58] workmad3: hays: right, but then you'd need to pass that particular object around in order to get the same object
[23:21:12] dfockler: theery: well the `before do` is just code in the class, it's not a part of the parent class
[23:21:13] polpak: hays: what are you trying to do?
[23:21:25] workmad3: hays: whilst with a symbol, you'd get the same object back if you used the same symbol in different parts of your program... which is part of what makes them useful
[23:21:35] dfockler: polpak: we were just talking about what symbols are
[23:21:43] Lamarus: Could someone help out with this issue. I have been trying to do a bundle install, and it keeps yelling about nokogiri and not installing correctly. So I try to install that one using `gem install` and get an error no matter what I do. I need help on this... http://laravel.io/bin/LkEGO
[23:21:53] polpak: dfockler: oh. they are instances of the Symbol class
[23:21:59] polpak: dfockler: the end. ;p
[23:21:59] workmad3: hays: as you can create a hash with symbols as keys in one part of the app, pass that around and be able to access the hash with symbols everywhere else, with inexpensive lookups
[23:22:05] hays: polpak: understand symbols
[23:22:16] workmad3: hays: which is one of the normal first uses for symbols, hash lookup keys :)
[23:22:29] hays: yeah, I was noticing them being used that way, as keys in a hash
[23:23:00] hays: any way to go from "foo" to :foo ?
[23:23:06] polpak: hays: they're an annoying side effect of the fact that ruby chose to implement strings as mutable (rather than immutable)
[23:23:08] workmad3: >> "foo".to_sym
[23:23:09] ruboto: workmad3 # => :foo (https://eval.in/407641)
[23:23:26] jackjackdripper: has joined #ruby
[23:23:36] hays: >> "hello, world"
[23:23:37] ruboto: hays # => "hello, world" (https://eval.in/407642)
[23:23:58] riscky: has joined #ruby
[23:24:11] hays: polpak: heh, yeah python has immutable strings
[23:24:28] bruno-: has joined #ruby
[23:24:31] polpak: hays: indeed
[23:24:41] hays: I was noticing that when I was seeing a lot of "foo" + bar + "baz" around in the Ruby world
[23:24:44] workmad3: polpak: it's more of a smalltalk legacy, tbh... I'd need to dig into a bit more history to dredge up why smalltalk went with symbols and strings though (but I think there was more to it than just "side effect of mutable strings")
[23:24:46] Ropeney: has joined #ruby
[23:24:53] michael_mbp: has joined #ruby
[23:25:08] hays: mutable strings aren't a bad thing though
[23:25:10] polpak: hays: you see that in python too
[23:25:15] polpak: hays: and yes they are ;p
[23:25:22] hays: polpak: yes but you also slap people in that case :)
[23:25:38] hays: I have to say im not a huge fan of "#{barf}"
[23:25:42] dfockler: it's just better to use an immutable string for certain things like enums
[23:25:47] Pupeno_: has joined #ruby
[23:26:10] workmad3: dfockler: sure... if you have immutable strings and no enum or symbol type, you'd likely use them for that sort of situation :)
[23:27:05] bullcitydev: has joined #ruby
[23:27:08] workmad3: hays: more generally, symbols get used a lot as names in ruby... method names are symbols, variable names are symbols, constant names are symbols
[23:27:18] dfockler: "#{barf}" is better than parsing through "%s hello %s" % (var1, var2)
[23:27:32] hays: is there a way to see what an object's parent class is?
[23:27:32] weemsledeux: has joined #ruby
[23:27:44] workmad3: hays: object.class
[23:27:54] Ox0dea: >> '%d + %d = %d' % [1, 2, 3] # dfockler
[23:27:55] ruboto: Ox0dea # => "1 + 2 = 3" (https://eval.in/407646)
[23:27:59] Ox0dea: Ruby has both. <3
[23:28:02] workmad3: hays: that'll give you the class of that object... if you want the superclass of that class, you'd then use object.class.superclass
[23:28:10] dfockler: Ox0dea: boom! :)
[23:28:24] hays: workmad3: does ruby have MI?
[23:28:43] workmad3: hays: no, single class inheritance, but multiple module inclusion
[23:28:49] polpak: hays: you can also do foo.class.ancestors to get everybody
[23:29:14] shadoi: has joined #ruby
[23:29:16] robbyoconnor: has joined #ruby
[23:29:32] polpak: dfockler: I disagree about the string formatting arguement, but I'm not going to debate the point
[23:29:33] hays: workmad3: wait a minute... method names are symbols?
[23:29:49] Ox0dea: >> def foo; end # hays
[23:29:50] ruboto: Ox0dea # => :foo (https://eval.in/407647)
[23:29:57] workmad3: hays: if you do 'some_object.methods' you'll notice all the names are symbols ;)
[23:30:01] dseitz: has joined #ruby
[23:30:14] dfockler: polpak: like Ox0dea you can do either if you want
[23:30:24] polpak: dfockler: indeed
[23:30:25] workmad3: and yeah, ruby also now returns the method name as a symbol from 'def'
[23:30:48] triangles: has joined #ruby
[23:31:12] hays: hmm ok but I don't define them that way.. I still do def foo
[23:31:29] Ox0dea: workmad3: Module#include/#extend is essentially multiple inheritance, no
[23:31:35] workmad3: hays: you can also do 'define_method :foo do; <method body>; end'
[23:31:49] Ox0dea: workmad3: Then again, you could've used a String there.
[23:32:21] workmad3: Ox0dea: sure... but if you looked at all the symbols with ObjectSpace before and after the define_method, you'd notice a new symbol appear ;)
[23:32:25] polpak: hays: of course. but you can refer to them by the symbol to call them (via send or similar)
[23:32:33] Ox0dea: workmad3: Aye, fair enough.
[23:33:14] hays: what's the deal with do.. sometimes its around and sometimes its not
[23:33:55] RonRichie: has joined #ruby
[23:33:56] polpak: hays: it defines a block (like braces)
[23:34:44] Lamarus: Could someone help out with this issue. I have been trying to do a bundle install, and it keeps yelling about nokogiri and not installing correctly. So I try to install that one using `gem install` and get an error no matter what I do. I need help on this... http://laravel.io/bin/LkEGO
[23:34:57] workmad3: Ox0dea: and module include/extend is a sort of a form of multiple inheritance... it's implemented essentially as inheritance, but it doesn't interfere with superclass chains, and it's really closer to inserting a new superclass into the chain
[23:34:57] Yzguy: has joined #ruby
[23:35:08] Ox0dea: >> s = Symbol.all_symbols; define_method(:wtf) {}; Symbol.all_symbols - s # workmad3
[23:35:10] ruboto: Ox0dea # => [] (https://eval.in/407649)
[23:35:12] Ox0dea: What's going on there?
[23:35:36] Cache_Money: has joined #ruby
[23:36:22] workmad3: >> s = Symbol.all_symbols.dup; define_method(:wtf) {}; Symbol.all_symbols - s
[23:36:23] ruboto: workmad3 # => [] (https://eval.in/407650)
[23:36:35] arescorpio: has joined #ruby
[23:36:40] workmad3: hmm... weird, I get ':wtf' out locally for that
[23:37:00] Lamarus: has joined #ruby
[23:37:24] workmad3: Ox0dea: oh, it's because it's all on one line
[23:37:41] workmad3: Ox0dea: the parser creates the symbol as soon as it parses the line
[23:37:44] pietr0: has joined #ruby
[23:37:49] Ox0dea: Ah, that does make sense.
[23:37:53] matp: has joined #ruby
[23:37:59] hays: i bet symbols come from the fact that with smalltalk you could peek into the interpreter in weird ways
[23:38:08] jackjackdripper: has joined #ruby
[23:38:11] Ox0dea: hays: We can peek into Ruby in very weird ways too.
[23:38:22] Ox0dea: Poke, as well.
[23:38:24] hays: im pretty sure i remember smalltalk letting you like subclass its own parser
[23:38:36] ivanskie: is there an inflector to convert every word in a string to capitalized? .capitalize isn't doing it for me. .humanize only capitalizes first word.. (this is for company name, they are stored in db as all uppercase)
[23:38:51] Ox0dea: ivanskie: Why not just split.map(&:capitalize).join(' ')?
[23:39:10] Kyuujitsu: has left #ruby: ()
[23:39:29] ruurd: Lamarus why the special libxml2?
[23:39:34] ivanskie: awe undefined local variable or method `split' for #<#<Class:0x007fd0a0063308>:0x007fd09eb2cc28>
[23:39:40] workmad3: hays: ruby doesn't allow you quite that level of introspection into itself, but it lets you poke in and change a lot of internals
[23:39:44] ivanskie: oh nevermind
[23:39:46] Ox0dea: ivanskie: Well, you'll need to turn $thing into a String first.
[23:39:59] ivanskie: < doing it wrong
[23:39:59] Lamarus: ruurd, I have tried with that and without.... same issue Tried it with based on a suggestion of using homebrew libxml2
[23:40:04] benlieb: has joined #ruby
[23:40:22] wldcordeiro_: has joined #ruby
[23:40:25] ruurd: did you try bundle config build.nokogiri --use-system-libraries
[23:40:28] ivanskie: ther we go. thanks Ox0dea
[23:40:30] ruurd: as per the comments?
[23:40:32] Lamarus: same issue
[23:40:34] Ox0dea: ivanskie: Happy to help. :)
[23:40:44] workmad3: hays: rubinius gives you a bit more introspective power too, as it implements a lot more of the ruby language inside ruby itself (it still has a C++ bootstrap which is hard to access inside ruby, iirc)
[23:40:47] Ox0dea: workmad3: Still no RubyVM::InstructionSequence#load, though. :(
[23:40:55] hays: ruby seems fun. it might be the object oriented language ive been looking for
[23:41:05] Ox0dea: hays: It is known.
[23:41:07] workmad3: right, I need to get to bed
[23:41:14] Ox0dea: Au revoir.
[23:41:20] workmad3: night all :)
[23:41:23] topdownjimmy: has joined #ruby
[23:41:35] Ox0dea: hays: I envy your fresh eyes and mind.
[23:41:40] polpak: hays: it's interesting, but personally I still prefer python
[23:41:45] Ox0dea: First getting into Ruby was a blast.
[23:41:49] polpak: hays: I just have to do this for work ;p
[23:41:51] Lamarus: ruurd, here is what I get when I do bundle install on my project that lead me to the nokogiri thing http://laravel.io/bin/0eqyM
[23:41:52] ruurd: Lamarus why stick to 2.2.1?
[23:42:17] Kyuujitsu: has joined #ruby
[23:42:19] hays: polpak: different tools for different things though... I do love me some python
[23:42:28] Lamarus: ruurd, what do you mean?
[23:42:39] GPrime: has joined #ruby
[23:42:58] sargas: has joined #ruby
[23:43:00] ruurd: why not update to ruby-2.2.2 ?
[23:43:08] hays: im using ruby for work also
[23:43:24] Lamarus: i will if that helps
[23:43:26] hays: trying to hack together some scripts--aparently its the nome de plume of this company
[23:43:31] Lamarus: i just did `brew install ruby`
[23:43:34] Lamarus: and it gave me 2.2.1
[23:43:38] bruno-: has joined #ruby
[23:44:05] hays: hrm. my ruby is 2.0.0p481
[23:44:06] polpak: hays: I think you mean lingua franca
[23:44:24] Lamarus: well, that is odd... `ruby -v` reports 2.2.1p85 but `brew install ruby` shows ruby-2.2.2 already installed
[23:44:28] hays: polpak: i do
[23:44:31] Lamarus: how do I get rid of 2.2.1
[23:44:32] ruurd: when was the last time you ran brew update && brew upgrade --all
[23:44:34] Ox0dea: hays: For reference, "nom de plume" essentially translates to "pen name".
[23:44:45] shadoi: has joined #ruby
[23:45:04] Ox0dea: From when we wrote with quills.
[23:45:05] ruurd: Oh. Ahem.
[23:45:11] hays: Ox0dea: yeh i felt stupid once i hit enter
[23:45:19] ruurd: what does which ruby tell you, Laramus?
[23:45:22] hays: but it had already come out
[23:45:24] polpak: hays: we've all had those moments :)
[23:45:32] polpak: hays: brains are funny things
[23:45:37] Lamarus: /Users/bretterer/.rvm/rubies/ruby-2.2.1/bin/ruby
[23:46:01] Kyuujitsu: has joined #ruby
[23:46:05] hays: sudo port install ruby22 for me :)
[23:46:21] ruurd: but that's not a brew install, that is an rvm install
[23:46:24] natbo: has joined #ruby
[23:46:36] hays: macports
[23:46:48] ruurd: rvm get head then rvm upgrade ruby-2.2.1
[23:46:54] Lamarus: well... that is my issue
[23:47:03] Lamarus: i want it to be a brew install... how do i get rid of rvm install
[23:47:17] Ox0dea: Lamarus: `rvm implode`, and never look back.
[23:47:29] hays: huh. os x ships with ruby
[23:47:32] Lamarus: Ox0dea that does not sound like a good idea
[23:47:35] hays: that's kinda surprising
[23:47:45] Lamarus: FYI, I am not a Ruby Dev.... have to use it for our blog
[23:47:57] sdwrage: has joined #ruby
[23:48:02] ruurd: Lamarus rvm ruby is better than a brew ruby really
[23:48:22] ruurd: much easier to run different rubies alongside each other
[23:48:50] Lamarus: ill do that and remove brew
[23:48:56] ruurd: and no problems wiht needing admin rights if you don't need them
[23:49:04] ruurd: just remove the ruby with brew
[23:49:08] Lamarus: running the upgrade ruby-2.2.1 ruby-2.2.2
[23:49:13] ruurd: brew uninstall ruby
[23:49:18] Lamarus: ya, ill do that
[23:49:23] Lamarus: will this fix my issue?
[23:49:31] hays: sudo port select --set ruby ruby22
[23:50:02] hays: everyone says brew is better--i just started with macports so i stick with it
[23:50:53] RegulationD: has joined #ruby
[23:51:34] Xoro: has joined #ruby
[23:51:46] Lamarus: well, ruby -v now shows ruby 2.0.0p481 ruurd
[23:51:57] Lamarus: there we go
[23:52:02] Lamarus: new shell needed to open
[23:52:11] Aeyrix: hays: it is
[23:52:19] Lamarus: lets see if this fixed it
[23:52:30] ruurd: I'm running a test for you
[23:52:45] Lamarus: Nope... now it fails on Installing json 1.8.1 with native extensions
[23:52:53] ruurd: wait a sec
[23:52:57] hays: ooh ... loop. that's probably better than while true
[23:53:03] ruurd: you have rvm right?
[23:53:08] Ox0dea: hays: Indeed it is.
[23:53:18] ruurd: create a directory and create two files in it
[23:53:26] ruurd: .ruby-version and .ruby-gemset
[23:53:38] ruurd: put ruby-2.2.2 in the .ruby-version file
[23:53:48] ruurd: and the name of a gemset in the .ruby-gemset file
[23:53:50] tjohnson: has joined #ruby
[23:54:07] Lamarus: matter where the directory is?
[23:54:07] ruurd: then go out of the subdirectory and move into the subdirectory again
[23:54:50] senttoyoubyus: has joined #ruby
[23:55:07] Lamarus: what ist eh gemset? (again, not a ruby person)
[23:55:26] hays: how do I treat a function as a first class object? e.g. having a dict of functions
[23:55:35] ruurd: a gem is a sort of library you can load
[23:55:44] Lamarus: right.. but which gemset are you talking about
[23:55:50] Ox0dea: hays: The #method method. :)
[23:55:52] ruurd: and rvm calls a collection of gems you use for a project a gemset
[23:56:03] ruurd: make one up
[23:56:05] Ox0dea: hays: Alternatively, you could use Procs instead of methods.
[23:56:12] ruurd: call it testing for all I care
[23:56:33] Mendenhall: has joined #ruby
[23:56:38] Ox0dea: >> [1.method(:to_s), '2'.method(:to_i)].map(&:call) # hays
[23:56:39] ruboto: Ox0dea # => ["1", 2] (https://eval.in/407652)
[23:56:40] hays: Ox0dea: the method method?
[23:56:48] Ox0dea: hays: Aye, the #method method. See above.
[23:56:54] Lamarus: ruurd: ok let me change my comment... what does a gemset look like?
[23:57:05] ruurd: just the name of the gemset
[23:57:10] Ox0dea: ruurd: Your intentions were good, but I think you're leading this person astray.
[23:57:15] benlieb: has joined #ruby
[23:57:26] ruurd: oh you're really helping here
[23:57:41] Lamarus: ok, i went into the directory
[23:57:45] Lamarus: ruby-2.2.2 - #gemset created /Users/bretterer/.rvm/gems/ruby-2.2.2@testgemset
[23:57:46] Lamarus: ruby-2.2.2 - #generating testgemset wrappers - please wait
[23:57:50] ruurd: excellent
[23:58:00] ruurd: now execute ruby -v
[23:58:12] ruurd: it should tell you ruby-2.2.2
[23:58:15] lannonbr: has joined #ruby
[23:58:33] Lamarus: it does.. ruby 2.2.2p95
[23:58:47] Ox0dea: Lamarus: Now change directories and run `ruby -v` again.
[23:58:51] ruurd: now execute gem install nokogiri
[23:59:15] hays: Ox0dea: so if I have def foo{1}
[23:59:15] curses: has joined #ruby
[23:59:23] hays: how do I access foo
[23:59:23] Ox0dea: hays: Then you have a synta error. :P
[23:59:28] Ox0dea: hays: method(:foo)
[23:59:32] Lamarus: Ox0dea: 2.2.2p95 still
[23:59:58] Lamarus: ruurd: running it now
[23:59:59] Lamarus: and it installed