« Back to channel list

#ruby - 17 May 2016

« Back 1 day Forward 1 day »
[00:00:00] postmodern: has joined #ruby
[00:00:46] horaceheaven: has joined #ruby
[00:02:13] blackmesa: has joined #ruby
[00:02:19] jenrzzz: has joined #ruby
[00:02:20] jenrzzz: has joined #ruby
[00:05:53] |2701: >> (1..100).to_a.combinations(3).select{|a,b,c| (a*a)+(b*b)==(c*c)}
[00:06:15] devyn: has joined #ruby
[00:06:24] kaleido: rubybot bein rude this evening
[00:06:27] |2701: in case you want to get nerdy and find some right triangles
[00:06:35] |2701: has joined #ruby
[00:06:35] |2701: has joined #ruby
[00:06:46] |2701: gotta be ident'd, should work now
[00:06:48] |2701: >> (1..100).to_a.combinations(3).select{|a,b,c| (a*a)+(b*b)==(c*c)}
[00:06:50] ruby[bot]: |2701: # => undefined method `combinations' for #<Array:0x421b1920> ...check link for more (https://eval.in/572321)
[00:07:04] |2701: >> (1..100).to_a.combination(3).select{|a,b,c| (a*a)+(b*b)==(c*c)}
[00:07:05] ruby[bot]: |2701: # => [[3, 4, 5], [5, 12, 13], [6, 8, 10], [7, 24, 25], [8, 15, 17], [9, 12, 15], [9, 40, 41], [10, 24, 26 ...check link for more (https://eval.in/572322)
[00:09:18] moeabdol: has joined #ruby
[00:09:28] rkazak: has joined #ruby
[00:14:35] replay: has joined #ruby
[00:14:46] jancel: has joined #ruby
[00:15:03] drewo: has joined #ruby
[00:15:27] idefine: has joined #ruby
[00:16:28] stannard: has joined #ruby
[00:19:16] tAn: has joined #ruby
[00:26:20] shevy: wrkrcoop you can define them like: module Foo; def self.foo; puts 'hi from foo()'; end; def foo; Foo.foo; end; end; Foo.foo
[00:27:20] KINGSABRI: has joined #ruby
[00:30:28] nankyokusei: has joined #ruby
[00:32:47] Nanuq: has joined #ruby
[00:33:45] mistermocha: has joined #ruby
[00:34:31] CloCkWeRX: has joined #ruby
[00:35:13] Azure: has joined #ruby
[00:35:52] hackeron: has joined #ruby
[00:37:14] arescorpio: has joined #ruby
[00:37:37] jhack: has joined #ruby
[00:39:43] nareiber: has joined #ruby
[00:40:04] govg: has joined #ruby
[00:41:56] jancel: has joined #ruby
[00:42:17] roshanavand1: has joined #ruby
[00:43:11] dsea: has joined #ruby
[00:47:05] idefine: has joined #ruby
[00:47:56] swills: has joined #ruby
[00:50:45] skolman_: has joined #ruby
[00:54:45] jenrzzz: has joined #ruby
[00:54:45] jenrzzz: has joined #ruby
[00:55:55] bronson: has joined #ruby
[00:56:53] der-landgraf: has joined #ruby
[00:58:31] someish: has joined #ruby
[00:59:27] idefine: has joined #ruby
[01:00:25] someish: Why do I have to write application_results[“app_name”][0][0] to get the first result for that particular “app_name”? Why doesn’t the code I wrote allow me to access it like this application_results[“app_name”][0] … https://gist.github.com/saturday/64daae33bd3050885b7c45a03fc410b4
[01:01:29] skweek: has joined #ruby
[01:03:42] psf: has joined #ruby
[01:04:57] zigzag_: has joined #ruby
[01:06:05] govg: has joined #ruby
[01:06:09] idefine: has joined #ruby
[01:09:08] hahuang65: has joined #ruby
[01:10:12] Ropeney: has joined #ruby
[01:10:58] Radar: someish: because you're using the shovel operator
[01:11:09] Radar: someish: https://gist.github.com/saturday/64daae33bd3050885b7c45a03fc410b4#file-meh-rb-L14 remove <<, use += instead
[01:11:12] Radar: observe this
[01:11:17] Radar: a = []; a << [1]
[01:11:20] Radar: >> a = []; a << [1]
[01:11:21] ruby[bot]: Radar: # => [[1]] (https://eval.in/572328)
[01:11:27] Radar: >> a = []; a += [1]
[01:11:28] ruby[bot]: Radar: # => [1] (https://eval.in/572329)
[01:11:31] hellcode: has joined #ruby
[01:11:35] someish: Radar: Thanks. I’ll read up.
[01:11:51] xall: has joined #ruby
[01:14:09] ruby-lang194: has joined #ruby
[01:15:17] OTORelic: has joined #ruby
[01:15:50] govg: has joined #ruby
[01:15:57] idefine: has joined #ruby
[01:18:18] kasisnu: has joined #ruby
[01:19:15] kasisnu_: has joined #ruby
[01:20:25] kasisnu__: has joined #ruby
[01:21:12] mistermocha: has joined #ruby
[01:21:30] kasisnu__: has joined #ruby
[01:21:42] A5101: has joined #ruby
[01:21:42] rbennacer: has joined #ruby
[01:22:36] kasisnu__: has joined #ruby
[01:23:55] kasisnu: has joined #ruby
[01:24:33] zigzag__: has joined #ruby
[01:24:44] joneshf-laptop: has joined #ruby
[01:25:58] kasisnu_: has joined #ruby
[01:30:00] OTORelic: has joined #ruby
[01:30:34] tannarchy: has joined #ruby
[01:32:13] karmatr0n: has joined #ruby
[01:37:06] jaguarmagenta: has joined #ruby
[01:39:01] LoneHerm_: has joined #ruby
[01:39:03] oetjenj: has joined #ruby
[01:39:13] jancel: has joined #ruby
[01:41:39] tannarchy: has joined #ruby
[01:42:40] idefine: has joined #ruby
[01:43:42] jackjackdripper: has joined #ruby
[01:44:01] FooMunki: has joined #ruby
[01:44:57] jackjackdripper: has joined #ruby
[01:47:39] tannarchy: has joined #ruby
[01:52:09] fmcgeough: has joined #ruby
[01:52:25] rbennacer: has joined #ruby
[01:53:14] idefine: has joined #ruby
[01:53:31] nsuria: has joined #ruby
[01:53:59] raz: has left #ruby: ("*fump*")
[01:54:06] whathappens: has joined #ruby
[01:57:29] moeabdol: has joined #ruby
[01:58:11] der-landgraf: has joined #ruby
[01:58:54] idefine: has joined #ruby
[02:00:05] OTORelic: has joined #ruby
[02:02:52] banister: has joined #ruby
[02:03:50] mosez: has joined #ruby
[02:05:50] lucidity: has joined #ruby
[02:06:22] idefine: has joined #ruby
[02:07:37] Akuma: has joined #ruby
[02:08:21] FooMunki: has joined #ruby
[02:13:05] nerium: has joined #ruby
[02:15:21] youch: has joined #ruby
[02:17:27] jancel: has joined #ruby
[02:17:56] jaguarmagenta: has joined #ruby
[02:18:39] kies: has joined #ruby
[02:20:36] tAn: has joined #ruby
[02:21:54] agarie: has joined #ruby
[02:23:29] idefine: has joined #ruby
[02:23:40] nanoz: has joined #ruby
[02:23:54] nanoz: has joined #ruby
[02:26:44] blackmesa: has joined #ruby
[02:31:35] nankyokusei: has joined #ruby
[02:37:03] jancel: has joined #ruby
[02:42:04] halfamind: has joined #ruby
[02:43:15] allcentury: has joined #ruby
[02:43:30] stardiviner: has joined #ruby
[02:43:38] nerium: has joined #ruby
[02:44:13] nerium: Is there another way of checking the current ruby version then RUBY_VERSION?
[02:44:28] hellcode: ruby --version
[02:45:03] |ifei5g00d: has joined #ruby
[02:45:09] nerium: Sorry, I ment in a script
[02:45:23] LoneHerm_: has joined #ruby
[02:45:44] jancel: has joined #ruby
[02:47:24] tmtwd: has joined #ruby
[02:47:25] nerium: Is there a way to define dependencies based on ruby version?
[02:47:30] nerium: in a gemspec
[02:47:47] pipework: nerium: `ruby --version`
[02:47:59] pipework: nerium: I think you can publish a gemspec for each ruby version constraint,maybe.
[02:48:10] pipework: >> `ruby --version`
[02:48:11] ruby[bot]: pipework: # => (https://eval.in/572344)
[02:48:23] nerium: Having to parse that output feels really error pone
[02:48:37] nerium: There must be a better way
[02:49:25] serafin88: has joined #ruby
[02:50:10] serafin88: Hello Pals, I newbie with Ruby
[02:50:13] idefine: has joined #ruby
[02:50:37] wilbert: has joined #ruby
[02:54:29] PlasmaStar: has joined #ruby
[02:54:31] LinuxHippie: has joined #ruby
[02:55:25] ramfjord: has joined #ruby
[02:58:39] nekomune: has joined #ruby
[02:58:39] halfamind: has joined #ruby
[02:58:43] morenoh149: I'm using homebrew to install chruby. but I can't call it from the terminal?
[02:58:47] morenoh149: do I have path issues?
[02:59:09] morenoh149: homebrew say chruby is already installed. I reinstalled it using homebrew as well.
[02:59:41] someish: morenoh149: Did you try restarting the terminal?
[02:59:47] pipework: morenoh149: Did you `brew info chruby`?
[02:59:57] pipework: Gotta read the output bruh
[03:01:00] morenoh149: no the problem is more fundamental. Why is a homebrew package not executable from the terminal? must be path issue
[03:01:12] morenoh149: brew info chruby prints instructions I already followed
[03:01:31] codeurge: has joined #ruby
[03:01:31] morenoh149: I opened a new terminal and sourced my .zshrc file multiple times
[03:01:47] Arcaire: cat ~/.zshrc | curl -F "sprunge=<-" https://sprunge.us/
[03:02:16] Arcaire: http apparently, not https
[03:02:18] Arcaire: we live in 2013
[03:03:01] Kallis: has joined #ruby
[03:04:05] morenoh149: ah needed both https://medium.com/@heidar/switching-from-rbenv-to-postmodern-s-ruby-install-and-chruby-f0daa24b36e6#.gx9zjmb9n
[03:10:26] Nice_BikeMaN: has joined #ruby
[03:11:58] braincrash: has joined #ruby
[03:14:47] morenoh149: what about this openssl stuff?
[03:15:03] morenoh149: ERROR: While executing gem ... (Gem::Exception)
[03:15:05] morenoh149: Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources
[03:15:21] Nice_BikeMaN: Does anyone know if the Ruby and Rails plugin will work for Netbeans 8.0.2?
[03:15:40] gix: has joined #ruby
[03:16:14] zast: has joined #ruby
[03:16:17] stannard: has joined #ruby
[03:16:25] zast: has left #ruby: ()
[03:16:28] moeabdol: has joined #ruby
[03:16:44] p1k: has joined #ruby
[03:16:44] hydr8d: has joined #ruby
[03:18:30] OTORelic: has joined #ruby
[03:20:55] jackjackdripper: has joined #ruby
[03:22:12] karmatr0n: has joined #ruby
[03:22:29] Insti: has joined #ruby
[03:24:45] govg: has joined #ruby
[03:25:39] stardiviner: has joined #ruby
[03:28:22] nando293921: has joined #ruby
[03:31:49] blackmesa: has joined #ruby
[03:33:25] whathappens: has joined #ruby
[03:35:33] jenrzzz_: has joined #ruby
[03:35:34] whathappens: has joined #ruby
[03:36:17] whathappens: has joined #ruby
[03:37:12] moeabdol: has joined #ruby
[03:39:32] chopin: has joined #ruby
[03:44:55] ruskie: has joined #ruby
[03:45:04] lxsameer: has joined #ruby
[03:46:11] agent_white: has joined #ruby
[03:52:09] zzak: has joined #ruby
[03:53:31] rbennacer: has joined #ruby
[03:54:15] ledestin: has joined #ruby
[03:56:59] bluOxigen_: has joined #ruby
[03:57:44] bluOxigen_: has left #ruby: ()
[03:57:46] karmatr0n: has joined #ruby
[04:03:29] kgrz: has joined #ruby
[04:04:33] someish: has joined #ruby
[04:06:05] jaguarmagenta: has joined #ruby
[04:07:51] bazzy: has joined #ruby
[04:12:07] kareeoleez: has joined #ruby
[04:13:08] zacts: has joined #ruby
[04:13:25] halfamind: has joined #ruby
[04:14:46] kareeole_: has joined #ruby
[04:14:46] jose9991: has joined #ruby
[04:16:23] pawnbox: has joined #ruby
[04:18:19] _kraken: has joined #ruby
[04:18:28] _kraken: Is this the main ruby irc?
[04:19:16] _kraken: has left #ruby: ("Leaving")
[04:19:21] _kraken: has joined #ruby
[04:19:40] _kraken: Do I need to initialize all my variables in an initialize method for a particular class or can I define them outside the methods in that class?
[04:19:51] _kraken: Is a class just composed of methods? AKA, nothing outside the methods?
[04:22:27] mbreedlove: has joined #ruby
[04:22:38] koooge: has joined #ruby
[04:23:29] astrobunny: has joined #ruby
[04:28:17] xall: has joined #ruby
[04:29:49] idefine: has joined #ruby
[04:32:10] nankyokusei: has joined #ruby
[04:32:38] blackmesa: has joined #ruby
[04:33:28] LoneHerm_: has joined #ruby
[04:35:42] znz_jp: has joined #ruby
[04:36:28] pipework: _kraken: Ruby is quite dynamic.
[04:36:49] allcentury: has joined #ruby
[04:36:57] pipework: Methods needn't even exist until runtime, and sometimes don't exist at all times in runtime.
[04:37:01] pipework: Quite the magical thing.
[04:37:33] voucher: has joined #ruby
[04:39:20] tildes_: has joined #ruby
[04:39:24] jose9991: has left #ruby: ()
[04:40:13] voucher: has left #ruby: ()
[04:40:58] kgrz: has joined #ruby
[04:42:42] karmatr0n: has joined #ruby
[04:50:21] TheWhip: has joined #ruby
[04:50:27] beauby: has joined #ruby
[04:55:21] ur5us: has joined #ruby
[04:57:37] terminalrecluse: has joined #ruby
[05:00:59] bronson: has joined #ruby
[05:05:32] Tref: has joined #ruby
[05:06:17] crystal77: has joined #ruby
[05:11:48] JohnBat26: has joined #ruby
[05:12:12] idefine: has joined #ruby
[05:13:18] Tref: anyone used the mapbox-rails gem?
[05:15:12] beauby: Hi there. I have a conditional module inclusion in my gem (`if defined?(ActionController); require 'rails-specific-stuff'; end;`). For testing purposes, how can I load ActionController before my gem itself? (using rspec)
[05:19:07] stannard: has joined #ruby
[05:20:26] gusrub: has joined #ruby
[05:21:02] tAn: has joined #ruby
[05:22:53] anisha: has joined #ruby
[05:24:59] Viz: has joined #ruby
[05:25:46] yaewa: has joined #ruby
[05:25:52] paatalaBhairavi: has joined #ruby
[05:25:52] paatala_bhairavi: has joined #ruby
[05:31:51] yfeldblum: has joined #ruby
[05:32:10] _kraken: Do you guys use blocks and procs alot with methods? These confuse me so fucking much
[05:32:28] SilverKey: has joined #ruby
[05:33:22] beauby: _kraken: Yeah they are useful when you want to pass an arbitrary function around (for instance taking a `formatter` lambda/prock as a parameter)
[05:33:31] bazzy: change your spec before changing the code!!
[05:33:39] blackmesa: has joined #ruby
[05:33:42] pipework: _kraken: They can be really useful, but I typically try not to make an excuse for them where they aren't necessary in code I share with others.
[05:33:51] pipework: Though DSLs and nice method interfaces are welcome.
[05:34:23] beauby: bazzy: was your comment for me?
[05:34:59] bazzy: it's for everyone!~
[05:35:05] bazzy: I'm learning TDD :D
[05:35:11] beauby: Oh I see :)
[05:37:21] bazzy: does this sound right?
[05:37:31] bazzy: to answer (why change spec before change code)
[05:37:33] bazzy: if you created tests already .. and then you think "Ou .. I am going to change how my thingy works.. then you want to change your spec (tests) FIRST! before changing the code! it helps breath life into your idea and provides the new tests first so you can work on getting them to pass!
[05:38:04] bazzy: is there a better clearer answer to "WHY change spec before code" ?
[05:38:05] allcentury: has joined #ruby
[05:38:23] hk238: has joined #ruby
[05:39:45] ravishankarjha: has joined #ruby
[05:40:53] beauby: bazzy: Philosophically, in TDD, you define behavior in your spec, and you make your code fulfill the specs. The spec is the contract. Plus, if you change your code first and your spec later, you're clouded with your implementation.
[05:40:57] duncannz: has joined #ruby
[05:41:06] jenrzzz: has joined #ruby
[05:41:06] jenrzzz: has joined #ruby
[05:41:47] duncannz: has joined #ruby
[05:42:09] bazzy: beauby, elaborate
[05:42:15] bazzy: "clouded with your impl"
[05:42:32] bazzy: you mean mentally
[05:42:37] bazzy: impl details are extranneous
[05:42:42] duncannz: has joined #ruby
[05:46:39] beauby: bazzy: There's a chance if you write code first you will be biased when writing the spec
[05:47:35] sauvin: has joined #ruby
[05:47:58] bazzy: Are there any considerations to take when you maintain a codebase that lacks a testing framework, and you want to create one.. or an approach proven?
[05:49:22] moeabdol: has joined #ruby
[05:49:57] xall: has joined #ruby
[05:52:16] moeabdol: has joined #ruby
[05:53:39] pushpak: has joined #ruby
[05:55:44] A5101: has joined #ruby
[05:59:14] LoneHerm_: has joined #ruby
[05:59:48] kareeoleez: has joined #ruby
[06:01:16] kareeoleez: has joined #ruby
[06:05:12] Coldblackice: has joined #ruby
[06:05:33] galeido^: has joined #ruby
[06:08:23] galeido: has joined #ruby
[06:09:28] jaruga___: has joined #ruby
[06:15:52] aganov: has joined #ruby
[06:17:04] d0nn1e: has joined #ruby
[06:22:02] emilkarl: has joined #ruby
[06:22:42] noobsu: has joined #ruby
[06:23:43] binaryplease: has joined #ruby
[06:24:55] neanderslob: has joined #ruby
[06:26:33] crdpink: has joined #ruby
[06:33:01] nankyokusei: has joined #ruby
[06:33:56] duoi: has joined #ruby
[06:34:51] blackmesa: has joined #ruby
[06:35:54] pawnbox: has joined #ruby
[06:39:35] allcentury: has joined #ruby
[06:43:11] bazzy: how come, for attr_accessor :var , you can read 'var' but you cannot do 'var =' you must do `self.var =` or `@var =`
[06:44:07] apeiros: bazzy: because how'd it otherwise know you mean the method `var =` and don't want to assign to a local variable?
[06:44:26] bazzy: apeiros, same for reading tho, wouldn't you think?
[06:44:43] apeiros: no. at the time of reading it can look what exists.
[06:44:51] apeiros: and local variable takes precedence.
[06:44:55] bazzy: but not for assignment?
[06:45:17] apeiros: so if you postulate the same for writing, then local variable also takes precedence -> i.e. you can't invoke a method with it
[06:45:40] bazzy: oh I GET IT .. yeah the local would be created in that moment
[06:45:49] bazzy: ACTION slaps self 
[06:46:25] jgt3: has joined #ruby
[06:46:26] bazzy: I wrote my first RSpec tests tonight (just following a tut tho)
[06:46:43] bazzy: actually Radar's book ;)
[06:46:59] bazzy: I saved my bacon bro
[06:47:45] Devalo: has joined #ruby
[06:47:49] gregf: has joined #ruby
[06:48:15] bazzy: `RSpec.describe Bacon` does Bacon actually need to be a constant in that declaration?
[06:48:34] rkazak: has joined #ruby
[06:49:01] bazzy: erm, I'm actually operating under the assumption that a class name is a constant
[06:49:18] noService: has joined #ruby
[06:49:42] moei: has joined #ruby
[06:51:18] bazzy: the answer is yes (I tried modifying it)
[06:51:58] bazzy: is there any bonus to using a constant in the describe statement vs. a string?
[06:53:20] pawnbox: has joined #ruby
[06:56:56] noServic1: has joined #ruby
[06:57:41] ravishankarjha: has joined #ruby
[06:59:03] Radar: bazzy: Yes, you can reference it as described_class
[06:59:10] Radar: bazzy: and then examples get access to a "subject" method which will return Bacon.new
[06:59:18] Radar: handy for the one-liner it blocks you'll see later
[07:00:41] Radar: Oops, I don't think we have one.
[07:01:48] czerasz__: has joined #ruby
[07:02:00] Radar: bazzy: https://www.relishapp.com/rspec/rspec-core/v/2-11/docs/subject/implicitly-defined-subject
[07:03:19] bronson: has joined #ruby
[07:03:41] codecop: has joined #ruby
[07:04:37] bazzy: "we recommend that you reserve it for support of custom
[07:04:37] bazzy: matchers and/or extension libraries that hide its use from examples." -- now i want an example of that!
[07:05:10] drale2k: has joined #ruby
[07:05:46] bazzy: does that mean like .. a private testing framework? i don't get it
[07:06:07] bazzy: i get the "custom matcher" use (even tho i've never seen one)
[07:06:22] bazzy: pardon the lowercase 'i' xD
[07:06:40] bazzy: but "extension library"?
[07:08:58] rxgcow: has joined #ruby
[07:10:02] bazzy: ..ok i get it
[07:10:10] bazzy: wow i need sleep.. that was a bad sign
[07:13:45] bluOxigen: has joined #ruby
[07:13:51] TheWhip: has joined #ruby
[07:14:00] mark_66: has joined #ruby
[07:14:28] antgel: has joined #ruby
[07:14:30] Ishido: has joined #ruby
[07:14:31] isxek: has joined #ruby
[07:17:30] ur5us: has joined #ruby
[07:18:22] tAn: has joined #ruby
[07:19:42] rkazak: has joined #ruby
[07:20:52] stannard: has joined #ruby
[07:24:02] duoi: has joined #ruby
[07:25:27] flughafen: has joined #ruby
[07:27:29] apeiros: moin adaedra
[07:27:48] Couch: has joined #ruby
[07:30:19] patrick_star_2: has joined #ruby
[07:30:27] toretore: has joined #ruby
[07:30:50] siovene: has joined #ruby
[07:31:32] duoi: has joined #ruby
[07:34:12] solars: has joined #ruby
[07:35:35] blackmesa: has joined #ruby
[07:35:56] aufi: has joined #ruby
[07:35:57] biberu: has joined #ruby
[07:36:14] codecop: has joined #ruby
[07:38:12] Labaleine: has joined #ruby
[07:39:49] N0de: has joined #ruby
[07:40:09] N0de: hey guys :)
[07:41:32] skade: has joined #ruby
[07:41:44] noService: has joined #ruby
[07:42:24] Madplatypus: has joined #ruby
[07:42:26] Hyuk: has joined #ruby
[07:47:17] nischay: has joined #ruby
[07:49:00] brunto: has joined #ruby
[07:50:01] ur5us: has joined #ruby
[07:50:23] TvL2386: has joined #ruby
[07:50:49] Ch4rAss: has joined #ruby
[07:54:42] wbsgrepit: has joined #ruby
[07:55:59] wbsgrepit: has left #ruby: ("WeeChat 1.4")
[07:57:52] edwinvdgraaf: has joined #ruby
[08:00:27] ravishankarjha: has joined #ruby
[08:00:34] ferr: has joined #ruby
[08:01:08] the_drow: has joined #ruby
[08:01:26] noService: has joined #ruby
[08:02:24] Ch4rAss: has joined #ruby
[08:04:46] djellemah: has joined #ruby
[08:09:04] neanderslob: has joined #ruby
[08:09:13] tgeeky: has joined #ruby
[08:09:28] jwang: has joined #ruby
[08:09:43] ramfjord: has joined #ruby
[08:09:45] Biopandemic: has joined #ruby
[08:10:05] stardiviner: has joined #ruby
[08:10:13] tAn: has joined #ruby
[08:10:39] hays: has joined #ruby
[08:10:57] drewo: has joined #ruby
[08:12:47] jds: has joined #ruby
[08:14:14] emilkarl: has joined #ruby
[08:15:05] Labaleine: has joined #ruby
[08:15:45] etehtsea: has joined #ruby
[08:17:29] noService: has joined #ruby
[08:17:45] hightower2: has joined #ruby
[08:19:15] Devalo: has joined #ruby
[08:21:17] pawnbox_: has joined #ruby
[08:21:19] horaceheaven: has joined #ruby
[08:25:00] AlexJakeGreen: has joined #ruby
[08:25:41] senayar: has joined #ruby
[08:26:05] blackmesa: has joined #ruby
[08:28:09] noobsu: has joined #ruby
[08:29:00] noobsu: has joined #ruby
[08:30:59] Ropeney: has joined #ruby
[08:33:56] nankyokusei: has joined #ruby
[08:34:42] platzhirsch: has joined #ruby
[08:36:12] skade: has joined #ruby
[08:36:19] aupadhye: has joined #ruby
[08:38:18] antgel: has joined #ruby
[08:38:53] WhatsGoingOn: has joined #ruby
[08:39:06] TomyWork: has joined #ruby
[08:39:10] duoi: has joined #ruby
[08:42:52] allcentury: has joined #ruby
[08:43:53] startupality: has joined #ruby
[08:44:40] Coldblackice_: has joined #ruby
[08:45:54] DoubleMalt: has joined #ruby
[08:46:16] marr: has joined #ruby
[08:46:51] antgel: has joined #ruby
[08:49:12] terlar: has joined #ruby
[08:49:30] kgrz: has joined #ruby
[08:49:37] twistedpixels: has joined #ruby
[08:49:37] twistedpixels: has joined #ruby
[08:50:10] LoneHerm_: has joined #ruby
[08:50:14] roshanavand1: has joined #ruby
[08:51:17] wigust: has joined #ruby
[08:52:17] LoneHerm_: has joined #ruby
[08:56:21] neanderslob: has joined #ruby
[08:56:30] wigust: has joined #ruby
[08:58:24] noobsu_: has joined #ruby
[08:59:36] WhatsGoingOn: has joined #ruby
[09:00:33] AlexJakeGreen_: has joined #ruby
[09:01:12] duoi: has joined #ruby
[09:02:04] haxrbyte: has joined #ruby
[09:04:05] blackgoat: has joined #ruby
[09:04:59] drewo: has joined #ruby
[09:05:22] bronson: has joined #ruby
[09:07:49] Shashikant86: has joined #ruby
[09:09:13] duoi: has joined #ruby
[09:10:12] pawnbox: has joined #ruby
[09:14:12] prestorium: has joined #ruby
[09:18:44] duoi: has joined #ruby
[09:19:34] shlomo: has joined #ruby
[09:20:07] blackgoat: has joined #ruby
[09:20:33] troulouliou_div2: has joined #ruby
[09:21:49] FooMunki: has joined #ruby
[09:23:10] astrobunny: has joined #ruby
[09:27:37] ma489: has joined #ruby
[09:28:26] startupality: has joined #ruby
[09:29:18] WebDevB: has joined #ruby
[09:31:26] araujo: has joined #ruby
[09:31:26] araujo: has joined #ruby
[09:31:40] noService: has joined #ruby
[09:32:25] pawnbox: has joined #ruby
[09:34:29] roshanavand1: has joined #ruby
[09:35:58] blackgoat: has joined #ruby
[09:38:08] binaryplease: has joined #ruby
[09:38:41] codeurge: has joined #ruby
[09:38:57] brunto: has joined #ruby
[09:44:32] roshanavand1: has joined #ruby
[09:45:19] workmad3: has joined #ruby
[09:45:26] hangelo: has joined #ruby
[09:46:25] psf: has joined #ruby
[09:48:39] shevy: power-insta-quitting!
[09:48:59] moeabdol: has joined #ruby
[09:51:01] psf: has joined #ruby
[09:52:36] Shashikant86: has joined #ruby
[09:53:02] blackgoat: has joined #ruby
[09:53:05] evidex: has joined #ruby
[09:54:04] blaxter: has joined #ruby
[09:54:09] Ropeney: has joined #ruby
[09:56:11] startupality: has joined #ruby
[09:57:40] das_j: has joined #ruby
[09:58:33] vondruch_: has joined #ruby
[09:58:48] duoi: has joined #ruby
[09:59:03] drewo: has joined #ruby
[09:59:23] das_j: Hello, I'm a newbie and I'm currently trying to run a rakefile through bundler using `bundle exec rake rake-target`. The output of the command is "Could not find rake-10.5.0 in any of the sources" and "use bundle install". Using bundle install just tells me that the package is already installed.
[09:59:29] das_j: What should I do in this case?
[09:59:37] Zggb_: has joined #ruby
[10:00:48] duoi: has joined #ruby
[10:01:12] Devalo: has joined #ruby
[10:01:31] Polysics: has joined #ruby
[10:03:20] Masonn: has joined #ruby
[10:03:48] das_j: Oh and of course, rake is in my gem path
[10:04:14] horaceheaven: has joined #ruby
[10:04:41] tgeeky: has joined #ruby
[10:05:30] pandaant: has joined #ruby
[10:06:10] das_j: `bundle exec rake --version` shows me 10.5.0 which seems to be correct
[10:07:09] codecop: has joined #ruby
[10:14:41] davidblko: has joined #ruby
[10:16:47] chip_: has joined #ruby
[10:17:35] d0lph1n98: has joined #ruby
[10:18:26] allcentury: has joined #ruby
[10:21:56] dionysus69: has joined #ruby
[10:22:35] stannard: has joined #ruby
[10:26:49] yosafbridge: has joined #ruby
[10:27:29] blaxter: has joined #ruby
[10:30:28] pLaToOn: has joined #ruby
[10:33:04] v0dro: has joined #ruby
[10:34:45] nankyokusei: has joined #ruby
[10:35:27] astrobunny: has joined #ruby
[10:37:23] Gasher: has joined #ruby
[10:38:34] emilkarl: has joined #ruby
[10:39:36] kholbekj: has joined #ruby
[10:41:30] qasaur: has joined #ruby
[10:42:12] cultureulterior1: has joined #ruby
[10:42:20] LoneHermit: has joined #ruby
[10:43:21] sdothum: has joined #ruby
[10:44:47] c355E3B: has joined #ruby
[10:49:33] startupality: has joined #ruby
[10:50:04] sdothum: has joined #ruby
[10:50:30] the_drow: has joined #ruby
[10:51:36] symm-: has joined #ruby
[10:52:11] mdw: has joined #ruby
[10:53:10] drewo: has joined #ruby
[10:53:13] johnmilton: has joined #ruby
[10:53:40] Shashikant86: has joined #ruby
[10:54:35] jokke: i'm having a bit of trouble with minitest and webmock. https://p.jreinert.com/0cU7za/
[10:54:57] jokke: any ideas what might be going wrong here?
[10:55:20] Zarthus: you're doing a thing but you haven't stubbed it yet
[10:55:28] Zarthus: because it doesn't know how to mock it, it throws an error instead
[10:55:35] jokke: Zarthus: see the last line
[10:55:52] Zarthus: does it support regexes?
[10:56:03] jokke: according to docs it does
[10:56:06] Zarthus: if it does, should it not be a Regexp class instead of a string?
[10:56:15] jokke: yeah that's what i thought too
[10:56:23] jokke: and that's how i mocked the request
[10:56:23] Zarthus: also your regex seems weird to me
[10:56:39] yosafbridge: has joined #ruby
[10:56:58] jokke: it's basically just a /^#{Regexp.escape(url)}.*/
[10:57:02] Zarthus: hm, no nevermind. you just didn't provide a top level domain
[10:57:15] Zarthus: or rather, the url is weird because it's not what you'd normally expect an url to look like
[10:58:40] Zarthus: I think you need to remove the quot marks in your #stub_request code
[10:58:47] jokke: weirdest of all: if i run the test by itself (by running rake test path/to/test/that/fails.rb) i get no error
[10:58:54] duoi: has joined #ruby
[10:59:40] mdw7: has joined #ruby
[10:59:45] m_antis: has joined #ruby
[10:59:50] umdstu: has joined #ruby
[11:00:15] ixti: has joined #ruby
[11:00:21] jokke: i mock the request in the setup block
[11:00:35] gnufied: has joined #ruby
[11:00:49] jokke: of the parent class of my test
[11:01:01] cdg: has joined #ruby
[11:01:02] kam270: has joined #ruby
[11:01:10] jokke: (i hate minitest, i just have to use it for this project)
[11:02:25] v0dro: has joined #ruby
[11:03:05] jgt3: has joined #ruby
[11:07:05] pwnd_nsfw`: has joined #ruby
[11:07:37] bronson: has joined #ruby
[11:07:54] Zarthus: nobody likes mocking http requests
[11:07:57] crdpink: has joined #ruby
[11:08:09] ruby[bot]: apeiros is nobody
[11:08:15] apeiros: true. I do.
[11:08:55] brunto: has joined #ruby
[11:08:56] noService: has joined #ruby
[11:09:12] Zarthus: Nobody much prefers mocking HTTP requests over mocking non-http requests?
[11:09:15] Zarthus: ACTION stab in the wild
[11:09:32] Kallis: has joined #ruby
[11:09:42] p1k: has joined #ruby
[11:09:49] apeiros: what's a non-http request?
[11:10:00] ferr: has joined #ruby
[11:10:02] apeiros: jokke: show your stub_request code?
[11:10:29] p1k: what's a sane way to monkey-patch a class that uses alias to avoid collision
[11:10:52] p1k: e.g. I need to patch :load, but the inheriting class calls alias :load, :_load and then defines a new :load etc.
[11:10:58] apeiros: a sane way to monkey-patch a class is to not monkey-patch it
[11:11:00] rtl: has joined #ruby
[11:11:05] apeiros: sounds like you want to reinvent alias_method_chain?
[11:11:24] kies: has joined #ruby
[11:11:28] apeiros: oh, misread
[11:11:48] apeiros: monkey patch the descendant to then?
[11:12:07] p1k: yeah I need to patch the :load which will become :_load
[11:12:11] startupality: has joined #ruby
[11:13:52] humd1ng3r: has joined #ruby
[11:15:11] rodfersou: has joined #ruby
[11:21:07] shevy: p1k isn't that simple? I mean you can temporarily define/alias methods and also remove them at will again via... either remove_method or undefine_method
[11:21:30] shevy: though the original implementation there sounds quite crazy already
[11:21:37] blackmesa: has joined #ruby
[11:21:48] jaruga___: has joined #ruby
[11:23:38] ldnunes: has joined #ruby
[11:24:08] Ch4rAss: has joined #ruby
[11:24:12] Masonn: has joined #ruby
[11:27:42] jancel: has joined #ruby
[11:28:51] p1k: buckets of joy monkey patching someone else's library to add logging
[11:29:18] apeiros: ah those moments when you wish ruby had a tiny bit of AOP
[11:32:05] wigust: has joined #ruby
[11:34:26] shevy: you still want ruby to be hypercard!!!
[11:34:40] apeiros: hypercard didn't have aop
[11:34:53] apeiros: and no, I don't want ruby to be hypercard either :)
[11:35:00] mg^: has joined #ruby
[11:37:58] TheBrayn: I want everything to be hypercard
[11:39:08] BaroMeter: has joined #ruby
[11:39:17] vondruch: has joined #ruby
[11:42:43] nettoweb: has joined #ruby
[11:44:35] |2701: has joined #ruby
[11:44:56] senayar: has joined #ruby
[11:46:30] lewis1711: has joined #ruby
[11:47:05] shibly: has joined #ruby
[11:47:24] drewo: has joined #ruby
[11:47:40] lewis1711: why can't an enumerator be cloned?
[11:48:46] lewis1711: I mean it's just a glorified pointer surely
[11:49:28] shibly: has left #ruby: ()
[11:50:07] ravishankarjha: has joined #ruby
[11:51:00] allcentury: has joined #ruby
[11:51:14] LoneHermit: has joined #ruby
[11:53:45] flashpoint9: has joined #ruby
[11:54:46] halfamind: has joined #ruby
[11:55:16] Labaleine: has joined #ruby
[11:55:59] noobsu: has joined #ruby
[11:56:10] pawnbox: has joined #ruby
[11:56:24] wdi14: has joined #ruby
[11:56:39] evidex: has joined #ruby
[11:57:19] wdi14: Hello everybody. I'm new to Ruby and I need help to translate this code from javascript to Ruby
[11:57:48] wdi14: http://jsbin.com/punasozuti/edit?js,console
[11:58:21] wdi14: Hello everybody. I'm new to Ruby and I need help to translate this code from javascript to Ruby http://jsbin.com/punasozuti/edit?js,console
[11:58:26] ponga: has joined #ruby
[12:00:07] gregf_: wdi14: how are you willing to pay? *waits with bated breath*
[12:00:35] apeiros: lewis1711: iirc it's implemented via fibers (and used to be continuations - not sure though)
[12:00:48] wdi14: gregf_: Yes but I'd like to learn also
[12:01:03] gregf_: wow, so much business login in the view :|
[12:01:16] gregf_: s/login/logic/
[12:01:32] wdi14: gregf_: otherwise I'd had used fiverr or something else
[12:01:58] apeiros: gregf_: just wait for an actual question? :)
[12:02:40] nadir: has joined #ruby
[12:02:49] Devalo: has joined #ruby
[12:03:09] Hanmac: has joined #ruby
[12:03:11] mbreedlove: has joined #ruby
[12:03:18] Labaleine: has joined #ruby
[12:03:25] halfamind: has joined #ruby
[12:03:49] apeiros: wdi14: what gregf_ plays at is that at the moment it can be read as "please do it for me", and that's not what we do. you do the work, and we help when you have questions.
[12:04:37] wdi14: apeiros: Thanks
[12:04:38] senayar: has joined #ruby
[12:04:42] GodFather: has joined #ruby
[12:05:27] wdi14: apeiros: and gregf_ let me redo my question. Please, anyone here could help me to translate this http://jsbin.com/punasozuti/edit?js,console to Ruby? Thanks
[12:05:41] TheWhip: has joined #ruby
[12:05:46] wdi14: apeiros: and gregf_ , sorry
[12:06:03] apeiros: wdi14: how do you imagine that help works?
[12:07:21] chouhoulis: has joined #ruby
[12:07:34] wdi14: Well, idealist the person should ask for help (politely) and receive
[12:07:43] wdi14: Is that right? for you apeiros
[12:08:08] gregf_: wdi14: what apeiros said is quite true, but tbh, you can map that 1 - 1 in ruby. remove the 'var' and curly braces '{' , '}'?
[12:08:33] chouhoulis: has joined #ruby
[12:08:41] toretore: wdi14: your question makes it seem like you have made no effort on your own and are expecting someone to just do the work for you
[12:08:52] wdi14: toretore:
[12:08:55] rodfersou: has joined #ruby
[12:09:16] gregf_: also imho its too much logic. all you need is 4 statements of the type 1) "You must travel through " 2) "Change at Union Square." - almost always 3) "Your journey continues through" 4) "n stops in total." 5) ""
[12:09:40] apeiros: wdi14: ok. not what I meant. yes, we will help you. do you have a specific problem?
[12:10:11] gregf_: anyways, we're not here to write the code for you. you learn it better when you try it yourself. come back here after you've tried something as apeiros has said :)
[12:10:17] synthroid: has joined #ruby
[12:10:18] stannard: has joined #ruby
[12:10:25] wdi14: apeiros: where could I show you my code in Ruby? Gist?
[12:10:42] apeiros: yes, gist is excellent
[12:11:00] gregf_: wdi14: write tests as well
[12:11:31] wdi14: apeiros: Here is where I'm at the moment https://gist.github.com/fbi1714/6003f9a1224255221979b057d4f48b97
[12:11:45] gregf_: fbi *shudders*
[12:12:02] apeiros: don't worry. it's the fbi from 1714
[12:12:19] wdi14: when I call the function in pry it returns me an error
[12:12:20] apeiros: wdi14: ok. and your issue is?
[12:12:41] apeiros: then you should put that into your gist
[12:13:04] apeiros: I'll assume it's something along "NameError, no method or variable trainLines"?
[12:14:30] wdi14: apeiros: that's the error accordingly to pry
[12:14:34] wdi14: apeiros: https://gist.github.com/anonymous/b0057dd6b0b4874734bdd17e7552497e
[12:14:41] toretore: wdi14: what is the purpose of all this?
[12:15:25] flips: I understand Rails guidelines to be that I should type myhash = {} instead of Hash.new (?) ... But, how would I then type something like: your_hash = Hash.new { |hash, key| hash[key] = Array.new } ?
[12:15:45] apeiros: wdi14: you have to either run it via `ruby trainSystem.rb` or add a shebang. otherwise your shell thinks it's bash.
[12:15:46] wdi14: toretore: https://gist.github.com/ga-wolf/8c662888636577c5a7ba4c35b6579bc3
[12:16:01] toretore: flips: you wouldn't, don't worry about what the rails guidelines say
[12:16:27] apeiros: flips: I think the rails guide also states that when you make use of the constructor's abilities, it's fine to use it
[12:16:36] toretore: wdi14: so this is homework?
[12:16:40] flips: ;) ok ...
[12:16:41] wdi14: toretore: I did it in javascript and now I need to make in Ruby
[12:16:49] wdi14: toretore: yes
[12:17:16] wdi14: apeiros: I'm doing that at my terminal ruby mta.rb
[12:17:25] wdi14: apeiros: mta.rb is the name of my file
[12:17:46] apeiros: doesn't look like you do from your own gist…
[12:17:49] apeiros: says `mta-ruby $trainSystem`
[12:18:09] apeiros: actually it even says `mta-ruby $trainSystem (:N, "Times Square", :L, "Grande Central")`
[12:18:52] apeiros: and the "bash" part in "bash: syntax error" makes it pretty clear you're in bash context, not ruby
[12:19:14] TheWhip: has joined #ruby
[12:19:45] wdi14: apeiros: try here https://repl.it/CReP
[12:20:49] wdi14: apeiros: ok
[12:20:51] apeiros: and I'm pretty sure you won't get a "bash syntax error" there either ;-)
[12:22:23] gregf_: flips: it surely works from the rails console
[12:22:27] wdi14: apeiros: so what am I doing wrong?
[12:22:36] apeiros: I told you
[12:22:38] roshanavand1: has joined #ruby
[12:23:23] solars: has joined #ruby
[12:24:05] wdi14: apeiros: I'm not understanding really
[12:24:10] apeiros: you say you run it via `ruby mta.rb` - I suggest you update your gist then where you actually do that and the error you get there.
[12:24:15] apeiros: because again, in your gist, that's not what you do.
[12:24:32] norc: has joined #ruby
[12:24:38] norc: asm>> defined?(@a)
[12:24:39] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/572532
[12:26:39] jancel: has joined #ruby
[12:26:53] wdi14: apeiros: I just sent you the gist link to show you the code
[12:27:10] sepp2k: has joined #ruby
[12:27:52] apeiros: this is tedious…
[12:28:00] apeiros: wdi14: https://gist.github.com/fbi1714/6003f9a1224255221979b057d4f48b97 your code - ok. that part is fine.
[12:28:33] apeiros: wdi14: https://gist.github.com/anonymous/b0057dd6b0b4874734bdd17e7552497e your supposed error - NOT ok. this does NOT show you running your code as `ruby mta.rb` as you later stated.
[12:28:59] apeiros: and the error you get is from *bash*, your *shell*. not ruby. which is expected if you try to run ruby code through bash.
[12:29:17] apeiros: so until you updated your error gist to the proper problem, there's nothing for me to do.
[12:29:50] wdi14: apeiros: forget about this gist with the error
[12:29:56] wdi14: apeiros: it's very confusing
[12:30:13] apeiros: no gist with the full error you get = no help from me.
[12:30:22] evidex: has joined #ruby
[12:32:16] norc: If a derived class has no initializer, and I add one like this; def initialize(*args); @foobar = 1; super(*args); end -- could this possibly have any side effect that Im not seeing directly?
[12:32:37] horaceheaven: has joined #ruby
[12:32:40] swills: has joined #ruby
[12:32:41] norc: Actually take away the assignment to an instance variable.
[12:32:43] apeiros: norc: it'll also pass along a block passed to new
[12:33:11] norc: apeiros: Ahh.
[12:33:12] norc: That must be it.
[12:33:41] apeiros: and assuming the superclass does not have an initialize method either, you'll probably get an exception from super
[12:33:56] norc: apeiros: Oh it does. The block was the reason.
[12:34:05] norc: apeiros: And interesting that just showed me why keyword_super exists.
[12:34:20] norc: The only way to pass a block along is if you bind it to a proc which is expensive.
[12:34:30] mtkd: has joined #ruby
[12:34:38] norc: But keyword_super passes the block without procifying it.
[12:34:44] apeiros: you could also super { |*a| yield(*a) }
[12:34:48] wdi14: apeiros: https://gist.github.com/anonymous/dbf4582b67798fa19965dce54d9bfd5f check now
[12:34:53] wdi14: apeiros: I'm using pry
[12:34:58] aries_liuxueyang: has joined #ruby
[12:35:07] norc: apeiros: Mm, that would introduce an additional block still, but not as expensive I supose.
[12:35:15] apeiros: wdi14: and there we are: `NameError: undefined local variable or method `trainLines' for main:Object`
[12:35:24] borodin: has joined #ruby
[12:35:35] apeiros: 14:13 apeiros: I'll assume it's something along "NameError, no method or variable trainLines"?
[12:35:38] nankyokusei: has joined #ruby
[12:35:50] wdi14: apeiros: Yes, you said that
[12:36:00] astrobunny: has joined #ruby
[12:36:01] apeiros: but great that we now got you up to speed with properly reporting a problem.
[12:36:09] Zggb: has joined #ruby
[12:36:17] apeiros: rubys variable scoping works differently from javascript
[12:36:25] norc: apeiros: And you meant super(*args) { |*a| yield(*a) } rather than just keyword_super (which I still hate)
[12:36:35] apeiros: `def … end` starts a new lexical context. no outer local variable is accessible by it.
[12:36:57] apeiros: norc: super == super(*args) :)
[12:36:59] norc: ACTION passes binding_of_caller to apeiros 
[12:37:01] dstarh: has joined #ruby
[12:37:05] apeiros: norc: super != super()
[12:37:14] apeiros: norc: and yes, that's super-quirky ;-)
[12:37:28] KINGSABRI_: has joined #ruby
[12:37:31] norc: apeiros: super == super(*args) { |*a| yield(*a) }
[12:37:43] norc: apeiros: That key difference is what gave me an interesting headache today
[12:37:45] apeiros: your minimal definition of "do something and don't care about args": def initialize(*); super; end
[12:38:12] apeiros: your minimal definition of "do something and don't care about args, but suppress any block passed": def initialize(*args); super(*args, &nil); end
[12:38:14] norc: Which there was a way to forward the block.
[12:38:26] wdi14: apeiros: so how should I model my code for that?
[12:38:46] iamvery_: has joined #ruby
[12:39:23] ytti: norc, block is just proc, you can forward it as any variable, by reference
[12:39:29] norc: ytti: block is not proc.
[12:39:44] norc: ytti: blocks are not objects, procs are.
[12:41:29] drewo: has joined #ruby
[12:41:48] apeiros: seems my message didn't get through the disco
[12:41:50] apeiros: wdi14: proper: make it a class and assign @trainLines to an instance variable
[12:41:54] apeiros: quick-shot: make trainLines a constant like this: TrainLines
[12:42:01] norc: >> def f(&a); p a.class; end; f {} # ytti
[12:42:03] ruby[bot]: norc: # => Proc ...check link for more (https://eval.in/572544)
[12:42:26] norc: By doing that you are suddenly creating an object which is what I would like to avoid.
[12:42:35] wdi14: apeiros: Let me try
[12:42:51] ytti: norc, http://p.ip.fi/Logq
[12:43:40] apeiros: norc: yes, would be nice. who knows, maybe ruby optimizes that case if it doesn't see `block` referenced other than as `&block`?
[12:43:52] Weavel: has joined #ruby
[12:44:01] apeiros: nobu & co have done more amazing optimizations than that before…
[12:44:02] SShrike: has joined #ruby
[12:44:11] pawnbox: has joined #ruby
[12:44:35] norc: apeiros: From my experience Ruby only does local optimizations, but I haven't looked at the entire compile.c
[12:44:36] aagdbl: has joined #ruby
[12:45:53] aagdbl: does anyone know of a migration framework which can be used for non database tasks?
[12:46:01] mg^: has joined #ruby
[12:46:08] p1k: aagdbl: what are you migrating -- curious
[12:46:16] halfamind: has joined #ruby
[12:46:25] aagdbl: chef data bags
[12:47:05] aagdbl: actually i could use it for quite a few chef operations like uploading cookbooks, databags, etc
[12:47:10] p1k: like a migrationframeworkfactoryframework ?
[12:47:42] aagdbl: i have no clue what that means :)
[12:47:44] norc: apeiros: Come to think of it the best way is actually: def initialize(*args); super(*args, &Proc.new); end
[12:47:52] norc: apeiros: At least that won't create a new proc unconditionally.
[12:48:08] apeiros: but it'll add a method call overhead
[12:48:16] apeiros: and a constant lookup
[12:48:22] aagdbl: just something that creates unique migration, maybe stores the info locally in a yaml or something that is commited. and gives me up and down methods
[12:48:33] norc: apeiros: The method will be called regardless if you bind it using &foo
[12:49:06] norc: (Don't think that bit can be made visible in assembly though)
[12:49:07] apeiros: I mean the ".new" call
[12:49:11] p1k: aagdbl: I think that shouldn't be hard to write yourself -- but I don't know of an abstract one
[12:49:26] skweek: has joined #ruby
[12:49:36] papachan: has joined #ruby
[12:49:40] cultureulterior1: has left #ruby: ("Leaving")
[12:49:56] apeiros: btw., &proc works too. shorter than &Proc.new (and maybe a const lookup less)
[12:50:49] norc: >> def f(&b); b.call(); end; Proc.send(:define_method, :initialize) { puts "bark" }; f {}
[12:50:50] ruby[bot]: norc: # => nil (https://eval.in/572545)
[12:50:52] norc: That is interesting.
[12:51:23] norc: apeiros: I was wrong. How is this proc object being created o_o
[12:51:54] apeiros: I don't know the inner workings. but proc/Proc.new invoked without a block will use the block of the caller's scope
[12:51:59] p1k: aagdbl: I've done schema where I couldn't use AR and I found that a module wrapping the versioned class with a method for obtaining / caching the correct version from the database worked well enough
[12:52:15] p1k: but it was a different use case
[12:52:18] marr: has joined #ruby
[12:52:26] norc: apeiros: You must pass a block to Proc.new, and indeed I am passing one in the call at the end f {}
[12:52:35] ocbtec: has joined #ruby
[12:52:36] apeiros: they'll also complain if the caller's scope doesn't have one
[12:52:40] norc: But it seems like Ruby creates without Ruby methods.
[12:52:52] norc: It just pulls one out of its magical hat.
[12:53:00] norc: So its free, right?
[12:53:12] wilsonc91: has joined #ruby
[12:53:15] apeiros: noooooo idea :D
[12:53:37] apeiros: I rarely ever look under the hood. I just observe performance metrics. and this is actually one I've never tested.
[12:53:56] norc: apeiros: There are a few benchmarks around that show that procifying is a lot more expensive.
[12:54:53] apeiros: norc: you mean `def foo(&block); bar(&block); end` is always more expensive than `def foo; bar(&block); end`?
[12:55:00] apeiros: norc: you mean `def foo(&block); bar(&block); end` is always more expensive than `def foo; bar(&proc); end`?
[12:55:18] norc: apeiros: def f(&b); b.call; end is more expensive than def f; yield; end
[12:55:38] norc: apeiros: And the last statement somewhat yes.
[12:55:50] norc: apeiros: If the method can be called without a block its cheaper. If not it is the same.
[12:56:03] LoneHermit: has joined #ruby
[12:56:07] apeiros: but `def f(&b); @nested.f(&b); end` is less expensive than `def f; @nested.f { |*args| yield(*args) }; end`
[12:56:11] norc: (Proc.new has that habit of not doing anything if no block is around)
[12:56:45] norc: apeiros: Are you sure about that?
[12:57:01] norc: It just introduces a call overhead over turning a block into a proc.
[12:57:18] ramortegui: has joined #ruby
[12:57:20] araujo_: has joined #ruby
[12:57:22] norc: And the only cost there is passing arguments.
[12:57:35] apeiros: though it's a bit dated, might need rechecking. but had a lenghty argument with a rails core dev and they checked and confirmed
[12:57:39] norc: (Which since they are basically passed as pointers internally is practically for free)
[12:57:59] norc: apeiros: Is that possibly from pre 2.0 times?
[12:58:08] ravishankarjha: has joined #ruby
[12:58:26] apeiros: might have been 1.9. and I know arg passing has been heavily reworked in both 2.2 and 2.3, so might indeed be high time to recheck that wisdom :)
[12:58:40] norc: apeiros: Ill check into that.
[12:58:56] iooner: has left #ruby: ("Bye!")
[12:59:08] apeiros: iirc it was both faster and less gc stress
[12:59:25] akiTendo: has joined #ruby
[12:59:36] araujo_: has joined #ruby
[13:00:33] araujo__: has joined #ruby
[13:03:25] ftnsdf: has joined #ruby
[13:04:25] johnmilton: has joined #ruby
[13:04:27] gheegh: has joined #ruby
[13:05:27] dubin: has joined #ruby
[13:05:47] perlgod: has joined #ruby
[13:06:04] moeabdol: has joined #ruby
[13:06:27] dubin: Is there a version of Ruby that can be used to script on a windows server?
[13:06:57] adaedra: Ruby is compatible with windows
[13:08:02] adaedra: See https://www.ruby-lang.org/fr/documentation/installation/#rubyinstaller
[13:09:33] bronson: has joined #ruby
[13:10:24] adaedra: https://www.ruby-lang.org/en/documentation/installation/#rubyinstaller
[13:10:36] adaedra: didn't notice the automatic language detection :p
[13:11:56] ChiefAlexander: has joined #ruby
[13:12:11] aupadhye: has joined #ruby
[13:15:22] phrozen77: has joined #ruby
[13:15:29] malconis: has joined #ruby
[13:16:17] emilkarl: has joined #ruby
[13:16:31] brunto: has joined #ruby
[13:18:14] mc_fail: hi everyone
[13:18:39] mc_fail: is there any way to have Net::HTTP working with pkcs11 in ruby?
[13:19:02] mc_fail: i see there is a module for pkcs11 on github https://github.com/larskanis/pkcs11
[13:22:14] M-Kodo: has joined #ruby
[13:22:31] Ch4rAss: has joined #ruby
[13:23:14] mc_fail: but it doesnt seems like it supported by https somehow
[13:25:16] diegoaguilar: has joined #ruby
[13:27:07] jhass: are you talking about TLS client authentication?
[13:30:30] hutch4: has joined #ruby
[13:31:47] swills: has joined #ruby
[13:31:55] hutch34: has joined #ruby
[13:32:26] aegis3121: has joined #ruby
[13:32:45] jobewan: has joined #ruby
[13:32:57] jhass: mc_fail: ^?
[13:33:22] stannard: has joined #ruby
[13:33:59] mbreedlove: has joined #ruby
[13:34:03] dubin: can you use chomp to hide info from a user when running a script on a linux cli
[13:35:15] jhass: dubin: that seems conflated, try to elaborate your actual problem
[13:35:36] drewo: has joined #ruby
[13:36:52] astrobunny: has joined #ruby
[13:38:19] dubin: http://paste.ofcode.org/3bKJPG4RdrDMgmcZuSJTzMv
[13:39:02] dubin: In my script I'm trying to prevent the passwords from being displayed when the users are made
[13:39:25] arlek: has joined #ruby
[13:39:36] jhass: IO#noecho is the correct choice there
[13:40:11] stannard: has joined #ruby
[13:41:26] manveru: anyone know when Pathname#/ was added?
[13:42:05] dumdedum: has joined #ruby
[13:42:30] startupality: has joined #ruby
[13:44:52] manveru: damn, looks like 2.2 :P
[13:45:14] manveru: i thought it was there for ages... but that was Pathname#+
[13:45:29] davedev24: has joined #ruby
[13:45:34] heftig: manveru: looking at https://github.com/rubysl/rubysl-pathname/commits/2.0 suggests it might be 2.3
[13:45:50] manveru: i looked at https://github.com/ruby/ruby/commit/391fc2eeecfc2f0d0f851b0c27ba02e041fe2cd9
[13:46:27] manveru: not sure if it's 2.2 or 2.3, but the ruby i have to make this work with is 2.1 anyway
[13:46:47] heftig: manveru: eh, just use +
[13:47:37] griffindy: has joined #ruby
[13:47:47] jancel: has joined #ruby
[13:48:24] jancel: has joined #ruby
[13:49:09] johnmilton: has joined #ruby
[13:49:50] astrobunny: has joined #ruby
[13:50:29] Dysp: has joined #ruby
[13:50:46] bluOxigen: has joined #ruby
[13:51:55] horaceheaven: has joined #ruby
[13:52:04] rickmasta: has joined #ruby
[13:52:27] idefine: has joined #ruby
[13:53:04] johnmilton: has joined #ruby
[13:54:13] duoi: has joined #ruby
[13:54:30] idefine: has joined #ruby
[13:54:34] rodfersou|afk: has joined #ruby
[13:55:26] [ace]: has joined #ruby
[13:55:32] allcentury: has joined #ruby
[13:56:16] Dysp: Hi there! When I return an object from a function, how are they defined? Are they not defined at all and should be manually assigned to a variable I can then pass on to another function/whatever?
[13:56:39] OTORelic: has joined #ruby
[13:57:17] benzrf: Dysp: what do you mean?
[13:57:49] Dysp: If I have a function that returns x, how do I - outside that function - address this object?
[13:58:08] benzrf: Dysp: do you have a C background?
[13:58:10] Dysp: I could of course do x = function
[13:58:16] Dysp: Nothing. Complete newb.
[13:58:19] benzrf: oh, hold on
[13:58:24] benzrf: are you english as a second language, then?
[13:58:38] benzrf: sorry, just reacting to the word 'address' :p
[13:58:47] Dysp: HAh, yes. I think people are getting to know me a little too well in here ^^
[13:58:57] benzrf: its usage there struck me as either C-user or person-who-doesn't-natively-speak-english
[13:58:58] blackmesa: has joined #ruby
[13:59:10] Dysp: Lets go with number two!
[13:59:21] benzrf: not to say that it's not comprehensible - just a little bit unusual :)
[14:00:06] benzrf: when you return a value from a function, the only thing that happens is that the function call expression evaluates to that value
[14:00:23] asfasdf: has joined #ruby
[14:00:26] Dysp: Indeed. So how to pass on the entire object?
[14:00:34] Dysp: I am working with arrays, to be exact.
[14:00:52] benzrf: in ruby, 'value' is synonymous with 'object'
[14:00:59] benzrf: if you want to result in some object, just return that object
[14:01:12] Dysp: Alrighty.. Thats kinda what I thought, actually.
[14:01:41] Dysp: So, without assigning the object to a variable, how can I use it?
[14:01:56] Dysp: Also, what happens if I return several objects?
[14:02:04] benzrf: 'return several objects'?
[14:02:09] benzrf: you can only return one object
[14:02:11] Dysp: return x, y, z
[14:02:16] benzrf: that returns an array
[14:02:24] benzrf: it's just shorthand for "return [x, y, z]"
[14:02:50] Dysp: So what I am doing is getting return [[..], [..], [..]]
[14:03:13] benzrf: so then if i say your_func(), that expression will evaluate to that array
[14:03:27] pawnbox: has joined #ruby
[14:04:15] m_antis: has joined #ruby
[14:04:25] rbennacer: has joined #ruby
[14:04:42] idefine: has joined #ruby
[14:05:20] rbennacer: has joined #ruby
[14:05:45] Dysp: benzrf: Which mean I would have to assign the individual arrays in the array to variables, before I can pass them on to a new function?
[14:06:05] eljimmy: has joined #ruby
[14:06:05] araujo: has joined #ruby
[14:06:10] Devalo: has joined #ruby
[14:06:31] LoneHerm_: has joined #ruby
[14:07:06] benzrf: Dysp: not necessarily
[14:07:07] araujo: has joined #ruby
[14:07:31] benzrf: you can put any expression you want as a function argument
[14:07:43] benzrf: doesn't have to be a variable
[14:07:55] Dysp: In my case I think it has to
[14:08:17] Dysp: But you have clarified some stuff for me, so I can work around it, that is for sure. So thank you.
[14:09:01] mbreedlove: has joined #ruby
[14:09:30] evidex: has joined #ruby
[14:11:04] bweston92: has joined #ruby
[14:11:04] flughafen_: has joined #ruby
[14:11:12] apeiros: Dysp: `foo(bar())` - takes directly the return value from bar() as argument - no intermediary variable necessary
[14:11:33] apeiros: Dysp: `foo().bar()` - directly call bar on the return value from foo - no intermediary variable necessary
[14:11:45] duoi: has joined #ruby
[14:11:52] hobodave: has joined #ruby
[14:11:54] rbennacer: has joined #ruby
[14:12:10] Dysp: Yes. I get that. My problem is the way I am trying to build the script; if I did that, I would have to call the function several times instead of once.
[14:12:51] Dysp: But it definetly has something to do with me not correctly understanding how to optimize code. But I am learning. I've already made the script work as it should once; I am doing my first rewrite. :p
[14:12:54] ixti: has joined #ruby
[14:14:13] haxrbyte: has joined #ruby
[14:14:14] ftj: has joined #ruby
[14:14:20] hutch34: has joined #ruby
[14:15:41] ChiefAlexander: has joined #ruby
[14:16:02] nando293921: has joined #ruby
[14:16:54] rkazak: has joined #ruby
[14:17:30] SilverKey: has joined #ruby
[14:19:14] bmurt: has joined #ruby
[14:20:21] apeiros: it'd have been really swelte if foo(**nil) would work :-/
[14:24:10] jfabre: has joined #ruby
[14:24:56] skade: has joined #ruby
[14:25:47] agent_white: has joined #ruby
[14:26:20] VeryBewitching: has joined #ruby
[14:27:04] jfabre_: has joined #ruby
[14:29:45] drewo: has joined #ruby
[14:31:35] jsp: has joined #ruby
[14:32:14] edwinvdgraaf: has joined #ruby
[14:32:15] maxxe: has joined #ruby
[14:33:23] chipotle: has joined #ruby
[14:34:45] ChiefAlexander: has joined #ruby
[14:34:48] synthroid: has joined #ruby
[14:35:26] snowy: has joined #ruby
[14:35:41] cdg: has joined #ruby
[14:35:55] `tim`: has joined #ruby
[14:36:32] nankyokusei: has joined #ruby
[14:38:01] aufi: has joined #ruby
[14:39:44] mtkd: has joined #ruby
[14:44:18] skweek: has joined #ruby
[14:45:45] Zamyatin: has joined #ruby
[14:47:24] Zamyatin: has joined #ruby
[14:48:38] MadWasp: has joined #ruby
[14:48:55] tAn: has joined #ruby
[14:49:13] MadWasp: hi, is there any documentation on how a gem server works internally? like an api you’d have to provide when writing your own server
[14:49:30] kareeoleez: has joined #ruby
[14:49:31] Tyrant_: has joined #ruby
[14:51:00] jhass: rubygems.org is open source https://github.com/rubygems/rubygems.org/blob/master/config/routes.rb
[14:51:41] SilverKey: has joined #ruby
[14:52:02] inukshuk_: has joined #ruby
[14:52:36] DynamicMetaFlow: has joined #ruby
[14:53:02] karmatr0n: has joined #ruby
[14:53:05] kareeoleez: has joined #ruby
[14:53:22] dubin: it's gpl tho
[14:54:05] startupality: has joined #ruby
[14:54:10] MadWasp: so it’s a subset of the v1 namespace?
[14:54:24] jhass: dubin: where you read that?
[14:54:49] MadWasp: „RubyGems.org uses the MIT license.“
[14:55:07] kareeoleez: has joined #ruby
[14:55:09] jhass: MadWasp: you probably should copy the whole API to be safe
[14:55:19] jhass: regarding bundler uses and so
[14:56:00] MadWasp: webhooks, activity and search?
[14:56:26] jhass: well not the former too, I'd expect search to be used by gem list -r / gem search though
[14:58:01] jhass: http://guides.rubygems.org/rubygems-org-api/ some docs here I'd go by the code though tbh
[14:58:08] chouhoulis: has joined #ruby
[14:58:27] M-Technic: has joined #ruby
[14:58:34] sunya7a: has joined #ruby
[14:58:41] MadWasp: so i’d need to implement Gem Methods and Gem Version Methods from the api docs?
[14:58:46] sunya7a_: has joined #ruby
[14:58:58] isomorphismes: has joined #ruby
[14:59:03] manveru: MadWasp: also look at gem-in-a-box :)
[15:00:18] jhass: MadWasp: you can also ready rubygems' source and look what's called when ;) https://github.com/rubygems/rubygems
[15:00:34] kareeole_: has joined #ruby
[15:00:42] ftj: has joined #ruby
[15:01:07] codeurge: has joined #ruby
[15:01:29] flughafen_: has joined #ruby
[15:01:32] ljames: has joined #ruby
[15:03:49] stunder: has joined #ruby
[15:04:49] manveru: yeah... unless you want to support bundler :)
[15:05:30] cpruitt: has joined #ruby
[15:05:30] kareeoleez: has joined #ruby
[15:06:19] jhack: has joined #ruby
[15:06:40] aegis3121: has joined #ruby
[15:06:47] astrobunny: has joined #ruby
[15:10:06] Sp4rKy: has joined #ruby
[15:11:17] dANOKELOFF: has joined #ruby
[15:11:38] ftj: has joined #ruby
[15:11:44] bronson: has joined #ruby
[15:13:18] DynamicM`: has joined #ruby
[15:13:34] DynamicM`: has left #ruby: ()
[15:15:23] kareeole_: has joined #ruby
[15:16:19] chouhoul_: has joined #ruby
[15:17:07] chopin: has joined #ruby
[15:17:08] nareiber: has joined #ruby
[15:18:27] chopin_: has joined #ruby
[15:24:25] neanderslob: has joined #ruby
[15:25:18] Coldblackice: has joined #ruby
[15:28:36] allcentury: has joined #ruby
[15:28:42] Labaleine: has joined #ruby
[15:29:59] jaruga___: has joined #ruby
[15:32:34] stunder: has joined #ruby
[15:32:41] labaleine_: has joined #ruby
[15:33:02] mikecmpbll: has joined #ruby
[15:33:31] mikecmpbll: eeuughg, rspec.
[15:34:03] mikecmpbll: i just want to skip this whole test context for a while, without deleting it.
[15:34:18] zacts: morning rubyists
[15:34:29] Es0teric: has joined #ruby
[15:35:11] phrozen77: has joined #ruby
[15:36:14] DynamicMetaFlow: has joined #ruby
[15:36:40] chromis: has joined #ruby
[15:37:36] rippa: has joined #ruby
[15:38:50] thirax: has joined #ruby
[15:39:01] startupality: has joined #ruby
[15:39:53] smathy: has joined #ruby
[15:40:14] TomyLobo: has joined #ruby
[15:43:02] wilbert: has joined #ruby
[15:43:12] riobe: has joined #ruby
[15:46:18] Masonn: has joined #ruby
[15:47:33] m_antis: has joined #ruby
[15:48:15] shevy: yo zacts yo thirax
[15:48:18] jwren: has joined #ruby
[15:50:20] zacts: yo yo! =)
[15:50:29] zacts: shevy: two ch's to go
[15:50:42] zacts: I'm going to be making a simple Sinatra web server today
[15:51:01] gregf_: er, server or app :)
[15:52:05] dsea: has joined #ruby
[15:52:08] purrkode: has joined #ruby
[15:52:40] kareeoleez: has joined #ruby
[15:53:24] dsea: has joined #ruby
[15:54:03] amclain: has joined #ruby
[15:54:32] pawnbox: has joined #ruby
[15:55:23] araujo: has joined #ruby
[15:55:24] araujo: has joined #ruby
[15:55:37] bluOxigen: has joined #ruby
[15:55:58] whathappens: has joined #ruby
[15:56:02] drewo: has joined #ruby
[15:59:39] kareeoleez: has joined #ruby
[16:00:25] norc: has joined #ruby
[16:01:10] riobe_: has joined #ruby
[16:01:11] norc: There was a module/class that had constants for the C sizeof of various internal types. Can someone give me a pointer at what Im looking for?
[16:01:27] zacts: gregf_: oops s/server/app/
[16:02:12] diegoaguilar: has joined #ruby
[16:02:13] norc: Ah. They are in Fiddle after all. Must have looked at the wrong page.
[16:02:32] perlgod_: has joined #ruby
[16:03:54] diegoaguilar: has joined #ruby
[16:04:28] moeabdol: has joined #ruby
[16:04:31] diegoaguilar: has joined #ruby
[16:04:38] synthroid: has joined #ruby
[16:04:41] startupality: has joined #ruby
[16:05:04] wrkrcoop: has joined #ruby
[16:05:22] wrkrcoop: how can i get my json objects printed in my console in a readable way?
[16:05:26] diegoaguilar: has joined #ruby
[16:05:43] apeiros: ?jsonobject
[16:05:43] ruby[bot]: there is no such thing as a JSON object. You either have a String containing serialized JSON, or you have ruby objects (usually Hashes/Arrays/Strings). Which is it?
[16:05:52] apeiros: @ wrkrcoop ^
[16:05:55] stunder001: has joined #ruby
[16:06:04] morenoh149: has joined #ruby
[16:06:07] wrkrcoop: apeiros: can u repeat that i cleared the chat room
[16:06:15] apeiros: ?logs wrkrcoop
[16:06:15] ruby[bot]: wrkrcoop: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[16:06:27] apeiros: (no, no I can't)
[16:06:50] zacts: oh that's interesting re: JSON, I didn't realize this
[16:07:00] wrkrcoop: i guess i want to print my objects in a way that they are readable
[16:07:04] wrkrcoop: not all smushed together
[16:07:08] `derpy: http://ruby-doc.org/core-2.3.0/Kernel.html#method-i-p, http://ruby-doc.org/stdlib-2.3.0/libdoc/irb/rdoc/IRB/Notifier/AbstractNotifier.html#method-i-pp
[16:07:13] apeiros: pp obj # needs require 'pp'
[16:07:16] adaedra: no bad `derpy
[16:07:16] karmatr0n: has joined #ruby
[16:07:23] zacts: apeiros: p obj does, puts obj.inspect right?
[16:07:36] apeiros: zacts: simply put yes. it's slightly different, tho
[16:07:43] Devalo: has joined #ruby
[16:07:54] norc: zacts: It is amusing that people all over are serializing objects without understanding what they are doing, possibly even why. :)
[16:07:59] norc: (No insult intended)
[16:08:13] wrkrcoop: ppwait how do i do it?
[16:08:23] zacts: norc: I'm still a newbie, so I'm just learning
[16:08:29] adaedra: zacts: p also returns the object, which allows you to just drop it to debug
[16:08:43] manveru: >> require 'pp'; pp %w[oh hai]
[16:08:44] ruby[bot]: manveru: # => ["oh", "hai"] ...check link for more (https://eval.in/572750)
[16:08:44] adaedra: http://www.rubydoc.info/stdlib/pp/PP#pp-class_method
[16:08:57] norc: zacts: Usually the need to serialize objects comes fairly early when solving the usual problems in books.
[16:09:13] zacts: norc: it's the last ch of my book
[16:09:19] zacts: I'm not there yet, but will get there
[16:09:41] norc: Alright gotta catch a train, be back later.
[16:09:55] manveru: >> require 'json'; JSON.pretty_unparse(%w[oh hai])
[16:09:56] ruby[bot]: manveru: # => "[\n \"oh\",\n \"hai\"\n]" (https://eval.in/572752)
[16:10:11] dh64: has joined #ruby
[16:10:12] manveru: that one is fun too, if you want to output pretty json
[16:10:43] manveru: i still have no clue why they chose such a weird name though
[16:11:25] dionysus69: has joined #ruby
[16:11:33] wrkrcoop: soo pp comes with standard library?
[16:12:27] manveru: stdlib is full of fun and scary things
[16:12:29] hutch34: has joined #ruby
[16:12:34] wrkrcoop: so require ‘pp’ then pp(obj)?
[16:12:42] howdoi: has joined #ruby
[16:12:54] manveru: do you know about irb?
[16:13:59] ruby[bot]: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[16:14:35] manveru: yeah, but pry is not in stdlib
[16:14:55] manveru: you can pry irb from my dead cold hands :P
[16:14:59] DynamicM`: has joined #ruby
[16:15:36] CJKinni: has joined #ruby
[16:16:12] ule: has joined #ruby
[16:17:03] nettoweb: has joined #ruby
[16:18:08] KINGSABRI_: has joined #ruby
[16:18:10] kareeoleez: has joined #ruby
[16:19:18] apeiros: manveru: no worries. you can keep it ;-p
[16:21:14] adaedra: pry > irb by a landslide.
[16:21:51] mistermocha: has joined #ruby
[16:22:59] riobe_: has joined #ruby
[16:22:59] Labaleine: has joined #ruby
[16:22:59] ChiefAlexander: has joined #ruby
[16:23:29] tubbo: irb is still useful to learn
[16:23:43] tubbo: in cases where pry is not an option
[16:23:46] astrobunny: has joined #ruby
[16:23:57] thirax: has left #ruby: ("Leaving")
[16:24:09] Labaleine: Hello ! I want to delete a task from an array which is quite easy arr.delete(x). But it is actually not working in my code. The only way I find is to put an index to my array and then use delete_at. But I don't want this.
[16:24:30] horaceheaven: has joined #ruby
[16:24:33] toretore: ?code labaleine
[16:24:34] ruby[bot]: labaleine: We can't help you without your code, please post it to https://gist.github.com
[16:24:39] Labaleine: I specifically want the user to type exactly what needs to be deleted
[16:24:39] ferr: has joined #ruby
[16:24:47] blackmesa: has joined #ruby
[16:24:57] noService: has joined #ruby
[16:25:05] Labaleine: https://gist.github.com/anonymous/d3d82d2e6f547be88096e6c8fe423553
[16:25:12] toretore: labaleine: user input => String, your value = ?
[16:25:20] moeabdol: has joined #ruby
[16:26:17] Gasher: has joined #ruby
[16:26:57] DynamicM`: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[16:27:34] Labaleine: Maybe I am doing it in a wrong way or its not working
[16:28:56] kareeoleez: has joined #ruby
[16:29:05] toretore: labaleine: your array inside List has Tasks, you are asking it to delete a String
[16:29:22] toretore: Task.new('a string') != 'a string'
[16:30:14] toretore: and Task.new('a string') != Task.new('a string') because Task doesn't specify how to compare it to another Task
[16:31:11] apeiros: (which means it'll use identity comparison, aka Object#equal? - in case anybody wonders)
[16:31:26] sumobob: has joined #ruby
[16:32:01] Guest38: has joined #ruby
[16:32:01] Labaleine: hum I think i got
[16:32:17] toretore: (which is basically (or exactly?) obj1.object_id == obj2.object_id)
[16:33:23] ctp: has joined #ruby
[16:33:46] rbennacer: has joined #ruby
[16:34:07] phrozen77_: has joined #ruby
[16:34:24] chouhoulis: has joined #ruby
[16:34:31] mog: has joined #ruby
[16:34:34] skade: has joined #ruby
[16:34:50] mog: hi i am trying to build a bundle and it gets tuck on a package Gem::InstallError: string-scrub requires Ruby version < 2.1, >= 1.9.3.
[16:34:57] mog: but i am running ruby 2.0
[16:34:58] Labaleine: ok thanks !
[16:35:04] mog: so not sure why i keep getting that error
[16:35:40] danostrowski: has joined #ruby
[16:36:26] riobe_: has joined #ruby
[16:36:34] skarrg: has joined #ruby
[16:36:38] emilkarl: has joined #ruby
[16:37:21] nankyokusei: has joined #ruby
[16:37:21] manveru: adaedra: i use pry mostly when i want to set a breakpoint, but otherwise i don't see how it's much better
[16:38:09] apeiros: mostest hugestest timesaver ever
[16:38:39] perlgod: has joined #ruby
[16:39:02] cdg: has joined #ruby
[16:39:08] apeiros: I guess ls is also nice, though I'd love a toned down version for crazy bananas like everything-rails
[16:40:30] Papierkorb: also pry-coolline
[16:40:36] zacts: when to use regex and when not to (I do know HTML should NOT use regex)
[16:41:01] Papierkorb: zacts: don't use regexes, except if you have to ..? That question is too vague
[16:42:00] eam: generally, use regex when matching patterns of text is called for
[16:42:06] shevy: regex all the things!
[16:43:33] apeiros: use regex to determine whether an integer is prime
[16:43:38] Zamyatin: has joined #ruby
[16:43:41] apeiros: for everything else, use ordinary string stuff
[16:43:57] banister: has joined #ruby
[16:44:28] zast: has joined #ruby
[16:45:01] wrkrcoop: has joined #ruby
[16:45:40] kareeoleez: has joined #ruby
[16:46:13] ramfjord: has joined #ruby
[16:46:57] perlgod: has joined #ruby
[16:48:37] Dimik: has joined #ruby
[16:50:23] codecop: has joined #ruby
[16:50:36] arlek: has joined #ruby
[16:51:19] Madplatypus: has joined #ruby
[16:51:32] tatsuo: has joined #ruby
[16:54:19] mwlang: has joined #ruby
[16:54:30] aegis3121: has joined #ruby
[16:54:46] izzimus: has joined #ruby
[16:54:52] Cohedrin: has joined #ruby
[16:55:28] shevy: zacts are you very pleased with these answers
[16:55:49] norc: has joined #ruby
[16:55:57] mikecmpbll: has joined #ruby
[16:56:04] norc: >> class Object; def f; end; end; "".f
[16:56:06] ruby[bot]: norc: # => nil (https://eval.in/572776)
[16:56:09] horaceheaven: has joined #ruby
[16:56:18] norc: Brr. https://repl.it/CRnD doesn't let me do this. :(
[16:56:41] riobe_: has joined #ruby
[16:56:53] AndroidLoverInSF: has joined #ruby
[16:57:37] xue: has joined #ruby
[16:59:01] drewo: has joined #ruby
[16:59:31] ChiefAlexander: has joined #ruby
[17:00:30] codecop: has joined #ruby
[17:01:16] jhass: can we throw repl.it into the trashcan already?
[17:02:02] malconis: has joined #ruby
[17:02:48] ullu: I find this curious: h = Hash.new([]); h[:one] << "foo"; h[:two] << "bar" # => ["foo","bar"]
[17:02:58] ullu: h.class # => Hash
[17:03:13] ullu: what happened to the keys?
[17:03:37] jhass: ullu: Hash doesn't clone #default, it just assigns the same object
[17:03:38] ullu: or is the array the key?
[17:03:49] kareeoleez: has joined #ruby
[17:04:08] norc: ullu, it becomes more obvious this way:
[17:04:43] skolman_: has joined #ruby
[17:05:15] riobe_: has joined #ruby
[17:05:33] aegis3121: The key :one doesnt exist, so it pulls up its default and pushes that in there. The key :two doesn't exist so it pulls up its default (the same Array) and pushes them into there. None of these are assignments, so it's never assigned.
[17:05:39] ullu: jhass: so the key refs are essentially ignored/absorbed?
[17:05:50] mog: has left #ruby: ("Leaving")
[17:05:55] jhass: no, I'm not sure what you're going at with the keys
[17:06:04] norc: >> ary = []; h = Hash.new(ary); h[:one] << "foo"; h[:two] << "bar"; p ary # ullu
[17:06:05] riobe_: has joined #ruby
[17:06:05] ruby[bot]: norc: # => ["foo", "bar"] ...check link for more (https://eval.in/572786)
[17:06:20] jhass: >> h = Hash.new([]); h[:one] << "foo"; h[:two] << "bar"; h.keys
[17:06:21] ruby[bot]: jhass: # => [] (https://eval.in/572787)
[17:06:23] ullu: aegis3121: ahh, ok that makes sense!
[17:06:25] aegis3121: Yea. if you want a default of an empty array for each, you'd need Hash.new { |h, k| h[k] = [] }
[17:06:36] jhass: oh wait, #default does not create the keys, right
[17:06:41] jhass: always forgetting that
[17:06:43] dionysus70: has joined #ruby
[17:06:55] kobain: has joined #ruby
[17:07:03] aegis3121: >> h = Hash.new { |h, k| h[k] = [] }; h[:a] << 'harold'; h[:c] << 'carrot'; puts h
[17:07:04] ruby[bot]: aegis3121: # => {:a=>["harold"], :c=>["carrot"]} ...check link for more (https://eval.in/572788)
[17:07:13] emilkarl: has joined #ruby
[17:07:19] ullu: aegis3121: interesting behavior
[17:08:13] norc: https://eval.in/572789 # jhass all I wanted is try this in repl.it :(
[17:08:14] aegis3121: That creates a new array for each default and then allows you to mutate that instance of an array
[17:08:19] norc: ACTION had this brilliant idea today.
[17:08:29] jhass: >> h = Hash.new; b = [h[:foo], h.default]; h.default = 1; [b, [h[:foo], h.default]]
[17:08:35] ruby[bot]: jhass: I'm terribly sorry, I could not evaluate your code because of an error: OpenURI::HTTPError:500 Internal Server Error
[17:08:43] djbkd: has joined #ruby
[17:09:04] jhass: >> h = Hash.new; b = [h[:foo], h.default]; h.default = 1; [b, [h[:foo], h.default]]
[17:09:05] ruby[bot]: jhass: # => [[nil, nil], [1, 1]] (https://eval.in/572791)
[17:09:21] jhass: ullu: ^ Hash.new's first argument is simply setting #default
[17:09:28] jhass: #default's value is returned for missing keys
[17:10:33] jhass: norc: crashes ruby if you try to access an instance var the other doesn't have, right?
[17:10:48] ullu: ACTION schooled on hashes 
[17:11:24] norc: jhass, nope. Instance variables will return nil if not defined.
[17:11:53] norc: jhass, but if the classes are not compatible this will very quickly crash you are correct.
[17:12:22] ullu: jhass: yes, I was aware of the default arg, but the behavior threw me -- thanks to y'all for clarifying
[17:12:50] kareeoleez: has joined #ruby
[17:13:09] last_staff: has joined #ruby
[17:13:21] norc: jhass, though the more I think about it, I cannot see a reason this should ever crash.
[17:14:09] bronson: has joined #ruby
[17:14:11] v0dro: has joined #ruby
[17:14:38] norc: All the rbasic klass is used for is method dispatch, and some interrogation like #ancestors.
[17:14:55] mtkd: has joined #ruby
[17:15:12] norc: It will probably cause problems if your class has its own allocator though.
[17:15:57] mozzarella: has joined #ruby
[17:16:11] Symbiosisz: has joined #ruby
[17:16:38] ullu: norc: your example above prints [] (empty array) -- now I'm confused again, is the default val not getting populated because no key assignments have been made?
[17:16:45] mog: has joined #ruby
[17:16:50] riobe_: has joined #ruby
[17:17:10] mog: how do i point bundle to my rubygems dir properly?
[17:17:21] shinnya: has joined #ruby
[17:17:22] mog: it keeps trying to find gems in my system dir
[17:17:29] mog: but not where it actually installed them
[17:17:36] norc: ullu, check your code. You didnt paste it right if you got an empty array.
[17:17:37] dionysus69: has joined #ruby
[17:17:39] ruby-lang745: has joined #ruby
[17:17:45] norc: >> ary = []; h = Hash.new(ary); h[:one] << "foo"; h[:two] << "bar"; p ary # ullu
[17:17:46] ruby[bot]: norc: # => ["foo", "bar"] ...check link for more (https://eval.in/572799)
[17:18:00] norc: As ruby[bot] told you, the object that ary points at is quite populated.
[17:18:12] spider-mario: has joined #ruby
[17:18:37] ullu: norc: my bad -- mixed up my names on the hash variable
[17:18:44] codeurge: has joined #ruby
[17:18:59] norc: >> ary = []; h = Hash.new(ary); p [h[:a].__id__, ary.__id__] # ullu
[17:19:00] ruby[bot]: norc: # => [545721700, 545721700] ...check link for more (https://eval.in/572805)
[17:19:17] jhass: mog: bundler should respect GEM_HOME and I'd expect it to respect GEM_PATH too
[17:19:18] norc: This is proof that they are in fact pointing at the same object.
[17:19:27] mog: i have gem_home set
[17:19:32] mog: not gem_path though
[17:19:43] ullu: norc: got it, thanks
[17:21:04] norc: jhass, okay okay. Apparently instance variable access is... dubious. Looks like I have to dig some.
[17:22:06] GinoManWorks: has joined #ruby
[17:22:06] kareeoleez: has joined #ruby
[17:22:34] mog: jhass, that did nt do it , still looking for json in systemdir
[17:22:35] mozzarel1: has joined #ruby
[17:22:44] norc: Wow. When did +@ get added to Ruby?! Has this always been there?
[17:23:11] marr: has joined #ruby
[17:23:21] jhass: as long as I can remember
[17:23:39] apeiros: for things like x = +y
[17:23:44] norc: I have never. Ever seen this being used in production code anywhere.
[17:23:45] tatsuo: has joined #ruby
[17:23:52] ChiefAlexander: has joined #ruby
[17:24:02] norc: apeiros, mmm. Math libraries?
[17:24:10] jhass: yes, math
[17:24:10] wldcordeiro: has joined #ruby
[17:24:20] jhass: -@ is a thing too
[17:24:30] eam: I've seen it used accidentally, when people put a newline after an operand instead of after an operator in a long math expression ...
[17:24:49] norc: Makes sense.
[17:24:49] eam: the funny thing about stuff like -@ is it's only sometimes a method
[17:25:21] norc: asm>> puts 1 + (-2)
[17:25:26] ruby[bot]: norc: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:25:36] eam: >> class Fixnum; def -@; 5; end; end; x = 7; [-7, -(7), - 7, -x]
[17:25:45] norc: ruby[bot], give me a stack trace, sucker. :(
[17:25:55] eam: why does the bot hate me
[17:26:22] mog: fixed it
[17:26:28] mog: i was using system bundler somehow
[17:26:53] eam: has joined #ruby
[17:27:02] eam: >> class Fixnum; def -@; 5; end; end; x = 7; [-7, -(7), - 7, -x]
[17:27:05] norc: eam, that makes sense. -7 should be handled by the lexer.
[17:27:08] ruby[bot]: eam: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:27:09] eam: norc: yeah
[17:27:18] eam: wow, bot's hosed
[17:30:26] norc: eam: # => [-7, 5, 5, 5] ...check link for more (https://eval.in/572813)
[17:30:44] norc: If I take over this job, do you think apeiros will pay me?
[17:31:02] eam: I'll pay attention, how about that
[17:31:04] hahuang65: has joined #ruby
[17:31:59] adaedra: manveru: coloration, completion, $ and ? like apeiros said, ls, and binding.pry invocation
[17:32:13] eam: +@ and -@ are super dangerous, I think, considering the unreliable behavior of them being parsed as methods
[17:32:20] m_antis: has joined #ruby
[17:32:36] eam: a non issue if you don't touch 'em I mean, but if you do ...
[17:32:59] skade: has joined #ruby
[17:33:09] norc: It immediately became clear they could be abused to a great extend to write obfuscated code.
[17:34:09] saush: has joined #ruby
[17:34:42] rbennacer: has joined #ruby
[17:36:00] MEATCHICKEN: has joined #ruby
[17:37:12] karmatr0n: has joined #ruby
[17:38:03] saush: I followed ruby repo on github and wanted to know how is a new version released? As in, whenever someone contributes it goes on the truck branch now. So what happens when a new version has to be released?
[17:38:49] apeiros: I ducked something up in the user & channel manager. after a while its track of the users starts to become incorrect
[17:39:11] SilverKey: has joined #ruby
[17:39:30] eam: saush: https://github.com/ruby/ruby/releases
[17:40:08] eam: ruby is authoritatively developed out of a subversion repo, but the info is mirrored over to github
[17:40:25] kareeoleez: has joined #ruby
[17:40:39] eam: there are release tags in most SCM systems
[17:41:22] eam: afaik the ruby on github uses trunk instead of master because of svn
[17:42:53] symm-: has joined #ruby
[17:43:32] nofxx: has joined #ruby
[17:43:43] ramfjord: has joined #ruby
[17:45:52] saush: eam: I see that that there are branches made such as ruby_2_2, ruby_2_3 etc. So at the time of release all the commits from trunk have to be merged with this branches. Is this the way it is?
[17:47:07] mog: rake cant seem to find my gems LoadError: cannot load such file -- google/api_client
[17:47:23] mog: even though it was running from within my gems /home/mog/rubygems/gems/rake-11.1.2/bin/rake:33:in `<top (required)>'
[17:48:33] eam: saush: usually the way to reason about it is tagging a particular point on trunk
[17:48:59] jhass: mog: it sounds like you're reinventing chruby/rvm/rbenv
[17:49:13] trav408: has joined #ruby
[17:49:20] jhass: or chgems at least
[17:50:26] mog: i dont have root on this box so i set the gems dir to my home dir
[17:50:41] mog: but it doesnt seem like its looking correctly when rake is run
[17:50:42] jackjackdripper: has joined #ruby
[17:51:47] giz|work: has joined #ruby
[17:51:57] mog: my gem env looks right too
[17:52:47] drewo: has joined #ruby
[17:53:03] jhass: mog: might be easier to just bundle install --path vendor/bundle and bundle exec everything
[17:53:51] mog: trying that now
[17:54:47] oetjenj: has joined #ruby
[17:57:33] Devalo: has joined #ruby
[17:57:46] emilkarl: has joined #ruby
[17:58:01] brendan-: has joined #ruby
[17:58:40] kareeoleez: has joined #ruby
[17:59:35] IrishGringo: has joined #ruby
[17:59:38] mog: jhass, same thing http://pastebin.com/ZMezykkM
[17:59:38] ruby[bot]: mog: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/9c2256902b3a376262ce3fc5b66da0aa
[17:59:40] ruby[bot]: mog: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[18:00:02] mog: oh thanks ruby[bot] wont do it again.
[18:00:22] jhass: mog: then whatever gem provides that (google-api_client ?) is not in your Gemfile
[18:00:26] Yiota: has joined #ruby
[18:00:29] mdw: has joined #ruby
[18:00:44] mog: gem "google-api-client", require: 'google/api_client'
[18:00:50] mog: is in my gemfile
[18:02:07] nofacade: has joined #ruby
[18:02:27] opaqe: has joined #ruby
[18:02:28] mog: and the file is in the bundler dir
[18:02:49] blandflakes: has joined #ruby
[18:03:10] opaqe: has left #ruby: ("Leaving")
[18:04:54] ramfjord: has joined #ruby
[18:05:04] sumobob: has joined #ruby
[18:05:37] skolman_: has joined #ruby
[18:06:34] morenoh149: has joined #ruby
[18:07:50] banister: has joined #ruby
[18:09:13] moeabdol: has joined #ruby
[18:09:30] stunder001: has joined #ruby
[18:11:05] mikecmpbll: has joined #ruby
[18:12:22] blackmesa: has joined #ruby
[18:13:00] skalfyfan: has joined #ruby
[18:13:57] djbkd: has joined #ruby
[18:13:58] shevy: do you people write a lot of boilerplate for your classes? or are you classes minimalistic
[18:15:59] Zarthus: i write far too much and complete far too little
[18:16:21] Zarthus: i divide my classes like I'm writing java, not ruby.
[18:16:26] Zarthus: ¯\_(ツ)_/¯
[18:16:28] chosen1: has joined #ruby
[18:16:43] kareeoleez: has joined #ruby
[18:17:18] purrkode: has joined #ruby
[18:17:22] nofxx: Zarthus, I often don't believe it's working... so few lines =D
[18:17:39] shevy: Zarthus yeah I am noticing that in my classes too
[18:17:49] aegis3121: has joined #ruby
[18:17:50] shevy: not just the code itself though, also more and more comments and structures within the comments
[18:17:56] nofxx: then, "exceptions" make it ugly... haha noticed? 80% of the code for 5% of the problem? only the exception
[18:18:07] nofxx: yeah, worst than paretto
[18:18:19] Zarthus: I do a lot of comments when they're necessary
[18:18:50] B1n4r10: has joined #ruby
[18:18:54] Zarthus: but if my class is about keeping a list of potatoes on Jerries farm, just a class named PotatoList should give a sufficient description of what it is
[18:18:59] yfeldblum: has joined #ruby
[18:19:20] nofxx: use rubocop/lint integrated on your editor, I'm coding way better with yellow/red arrows next to the line number
[18:19:42] finisherr: has joined #ruby
[18:19:46] Zarthus: the rubocop intelij plugin doesn't work on windows
[18:20:00] nofxx: emacs ftw
[18:20:23] norc: Zarthus, so you try to adhere to the Law of Demeter? Java strongly encourages Wrapper classes ontop of Factories ontop of Wrappers classes to its extremes...
[18:20:36] Zarthus: nah, not that much
[18:20:46] finisherr: has joined #ruby
[18:21:38] rbennacer: has joined #ruby
[18:21:41] mistermocha: has joined #ruby
[18:22:56] shevy: yeah the editor helps but it's still more on the wall of text to look at :(
[18:23:04] ramfjord: has joined #ruby
[18:23:21] Zarthus: if i didn't like writing i wouldn't be on irc
[18:23:50] Zarthus: if anything bugs me it's that ruby doesn't have multiline comments
[18:24:02] aegis3121: it does, they just aren't pretty
[18:24:22] jhass: when are multiline comments pretty anyway
[18:24:25] jhass: get a proper editor
[18:24:32] astrobunny: has joined #ruby
[18:24:44] Zarthus: helps write multiline comments, yo
[18:25:12] shevy: irc is a lot easier than coding!
[18:25:15] Zarthus: I just miss the /**<enter> from my editor I guess for automatically generating documentation
[18:26:26] startupality: has joined #ruby
[18:26:28] danostrowski: has joined #ruby
[18:26:50] kirun: has joined #ruby
[18:29:07] jackjackdripper: has joined #ruby
[18:32:58] tatsuo: has joined #ruby
[18:35:09] kareeoleez: has joined #ruby
[18:35:40] ramfjord: has joined #ruby
[18:36:53] sergey_makagon: has joined #ruby
[18:36:54] nanoz: has joined #ruby
[18:37:19] kareeoleez: has joined #ruby
[18:38:01] jackjackdripper1: has joined #ruby
[18:38:12] nankyokusei: has joined #ruby
[18:44:32] tildes_: has joined #ruby
[18:46:34] halfamind: has joined #ruby
[18:46:35] Masonn: has joined #ruby
[18:46:44] symm-: has joined #ruby
[18:49:30] banister: has joined #ruby
[18:52:18] wrkrcoop: has joined #ruby
[18:54:18] skade: has joined #ruby
[18:55:40] banister: has joined #ruby
[18:55:43] weaksauce: has joined #ruby
[18:56:58] bluOxigen: has joined #ruby
[18:58:59] geekbri: has joined #ruby
[19:00:12] dionysus69: has joined #ruby
[19:00:24] Regulati_: has joined #ruby
[19:00:39] hightower2: has joined #ruby
[19:00:57] ramfjord: has joined #ruby
[19:02:23] johnathon: has joined #ruby
[19:02:31] minimalism: has joined #ruby
[19:02:38] maucar: has joined #ruby
[19:05:10] tAn: has joined #ruby
[19:05:28] asher128__: has joined #ruby
[19:05:51] asher128__: Hi I'm a beginner. Can you please tell me what the unless does here: has_command(:puppet, puppet_path) unless puppet_path.nil?
[19:06:05] asher128__: I need to adapt it and use if instead of unless
[19:07:18] tao_: has joined #ruby
[19:08:12] CloCkWeRX: has joined #ruby
[19:10:24] weaksauce: it runs that line unless the puppet_path variable is nil.
[19:10:30] Zarthus: asher128__: unless is a negation. It means 'if !puppet_path.nil?'
[19:10:53] Zarthus: converting it to use an if is redundant
[19:10:55] asher128__: weaksauce, ok, i'll use if !puppet_path.nil?
[19:11:05] asher128__: weaksauce, zenguy_pc thank you guys
[19:11:06] Zarthus: why the arbitrary change?
[19:11:44] shevy: asher128__ if puppet_path
[19:11:54] asher128__: shevy, yeah it is simpler :)
[19:12:45] asher128__: weaksauce, zenguy_pc, shevy, Zarthus: I'm a Python programmer and I'm thinking about learning ruby. What are, for you guys, the advantages of Ruby over Python?
[19:13:01] weaksauce: insignificant whitespace
[19:13:01] shevy: I found that my brain needs a bit longer for "unless" statements... my brain works faster with "if"
[19:13:17] xall: has joined #ruby
[19:13:33] asher128__: shevy, you are not the only one :)
[19:13:34] weaksauce: sane package manager
[19:13:38] shevy: asher128__ you can model ruby how you think
[19:14:03] asher128__: shevy, is it because there is not 1 way to do something? you are free to do things as you want?
[19:14:03] shevy: the whole rails ecosystem sorta is like that - a way to think
[19:14:20] shevy: perl has the same philosophy but I always found it to get into my way
[19:14:48] shevy: I even kept on stumbling over forgetting to use a ";" as line terminator every now and then
[19:15:04] weaksauce: asher128__ everything is an object and you can metaprogram things to do what you want (to your own downfall sometimes)
[19:15:25] asher128__: weaksauce, everything is an object on Python too
[19:15:39] asher128__: weaksauce, what I want to know is what is the big advantage of ruby
[19:15:42] shevy: everything is an object in bioperl too! http://bioperl.org/howtos/SeqIO_HOWTO.html
[19:15:44] asher128__: weaksauce, from your point of you
[19:15:44] weaksauce: ruby is a less rigid way of looking at things.
[19:15:50] shevy: my $seqio_object = Bio::SeqIO->new(-file => $file);
[19:16:00] bronson: has joined #ruby
[19:16:07] shevy: there is so much superfluous content there
[19:16:16] duoi: has joined #ruby
[19:16:26] blackmesa: has joined #ruby
[19:16:37] asher128__: weaksauce, shevy: what about the performance? Some people told me ruby is slower than Python. Is it still the case?
[19:16:49] d0nn1e: has joined #ruby
[19:16:56] asher128__: weaksauce, shevy: is there any way to write C extensions?
[19:17:00] weaksauce: asher128__ it doesn't really matter for 99% of the cases
[19:17:08] weaksauce: and yes c extensions are possible
[19:17:12] asher128__: weaksauce, shevy: is there a GIL like python that limits the threads?
[19:17:19] asher128__: weaksauce, ok
[19:19:00] jhass: oh I never realized python had a GIL too
[19:19:15] emilkarl: has joined #ruby
[19:19:44] shevy: asher128__ do you think that speed matters?
[19:20:02] shevy: we have C!
[19:20:05] shevy: or crystal
[19:20:41] shevy: you will probably find fewer articles these days about speed differences. a lot of the articles originated from the 1.8.x era
[19:20:48] PedramT: has joined #ruby
[19:22:28] asher128__: shevy, ;) yeah speed matter less than before, especially with the CPUs we have
[19:22:38] asher128__: jhass, yeah it has ;)
[19:22:54] toretore: cpus plural
[19:23:10] shevy: sounds like a tooth paste
[19:24:55] davedev24: has joined #ruby
[19:25:47] tildes_: has joined #ruby
[19:26:00] jhack_: has joined #ruby
[19:26:47] wrkrcoop: my teammate is trying to use each loop and im saying use reduce, we are trying to filer an array
[19:26:54] wrkrcoop: is reduce better because it saves memory?
[19:26:58] wrkrcoop: i need a convincing reason
[19:27:47] toretore: they're the same
[19:29:43] JesseH: has joined #ruby
[19:30:55] jhass: wrkrcoop: use .select because it reads a lot better
[19:31:24] wrkrcoop: jhass: is .each not better than .select / reduce?
[19:31:30] ruby[bot]: "Best" and "better" are subjective. Try to use a different term.
[19:31:44] wrkrcoop: jhass: so reduce select have no benefits over each?
[19:31:58] jhass: they do quite different stuff
[19:32:06] jhass: almost incomparable I'd say
[19:32:46] jhass: for "filtering an array" select/reject are the best because they require the least boilerplate code and read thus a lot better
[19:33:06] snowy: has joined #ruby
[19:33:27] wrkrcoop: jhass: got it
[19:34:03] nareiber: has joined #ruby
[19:37:55] noService: has joined #ruby
[19:40:15] curses: has joined #ruby
[19:41:32] brunto: has joined #ruby
[19:41:46] ma489: has joined #ruby
[19:42:01] blackmesa: has joined #ruby
[19:43:06] weaksauce: asher128__ the best reason to use ruby is because exit works and doesn't give you a snarky response
[19:45:28] whathappens: has joined #ruby
[19:46:09] ctp: has joined #ruby
[19:46:20] hutch34: has joined #ruby
[19:46:33] brunto: has joined #ruby
[19:47:03] skolman_: has joined #ruby
[19:47:41] Devalo: has joined #ruby
[19:51:20] yfeldblum: has joined #ruby
[19:52:59] dopie: has joined #ruby
[19:53:31] johnny56_: has joined #ruby
[19:55:17] stunder001: has joined #ruby
[19:55:37] harrymoreno: has joined #ruby
[19:56:48] noobsu: has joined #ruby
[19:59:55] S1kx: has joined #ruby
[20:00:22] impi0us: has joined #ruby
[20:01:19] impi0us: has left #ruby: ()
[20:02:44] flashpoint9: has joined #ruby
[20:03:50] Asher: has joined #ruby
[20:04:07] flashpoint9: has joined #ruby
[20:04:19] blackthor: has joined #ruby
[20:05:14] zacts: shevy: this opal looks cool for Ruby -> JavaScript
[20:05:17] ur5us: has joined #ruby
[20:05:23] zacts: I might try to make some Atom editor plugins with Opal
[20:05:51] tgeeky: hmm... I must be missing something. How does one load a .rb file into IRB (or pry, in this case), and keep the context of the file in the interactive sesions?
[20:06:23] tgeeky: it loads the file fine (with require, or -r), runs whatever is in the file, then forgets the context and gives me a blank pry shell
[20:06:45] zacts: I do bash-$ irb -I .
[20:06:50] jhass: tgeeky: better to turn it around, add require "pry"; binding.pry to the file and run the file
[20:07:00] zacts: irb-$ require 'file-without-rb-extension'
[20:07:17] zacts: (perhaps my way isn't the best)
[20:07:38] jhass: zacts: -r does basically that ;)
[20:08:11] jhass: won't let you access local variables from the file, which I gather they want
[20:08:17] tAn: has joined #ruby
[20:08:23] tgeeky: i need to inspect them
[20:08:24] nando293921: has joined #ruby
[20:09:07] tgeeky: ah, so binding.pry is basically a breakpoint
[20:09:18] tgeeky: roger. thanks jhass!
[20:09:31] tgeeky: jhass: out of curiosity, why does the alternate method not show the local context?
[20:09:41] tgeeky: I guess in libraries without any state, it doens't make sense to
[20:09:51] jhass: because local variables at the top level are file local
[20:10:07] jhass: your irb/pry session is basically a new "file"
[20:10:32] tgeeky: jhass: any plugins to make this process killer, or at least better?
[20:10:39] jhass: (unless specially invoked in the context of one, which binding.pry does, Binding describes a scope)
[20:11:12] jhass: tgeeky: I like pry-byebug, pry-rescue, pry-doc and pry-stack_explorer for my debugger pry
[20:12:00] nettoweb: has joined #ruby
[20:13:01] weemsledeux: has joined #ruby
[20:13:31] snowy: has joined #ruby
[20:13:58] nankyokusei: has joined #ruby
[20:15:58] tgeeky: jhass: thanks again. I got them all plus pry-nav.
[20:16:36] jhass: looks like pry-nav recommends to use pry-byebug instead ;)
[20:16:46] tgeeky: oh. yes. pry-nav is old
[20:16:50] tgeeky: it failed lol
[20:17:17] bronson: has joined #ruby
[20:17:20] wrkrcoop: has joined #ruby
[20:18:09] yqt: has joined #ruby
[20:18:13] xall: has joined #ruby
[20:18:27] jancel: has joined #ruby
[20:18:56] Labaleine: has joined #ruby
[20:19:22] duoi: has joined #ruby
[20:20:37] danostrowski: has joined #ruby
[20:21:32] yxhuvud: has joined #ruby
[20:22:03] mdw: has joined #ruby
[20:22:28] purrkode: has joined #ruby
[20:23:18] cdg: has joined #ruby
[20:25:09] skolman__: has joined #ruby
[20:25:24] astrobunny: has joined #ruby
[20:26:40] banister: has joined #ruby
[20:30:38] jhack: has joined #ruby
[20:37:23] dopie: has joined #ruby
[20:39:41] sneakerhax: has joined #ruby
[20:41:45] opus_: has joined #ruby
[20:43:31] mynameisbrian: has joined #ruby
[20:43:49] mynameisbrian: self.each { |current_num| result = yield(result, current_num) }
[20:44:00] mynameisbrian: is there a better way to write that? I don't want each's return value, I want result
[20:44:15] mynameisbrian: so if I write a method, I would have to put result after each
[20:44:34] Papierkorb: mynameisbrian: what is that method supposed to really do?
[20:44:56] mynameisbrian: I'm rewriting it just to learn how to do it
[20:45:26] SilverKey: has joined #ruby
[20:45:42] Papierkorb: mynameisbrian: in that case, looks fine to me. It's a three-liner.
[20:46:00] mynameisbrian: https://gist.github.com/anonymous/9159f68b15edd21aa2729bf98ede7f73
[20:46:24] tjohnson: has joined #ruby
[20:46:40] Papierkorb: Well, that's something /like/ #inject ;)
[20:46:45] danostrowski: has joined #ruby
[20:47:25] mynameisbrian: does inject have other features?
[20:47:53] karmatr0n: has joined #ruby
[20:48:10] mynameisbrian: well yeah it just does that
[20:48:33] Papierkorb: mynameisbrian: http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-inject
[20:48:58] nettoweb: has joined #ruby
[20:51:37] mynameisbrian: yeah mine only handles arrays, I haven't learned about ranges yet
[20:52:27] snowy: has joined #ruby
[20:52:52] bobbycvi: has joined #ruby
[20:53:34] mynameisbrian: well when I added it to Range it still worked for that example
[20:54:10] Labaleine: has joined #ruby
[20:54:32] tgeeky: jhass: it seems that pry-stack_explorer was causing a warning/error, so I removed the gem (someone claimed that byebug provides identical functionality)
[20:54:38] tgeeky: jhass: but now, my binding.pry lines are ignored
[20:54:59] tgeeky: jhass: instead, when pry opens I see a debuger of Pry#evaluate_ruby
[20:55:34] tgeeky: jhass: not actually ignored; if I remove all binding.pry statements, then it just runs cleanly (no output)
[20:55:49] tgeeky: any suggestions? :O
[20:55:52] Papierkorb: mynameisbrian: add it to module Enumerable instead :P
[20:56:08] Don_John: has joined #ruby
[20:56:32] jhass: tgeeky: haven't seen that before, sorry :(
[20:57:12] kaleido: has joined #ruby
[20:57:36] banister: has joined #ruby
[20:59:20] mynameisbrian: yeah I'll try that
[20:59:30] mynameisbrian: do people commonly use loop?
[20:59:34] mynameisbrian: loop do and so on
[20:59:56] Papierkorb: mynameisbrian: I don't need an infinite that often, no. (But when you do, ...)
[21:00:06] Papierkorb: *infinite loop
[21:00:15] riobe__: has joined #ruby
[21:01:12] jhack: has joined #ruby
[21:01:19] mynameisbrian: I see, thanks for all the info Papierkorb
[21:01:42] mistermocha: has joined #ruby
[21:01:48] mynameisbrian: I need to find another learning resource. I'm using Perl Monk, when I'm finished, I'll read a book or something
[21:01:57] mynameisbrian: I'm only on the beginnner of Perl Monk right now though
[21:02:14] Papierkorb: mynameisbrian: Begin building something cool and then learn on the way what you're missing
[21:02:28] mynameisbrian: yeah I have some project ideas
[21:03:03] Papierkorb: mynameisbrian: you already understood enumerables and stuff, IMO you're wasting your time by continuing on writing micro 'projects'
[21:03:42] hightower2: Hey, how can I place a bunch of text as "DATA" section at the end of a Ruby script? (I'm looking for an equivalent of Perl's __DATA__ and <DATA>)
[21:04:03] blackgoat: has joined #ruby
[21:04:29] mynameisbrian: well that's what I mean, I have ideas of things I'm going to build
[21:04:48] Papierkorb: hightower2: https://gist.github.com/Papierkorb/8f4a9c19aa6fc65d436203399bc15d47
[21:05:24] hightower2: Papierkorb++
[21:06:33] zeroDi: has joined #ruby
[21:07:35] Guest43: has joined #ruby
[21:07:58] Guest43: has joined #ruby
[21:13:56] Masonn: has joined #ruby
[21:14:20] haxrbyte: has joined #ruby
[21:15:23] drewo: has joined #ruby
[21:17:16] swills: has joined #ruby
[21:19:26] neanderslob: has joined #ruby
[21:22:17] platzhirsch: has joined #ruby
[21:24:51] e4xit: has joined #ruby
[21:25:16] ur5us: has joined #ruby
[21:26:37] ptx0: has joined #ruby
[21:27:00] ocbtec: has joined #ruby
[21:27:23] whathappens: has joined #ruby
[21:27:42] whathapp_: has joined #ruby
[21:32:25] akiTendo_: has joined #ruby
[21:32:54] djbkd: has joined #ruby
[21:33:33] codeurge: has joined #ruby
[21:35:30] idefine: has joined #ruby
[21:39:53] hutch34: has joined #ruby
[21:41:09] drewo: has joined #ruby
[21:43:07] stunder001: has joined #ruby
[21:43:53] mistermocha: has joined #ruby
[21:43:58] zapata: has joined #ruby
[21:48:54] edwinvdgraaf: has joined #ruby
[21:50:47] lewis1711: has joined #ruby
[21:50:50] B1n4r10: has joined #ruby
[21:51:42] lewis1711: if I have an array "xs", how to get an enumerator starting at a particular index in the array?
[21:52:01] firstdayonthejob: has joined #ruby
[21:52:03] A124: has joined #ruby
[21:52:55] lewis1711: oh nm, xs[index..-1].to_enum
[21:54:30] Kyle__: Can you have a class methind something like def keys<<(newkey)
[21:54:43] ChiefAlexander: has joined #ruby
[21:54:49] Kyle__: ACTION could have sworn there were a way of doing that, but can't make it work atm.
[21:55:47] bollullera: has joined #ruby
[21:55:59] johnmilton: has joined #ruby
[21:56:05] beauby: has joined #ruby
[21:56:41] akiTendo: has joined #ruby
[21:57:12] Es0teric: has joined #ruby
[21:59:45] ctp: has joined #ruby
[22:00:02] minimalism: has joined #ruby
[22:00:35] bollullera: has left #ruby: ()
[22:01:02] johnmilton: has joined #ruby
[22:01:02] e4xit: has joined #ruby
[22:01:19] jhass: kyle__: in a.b << c the method b is called on a with no arguments and then the method << is called on the return value of b with the argument c
[22:02:15] tfitts: has joined #ruby
[22:02:22] Kyle__: jhass: So in that case b would have to be it's own class?
[22:02:39] pawnbox: has joined #ruby
[22:03:55] moeabdol: has joined #ruby
[22:04:03] jhass: kyle__: you could in fact rewrite the expression to a.b.<<(c), still valid ruby
[22:04:45] Kyle__: Yeah, but it's not what I was intending. Also explains why what I was doing wasn't working. I'll use the word 'append' instead of << instead. Easy enough.
[22:08:44] sphex: has joined #ruby
[22:09:06] eljimmy: has joined #ruby
[22:11:46] jancel: has joined #ruby
[22:13:36] chouhoul_: has joined #ruby
[22:16:34] XxJMGxX: has joined #ruby
[22:18:15] skolman_: has joined #ruby
[22:18:17] dopie: has joined #ruby
[22:18:54] crystal77: has joined #ruby
[22:19:10] johnmilton: has joined #ruby
[22:19:54] purrist: has joined #ruby
[22:20:20] greg: has joined #ruby
[22:20:40] skalfyfan: has joined #ruby
[22:21:34] RegulationD: has joined #ruby
[22:22:08] tax: has joined #ruby
[22:22:16] Oclair: has joined #ruby
[22:23:36] pawnbox: has joined #ruby
[22:24:01] aghalarp: has joined #ruby
[22:24:40] FooMunki: has joined #ruby
[22:26:00] astrobunny: has joined #ruby
[22:26:28] skylerto: has joined #ruby
[22:26:30] aghalarp: Newbie question: Am I supposed to update Ruby and RubyGems separately? Or are the two things the same? Rubygems is part of Ruby? So if I update Ruby, I'll have also updated Rubygems?
[22:27:24] skylerto: uh, afaik you don't ever update Rubygems specifically.
[22:27:30] skylerto: You can update your copy of gems.
[22:27:46] astrobunny: has joined #ruby
[22:28:37] Radar: aghalarp: Ruby and RubyGems are updated separately.
[22:29:15] jancel: has joined #ruby
[22:29:28] smathy: gem update --system
[22:29:38] aghalarp: Is it recommended to update rubygems then?
[22:29:51] aghalarp: or only if there's an issue
[22:30:14] skylerto: your system wide gems you should keep up to date.
[22:30:29] Radar: Yes, it's recommended to update rubygems.
[22:30:46] aghalarp: Btw I'm completely new to ruby so I have no gems at all yet
[22:31:19] aghalarp: and I pretty much have no idea what I'm doing! :)
[22:31:32] noobsu: has joined #ruby
[22:31:39] smathy: At least you know that much.
[22:32:04] aghalarp: The plan is to type and click things until they break.
[22:32:16] Radar: aghalarp: that's what I get paid to do every day
[22:32:28] smathy: So say we all.
[22:32:30] toretore: just put a rescue nil after youll be fine
[22:32:58] skylerto_: has joined #ruby
[22:33:04] aghalarp: Also I guess now is a good time to ask: RVM vs rbenv?
[22:33:12] nettoweb: has joined #ruby
[22:34:20] skylerto: has joined #ruby
[22:34:23] jhass: RVM but chruby before both ;)
[22:34:47] smathy: rbenv, but chruby before both.
[22:35:21] vdamewood: has joined #ruby
[22:35:29] aghalarp: hm... never really gave chruby a look
[22:35:31] havenwood: no switcher, but chruby if you must
[22:36:05] aghalarp: What's the most popular these days?
[22:36:24] stunder001: has joined #ruby
[22:36:42] jhass: rvm is probably still the most used but chruby should be used more often than rbenv
[22:37:21] jhass: note that chruby is younger, and rvm is the oldest, you got some legacy and some people who never had a reason to move
[22:37:37] jhass: popularity is usually a bad measure
[22:37:48] aghalarp: yeah that's a good point
[22:38:45] dopie: has joined #ruby
[22:38:54] danostrowski: has joined #ruby
[22:40:28] zenlot6: has joined #ruby
[22:41:46] nankyokusei: has joined #ruby
[22:43:54] Radar: aghalarp: what OS are you?
[22:43:57] gtsai: has joined #ruby
[22:43:57] Radar: are you on*
[22:44:25] Radar: aghalarp: There's a guide for that: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/
[22:44:30] horaceheaven: has joined #ruby
[22:45:14] aghalarp: ah cool, thanks. Was reading another guide but I'll look through this one too
[22:48:59] nerium: has joined #ruby
[22:49:26] luigi: has joined #ruby
[22:51:38] Gasher: has joined #ruby
[22:52:11] gtsai_: has joined #ruby
[22:58:00] hightower3: has joined #ruby
[23:01:18] aghalarp: has joined #ruby
[23:01:25] gtsai: has joined #ruby
[23:03:01] Nahra: has joined #ruby
[23:03:08] Tyrant_: has joined #ruby
[23:08:48] hightower3: Hey, how do I create a here document that is effectively surrounded by ' and not " ?
[23:10:05] hightower3: (i.e. no interpolation in it)
[23:12:26] gtsai_: has joined #ruby
[23:12:42] hahuang65: has joined #ruby
[23:12:44] weaksauce: hightower3 surround the token with single quotes
[23:13:07] hightower3: Oh ok, didn't think it was the same as in Perl, thanks!
[23:13:30] grs: has joined #ruby
[23:13:31] weaksauce: hightower3 http://ruby-doc.org/core-2.2.0/doc/syntax/literals_rdoc.html#label-Here+Documents
[23:13:42] weaksauce: other options
[23:16:21] impermanence: has joined #ruby
[23:16:28] symm-_: has joined #ruby
[23:17:26] gtsai: has joined #ruby
[23:18:05] zapata: has joined #ruby
[23:18:14] startupality: has joined #ruby
[23:19:08] Synthead: has joined #ruby
[23:19:35] bronson: has joined #ruby
[23:19:51] karmatr0_: has joined #ruby
[23:20:33] youch: has joined #ruby
[23:23:47] impermanence: has joined #ruby
[23:24:12] aghalarp: has joined #ruby
[23:31:06] ramfjord: has joined #ruby
[23:32:19] lewis1711: has joined #ruby
[23:32:46] wrkrcoop: has joined #ruby
[23:33:24] idefine: has joined #ruby
[23:35:24] lewis1712: has joined #ruby
[23:37:10] rkazak: has joined #ruby
[23:37:12] IrishGringo: has joined #ruby
[23:37:51] mwlang: has joined #ruby
[23:41:06] chris2: has joined #ruby
[23:42:01] A124: has joined #ruby
[23:44:26] ur5us_: has joined #ruby
[23:46:35] Limix: has joined #ruby
[23:47:09] aeterne: has joined #ruby
[23:49:06] crystal77: has joined #ruby
[23:49:16] koooge: has joined #ruby
[23:49:29] youch: has joined #ruby
[23:51:12] grs: has joined #ruby
[23:52:01] moeabdol: has joined #ruby
[23:53:47] tgeeky: can I pass an object (say, a ProgressBar) in a options hash to a function?
[23:53:51] tgeeky: and expect it to work?
[23:54:52] tgeeky: i seem to be getting a reference to the object, but it's all valueless and reset :/
[23:55:12] Radar: ?code tgeeky
[23:55:12] ruby[bot]: tgeeky: We can't help you without your code, please post it to https://gist.github.com
[23:55:18] Radar: p.s. good morning
[23:55:23] tgeeky: Radar: ayyyy
[23:57:22] tgeeky: http://pastie.org/10841507
[23:57:34] tgeeky: first file is in a Kiba-ETL format (it's just ruby though)
[23:57:39] tgeeky: i create the progress bar
[23:57:44] tgeeky: then try to pass it to the source thing
[23:57:47] tgeeky: then to the transformation thing
[23:58:00] Radar: Why are you using class variables.
[23:58:08] tgeeky: because i haven't fixed that yet
[23:58:08] Radar: Use instance variables instead.
[23:58:12] tgeeky: yeah, i plan to
[23:58:18] tgeeky: i was having trouble and used it as a workaround
[23:58:18] Radar: It might work with instance variables?
[23:58:28] Radar: I don't know for certain. I would need to fiddle with it
[23:58:40] tgeeky: @@ is class, @ is instance?
[23:59:47] tgeeky: oh, I see what's going on
[23:59:49] tgeeky: nevermind.