« Back to channel list

#ruby - 17 June 2016

« Back 1 day Forward 1 day »
[00:00:42] mistermocha: has joined #ruby
[00:02:33] CloCkWeRX: has joined #ruby
[00:04:21] davedev24: has joined #ruby
[00:05:04] RickHull: >> puts { foo: true }.to_json, true.to_json
[00:05:06] ruby[bot]: RickHull: # => /tmp/execpad-457a96ab9263/source-457a96ab9263:2: syntax error, unexpected ':', expecting '}' ...check link for more (https://eval.in/590492)
[00:05:09] cdg: has joined #ruby
[00:05:49] ramfjord_: has joined #ruby
[00:06:02] RickHull: >> puts({ foo: true }.to_json), true.to_json
[00:06:03] ruby[bot]: RickHull: # => /tmp/execpad-cc891f51a215/source-cc891f51a215:2: syntax error, unexpected ',', expecting keyword_end ...check link for more (https://eval.in/590493)
[00:06:39] jhass: ?experiment RickHull
[00:06:39] ruby[bot]: RickHull: Please use your local irb or pry (see ?pry) to experiment, ruby[bot]'s eval functionality is for demonstration purposes only.
[00:06:59] RickHull: sorry, my question is: isn't true in json supposed to be a quoted string?
[00:07:35] sesquipedalian: has joined #ruby
[00:08:06] RickHull: oh, hm, guess not
[00:08:11] RickHull: all set, nvm
[00:08:21] mistermocha: has joined #ruby
[00:11:36] certainty: has joined #ruby
[00:14:57] tildes: has joined #ruby
[00:15:04] pwnd_nsfw`: has joined #ruby
[00:17:29] the_drow: has joined #ruby
[00:19:26] mattwashere: has joined #ruby
[00:20:39] brandon_j: has joined #ruby
[00:21:12] brandon_j: How do I create a range of time from the beginning of a the current month to TIme.now?
[00:21:18] brandon_j: of the current*
[00:21:29] jhass: brandon_j: rails/activesupport?
[00:22:08] snowy: has joined #ruby
[00:22:58] smathy: has joined #ruby
[00:23:41] ICantCook: has joined #ruby
[00:30:27] LoneHermit: has joined #ruby
[00:31:43] evidex: has joined #ruby
[00:34:04] nettoweb: has joined #ruby
[00:34:14] aupadhye: has joined #ruby
[00:38:35] the_drow: has joined #ruby
[00:38:57] vipinj: has joined #ruby
[00:39:23] the_drow: has joined #ruby
[00:39:29] debajit: has joined #ruby
[00:39:40] roamingdog: has joined #ruby
[00:44:12] vipinj: has left #ruby: ("Leaving")
[00:44:31] vipinj: has joined #ruby
[00:44:33] vjain_: has joined #ruby
[00:44:47] vjain_: has left #ruby: ()
[00:45:49] charliesome: has joined #ruby
[00:48:26] rffleiae: has joined #ruby
[00:50:44] lightt: has joined #ruby
[00:52:27] the_drow: has joined #ruby
[00:52:55] jancel: has joined #ruby
[00:52:57] debajit: has joined #ruby
[00:53:10] rickmasta: has joined #ruby
[00:55:25] nankyokusei: has joined #ruby
[00:58:03] arescorpio: has joined #ruby
[00:59:02] duckpuppy: has joined #ruby
[01:00:22] ramfjord: has joined #ruby
[01:00:24] LoneHermit: has joined #ruby
[01:00:27] rickmasta: has joined #ruby
[01:03:04] polll: has joined #ruby
[01:05:31] RegulationD: has joined #ruby
[01:06:17] the_drow: has joined #ruby
[01:07:15] ledestin: has joined #ruby
[01:07:52] LoneHerm_: has joined #ruby
[01:08:35] inoic: has joined #ruby
[01:08:35] polll: has joined #ruby
[01:10:22] Omen: has joined #ruby
[01:11:10] maloik: has joined #ruby
[01:12:07] ponga: has joined #ruby
[01:12:22] certainty: has joined #ruby
[01:13:05] AcidCras_: has joined #ruby
[01:13:49] polll: has joined #ruby
[01:14:28] rickmasta: has joined #ruby
[01:15:26] jetpackjoe: has joined #ruby
[01:17:02] aberen: has joined #ruby
[01:17:17] Yiota: has joined #ruby
[01:17:17] rickmasta: has joined #ruby
[01:18:12] skweek: has joined #ruby
[01:18:13] jaguarmagenta: has joined #ruby
[01:19:03] mistermocha: has joined #ruby
[01:20:14] jhack: has joined #ruby
[01:21:02] mistermo_: has joined #ruby
[01:23:02] snowy: has joined #ruby
[01:24:03] tAn: has joined #ruby
[01:25:07] lightt: has joined #ruby
[01:25:35] mattwashere: has joined #ruby
[01:25:57] ponga: anyone familiar with concurrency in ruby
[01:26:04] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[01:26:32] ponga: nice, jhass :) i was already writing question in a sane format
[01:27:29] drahosj: has joined #ruby
[01:27:42] jhass: !fact ed anyone Just ask your question, if anyone has, is or can, they will respond.
[01:27:42] ruby[bot]: jhass: I stand corrected that anyone is Just ask your question, if anyone has, is or can, they will respond.
[01:28:38] Yiota: has joined #ruby
[01:29:27] kgrz: has joined #ruby
[01:31:11] ponga: how can i achieve in ruby, of concurrency or multithreading, that you stress-freely just squeeze the tasks into a queue , where processors are having a cup of tea and one of them come to the table and pick it up?
[01:31:20] ponga: not sure my analogy is making sense
[01:31:29] the_drow: has joined #ruby
[01:32:18] rickmasta: has joined #ruby
[01:32:25] JeremyM_: has joined #ruby
[01:33:26] havenwood: ponga: http://ruby-concurrency.github.io/concurrent-ruby/file.thread_pools.html
[01:33:34] ponga: sounds like thread pool would work
[01:33:42] ponga: havenwood: my god i just found your answer
[01:34:56] havenwood: ponga: You might consider trying JRuby with the concurrent-ruby gem.
[01:35:14] ponga: does thread pool distribute tasks over multiple cores?
[01:35:28] havenwood: ponga: On JRuby it does. On CRuby it might.
[01:35:45] chopin: has joined #ruby
[01:36:15] ponga: uh I never used JRuby extensively before
[01:36:32] ponga: would i need to write everything into JRuby syntax
[01:36:37] rffleiae: has joined #ruby
[01:37:13] karmatr0n: has joined #ruby
[01:37:26] havenwood: ponga: JRuby runs regular Ruby code. Give it a try.
[01:38:30] ensyde: has joined #ruby
[01:39:47] ponga: about this thread_pool thing, what if both A and B tasks are initially put into pool, where A needs a result return from B to execute, do I have to manually set A to 'wait' somehow
[01:41:35] allcentury: has joined #ruby
[01:42:03] tAn: has joined #ruby
[01:42:19] hutch34: has joined #ruby
[01:43:33] havenwood: ponga: If you haven't already, take a look at Ruby's Mutex, ConditionVariable and Queue classes.
[01:44:28] mattwashere: has joined #ruby
[01:44:34] ponga: you are a champion
[01:44:59] Coldblackice: has joined #ruby
[01:45:10] roamingdog: has joined #ruby
[01:47:11] edwardly: has joined #ruby
[01:47:11] edwardly: has joined #ruby
[01:48:59] Long: has joined #ruby
[01:51:02] SilverKey: has joined #ruby
[01:52:37] roamingdog: has joined #ruby
[01:54:24] rickmasta: has joined #ruby
[01:54:35] PaulCape_: has joined #ruby
[01:55:21] tAn: has joined #ruby
[01:59:39] Yiota: has joined #ruby
[02:01:26] Caerus|Away: has joined #ruby
[02:03:04] solocshaw: has joined #ruby
[02:03:36] banister: has joined #ruby
[02:05:06] ryan_notabot: has joined #ruby
[02:07:36] shevy: a true champignon
[02:09:01] Alazoral: has joined #ruby
[02:09:57] jgt3: has joined #ruby
[02:13:07] certainty: has joined #ruby
[02:18:56] aberen: has joined #ruby
[02:24:01] ur5us: has joined #ruby
[02:24:19] vipinj: has joined #ruby
[02:24:43] vipinj: has joined #ruby
[02:24:47] rffleiae: has joined #ruby
[02:26:47] mattwashere: has joined #ruby
[02:28:09] mattwashere: has joined #ruby
[02:31:45] cbyrda: has joined #ruby
[02:33:44] Yiota: has joined #ruby
[02:35:19] Niham: has joined #ruby
[02:38:02] karmatr0n: has joined #ruby
[02:50:40] mistermocha: has joined #ruby
[02:51:16] tAn: has joined #ruby
[02:54:56] brianpWins_: has joined #ruby
[02:55:15] ramfjord: has joined #ruby
[02:55:35] cbyrda: has joined #ruby
[02:56:16] nankyokusei: has joined #ruby
[02:59:32] Xiti: has joined #ruby
[03:00:03] rueben: has joined #ruby
[03:01:05] duckpuppy: has joined #ruby
[03:05:52] RegulationD: has joined #ruby
[03:09:06] rffleiae: has joined #ruby
[03:10:48] jgt3: has joined #ruby
[03:13:54] certainty: has joined #ruby
[03:14:33] jhack: has joined #ruby
[03:15:26] duckpuppy: has joined #ruby
[03:17:16] rffleiae: has joined #ruby
[03:18:54] jaguarmagenta: has joined #ruby
[03:19:37] aberen: has joined #ruby
[03:20:53] k3rn31: has joined #ruby
[03:23:01] braincras: has joined #ruby
[03:26:54] tAn: has joined #ruby
[03:30:51] hahuang62: has joined #ruby
[03:34:05] binaryplease1: has joined #ruby
[03:36:47] Rodya_: has joined #ruby
[03:39:00] gix: has joined #ruby
[03:39:03] karmatr0n: has joined #ruby
[03:43:39] kareeoleez: has joined #ruby
[03:43:43] Yiota: has joined #ruby
[03:44:20] astrobunny: has joined #ruby
[03:45:29] kareeoleez: has joined #ruby
[03:45:57] robmclark: has joined #ruby
[03:52:28] Yiota: has joined #ruby
[03:53:37] lightt: has joined #ruby
[03:53:37] LoneHerm_: has joined #ruby
[03:54:32] rffleiae: has joined #ruby
[03:56:05] rikai: has joined #ruby
[03:56:07] arlek: has joined #ruby
[03:56:17] robmclark: Hello. How do I get my terminal on my mac to run my .rb files? chmod x was mentioned on a google search, but as a newbie using Ruby to learn programming in general I have no clue what to do with that info. thanks.
[03:56:30] tubbo: has joined #ruby
[03:57:40] LoneHerm_: has joined #ruby
[03:58:39] LoneHermit: has joined #ruby
[03:59:09] Pharaoh2: has joined #ruby
[04:00:17] LoneHerm_: has joined #ruby
[04:00:32] shevy: robmclark execute it. "ruby foo.rb"
[04:01:16] robmclark: hello shevy
[04:01:27] robmclark: do you mean simply open the terminal and click and drag it and hit enter?
[04:01:28] LoneHerm_: has joined #ruby
[04:01:33] robmclark: oh, one second.
[04:02:23] LoneHerm_: has joined #ruby
[04:02:31] robmclark: load error, No such file or directory.
[04:03:21] LoneHermit: has joined #ruby
[04:04:18] robmclark: this problem is not there on the PC
[04:04:19] LoneHerm_: has joined #ruby
[04:04:27] robmclark: also get permission denied
[04:04:42] tvw: has joined #ruby
[04:04:50] Yiota: has joined #ruby
[04:05:14] LoneHerm_: has joined #ruby
[04:06:39] RegulationD: has joined #ruby
[04:08:04] robmclark: sorry to bother Shevy. What exactly do I type in the terminal?
[04:10:48] LoneHermit: has joined #ruby
[04:11:38] jgt3: has joined #ruby
[04:11:44] LoneHerm_: has joined #ruby
[04:12:33] vipinj: has joined #ruby
[04:12:40] tmtwd: has joined #ruby
[04:13:13] d0nn1e: has joined #ruby
[04:14:14] robmclark: Shevy, I'll jump on another time (crashing) Thanks for trying to help.
[04:14:31] Pharaoh2: has joined #ruby
[04:19:01] digneety: has joined #ruby
[04:20:43] aberen: has joined #ruby
[04:21:31] tAn: has joined #ruby
[04:22:26] vuoto: has joined #ruby
[04:23:15] G: has joined #ruby
[04:26:47] jas02: has joined #ruby
[04:28:11] AcidCrash: has joined #ruby
[04:28:30] KnownSy0: has joined #ruby
[04:29:22] jancel: has joined #ruby
[04:29:53] jenrzzz: has joined #ruby
[04:31:52] jaguarmagenta: has joined #ruby
[04:32:54] roamingdog: has joined #ruby
[04:34:28] yesthatallen: has joined #ruby
[04:35:16] ruskie: has joined #ruby
[04:37:04] yesthatallen: thanks @havenwood for the advice on speeding up ruby install
[04:37:09] yesthatallen: I'm trying it now
[04:37:40] yesthatallen: also, I couldn't find the straight up download link for brightbox's ruby installer, and one of the requirements is that we need to be able to install offline
[04:37:57] xue: has joined #ruby
[04:38:22] yesthatallen: so, I'm not sure how to leverage their repository
[04:39:42] A124: has joined #ruby
[04:40:34] pawnbox: has joined #ruby
[04:41:24] biggernashing: has joined #ruby
[04:41:47] biggernashing: i would like to get better at technical interview questions and word problems could you please help me out by pointing me out to the right direction?
[04:41:51] arooni: has joined #ruby
[04:41:57] SilverKey: has joined #ruby
[04:48:57] Long: has joined #ruby
[04:52:38] mistermocha: has joined #ruby
[04:54:32] mistermo_: has joined #ruby
[04:56:33] mistermo_: has joined #ruby
[04:57:08] nankyokusei: has joined #ruby
[04:57:22] Radar: biggernashing: http://exercism.io/
[04:57:56] biggernashing: today i had my very first technical interview
[04:58:00] biggernashing: i failed miserably
[04:58:03] duncannz: has joined #ruby
[04:58:32] mistermocha: has joined #ruby
[05:00:35] Radar: biggernashing: It's pretty normal to bomb the first technical interview
[05:00:36] bluOxigen: has joined #ruby
[05:00:39] mistermocha: has joined #ruby
[05:00:40] Radar: Keep persisting :) You'll get there.
[05:01:44] biggernashing: well the thing is i am really bad at arithmetical thinking or whatever it's called Radar
[05:01:51] biggernashing: i can't figure out the formula
[05:02:08] biggernashing: i'd love to learn how to do it and get the mindset =(
[05:02:23] mistermo_: has joined #ruby
[05:02:24] biggernashing: i can figure out simple stuff, but not stuff i haven't seen before or more complex things
[05:02:28] vdamewood: has joined #ruby
[05:04:36] mistermo_: has joined #ruby
[05:05:40] Radar: biggernashing: How long have you been doing Ruby for?
[05:05:56] Radar: biggernashing: How long have you been doing Ruby for?
[05:06:24] mistermocha: has joined #ruby
[05:07:52] Radar: You should go through the exercises on Exercism. There's also the Ruby Koans which are great for practicing some Ruby basics: http://rubykoans.com/
[05:08:00] Radar: The only way you're going to get better at it is by practicing it.
[05:08:11] mistermo_: has joined #ruby
[05:09:00] karmatr0n: has joined #ruby
[05:09:15] astrobunny: has joined #ruby
[05:09:23] mistermo_: has joined #ruby
[05:10:23] biggernashing: Radar: i'm bad at logic
[05:10:43] LoneHermit: has joined #ruby
[05:10:46] biggernashing: i'm very good at intuition and figuring out whether or not something will turn out the way it's supposed to
[05:11:19] biggernashing: but figuring out how to draw characters on a screen is hard for me
[05:11:45] sauvin: has joined #ruby
[05:12:42] biggernashing: like i would never be able to create a script that draws a smiley face with my current knowledge and mindset
[05:16:17] kfpratt: has joined #ruby
[05:17:42] pawnbox: has joined #ruby
[05:19:15] Niham: has joined #ruby
[05:20:25] Radar: I don't even think I can do that.
[05:20:46] Radar: Not without a lot of futzing anyway
[05:21:39] aberen: has joined #ruby
[05:22:36] elifoster: has joined #ruby
[05:23:59] kareeoleez: has joined #ruby
[05:24:31] spectra: has joined #ruby
[05:31:31] houhoulis: has joined #ruby
[05:31:44] hahuang62: has joined #ruby
[05:31:59] madgen: has joined #ruby
[05:38:03] astrobunny: has joined #ruby
[05:40:39] Madplatypus: has joined #ruby
[05:41:31] KnownSyntax: has joined #ruby
[05:45:25] biggernashing: Radar: if i can't solve an exercise on exercism what should i do?
[05:45:37] Radar: biggernashing: You can ask for help here.
[05:45:52] biggernashing: if i want to become self-reliant?
[05:46:19] biggernashing: i like having fishermen catch fish for me that i buy at the store and use at home for food
[05:46:25] TomyLobo: has joined #ruby
[05:46:26] biggernashing: but eventually i'd like to go fishing
[05:46:34] apeiros: !badnick biggernashing
[05:46:35] ruby[bot]: +bbb $a:biggernashing$#ruby-banned biggernashing!*@*$#ruby-banned *!*@gateway/web/freenode/ip.85.203.18.254$#ruby-banned
[05:46:35] ruby[bot]: ruby[bot] kicked biggernashing: is not suitable for this channel, see http://ruby-community.com/pages/user_rules
[05:48:30] Pharaoh2: has joined #ruby
[05:49:07] shinnya: has joined #ruby
[05:50:05] last_staff: has joined #ruby
[05:50:46] Coldblackice: has joined #ruby
[05:55:06] Radar: -b *!*@gateway/web/freenode/ip.85.203.18.254$#ruby-banned
[06:00:24] tildes: has joined #ruby
[06:01:36] Radar: -b *!*@gateway/web/freenode/ip.216.216.202.69$#ruby-banned
[06:02:48] aberen: has joined #ruby
[06:04:02] astrobunny: has joined #ruby
[06:05:18] Radar: -b $a:biggernashing$#ruby-banned
[06:05:25] kareeoleez: has joined #ruby
[06:05:25] Radar: -b biggernashing!*@*$#ruby-banned
[06:05:36] nashville45: has joined #ruby
[06:07:17] kareeoleez: has joined #ruby
[06:07:30] RegulationD: has joined #ruby
[06:08:00] Radar: nashville45: welcome back
[06:08:07] jgt3: has joined #ruby
[06:08:08] Radar: nashville45: If you want to become self-reliant you need to practice.
[06:08:46] andikr: has joined #ruby
[06:08:53] nashville45: well i would like to learn what to practice
[06:09:06] nashville45: because i have been learning on my own and i feel like i have been learning the wrong things
[06:09:07] Radar: Exercism exercises and the ruby koans should be enough for now.
[06:09:18] Radar: Ask here if you get stuck. There's always someone around to help out.
[06:09:29] nashville45: what kind of problems are exercism problems?
[06:11:46] nashville45: like what are they called?
[06:12:38] Sheperson: has joined #ruby
[06:14:12] fenre: has joined #ruby
[06:15:04] eGGshke: has joined #ruby
[06:15:21] d0lph1n98: has joined #ruby
[06:16:05] axxyhtrx: has joined #ruby
[06:18:16] jancel: has joined #ruby
[06:23:14] karmatr0n: has joined #ruby
[06:25:13] mistermocha: has joined #ruby
[06:25:58] Silthias: has joined #ruby
[06:26:59] yfeldblum: has joined #ruby
[06:29:35] wsewolod: has joined #ruby
[06:31:24] certainty: has joined #ruby
[06:33:55] jaguarmagenta: has joined #ruby
[06:34:54] mistermocha: has joined #ruby
[06:35:39] moeabdol: has joined #ruby
[06:36:59] skade: has joined #ruby
[06:39:08] blaxter: has joined #ruby
[06:40:04] dionysus69: has joined #ruby
[06:43:03] aganov: has joined #ruby
[06:43:39] digneety: has joined #ruby
[06:45:47] xcesariox: has joined #ruby
[06:48:22] ferr: has joined #ruby
[06:49:15] xcesariox: has joined #ruby
[06:51:30] aufi: has joined #ruby
[06:56:09] lsmola: has joined #ruby
[06:57:57] nankyokusei: has joined #ruby
[07:04:34] biberu: has joined #ruby
[07:04:38] Guest_: has joined #ruby
[07:05:56] lightt: has joined #ruby
[07:06:27] danostrowski: has joined #ruby
[07:08:56] jaruga___: has joined #ruby
[07:09:36] Ishido: has joined #ruby
[07:10:57] TomyWork: has joined #ruby
[07:11:04] dionysus69: has joined #ruby
[07:14:48] aberen: has joined #ruby
[07:15:43] al2o3-cr: has joined #ruby
[07:18:05] terlar: has joined #ruby
[07:18:55] norc: has joined #ruby
[07:23:01] craigp: has joined #ruby
[07:24:13] Beverage: has joined #ruby
[07:24:21] norc: has joined #ruby
[07:25:31] jordanm: has joined #ruby
[07:26:38] axxyhtrx: has joined #ruby
[07:29:05] DoubleMalt: has joined #ruby
[07:30:59] Hounddog: has joined #ruby
[07:33:47] aberen: has joined #ruby
[07:34:30] Dimik: has joined #ruby
[07:34:46] hutch34: has joined #ruby
[07:35:37] jaguarmagenta: has joined #ruby
[07:36:19] iCHAIT: has joined #ruby
[07:36:44] iCHAIT: How do I reinitialize a Hash in ruby? For instance take a look at this code - http://dpaste.com/3G6Z429
[07:36:57] jgt3: has joined #ruby
[07:37:13] bnjf: has joined #ruby
[07:37:22] iCHAIT: IN this line 12 prints - {"password"=>"password"} but I think it should have printed - {'username': 'example-user', 'password': 'password'}
[07:37:45] iCHAIT: So it looks like user_to_test is not getting reinitialized correctly.
[07:37:49] pamatya: has joined #ruby
[07:37:49] baweaver: deelte mutates
[07:37:51] iCHAIT: Can someoone help?
[07:38:02] baweaver: also, Ruby tends to not use for loops
[07:38:38] baweaver: >> {user: 'foobar', password: 'baz'}.reject { |key, value| key == :password }
[07:38:40] ruby[bot]: baweaver: # => {:user=>"foobar"} (https://eval.in/590602)
[07:38:51] exilarch: has joined #ruby
[07:39:05] pamatya: is there a ruby hook for class methods being called ?
[07:39:11] codecop: has joined #ruby
[07:39:15] baweaver: >> h = {user: 'foobar', password: 'baz'}; h.reject { |key, value| key == :password }; h
[07:39:16] ruby[bot]: baweaver: # => {:user=>"foobar", :password=>"baz"} (https://eval.in/590603)
[07:39:25] baweaver: notice how reject does not mutate the hash.
[07:40:22] baweaver: pamatya: how so?
[07:40:34] baweaver: like you call Class.method and something else gets called?
[07:41:02] iCHAIT: baweaver: Oh thanks for that info, BTW does that mean that we should avoid use of delete?
[07:41:15] baweaver: unless you want to delete the key from the hash
[07:41:30] baweaver: I would recommend reading through Eloquent Ruby and getting more familiar with the language
[07:42:41] Mia: has joined #ruby
[07:43:44] baweaver: pamatya: if so then no, there's not unless you make one. Even then, the question becomes why would you?
[07:46:03] multi_io: has joined #ruby
[07:49:46] aryaching: has joined #ruby
[07:50:05] fujinuma: has joined #ruby
[07:50:47] fujinuma: is this correct? class Node < Struct.new(:value, :left, :right); end
[07:53:29] edwinvdgraaf: has joined #ruby
[07:55:19] apeiros: just do Node = Struct.new(…) do … end
[07:55:32] apeiros: no need for an additional layer of inheritance
[07:56:00] tAn: has joined #ruby
[07:56:04] Silthias1: has joined #ruby
[07:56:20] fujinuma: apeiros: thanks
[07:59:17] SenpaiSilver: has joined #ruby
[08:00:45] LoneHerm_: has joined #ruby
[08:02:08] evidex: has joined #ruby
[08:02:23] workmad3: has joined #ruby
[08:02:30] certainty: has joined #ruby
[08:02:32] neanderslob: has joined #ruby
[08:02:40] neanderslob_: has joined #ruby
[08:03:57] neanderslob: has joined #ruby
[08:04:02] nerium: has joined #ruby
[08:04:22] skade: has joined #ruby
[08:06:16] dasher^0_o: has joined #ruby
[08:06:43] norc: apeiros: Though I think the extra inheritance allows for the common "class A; end" style.
[08:07:10] apeiros: yes, but what for?
[08:07:55] apeiros: so "let's make it worse so it looks better"?
[08:08:02] pamatya: sorry @baweaver, was away for a while
[08:08:05] norc: I wouldn't go as far as calling it "worse" ;p
[08:08:18] apeiros: lookup chain is increased for no technical reason
[08:08:23] RegulationD: has joined #ruby
[08:08:45] norc: apeiros: And that is bad because?
[08:08:48] pamatya: actual task is i need to be able to print out name of class method being called within given class
[08:08:57] apeiros: norc: because your lookup chain is longer?
[08:09:06] norc: apeiros: And that has a notable impact how?
[08:09:10] pamatya: Foo.my_method => should print 'my_method'
[08:09:13] ramfjord: has joined #ruby
[08:09:26] norc: pamatya: __method__
[08:09:43] apeiros: norc: the impact is more notable than "oh shiny"?
[08:09:45] pamatya: its a interview question
[08:10:34] norc: pamatya: Is this for a Ruby job?
[08:10:52] norc: pamatya: How about you learn Ruby properly, instead of asking us to give you answers for basic Ruby problems.
[08:10:53] pamatya: gone through metaprogramming blogs
[08:11:07] ocbtec: has joined #ruby
[08:11:33] pamatya: i have been learning it, been able to work around most of the problem so far
[08:12:03] norc: pamatya: The goal of interview questions is to ascertain your skills with Ruby. Giving you the answers will not make you a better candidate.
[08:12:14] pamatya: i cldn't figure this one out, don't mind me asking if u think its a easy one.
[08:12:55] norc: pamatya: Considering I gave you a hint already that was completely ignored, I shall go do productive things instead.
[08:12:57] norc: Good luck.
[08:13:26] pamatya: i am walking through that lead, thanks for that @norc
[08:15:49] lightt: has joined #ruby
[08:17:12] anisha: has joined #ruby
[08:17:49] norc: pamatya: By the way, let this be a good tip for you. If you had googled for "current method name ruby" the first 10 hits would have given you the answer. If you cannot utilise google to find out about unknown features in Ruby, I would think about a different job.
[08:18:51] Stan: has joined #ruby
[08:18:57] norc: (I really don't mind beginners asking questions here, but if the goal is to get past an interview it pisses me off - because it's these people whose code I might have to clean up later)
[08:20:04] AcidCras_: has joined #ruby
[08:20:18] mozzarel1: has joined #ruby
[08:20:29] nickjj_: has joined #ruby
[08:20:36] Azure: has joined #ruby
[08:22:14] cyphactor: has joined #ruby
[08:22:49] LiquidInsect: has joined #ruby
[08:23:12] PaulePanter: has joined #ruby
[08:23:16] ryotarai: has joined #ruby
[08:23:33] crowell: has joined #ruby
[08:23:33] Morrolan: has joined #ruby
[08:23:39] Antiarc: has joined #ruby
[08:23:40] moeabdol: has joined #ruby
[08:23:53] D9: has joined #ruby
[08:24:04] ruisantos: has joined #ruby
[08:24:07] joonty: has joined #ruby
[08:24:26] kbni: has joined #ruby
[08:24:37] Trynemjoel: has joined #ruby
[08:25:02] hiddenloop: has joined #ruby
[08:28:27] callumacrae: has joined #ruby
[08:31:45] xall: has joined #ruby
[08:32:29] [74]HELLth: has joined #ruby
[08:33:46] karmatr0n: has joined #ruby
[08:34:10] fenre_: has joined #ruby
[08:34:54] helpa: has joined #ruby
[08:35:18] last_staff1: has joined #ruby
[08:36:03] the_drow: has joined #ruby
[08:36:11] sjumsa: has joined #ruby
[08:36:12] prooftechnique_: has joined #ruby
[08:36:41] raddazong: has joined #ruby
[08:37:22] knight_: has joined #ruby
[08:37:38] PaulePan1er: has joined #ruby
[08:37:49] GreyKite: has joined #ruby
[08:37:52] Sirecote: has joined #ruby
[08:37:52] My_Hearing: has joined #ruby
[08:37:59] hfp_work: has joined #ruby
[08:38:00] GinoManWorks: has joined #ruby
[08:38:02] exilarch0: has joined #ruby
[08:38:05] edwardly: has joined #ruby
[08:38:05] edwardly: has joined #ruby
[08:38:11] hightower2: has joined #ruby
[08:38:18] Amnez777-: has joined #ruby
[08:38:19] gsingh93: has joined #ruby
[08:38:23] fumk: has joined #ruby
[08:38:30] funnel_: has joined #ruby
[08:38:38] izaac: has joined #ruby
[08:38:42] lianj: has joined #ruby
[08:38:55] lianj: has joined #ruby
[08:39:06] araujo: has joined #ruby
[08:39:42] atmosx_alt: has joined #ruby
[08:39:48] mgorbach: has joined #ruby
[08:39:50] johnDoe111: has joined #ruby
[08:40:03] Lightsword: has joined #ruby
[08:40:10] _Suntzu: has joined #ruby
[08:40:14] Kuukunen: has joined #ruby
[08:40:16] Synthead: has joined #ruby
[08:40:17] jtoy: has joined #ruby
[08:40:40] unvexp: has joined #ruby
[08:40:46] strongcode: has joined #ruby
[08:40:47] sindork: has joined #ruby
[08:41:01] erlend: has joined #ruby
[08:41:45] quarcu_: has joined #ruby
[08:42:01] ironcamel: has joined #ruby
[08:42:19] tekku: has joined #ruby
[08:42:31] schmoot-: has joined #ruby
[08:42:40] certainty: has joined #ruby
[08:42:48] mic_e: has joined #ruby
[08:42:48] voodoofish4302: has joined #ruby
[08:42:49] joeyjones_: has joined #ruby
[08:42:49] ghr: has joined #ruby
[08:42:49] svkurowski: has joined #ruby
[08:42:53] araujo: has joined #ruby
[08:42:57] thoraxe: has joined #ruby
[08:42:58] tmi1: has joined #ruby
[08:42:58] sandelius: has joined #ruby
[08:42:59] EXCHGR: has joined #ruby
[08:42:59] veloutin: has joined #ruby
[08:43:06] insu: has joined #ruby
[08:43:08] iamayam: has joined #ruby
[08:43:09] Fridtjof: has joined #ruby
[08:43:09] joeyjones_: has joined #ruby
[08:43:12] Vircung: has joined #ruby
[08:43:16] dling: has joined #ruby
[08:43:23] zeroDivisible: has joined #ruby
[08:43:25] tommylommykins: has joined #ruby
[08:43:30] awk: has joined #ruby
[08:43:42] abort: has joined #ruby
[08:43:43] chrisarcand: has joined #ruby
[08:43:48] tsunamie: has joined #ruby
[08:43:50] drbrain: has joined #ruby
[08:43:51] unsymbol: has joined #ruby
[08:43:52] unsymbol: has joined #ruby
[08:43:57] bier_: has joined #ruby
[08:43:57] pragmatism: has joined #ruby
[08:44:01] D9: has joined #ruby
[08:44:03] Karunamon: has joined #ruby
[08:44:04] angelixd: has joined #ruby
[08:44:12] blingrang: has joined #ruby
[08:44:15] gf3: has joined #ruby
[08:44:36] Evan-: has joined #ruby
[08:44:38] the_drow: has joined #ruby
[08:44:39] apeiros: has joined #ruby
[08:44:47] moshee: has joined #ruby
[08:44:47] moshee: has joined #ruby
[08:45:22] gomix: has joined #ruby
[08:46:10] timonv: has joined #ruby
[08:46:21] NightMonkey: has joined #ruby
[08:46:27] ytti: has joined #ruby
[08:47:01] yfeldblum: has joined #ruby
[08:47:10] kapowaz: has joined #ruby
[08:47:17] Hates_: has joined #ruby
[08:47:39] deeprave: has joined #ruby
[08:47:40] incomprehensibly: has joined #ruby
[08:49:29] jcp: has joined #ruby
[08:49:30] Fridtjof: has joined #ruby
[08:49:31] spectra: has joined #ruby
[08:49:39] marr: has joined #ruby
[08:49:49] gmci: has joined #ruby
[08:52:04] blackmesa: has joined #ruby
[08:53:40] tvw: has joined #ruby
[08:56:33] weckl: has joined #ruby
[08:57:53] axxyhtrx: has joined #ruby
[08:58:52] nankyokusei: has joined #ruby
[09:00:21] the_drow: has joined #ruby
[09:02:16] LoneHerm_: has joined #ruby
[09:04:01] mdw: has joined #ruby
[09:04:49] pamatya: has joined #ruby
[09:06:49] craigp: has joined #ruby
[09:07:17] ramfjord: has joined #ruby
[09:12:45] the_drow: has joined #ruby
[09:14:43] nerium: has joined #ruby
[09:15:29] czerasz: has joined #ruby
[09:17:19] axxyhtrx: has joined #ruby
[09:18:00] ramfjord: has joined #ruby
[09:18:42] ineb_: has joined #ruby
[09:20:25] ineb_: iam havin troubles in hashing hex strings. Doing Digest::SHA256.hexdigest "1" is hashing the String "1" but what i really want is hashing the number, like Digest::SHA256.hexdigest "\x01". How can i hash a long hex-string like 'deadbeef' that way?
[09:22:00] apeiros: you convert the number into its binary (string) form first
[09:22:26] apeiros: which depends some contextual questions, like how many bits? which endian?
[09:22:57] apeiros: you can use e.g. Array#pack for the conversion
[09:23:25] apeiros: >> [0xdeadbeef].pack("N*")
[09:23:27] ruby[bot]: apeiros: # => "\xDE\xAD\xBE\xEF" (https://eval.in/590698)
[09:24:47] ineb_: good idea. i will tinker with that.
[09:25:43] ineb_: the hash values are coming from a chipcard and iam trying to check, if they are valid.
[09:26:12] ineb_: took me a while to realize that "1" is not 1 :/
[09:26:21] the_drow: has joined #ruby
[09:27:10] apeiros: even "1" can be different from "1"
[09:27:32] ineb_: depending on the encoding
[09:27:53] bruce_lee: has joined #ruby
[09:28:05] edwinvdgraaf: has joined #ruby
[09:28:21] kristofferR: has joined #ruby
[09:28:57] ineb_: yeah, tricky stuff.
[09:31:27] astrobunny: has joined #ruby
[09:32:57] jgt3: has joined #ruby
[09:33:42] opentux: has joined #ruby
[09:34:02] noodle: has joined #ruby
[09:34:40] karmatr0n: has joined #ruby
[09:36:08] charliesome: has joined #ruby
[09:36:39] iCHAIT: has left #ruby: ()
[09:37:23] the_drow: has joined #ruby
[09:37:33] ineb_: >> ["dc79c4664aa45aa5eb4ccd3b63aaf5c06e1605609b4ba1cda16702831a13a441"].pack("N*")
[09:37:36] c355E3B: has joined #ruby
[09:37:41] ineb_: this is doing the trick for me
[09:38:02] ngw: has joined #ruby
[09:38:33] ineb_: oh, how can i trigger the bot?
[09:41:04] the_drow: has joined #ruby
[09:47:22] snowy: has joined #ruby
[09:50:02] aryaching: has joined #ruby
[09:51:01] Mia: has joined #ruby
[09:51:01] Mia: has joined #ruby
[09:51:34] the_drow: has joined #ruby
[09:52:00] certainty: has joined #ruby
[09:53:33] jancel: has joined #ruby
[09:55:27] moeabdol: has joined #ruby
[09:59:08] xall: has joined #ruby
[10:00:12] the_drow: has joined #ruby
[10:00:26] charliesome: has joined #ruby
[10:01:05] the_drow: has joined #ruby
[10:01:14] Vingador: has joined #ruby
[10:01:28] axxyhtrx: has joined #ruby
[10:02:26] aryaching: has joined #ruby
[10:03:08] jhass: ineb_: you need to be identified with nickserv
[10:04:34] chip_: has joined #ruby
[10:06:43] mercerist: has joined #ruby
[10:09:12] RegulationD: has joined #ruby
[10:09:37] Kedare: has joined #ruby
[10:12:56] blackmesa: has joined #ruby
[10:13:47] Gasher: has joined #ruby
[10:14:04] koooge: has joined #ruby
[10:15:16] jgt: has joined #ruby
[10:18:20] the_drow: has joined #ruby
[10:18:46] suchness: has joined #ruby
[10:20:29] suchness: So I have a class with an instance method that returns __FILE__, when I create another class that subclasses the first class and call that method, it gives me back the path from the top level class. Is there a way to get around this?
[10:25:38] vdamewood: has joined #ruby
[10:26:29] hk238: has joined #ruby
[10:27:24] armyriad: has joined #ruby
[10:27:49] TvL2386: has joined #ruby
[10:30:05] the_drow: has joined #ruby
[10:30:15] pawnbox: has joined #ruby
[10:32:04] k3rn31: has joined #ruby
[10:32:47] jhass: I doubt so
[10:33:10] lupine: override the method ^^
[10:34:45] the_drow: has joined #ruby
[10:35:31] matp: has joined #ruby
[10:35:35] karmatr0n: has joined #ruby
[10:40:21] d0lph1n98: has joined #ruby
[10:43:29] nadir: has joined #ruby
[10:44:09] ur5us: has joined #ruby
[10:45:15] the_drow: has joined #ruby
[10:46:09] k3rn31: has joined #ruby
[10:48:48] charliesome: has joined #ruby
[10:49:30] LoneHermit: has joined #ruby
[10:54:21] sdothum: has joined #ruby
[10:56:25] toretore: has joined #ruby
[10:56:28] allcentury: has joined #ruby
[10:57:29] bkxd: has joined #ruby
[10:57:30] aries_liuxueyang: has joined #ruby
[10:59:44] nankyokusei: has joined #ruby
[11:01:30] the_drow: has joined #ruby
[11:02:22] jgt: has joined #ruby
[11:02:56] AlexJakeGreen: has joined #ruby
[11:04:34] amtrivedi: has joined #ruby
[11:04:46] amtrivedi: Does anyone here has experience with bcrypt?
[11:05:47] jhass: ?anyone amtrivedi
[11:05:48] ruby[bot]: amtrivedi: Just ask your question, if anyone has, is or can, they will respond.
[11:06:19] ruby[bot]: -b *!*@gateway/web/cgi-irc/kiwiirc.com/ip.99.181.20.181$#ruby-banned
[11:06:40] last_staff: has joined #ruby
[11:07:48] amtrivedi: I want to know how do I a hash corresponds to a password that was hashed earlier?
[11:08:04] jhass: using the bcrypt gem?
[11:08:20] jhass: or bcrytp-ruby ?
[11:08:31] gnufied: has joined #ruby
[11:08:38] jhass: mh, I guess it's the same by now
[11:09:09] amtrivedi: http://dpaste.com/2Z8TAEY
[11:09:13] norc: ACTION fails to parse amtrivedi's question
[11:10:05] amtrivedi: Now, I want to check if password and hashed correspond to each other.
[11:10:19] amtrivedi: Basically, this - https://github.com/pyca/bcrypt#basic
[11:10:20] norc: amtrivedi: Just use ==
[11:10:29] jhass: amtrivedi: stored = BCrytp::Password.new(hashed); stored == password #=> true
[11:10:34] norc: amtrivedi: So hashed_password == unhashed_password
[11:10:49] norc: (BCrypt has that method override to automatically hash the right side)
[11:14:23] gnufied: has joined #ruby
[11:15:00] the_drow: has joined #ruby
[11:16:39] tvw: has joined #ruby
[11:20:11] Fernando-Basso: has joined #ruby
[11:21:35] moeabdol: has joined #ruby
[11:22:39] pawnbox: has joined #ruby
[11:24:43] startupality: has joined #ruby
[11:26:12] the_drow: has joined #ruby
[11:27:05] phutchins2: has joined #ruby
[11:27:17] the_drow: has joined #ruby
[11:35:04] the_drow: has joined #ruby
[11:36:15] blackmesa: has joined #ruby
[11:36:40] karmatr0n: has joined #ruby
[11:37:32] ldnunes: has joined #ruby
[11:38:11] jgt: has joined #ruby
[11:40:21] amtrivedi: has joined #ruby
[11:42:18] craigp: has joined #ruby
[11:42:59] Guest_: has joined #ruby
[11:44:01] dionysus69: has joined #ruby
[11:45:42] terlar: has joined #ruby
[11:46:29] Vingador: has joined #ruby
[11:47:18] the_drow: has joined #ruby
[11:47:40] d0lph1n98: has joined #ruby
[11:48:06] Fernando-Basso: has joined #ruby
[11:48:53] rodfersou: has joined #ruby
[11:49:24] ryan_notabot: has joined #ruby
[11:51:37] mdw: has joined #ruby
[11:52:22] Hanmac: has joined #ruby
[11:52:32] certainty: has joined #ruby
[11:53:50] mistermocha: has joined #ruby
[11:56:46] the_drow: has joined #ruby
[11:57:39] the_drow: has joined #ruby
[11:58:36] iCHAIT: has joined #ruby
[12:00:30] iCHAIT: In ruby how can I parse a time string containing invalid time?
[12:00:31] iCHAIT: for example  - If I want to parse "3h30m2h"
[12:00:31] iCHAIT: I know I can parse for a valid string time using Time.strptime
[12:00:31] iCHAIT: But strptime doesn't catches the above invalid time duration.
[12:01:13] shevy: Time.parse "3h30m2h" # => 2016-06-17 03:30:02 +0800
[12:01:27] araujo_: has joined #ruby
[12:01:42] shevy: I don't know what your format is there
[12:01:46] shevy: why do you have 2x h
[12:02:18] iCHAIT: I am writing tests for a ruby app, and it involves testing for an invalid time string passed by a user "3h30m2h" for example.
[12:03:48] araujo_: has joined #ruby
[12:04:07] kedare1: has joined #ruby
[12:04:15] sergio_101: has joined #ruby
[12:04:22] ornerymoose: has joined #ruby
[12:04:23] mdw7: has joined #ruby
[12:05:29] Vile`: has joined #ruby
[12:06:12] the_drow: has joined #ruby
[12:07:00] christianrojas: has joined #ruby
[12:07:33] araujo__: has joined #ruby
[12:07:56] mercerist: has joined #ruby
[12:10:04] araujo__: has joined #ruby
[12:10:08] RegulationD: has joined #ruby
[12:10:42] FastJack_: has joined #ruby
[12:11:00] synthroid: has joined #ruby
[12:12:24] araujo__: has joined #ruby
[12:13:08] jhass: has joined #ruby
[12:13:35] araujo_: has joined #ruby
[12:14:45] GodFather: has joined #ruby
[12:15:00] the_drow: has joined #ruby
[12:15:08] synthroid: has joined #ruby
[12:17:13] snowy: has joined #ruby
[12:18:25] conta: has joined #ruby
[12:19:02] ricer2: has joined #ruby
[12:19:07] fmcgeough: has joined #ruby
[12:21:00] Silthias: has joined #ruby
[12:21:17] last_staff: has joined #ruby
[12:27:44] snebel: has joined #ruby
[12:29:19] joonty: has joined #ruby
[12:29:52] tesuji: has joined #ruby
[12:30:09] bkxd: has joined #ruby
[12:32:03] jhass: has joined #ruby
[12:32:06] the_drow: has joined #ruby
[12:33:05] the_drow: has joined #ruby
[12:33:26] ornerymoose: has joined #ruby
[12:33:55] the_drow: has joined #ruby
[12:34:25] duoi: has joined #ruby
[12:34:35] the_drow: has joined #ruby
[12:35:19] the_drow: has joined #ruby
[12:36:20] JakFrist: has joined #ruby
[12:36:27] tubuliferous_: has joined #ruby
[12:37:32] jgt: has joined #ruby
[12:37:32] Yiota: has joined #ruby
[12:37:33] karmatr0n: has joined #ruby
[12:37:43] certainty: has joined #ruby
[12:39:51] nettoweb: has joined #ruby
[12:40:10] pawnbox: has joined #ruby
[12:42:25] yqt: has joined #ruby
[12:42:58] GarethAdams: has joined #ruby
[12:45:40] edwinvdgraaf: has joined #ruby
[12:47:22] bruce_lee: has joined #ruby
[12:48:28] goget: has joined #ruby
[12:50:20] aries_liuxueyang: has joined #ruby
[12:52:11] CloCkWeRX: has joined #ruby
[12:52:39] the_drow: has joined #ruby
[12:53:09] duckpuppy: has joined #ruby
[12:55:37] strigonLeader: has joined #ruby
[12:57:09] ramortegui: has joined #ruby
[12:58:46] Yiota: has joined #ruby
[13:00:31] karmatr0n: has joined #ruby
[13:00:35] nankyokusei: has joined #ruby
[13:02:37] evansbee: has joined #ruby
[13:02:55] jhass: iCHAIT: https://github.com/hpoydar/chronic_duration
[13:03:21] aryaching: has joined #ruby
[13:04:15] ChiefAlexander: has joined #ruby
[13:04:41] snowy: has joined #ruby
[13:05:22] dionysus69: has joined #ruby
[13:05:34] jaguarmagenta: has joined #ruby
[13:06:29] hutch34: has joined #ruby
[13:07:07] vipinj: has joined #ruby
[13:10:18] flashpoint9: has joined #ruby
[13:10:39] cgfbee: has joined #ruby
[13:10:42] FernandoBasso: has joined #ruby
[13:11:09] CloCkWeRX: has joined #ruby
[13:11:41] greg: has joined #ruby
[13:11:53] iCHAIT: jhass: Thanks.
[13:14:57] k3dare: has joined #ruby
[13:15:03] malconis: has joined #ruby
[13:15:08] araujo__: has joined #ruby
[13:16:13] startupality: has joined #ruby
[13:16:30] malconis: has joined #ruby
[13:17:25] Vile`: has joined #ruby
[13:17:56] aegis3121: has joined #ruby
[13:18:17] jrafanie: has joined #ruby
[13:18:36] rippa: has joined #ruby
[13:20:20] sepp2k: has joined #ruby
[13:22:49] roamingdog: has joined #ruby
[13:25:38] Dysp: has joined #ruby
[13:28:36] startupality: has joined #ruby
[13:28:43] tknz: has joined #ruby
[13:28:56] Dysp: Mjello! When I initialize an object of the class, I do this by opening the excel sheet, grabbing what data I need and return an array of arrays. I like dat. However, when I next call my .calculate function to deal with these arrays, the data is gone. I think this is because I don't assign it to an instance-variable. The reason why I don't want to do this, is because I don't need the raw data to stay in the object when the calculations are
[13:29:02] Dysp: What would be the proper way of doing this?
[13:29:14] Dysp: Create the instance variable and then remove it from the instance when used?
[13:29:15] Dysp: https://gist.github.com/Dysp/574320db19b811233a1144fba151dbea
[13:29:47] jancel: has joined #ruby
[13:30:10] CJKinni: has joined #ruby
[13:30:24] snowy: has joined #ruby
[13:31:07] Silthias: has joined #ruby
[13:32:13] jhass: Dysp: no, repeating the same pattern you already did between load and extract_values
[13:32:45] Dysp: So basicly just passing the data as a parameter?
[13:33:08] JakFrist: has joined #ruby
[13:33:58] Dysp: Alrighty! ty
[13:34:02] snebel: I'm wondering if anybody knows if is possible to get an object.hash value which is always the same value no matter the session is running, I'd like to store that value and use it to compare objects later..
[13:34:04] snebel: http://pastebin.com/raw/v49a1NLJ
[13:34:05] ruby[bot]: snebel: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[13:34:24] LoneHerm_: has joined #ruby
[13:34:33] snebel: that's the issue...
[13:34:34] snebel: https://gist.github.com/snebel29/d68a304b147d151ee4c4b390aa9bee72
[13:34:37] JeremyM_: has joined #ruby
[13:35:18] toretore: snebel: why do you need it to be the same?
[13:35:38] snebel: well I try to compare objects such a hash
[13:35:50] snebel: but i want to compare them later in time..
[13:36:01] mattwashere: has joined #ruby
[13:36:06] toretore: snebel: why?
[13:37:10] agentmeerkat: has joined #ruby
[13:38:02] snebel: I'm working in an script that produce yaml files, then I import them into an external software (rundeck) that produces job definitions, I'd like to being able to see if somebody modified the initial yaml definition by generating some kind of hash...
[13:38:40] snebel: I'm experimenting how to produce this "hash" from a yaml object definition.
[13:38:46] allcentury: has joined #ruby
[13:38:50] nicoulaj: has joined #ruby
[13:39:01] Silthias: has joined #ruby
[13:39:12] toretore: then use a predictive hasging algorithm like sha or md5
[13:39:26] jhass: why do you have to compare a "hash"? Can't you just load the whole object and use Hash#== ?
[13:39:26] toretore: Digest::MD5.hexdigest(File.read('some.yaml'))
[13:39:32] snebel: Yeah I started using that but there is a problem with that
[13:39:54] toretore: what you want to know is if the bytes inside the file have changed
[13:39:56] snebel: the yaml files are not always ordered on the same way before import and after import
[13:40:09] lupine: well, semantic change is what you're interested in
[13:40:17] lupine: a mere whitespace commit can be skipped
[13:40:33] snebel: yaml/pysch produce and object that is an array of nested arrays and hashes
[13:40:45] moty66: has joined #ruby
[13:40:59] snebel: hashes are not always ordered so the md5/sha1 don't produce always the same "hash"
[13:41:09] lupine: hashes are ordered from 1.9 up aren't they?
[13:41:13] glcx: has joined #ruby
[13:41:13] glcx: has joined #ruby
[13:41:34] lupine: and positional changes in arrays may be significant, of course
[13:41:37] snebel: but don't forget that i'm importing/exporting the yaml defintion from a third party software rundeck
[13:41:43] snebel: which is not using ruby...
[13:42:01] snebel: so the order is not always the same
[13:42:04] toretore: you have to define more clearly what kind of change you care about
[13:42:32] lupine: right, but a DeepEquals-alike of a hash loaded from the yaml in ruby should be correct
[13:42:42] mshowman: has joined #ruby
[13:42:48] toretore: whether it's any change at all or only if it's semantically significant
[13:42:48] snebel: DeepEquals ?
[13:42:56] lupine: certainly more so than an md5sum
[13:43:07] snebel: sorry what is that?
[13:43:07] lupine: sorry, I do more go than ruby these days (for now)
[13:43:16] lupine: I'm sure ruby has an equivalent
[13:43:24] toretore: snebel: it's hash == other_hash
[13:43:39] snebel: yeah but the hash is different in differnt sessions
[13:43:47] snebel: https://gist.github.com/snebel29/d68a304b147d151ee4c4b390aa9bee72
[13:43:50] snebel: see it here
[13:43:54] toretore: hash being an instance of Hash
[13:43:57] swills: has joined #ruby
[13:43:57] matp: has joined #ruby
[13:43:59] snebel: this is basicaly what i'm looking for..
[13:44:04] toretore: i'm not talking about the hash method
[13:44:20] Dysp: Okay, okay, I am getting an "else without rescue is useless" warning for this: return true if array.inject(:+).quo(array.size) > 0 else return false
[13:44:22] toretore: what you're trying to do is not the way to do it
[13:44:37] Dysp: It's all in one line. Is this bad practice? I'm just trying to short it down. Would there be a more proper way of writing it?
[13:44:40] snebel: well i'm looking for inspiration :-)
[13:44:46] snebel: any suggestion?
[13:44:59] toretore: you have two real options: use Hash#== or compare the byte contents of the file using MD5 or SHA
[13:45:21] toretore: and to know which one to use, you have to define exactly what changes you care about
[13:45:51] toretore: Dysp: use a proper if-else-end
[13:46:10] Dysp: Do I dare ask why?
[13:46:20] Mia: has joined #ruby
[13:46:20] Mia: has joined #ruby
[13:46:21] toretore: because what you have is incorrect
[13:46:22] snebel: I started trying to do SHA1 on a file but seems a mess because the same YAML can be expressed on different ways
[13:46:35] flashpoint9: has joined #ruby
[13:46:41] toretore: snebel: does it make a difference?
[13:46:44] snebel: so you have a different file for the same definition plus the pbm of order
[13:46:50] Dysp: Well okay. Will do then
[13:47:14] palms: has joined #ruby
[13:47:20] snebel: yes, the SHA1 is different because of how the array es defined
[13:47:35] snebel: or if the yaml is exported using &1 values
[13:47:47] toretore: snebel: yes, but does it matter?
[13:48:10] toretore: snebel: context is important
[13:48:20] snebel: well, I think yes because the sha1 produced when i created the file an the one that i compute later is different
[13:48:39] toretore: you've said that 5 times now
[13:48:43] toretore: this is established
[13:49:05] jhass: let me repeat myself since you didn't answer: why do you have to compare a "hash"? Can't you just load the whole object and use Hash#== ?
[13:49:29] toretore: the question is, does it matter for your use case whether or not you get false positives?
[13:49:31] vipinj: has joined #ruby
[13:49:53] snebel: never used #== method let me check...
[13:50:02] jhass: oh I'm sure you did
[13:50:12] jhass: >> {a: 1, b: 2} == {b: 2, a: 1}
[13:50:13] ruby[bot]: jhass: # => true (https://eval.in/590896)
[13:50:27] snebel: fuck yes looks like could work
[13:50:52] snebel: you meant ==
[13:50:54] jhass: only cavehat is
[13:51:02] jhass: >> [1, 2] == [2, 1]
[13:51:03] ruby[bot]: jhass: # => false (https://eval.in/590897)
[13:51:11] snebel: yeah but for arrays is fine
[13:51:16] snebel: because order matters
[13:51:47] snebel: well, I'm going to test it but i'm going to feel really stupid if that works after the whole morning playing with that :-)
[13:51:57] dkam: has joined #ruby
[13:52:00] allcentury: has joined #ruby
[13:52:09] jhass: I don't English :P
[13:52:17] aegis3121: Going spelunking in sourcecode
[13:52:57] LoneHerm_: has joined #ruby
[13:54:22] Silthias1: has joined #ruby
[13:54:50] snebel: ah yes, the thing is I'm trying to store just a hash like string, not the whole yaml defintion...
[13:54:58] snebel: for compare it later
[13:55:15] snebel: may be I should store the whole yaml/object definition..
[13:55:42] ncthom91: has joined #ruby
[13:55:58] snebel: but yes I was all the time trying to just store some short string and being able to produce that same string later
[13:56:26] snebel: only way of comparing obj == obj would be storing the whole initial yaml definition
[13:56:29] snebel: i was trying to avoid that
[13:56:48] lupine: another option is to write your own semantic hasher for your own data
[13:56:54] babblebre: has joined #ruby
[13:57:06] snebel: semantic hasher? what you mean?
[13:57:13] jhass: or to bring it into a canonical from
[13:57:17] snebel: sorry i'm bit newbie
[13:57:37] snebel: canonical form? mm let's google some..
[13:57:45] jhass: that is sort by hash key, recursively, join all string values, sha1/md5 that
[13:57:59] jhass: something like that
[13:58:21] snebel: ah yes, i start this morning working on that
[13:58:36] rueben: has joined #ruby
[13:58:48] snebel: but found that array of hashes some times don't have same key to use for ordering
[13:58:56] blackmesa: has joined #ruby
[13:59:07] snebel: so it start getting more and more complex..
[13:59:23] lupine: it's a reasonably hard problem, TBH
[13:59:42] lupine: ruby lets you ignore these things for a very long time, until suddenly the built-in stuff stops working
[14:00:39] snebel: well I got some good ideas here
[14:00:51] snebel: may be i'll have to store the whole defintionm
[14:00:59] snebel: if i want to do it simple..
[14:01:21] snebel: may be i have to really go for this complex canonical regularisation
[14:01:28] certainty: has joined #ruby
[14:01:35] snebel: thank you all for you time :-)
[14:01:38] flok420: has joined #ruby
[14:06:12] c0mrad3: has joined #ruby
[14:07:29] blaxter: has joined #ruby
[14:07:30] flok420: trying to learn ruby. doing so by creating a bf to ruby converter. the result is http://vps001.vanheusden.com/~folkert/rub.rb running fails with "rub.rb:41: syntax error, unexpected keyword_end" but I see not why. any suggestions?
[14:08:38] kobain: has joined #ruby
[14:08:40] vipinj: has joined #ruby
[14:09:38] jhass: why does that thing force me to download it? -.-
[14:10:26] flok420: I'm not sure. let me paste it in pastebin. hold on
[14:10:26] jhass: huh, three spaces for indentation? that's... unique
[14:10:35] flok420: oh you got it
[14:10:41] chouhoulis: has joined #ruby
[14:10:44] jhass: flok420: ruby doesn't have foo++
[14:10:48] jhass: use foo += 1
[14:11:01] RegulationD: has joined #ruby
[14:11:03] Silthias1: has left #ruby: ()
[14:12:48] flok420: works much better :-)
[14:13:51] cek: has left #ruby: ()
[14:14:15] idle_task: has joined #ruby
[14:15:21] nerium: has joined #ruby
[14:16:38] deuterium: has joined #ruby
[14:17:18] SilverKey: has joined #ruby
[14:19:32] augcesar: has joined #ruby
[14:20:27] flok420: ok works. thanks!
[14:20:41] dionysus69: has joined #ruby
[14:21:48] dstarh: has joined #ruby
[14:21:57] Silthias: has joined #ruby
[14:23:45] ljarvis: has joined #ruby
[14:25:21] davedev24: has joined #ruby
[14:26:04] DanyC: has joined #ruby
[14:26:28] pawnbox: has joined #ruby
[14:26:51] fenre: has joined #ruby
[14:27:08] ChiefAlexander: has joined #ruby
[14:28:05] nerium: has joined #ruby
[14:28:30] certainty: has joined #ruby
[14:31:35] blackgoat: has joined #ruby
[14:33:42] sid_fules: has joined #ruby
[14:34:03] fenre: has joined #ruby
[14:34:05] bkxd: has joined #ruby
[14:35:01] clubsoda_christ: has joined #ruby
[14:35:36] jhack: has joined #ruby
[14:36:26] ur5us: has joined #ruby
[14:36:41] spiette: has joined #ruby
[14:38:22] prestorium: has joined #ruby
[14:40:29] christianrojas: has joined #ruby
[14:40:39] cdg: has joined #ruby
[14:41:26] evidex: has joined #ruby
[14:41:39] yardenbar: has joined #ruby
[14:43:15] frem_: has joined #ruby
[14:43:50] pawnbox: has joined #ruby
[14:43:54] Renich: has joined #ruby
[14:44:04] tjohnson: has joined #ruby
[14:45:12] mercerist: has joined #ruby
[14:47:30] arajakul: has joined #ruby
[14:49:32] mrgrieves: has joined #ruby
[14:50:06] mattwashere: has joined #ruby
[14:51:01] mrgrieves: with an array of integers, how would you suggest to check if the sum of any 2 items returns an specific number
[14:52:34] bmbouter: has joined #ruby
[14:52:47] bmbouter: I'm trying to configure a redirect using WEBrick
[14:52:56] bmbouter: the docs seem almost non-existant
[14:53:58] snebel: mrgrieves: how much data are you expeting? how big the numbers?
[14:54:13] kareeoleez: has joined #ruby
[14:54:40] fenre: has joined #ruby
[14:55:10] jhass: mrgrieves: sounds like a code challenge, what did you try so far?
[14:55:22] mrgrieves: snebel: not big
[14:55:42] DanielI: has joined #ruby
[14:56:07] snebel: not big numbers and not too much numbers?
[14:56:09] moos3: has joined #ruby
[14:56:13] mrgrieves: jhass: I'm looking at the enumerable docs trying to find the best way to iterate
[14:56:14] RegulationD: has joined #ruby
[14:56:33] dsimon: mrgrieves, you probably want to start off with "each"
[14:56:34] mistermocha: has joined #ruby
[14:56:37] snebel: why just not use some nested loop to sum each element which each other?
[14:56:43] mrgrieves: snebel: not too much numbers
[14:57:10] arajakul: Anyone know how to best practise recommendations for provisioning a cluster? 3 node cluster, node 2 and 3 require node 1 to perform certain tasks first, then node 2/3 run tasks, then node 1 require to perform tasks again.
[14:57:47] mrgrieves: dsimon: thanks I guess I'll have to combine it with snebel 's suggestion
[14:57:48] dsimon: arajakul, can you be more specific? what are these nodes doing?
[14:57:54] polishdub: has joined #ruby
[14:58:48] ChiefAlexander: has joined #ruby
[14:58:52] dsimon: that said: the best approach for inter-node data dependencies is usually queues
[14:59:06] dsimon: assuming you can get away with asynchronicity
[14:59:07] arajakul: dsimon, node 1 generates a file and pushes them to node 2 and 3/ or node 2and3 pull the file from node 1 after generation
[14:59:46] dsimon: arajakul, where is the file coming in initially?
[14:59:57] arajakul: node 1 runs a script
[15:00:03] arajakul: it generates a file
[15:00:44] CJKinni: has joined #ruby
[15:00:58] agent_white: has joined #ruby
[15:01:04] allcentury: has joined #ruby
[15:01:11] dsimon: so i'd recommend something like a rabbitmq work queue
[15:01:17] dsimon: https://www.rabbitmq.com/tutorials/tutorial-two-ruby.html
[15:01:27] nankyokusei: has joined #ruby
[15:01:31] arajakul: omg i feel like an idiot
[15:01:42] arajakul: i asked that in the wrong channel, meant to ask in #chef
[15:02:02] startupality: has joined #ruby
[15:02:12] dsimon: ah, no worries :-)
[15:02:17] arajakul: appreciate the answer tho dsimon ;D
[15:02:56] chouhoulis: has joined #ruby
[15:03:02] mistermo_: has joined #ruby
[15:03:15] kareeoleez: has joined #ruby
[15:03:28] SilverKey: has joined #ruby
[15:04:11] snath: has joined #ruby
[15:04:32] mistermocha: has joined #ruby
[15:06:27] pglombardo: has joined #ruby
[15:06:35] jhack: has joined #ruby
[15:06:45] moeabdol: has joined #ruby
[15:07:49] alexandernst: What is the difference between "has_many :services, :dependent => :destroy" and "has_many :services, dependent: :destroy" ?
[15:08:01] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[15:08:09] jhass: on the ruby level there's none
[15:09:00] kareeoleez: has joined #ruby
[15:09:46] lictor36: has joined #ruby
[15:10:42] eGGshke: has joined #ruby
[15:11:32] alexandernst: ok, thank you
[15:13:59] moeabdol: has joined #ruby
[15:15:01] Long: has joined #ruby
[15:16:32] chouhoul_: has joined #ruby
[15:17:40] tvw: has joined #ruby
[15:18:52] tuelz: has joined #ruby
[15:19:14] chouhoul_: has joined #ruby
[15:21:19] SilverKey: has joined #ruby
[15:21:40] GodFather: has joined #ruby
[15:23:29] christianrojas: has joined #ruby
[15:24:50] moeabdol: has joined #ruby
[15:25:32] pglombar_: has joined #ruby
[15:26:41] bkxd_: has joined #ruby
[15:27:05] fergal: has joined #ruby
[15:27:14] fergal: hi guys, does anyone here use browser mob?
[15:27:37] moos3: has left #ruby: ()
[15:29:31] shevy: never heard of that before
[15:30:45] moeabdol: has joined #ruby
[15:30:46] evansbee: has joined #ruby
[15:34:46] aryaching: has joined #ruby
[15:35:59] astrobunny: has joined #ruby
[15:36:02] xall: has joined #ruby
[15:36:47] nettoweb: has joined #ruby
[15:37:34] khaki: has joined #ruby
[15:37:57] wrkrcoop: has joined #ruby
[15:41:21] k3rn31: has joined #ruby
[15:41:58] smathy: has joined #ruby
[15:42:29] koochdog: has left #ruby: ()
[15:43:03] dkam: has joined #ruby
[15:44:02] moeabdol: has joined #ruby
[15:44:18] dstarh: has joined #ruby
[15:44:57] apeiros: though I think jhass failed and should have said 5…
[15:45:16] jhass: apeiros: weekend?
[15:45:24] Yiota: has joined #ruby
[15:45:29] apeiros: if I say yes, are you gonna ping me? :D
[15:45:49] apeiros: yes, weekend. alright, let's get that thing done :)
[15:46:32] gregor3005: has joined #ruby
[15:46:45] dcunit3d: has joined #ruby
[15:47:25] diegoviola: has joined #ruby
[15:47:33] [Butch]: has joined #ruby
[15:47:59] jgt: has joined #ruby
[15:50:19] droidburgundy: has joined #ruby
[15:53:18] zacstewa1t: has joined #ruby
[15:54:41] iCHAIT: has left #ruby: ()
[15:55:29] Yiota: has joined #ruby
[15:56:03] devster31: has joined #ruby
[15:56:32] danostrowski: has joined #ruby
[15:58:59] khaki: has joined #ruby
[16:01:23] whathappens: has joined #ruby
[16:01:34] bmbouter: I'm using WEBrick and doing a server.mount which is working
[16:01:41] bmbouter: I want it to match "/" and only "/"
[16:01:58] bmbouter: server.mount "/", WebForm
[16:02:05] bmbouter: instead that matches / and also /someotherpage
[16:02:24] TomyLobo: has joined #ruby
[16:03:20] bmbouter: how can I have the "dir" option in server.mount use a regex?
[16:03:20] chip_: has joined #ruby
[16:03:27] ljarvis: bmbouter: that's not how it works, you'll need to check for the request path inside your WebForm and then reject it if it's not "/"
[16:03:48] bmbouter: and if I reject it will it server from the static filesystem?
[16:04:03] flok420: has left #ruby: ("Looking for an alternative to irssi/x-chat? Check f-irc! http://www.vanheusden.com/fi/")
[16:04:18] terminalrecluse: has joined #ruby
[16:04:28] ljarvis: well, you would explicitly respond with whatever behaviour you wanted
[16:05:43] ljarvis: it sounds like you want a bit more flexibility than webrick provides though. Have you thought about alternatives?
[16:06:41] matp: has joined #ruby
[16:06:48] bmbouter: ljarvis: I have considered switching
[16:07:03] ljarvis: (and no, the dir option can't use a regex)
[16:07:09] khaki: has joined #ruby
[16:07:19] bmbouter: can't I just tell it to match against the next rule
[16:07:19] omphe: has joined #ruby
[16:07:28] bmbouter: "I'm not the handler you're looking for"
[16:08:09] ljarvis: what's the next rule? if you match against "/" then you match everything under "/". So you should add rules for more specific paths
[16:08:19] ljarvis: then "/" could be your catch-all
[16:08:55] khaki: has left #ruby: ()
[16:09:19] amclain: has joined #ruby
[16:09:41] yqt: has joined #ruby
[16:09:57] khaki: has joined #ruby
[16:11:51] jetpackjoe: has joined #ruby
[16:12:52] khaki: has joined #ruby
[16:14:39] roamingdog: has joined #ruby
[16:15:36] choke: has joined #ruby
[16:16:47] Yiota: has joined #ruby
[16:17:10] robmclark: has joined #ruby
[16:19:19] dkam: has joined #ruby
[16:19:42] blackmesa: has joined #ruby
[16:20:52] robmclark: Hello. When I try to drag a .rb file to my mac terminal, I get permission denied or no such directory. I am very new to programming so I haven’t been able to understand the solution recs when I googled my problem.
[16:21:49] adaedra: try typing 'ruby ' before drag'n'droping into the terminal
[16:21:58] robmclark: okay I will try now
[16:22:45] pglombardo: has joined #ruby
[16:24:04] braincrash: has joined #ruby
[16:25:26] jancel: has joined #ruby
[16:26:24] khaki: has joined #ruby
[16:26:58] robmclark: Adaedra- Thank you very much. Worked like a charm. Now back to tutorials :)
[16:27:14] yokel: has joined #ruby
[16:27:37] mistermocha: has joined #ruby
[16:27:58] Lewix: has joined #ruby
[16:28:07] mdw: has joined #ruby
[16:28:16] Lewix: hey folks
[16:28:28] Lewix: It's been a while
[16:29:00] khaki: has left #ruby: ()
[16:29:24] Lewix: I"m refreshing my ruby. Definition question; what does it mean "arguments shadow the same named variables from outer scope"
[16:29:31] khaki: has joined #ruby
[16:29:33] mattwashere: has joined #ruby
[16:29:53] Veejay: Arguments to what?
[16:29:54] khaki: has left #ruby: ()
[16:30:18] khaki: has joined #ruby
[16:31:05] robmclark: has left #ruby: ()
[16:32:12] flashpoint9: has joined #ruby
[16:32:12] Veejay: Lewix: If you have foo = "blah"; 10.times {|foo| puts foo}, it will display 0, 1, 2, etc.
[16:32:16] Veejay: I think that's what it means
[16:32:19] Lewix: here's how I understand it: attr ={sex: male} debug_only {|foo| attr = {} ; attr[:sex] = foo} attr is on the outer scope is overriden
[16:32:54] chouhoulis: has joined #ruby
[16:33:12] Yiota: has joined #ruby
[16:33:48] Lewix: Veejay: what does shadow mean? it's a definition problem I'm having
[16:33:53] cschneid: has joined #ruby
[16:34:42] Lewix: Veejay: I assumed shadow meant that 'it's a reference to..."
[16:34:51] aberen: has joined #ruby
[16:34:53] smathy: No, shadow means it hides the outer var,.
[16:35:09] smathy: It puts it in shade, so it can't be seen anymore.
[16:35:38] Lewix: smathy: thanks now it makes sense to use this term
[16:35:49] Lewix: ACTION kicks English in the butt
[16:37:09] smathy: In this sense it's basically a synonym for "obscure"
[16:37:51] braincrash: has joined #ruby
[16:37:56] jxs_: has joined #ruby
[16:38:01] Veejay: Yeah, the former variable with that name is now in the shadow of the glory of the new variable
[16:38:03] aegis3121: has joined #ruby
[16:38:05] Lewix: smathy: I was thinking of shadow as in a dark area or shape produced by a body coming between rays of light and a surface. - basically a reference to my body
[16:38:24] jorrin: has joined #ruby
[16:38:28] apeiros: Lewix: btw., same term is used for "local variable shadows method"
[16:38:43] apeiros: >> def foo; 123; end; foo = 987; foo # <-- won't call the method
[16:38:44] ruby[bot]: apeiros: # => 987 (https://eval.in/591032)
[16:38:45] smathy: Lewix, yeah, in that sense and in the other sense (of shadowing someone, as in following them around and observing them) the usage here is confusing.
[16:39:00] Lewix: smathy: bad name if you ask me
[16:39:09] Lewix: apeiros: yup
[16:39:31] smathy: ...but y'know, we English speakers all just decided spontaneously to start using the word as a synonym for "obscure"
[16:40:01] Lewix: smathy: I'm sorry to hear that :)
[16:40:02] smathy: http://memesvault.com/wp-content/uploads/Deal-With-It-Dog-Gif-01.jpg
[16:40:21] Lewix: smathy: it probably add a lot of complexity in your life
[16:40:24] pilne: has joined #ruby
[16:40:34] Lewix: thanks guys
[16:40:40] smathy: We don't even notice :)
[16:40:46] noodle: has joined #ruby
[16:41:01] smathy: ...until some poor bugger has to ask about it and it's like: "Oh yeah, we fucked that one up.... again."
[16:41:07] Lewix: smathy: so you instinctively thought about shadow as in obscure while I thought about shadow as in shadowing someone
[16:41:33] Lewix: that's complexity right there
[16:41:37] smathy: It's like casting a shadow on something makes it harder to see.
[16:41:38] smathy: ...makes perfect sense ;)
[16:41:44] allcentury: has joined #ruby
[16:42:20] Veejay: Hey Apeiros, meant to ask, outside of Ruby, which other languages do you use and like?
[16:42:33] Lewix: Veejay: am I eligible to answer?
[16:43:17] apeiros: Veejay: sadly not too many atm. javascript is the only other language I use to a relevant degree. C++ and C to a much lesser degree.
[16:43:30] Veejay: Color me surprised
[16:44:11] apeiros: the list of languages I'd like to play more with is long, the available time to do so is short :-/
[16:44:24] blaxter: has joined #ruby
[16:44:25] Veejay: apeiros: Ever checked Crystal?
[16:44:41] Veejay: Close enough to Ruby that it's appealing
[16:44:48] moeabdol: has joined #ruby
[16:44:57] wrkrcoop: has joined #ruby
[16:45:10] spudowiar: has joined #ruby
[16:45:14] Veejay: I'm afraid it's actually too close to Ruby and ends up being deceiving
[16:45:15] ytti: surely you're joking mr. feynman
[16:45:45] apeiros: Veejay: no. atm I prefer investing otherwise unspent time in C++
[16:45:54] Veejay: C++ is solid
[16:46:04] Veejay: It's a great language to have up your sleeve
[16:46:14] Veejay: It's like C, they're never going away those languages
[16:46:24] smathy: Despite many people's wishes.
[16:46:37] banister: has joined #ruby
[16:46:46] Veejay: smathy: If you start listening to "people" when picking your PLs, you do nothing
[16:47:39] smathy: I'm one of those people, C++ has never appealed to me.
[16:48:08] Veejay: The versatility, the speed, the tooling and the ubiquity has never appealed to you?
[16:49:37] lupine: I've used C++, but I don't *like* it
[16:50:01] Veejay: To be honest, I don't much like the look of it either
[16:50:03] lupine: fortunately, the state of programming language research is pretty good these days
[16:50:08] Veejay: But I can still recognize the strengths
[16:50:11] lupine: OSes and languages are experiencing a bit of a boom time at the moment
[16:50:39] bmbouter: ljarvis: yeah good point about the catch all
[16:51:36] tuelz: has joined #ruby
[16:53:02] pilne: in my learning/reading about ruby, i saw there were some serious debates a few years ago (at least... strongly worded blogs) about inheritence vs. composition, i've always thought that a nice thing about ruby is that it gives the options for either and you can utilized them together to make the most elegant solution?
[16:53:17] smathy: Veejay, sure, but those exist in other languages without any of the downsides, eg. C. I don't remember a time when any of the appealing features of the C++ ecosystem weren't fairly quickly copied into the C world.
[16:53:26] lupine: wellll, it's not really a ruby thing
[16:53:51] lupine: the language features might tip the cost-benefit one way or another slightly
[16:53:57] lupine: but this has been going on since at least SOLID, surely?
[16:54:04] marr: has joined #ruby
[16:54:12] smathy: Yep, most of it boils down to personal preference.
[16:54:18] smathy: I find C++ cumbersome.
[16:54:39] lupine: a bad inheritence hierarchy in ruby is still going to be bad
[16:55:14] pilne: but having both options, instead of the one-or-another that some languages go for, allows to make it all neat and tidy during refactoring (or creation if you are a better coder than i)
[16:55:36] lupine: well, no. with the general standard of the workforce, it's easy to convincingly argue that people should default to not using inheritence
[16:55:43] dkam: has joined #ruby
[16:55:44] smathy: ...maybe because I learnt C first and in the 90s, I think by that time C was a lot friendlier than it was when Stroustrup started C++
[16:56:00] lupine: pepole who actually know better will continue to use it, they're not the target audience
[16:56:03] pilne: i'm not talking "general code-monkeying" i'm talking someone's pet project type code.
[16:58:14] smathy: pilne, I agree btw, re Ruby and inheritance vs composition - it's something that appealed to me a lot too.
[16:58:56] pilne: i see myself creating it all initically with composition, and then refactoring to use inheritence where it is more elegant.
[16:59:01] pilne: initially*
[16:59:27] mistermocha: has joined #ruby
[16:59:46] ChiefAlexander: has joined #ruby
[16:59:55] jsownz: has joined #ruby
[16:59:56] dreinull: has joined #ruby
[17:00:37] lupine: Metz is of the opinion that when introducing subclasses, you should start with an empty superclass and promote behaviour upwards, ISTR
[17:00:40] dreinull: I include a module that has a method that might or might not exist in my class. if it dooesn't exist, fine, use it. If it does, use the original one. How can I do that?
[17:00:46] lupine: which could be seen as the same sort of thing
[17:01:26] bluOxigen: has joined #ruby
[17:02:18] nankyokusei: has joined #ruby
[17:02:37] smathy: dreinull, use prepend instead of include
[17:03:38] dreinull: prepend does the same thing here, right? The prepended modules method will be accessed first.
[17:03:58] dreinull: I want it the other way round, but you reminded me of something
[17:04:17] smathy: dreinull, so you think that prepend is just an alias for include ?
[17:04:30] lupine: I really need my own copy of POODR
[17:04:40] mercerist: has joined #ruby
[17:05:37] jiblet: has joined #ruby
[17:05:37] shevy: good old poodle
[17:06:40] jiblet: I need im using the select method and I was wondering if there was any easy way to return the results which returned true along with another list of the ones which returned false
[17:06:55] last_staff: has joined #ruby
[17:07:11] eam: jiblet: #partition
[17:07:21] omphe: has joined #ruby
[17:07:25] jiblet: much obliged eam
[17:07:29] dreinull: no, I assumed it puts those modules methods first
[17:07:46] hahuang62: has joined #ruby
[17:07:51] jiblet: christ ruby has such specific methods
[17:08:05] dreinull: smathy and include depends on where it is included
[17:08:13] firstdayonthejob: has joined #ruby
[17:08:31] lupine: things get really exciting with diamond inheritence
[17:09:11] ramfjord: has joined #ruby
[17:09:14] smathy: dreinull, so if prepend puts the module methods first, then if they're in the class too then they will override the module methods, isn't that what you wanted?
[17:10:01] dreinull: smathy ouch, you got me.
[17:10:20] smathy: lupine, meh, as long as there's a rule that's easy to understand, it's no different than any method overriding.
[17:10:52] lupine: that's that long-standing issue in computer science resolved
[17:10:59] lupine: on to the next one, I guess
[17:11:33] dreinull: smathy ok, it's more complicated than that. I also dynamically create that class with all its methods so I can't prepend it because it doesn't yet exist.
[17:11:50] hahuang65: has joined #ruby
[17:12:45] smathy: lupine, the fact that there are multiple ways to implement the solution to it doesn't mean that there's no solution. Languages already do exactly what I suggested.
[17:13:00] smathy: dreinull, prepend is just a method call.
[17:13:11] lupine: smathy: having an arbitrary rule does not solve the problem
[17:13:59] lupine: you've obviously got to do something if you permit diamond inheritance, and that something is more likely to be deterministic than not
[17:14:40] smathy: lupine, it does for the user of that language. The author of that language has to select which implementation to use, but this is not something that they don't already have to do with multiple inheritance or really, with any method dispatching / ancestor chain.
[17:14:43] lupine: that doesn't stop it from getting very insane, very quickly
[17:15:01] Hiryu: has left #ruby: ()
[17:16:13] apeiros: random preference in diamond inheritance - that sounds like fun
[17:16:31] apeiros: preferably the randomness is at run-time, not compile-time
[17:17:10] cschneid: From inside of ruby, is there a constant that is the location ruby is installed to?
[17:17:14] smathy: That was meant to be a smile.
[17:17:25] lupine: apeiros: personally I'd prefer it if ruby would forbid conflicting method definitions in this case
[17:17:35] apeiros: lupine: ruby doesn't have diamond inheritance
[17:17:43] lupine: modules are pretty close to it
[17:17:44] cschneid: something like this, but less hacky - >> Set.new.method(:each).source_location ## => => ["/Users/cschneid/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/set.rb", 304]
[17:17:48] apeiros: lupine: no they're not
[17:17:51] apeiros: they're strictly linear
[17:17:51] mdw7: has joined #ruby
[17:18:12] lupine: mm, I know
[17:18:28] apeiros: then you should also know that there's no "almost diamond inheritance" :)
[17:18:45] elifoster: has joined #ruby
[17:19:29] GodFather: has joined #ruby
[17:19:32] malconis: has joined #ruby
[17:19:47] lupine: the problem is identical. the solution is the adoption of linearity, which is arbitrary
[17:20:18] shevy: ruby is a gentle language, not the forbidding type
[17:20:20] lupine: if you rely on including lots of interdependent modules, you're going to suffer quickly
[17:20:56] apeiros: yeah. you can suffer quickly in many languages in even more ways.
[17:21:01] apeiros: news at eleven :D
[17:21:17] apeiros: it's a trade-off problem. something's gotta give.
[17:21:54] smathy: apeiros, you can have the same diamond problem in ruby, one class includes two modules which each include the same single module.
[17:21:57] apeiros: my preference would go another way than yours, lupine
[17:22:29] smathy: apeiros, it's just that ruby has a very clearly defined "last in wins" implementation.
[17:22:41] lupine: permit the language to have the feature, but fire anyone using it?
[17:22:46] Pharaoh2: has joined #ruby
[17:23:42] apeiros: hm, seems the mechanism for modules including modules has changed since I last fiddled with it. or I misremember. afaik it used to be "copy", not truly "include"
[17:24:06] lupine: ACTION got to learn how all this works the hard way, with a massive ruby-qt monolith using many many modules that had to be included *just so*
[17:24:08] lupine: *shudder*
[17:24:52] smathy: apeiros, I can't speak for < 2
[17:25:06] shevy: don't say you use ruby-qt lupine
[17:25:13] lupine: *I* don't :D
[17:25:30] apeiros: smathy: seems I can't speak for >2 :D
[17:25:31] lupine: that was a hell of a week
[17:25:40] apeiros: got to update my knowledge
[17:25:48] lupine: (incidentally, it's really hard to get it working on macs)
[17:25:51] apeiros: but not now
[17:25:53] smathy: apeiros, I can't speak for < 2
[17:26:24] shevy: is this a loop
[17:26:34] Guest3816: has joined #ruby
[17:26:56] smathy: Ha, sorry, I `arrow-up enter`ed in the wrong window :)
[17:27:41] RegulationD: has joined #ruby
[17:28:00] smathy: Seriously, focus-follows-eyes, it's 2016 already!!!
[17:30:18] banister: has joined #ruby
[17:32:28] dkam: has joined #ruby
[17:32:28] wrkrcoop: has joined #ruby
[17:33:32] GodFather: has joined #ruby
[17:34:44] omphe: has joined #ruby
[17:35:36] aberen: has joined #ruby
[17:35:57] chouhoulis: has joined #ruby
[17:36:29] tristanp: has joined #ruby
[17:36:52] shevy: I remember my days with irssi... I constantly mispasted into different channel buffers
[17:37:26] Pwnna: has joined #ruby
[17:37:29] SilverKey: has joined #ruby
[17:40:10] mtkd: has joined #ruby
[17:41:36] rcvalle: has joined #ruby
[17:42:13] whathapp_: has joined #ruby
[17:43:17] rkoller: has joined #ruby
[17:43:40] whathapp_: has joined #ruby
[17:44:15] whathapp_: has joined #ruby
[17:44:34] GodFather: has joined #ruby
[17:45:31] whathappens: has joined #ruby
[17:46:03] minimalism: has joined #ruby
[17:48:27] jhack: has joined #ruby
[17:52:03] sp4rrow: has joined #ruby
[17:52:07] mattwashere: has joined #ruby
[17:52:17] blackmesa: has joined #ruby
[17:53:20] k3rn31: has joined #ruby
[17:54:17] jhack: has joined #ruby
[17:55:17] GodFather: has joined #ruby
[17:55:35] jorrin2: has joined #ruby
[17:56:43] dcunit3d: has joined #ruby
[17:59:09] ChiefAlexander: has joined #ruby
[18:00:57] nerium: has joined #ruby
[18:02:14] roamingdog: has joined #ruby
[18:06:29] davedev24: has joined #ruby
[18:07:49] jas02: has joined #ruby
[18:09:07] dkam: has joined #ruby
[18:11:48] wrkrcoop: has joined #ruby
[18:14:22] symm-: has joined #ruby
[18:15:04] moos3: has joined #ruby
[18:15:38] Dimik: has joined #ruby
[18:15:39] ramfjord: has joined #ruby
[18:16:43] mistermocha: has joined #ruby
[18:17:50] hutch34: has joined #ruby
[18:17:58] Guest60015: has joined #ruby
[18:18:04] RegulationD: has joined #ruby
[18:18:23] flashpoint9: has joined #ruby
[18:18:48] axl_: has joined #ruby
[18:19:40] snath: has joined #ruby
[18:20:01] apeiros: hi Guest60015
[18:20:25] SCHAAP137: has joined #ruby
[18:20:52] kgrz: has joined #ruby
[18:24:47] rickmasta: has joined #ruby
[18:24:49] craigp: has joined #ruby
[18:25:15] davedev24: has joined #ruby
[18:25:19] whathappens: has joined #ruby
[18:26:12] arlek: has joined #ruby
[18:26:18] bmurt: has joined #ruby
[18:26:47] evansbee: has joined #ruby
[18:28:05] yokel: has joined #ruby
[18:29:08] jhack: has joined #ruby
[18:32:11] nofxx: has joined #ruby
[18:32:11] nofxx: has joined #ruby
[18:33:52] rickmasta: has joined #ruby
[18:34:54] vqrs: has joined #ruby
[18:35:34] GodFather: has joined #ruby
[18:35:38] cdg: has joined #ruby
[18:36:38] aberen: has joined #ruby
[18:37:05] dn`_: has joined #ruby
[18:37:06] aryaching: has joined #ruby
[18:37:20] omphe: has joined #ruby
[18:37:25] rickmasta: has joined #ruby
[18:37:40] chopin: has joined #ruby
[18:37:56] replay: has joined #ruby
[18:38:33] replay: has joined #ruby
[18:39:00] vuoto: has joined #ruby
[18:41:15] vuoto: has joined #ruby
[18:41:47] hahuang62: has joined #ruby
[18:42:58] miqlas-H: has joined #ruby
[18:43:16] wnd: has joined #ruby
[18:45:02] SilverKey: has joined #ruby
[18:45:50] dkam: has joined #ruby
[18:46:01] rickmasta: has joined #ruby
[18:46:28] yfeldblum: has joined #ruby
[18:47:35] sp4rrow: has joined #ruby
[18:48:57] bmurt: has joined #ruby
[18:50:46] bluOxigen: has joined #ruby
[18:54:34] blackmesa: has joined #ruby
[18:55:07] GinoManWorks: has joined #ruby
[18:56:20] ryan_notabot: has joined #ruby
[19:00:09] ghoti: has left #ruby: ()
[19:01:17] mistermocha: has joined #ruby
[19:01:37] flashpoint9: has joined #ruby
[19:02:32] dionysus69: has joined #ruby
[19:02:40] rickmasta: has joined #ruby
[19:03:10] nankyokusei: has joined #ruby
[19:04:29] tubuliferous_: has joined #ruby
[19:06:21] iCHAIT_: has joined #ruby
[19:07:50] yqt: has joined #ruby
[19:07:55] SilverKey: has joined #ruby
[19:09:50] Avinty-L_: has joined #ruby
[19:10:45] kirun: has joined #ruby
[19:11:48] jancel: has joined #ruby
[19:12:33] sid_fules: has joined #ruby
[19:12:54] helpa: has joined #ruby
[19:13:47] kraken: has joined #ruby
[19:14:26] krakenr: If I'm in a method in ruby, and in a loop, will a return statement break out of the loop and end the method, returning whatever I return, or will if simply break out the loop?
[19:14:42] gusrub: has joined #ruby
[19:15:09] wald0: has joined #ruby
[19:15:12] apeiros: return returns from the current method, regardless of whether you're in a loop o rnot
[19:15:52] jgt: has joined #ruby
[19:16:24] norc_: has joined #ruby
[19:16:50] pwnd_nsfw: has joined #ruby
[19:16:57] krakenr: awesome, thank you
[19:17:40] nofxx: has joined #ruby
[19:18:05] flowing-farrows: has joined #ruby
[19:18:18] apeiros: the return is lexical btw., which means you'll get LocalJump errors if you have a return statement in a block which you execute later/elsewhere (i.e. not in the method from which the return would return)
[19:18:24] aryaching: has joined #ruby
[19:19:05] iCHAIT_: has left #ruby: ()
[19:20:50] Gasher: has joined #ruby
[19:20:58] futilegames: has joined #ruby
[19:21:03] lacuna: has joined #ruby
[19:21:23] rickmasta: has joined #ruby
[19:21:34] Ikri: has joined #ruby
[19:22:49] Avinty-L__: has joined #ruby
[19:23:04] marsjaninzmarsa: has joined #ruby
[19:23:24] dkam: has joined #ruby
[19:23:45] zeroDi: has joined #ruby
[19:26:23] roamingdog: has joined #ruby
[19:27:01] RedNifre: has joined #ruby
[19:27:56] Miron: has joined #ruby
[19:28:07] bmurt: has joined #ruby
[19:28:30] RedNifre: Hi. Still on my quest to get the getontracks rails app running (first time setting up a ruby app on my server!). While it runs now, I have no css because the step where you turn your .css.scss files into .css failed but I don't quite understand the error message. What does this mean?: https://gist.github.com/RedNifre/7132b8da0510aa7f1cf6bbfebe9014a3
[19:29:52] lupine: RedNifre: #rubyonrails might be more help but it looks like a dependency of the project is not installed or not present
[19:30:25] lupine: if you're trying to get a rails application working and it has a Gemfile, i'd suggest looking at packager.io / https://github.com/crohr/pkgr
[19:30:25] RedNifre: That's odd, I thought bundler takes care of missing dependencies?
[19:30:35] lupine: well, if you'r eusing bundling, try prefixing your command with bundle exec
[19:30:36] Zai00: has joined #ruby
[19:30:58] lupine: my best guess from the error message is that the rack-dev-mark gem isn't being loaded before it's being used
[19:31:13] lupine: this might be because it's not in ruby's load path, or it could be because of some other breakage
[19:31:30] lupine: but in general, running bundle install on production hosts is a terrible idea
[19:31:34] lupine: (hence pkgr, etc)
[19:31:44] RedNifre: I'm trying to install the tracks app which comes with installation instruction: https://github.com/TracksApp/tracks/blob/master/doc/installation.md
[19:31:48] RedNifre: ah, okay...
[19:32:00] RedNifre: what's terrible about it?
[19:32:51] lupine: welcome to a 10-year epic discussion, predating bundler itself
[19:32:52] schuuu: has joined #ruby
[19:33:03] lupine: tl;dr it's a build-dep and build-deps don't go on production machines
[19:33:15] lupine: for hobbyist stuff it doesn't really matter
[19:34:07] Mia: has joined #ruby
[19:34:07] Mia: has joined #ruby
[19:34:08] RedNifre: It's hobbyist stuff, I'm trying to set up a todo list app on my toy server that's sitting at my home.
[19:34:17] lupine: I wouldn't worry about it then
[19:34:43] RedNifre: well, but why doesn't it work? So it's something about rails?
[19:35:42] shevy: rails has its own channel
[19:35:45] banister: has joined #ruby
[19:36:06] lupine: config/environments/development.rb references a method that isn't present. it looks like the method *should* come from a gem, so something there is borke
[19:36:06] RedNifre: alright, I'll ask them.
[19:36:49] tvw: has joined #ruby
[19:37:38] aberen: has joined #ruby
[19:37:58] blackmesa: has joined #ruby
[19:39:32] Infra-Red: has joined #ruby
[19:39:37] jackjackdripper: has joined #ruby
[19:39:48] wrkrcoop: has joined #ruby
[19:40:59] vuoto_: has joined #ruby
[19:42:44] vuoto: has joined #ruby
[19:43:13] hahuang62: has joined #ruby
[19:43:36] SilverKey: has joined #ruby
[19:44:54] joonty: has joined #ruby
[19:45:24] omphe: has joined #ruby
[19:47:37] conta: has joined #ruby
[19:47:39] wrkrcoop: has joined #ruby
[19:49:40] whathappens: has joined #ruby
[19:51:36] ElFerna: has joined #ruby
[19:51:39] rickmasta: has joined #ruby
[19:53:22] dkam: has joined #ruby
[19:53:56] wald0: has joined #ruby
[19:55:53] mtkd: has joined #ruby
[19:56:24] norc: has joined #ruby
[19:56:56] jackjackdripper: has joined #ruby
[19:58:10] nick_traveling: has joined #ruby
[19:58:24] shevy: can there ever be a situation where one would have "too much documentation" for ruby code? :D
[19:58:51] MEATCHICKEN: has joined #ruby
[19:58:56] MEATCHICKEN: What does @@ mean/
[19:59:08] MEATCHICKEN: class variable?
[19:59:09] smathy: has joined #ruby
[19:59:25] apeiros: and usually you'll not want to use them (most ruby coders do *not* understand fully how they work)
[19:59:29] MEATCHICKEN: Shared by all instances of the class/
[19:59:36] apeiros: and all descendants
[19:59:40] apeiros: and all instances of all descendants
[19:59:54] apeiros: and <insert long description> included modules
[20:00:09] apeiros: most ruby coders fail already at "all descendants and instances of descendants"
[20:00:39] apeiros: and most of those remaining (me included) fail at the specifics of "included modules" and/or "order of occurrence in subclasses"
[20:00:41] norc: I failed much earlier than that apeiros.
[20:00:44] lupine: it means "run far from this codebase"
[20:01:10] dkam: has joined #ruby
[20:01:23] apeiros: it'd be reeeal nice if @@vars were just shared among class + its instances
[20:02:38] norc: apeiros: and then there is class instance variables
[20:02:45] pwnd_nsfw`: has joined #ruby
[20:02:49] norc: apeiros: which is when things get confusing until you explain about the internal object model.
[20:03:08] apeiros: yes, which - once you got it - means stuff actually gets a lot simpler again :)
[20:03:12] CJKinni: has joined #ruby
[20:03:15] Regulati_: has joined #ruby
[20:03:23] apeiros: "only modules (and descendants) can have only instance methods - there's no such thing as class methods"
[20:03:26] lupine: ACTION re-read the ruby style guide last night
[20:03:34] lupine: it's quite funny just how many things have "do not use" next to them
[20:03:48] norc: apeiros: well.. module and classes can have modules.
[20:03:51] norc: But objects cannot. :p
[20:03:55] norc: *methods
[20:03:59] My_Hearing: Are we talking about C++ again? :p
[20:04:05] lupine: but classes are objects
[20:04:12] norc: lupine: RClasses can have modules.
[20:04:35] edwinvdgraaf: has joined #ruby
[20:04:58] apeiros: norc: what does "have modules" mean?
[20:05:03] norc: apeiros: I meant to say
[20:05:07] norc: apeiros: modules and classes can have methods.
[20:05:18] norc: apeiros: My itchy finger wants to type module everytime I think method.
[20:05:26] norc: apeiros: there are no "instance" methods under the hood. only methods. ;-)
[20:05:37] apeiros: yes. since Class < Module, you can simplify that to "modules and descendants"
[20:05:50] apeiros: norc: um, no?
[20:05:50] norc: fair enough
[20:05:56] apeiros: method is bound
[20:06:02] apeiros: instance method is unbound
[20:06:08] apeiros: and the method definition is unbound
[20:06:12] neanderslob: has joined #ruby
[20:06:23] apeiros: you define a method before you have an object responding to it
[20:06:24] edwinvdgraaf: has joined #ruby
[20:06:31] apeiros: (object responding to it = bound)
[20:06:46] norc: Which language are we talking about?
[20:06:48] apeiros: def self.… being the exception.
[20:06:57] norc: apeiros: No it is not an exception.
[20:07:07] norc: You just define it on a different class. It is still a very regular method
[20:07:34] norc: The only exceptional thing is the syntax by which you do it.
[20:07:37] apeiros: wrt "definition exists without a bound receiver", they are. because a singleton class requires an object to exist a priori
[20:07:57] Lewix: what's the concesus. rspec vs minitest?
[20:08:01] apeiros: they're instance methods too, in that regard they're no exception (which is what you mean, I presume)
[20:08:06] norc: Lewix: whichever you prefer.
[20:08:08] apeiros: Lewix: no consensus
[20:08:08] norc: Next customer please.
[20:08:12] apeiros: Lewix: I prefer minitest
[20:08:33] norc: Lewix: I prefer rspec because I actually threw a coin on my office and rspec won.
[20:08:37] norc: Now Im too lazy to learn minitest.
[20:08:47] norc: (True story)
[20:09:01] apeiros: I prefer minitest because it's much less to learn and much less of a moving target
[20:09:06] Lewix: norc: same here except that rspec won, but I prefer minitest but too lazy to look that way
[20:09:11] apeiros: maybe the latter has been "fixed" by now
[20:09:29] dsimon: i like rspec cause of --fail-fast
[20:09:41] dsimon: though maybe there's a minitest plugin for that now that i think
[20:09:50] lupine: minitest has a spec module
[20:10:11] lupine: ACTION isn't strongly opinionated, will use whichever one is already there
[20:10:17] Lewix: lupine: and the spec module is very similar to rspec
[20:10:38] lupine: if you're writing your tests well, it doesn't make too much difference
[20:13:10] sp4rrow: has joined #ruby
[20:14:23] norc: apeiros: It is a matter of perspective.
[20:14:29] Lewix: ok i need to get up to speed with minitest. good tutorial out there? (I used to use rspec back in the days)
[20:14:39] norc: apeiros: Internally there are no such things as "Modules" or "Classes" since these are actually ruby objects
[20:14:51] norc: apeiros: Internally you just have an RClass that has a method table. Nothing else.
[20:14:59] norc: But from a Ruby perspective you have a fair point.
[20:15:02] havenwood: <3 Minitest
[20:15:16] akahn: has joined #ruby
[20:15:22] lupine: I'd love minitest more if it were a bit more stable and *not shipped in stdlib*
[20:15:36] apeiros: norc: sure. my perspective usually is "observable". you could implement the observable behavior in quite a couple of ways :)
[20:15:41] Lewix: lupine: what do you mean
[20:15:43] norc: apeiros: absolutely.
[20:15:51] lupine: managing transitions from minitest2 to minitest5 was hard
[20:16:10] shevy: are you jumping PHP style there
[20:16:15] apeiros: norc: it might actually even be interesting how different ruby implementations handle the observable behavior
[20:16:19] Lewix: lupine: rspec has a lot of breaking changes too..over the years
[20:16:25] lupine: sure, and I dislike those too
[20:16:37] apeiros: I'd assume most differences would mostly relate to performance characteristics and/or ease of maintenance
[20:16:42] norc: apeiros: Did you watch chrisseaton's presentation about deoptimization?
[20:16:58] apeiros: no, I have far too little time for all those fun topics :(
[20:16:59] norc: (regarding jruby+truffle)
[20:17:03] Lewix: lupine: anyways, if you have nice links about getting up to speed with minitest please shoot
[20:17:14] havenwood: norc: i enjoyed it
[20:17:18] apeiros: I honestly ponder going 80% after this work project to have more time for fun stuff again
[20:17:28] apeiros: the current situation is rather dissatisfying
[20:17:32] lupine: nothing comes especially to mind
[20:17:47] mattwashere: has joined #ruby
[20:18:16] norc: havenwood: Though some of the JIT topics were bizarre to me, but then I dont understand JIT all to well.
[20:18:25] norc: Plus I'm a fair beginner with all of this.
[20:18:44] havenwood: norc: Have you checked out his thesis?: http://chrisseaton.com/phd/specialising-ruby.pdf
[20:18:49] norc: But it was really interesting to see someone give a presentation about how things are done in Ruby... that is not in Japanese.
[20:18:51] havenwood: norc: Worth a read!
[20:19:16] Lewix: http://ruby-doc.org/stdlib-2.0.0/libdoc/minitest/rdoc/MiniTest.html I guess that will do?
[20:19:19] norc: havenwood: Oh nice. I shall read it next week. :)
[20:19:28] norc: Lewix: bit oudated if you look at the version number
[20:19:35] norc: &ri MiniTest
[20:19:35] `derpy: No results
[20:19:45] norc: ACTION kicks `derpy and adaedra 
[20:19:52] edwinvdg_: has joined #ruby
[20:20:15] sent-hil: has joined #ruby
[20:20:20] adaedra: › ri MiniTest
[20:20:20] adaedra: Nothing known about MiniTest
[20:20:23] adaedra: ¯\_(ツ)_/¯
[20:20:44] havenwood: Lewix: Here's a gist about mocks in Minitest: https://gist.github.com/havenwood/84207afa092ce5d5a680
[20:20:49] blackgoat: has joined #ruby
[20:20:50] adaedra: For MiniTest I usually base myself on the github readme
[20:21:10] Lewix: havenwood: thanks
[20:21:23] Lewix: I guess I just learned minitest..
[20:21:25] havenwood: adaedra: speaking of Minitest changes, the T lost its caps
[20:21:28] sent-hil: hello, i'm having trouble with vim-ruby; getting https://gist.github.com/sent-hil/245538f243e2251fa910e387357837e0 whenever i open a ruby file (even empty one); my vimrc is what i use on other computers and not having this problem there: https://github.com/sent-hil/dotfiles-1/blob/master/vim/vimrc.symlink. Using rvm installed ruby (2.1.6), happens on others
[20:21:29] sent-hil: ruby version as well
[20:21:47] adaedra: I tested without the capital, ri is still clueless.
[20:21:56] havenwood: adaedra: but it's a good way to see if an article is up-to-date!
[20:21:57] dsimon: sent-hil, i think this is a vim problem, not a ruby problem
[20:22:03] norc: sent-hil: My first instinct is: rvm is probably an issue.
[20:22:18] dsimon: cause the errors are vimscript errors
[20:22:32] dsimon: possibly your vim is old?
[20:22:49] lightt: has joined #ruby
[20:23:27] sent-hil: dsimon: yep :) happens on 7.3, but not 7.4
[20:23:39] chrisseaton: norc: I'm writing a new toy JIT to try to explain how they work - I'll send you a copy when it's done if you DM me and want to give me some feedback?
[20:23:40] sent-hil: dsimon: thanks!
[20:23:56] shevy: wheeeee chrisseaton is at it again!
[20:24:33] norc: chrisseaton: I would be thrilled to.
[20:25:48] sid_fules: has joined #ruby
[20:26:52] postmodern: has joined #ruby
[20:26:54] Zai00: has joined #ruby
[20:28:17] chrisseaton: i'll ping you when it's ready
[20:28:54] mostlybadfly: has joined #ruby
[20:28:56] mistermocha: has joined #ruby
[20:31:36] CrappyDill: has joined #ruby
[20:33:25] Yiota: has joined #ruby
[20:34:17] dcunit3d: has joined #ruby
[20:38:37] dkam: has joined #ruby
[20:39:41] aberen: has joined #ruby
[20:40:33] aryaching: has joined #ruby
[20:43:41] Beverage: has joined #ruby
[20:43:55] jorrin: has joined #ruby
[20:46:10] bmurt: has joined #ruby
[20:47:20] wsewolod: has joined #ruby
[20:50:16] Rafcio: has joined #ruby
[20:50:42] Rafcio: hey guys, in Ruby how can I add 7 days to a date? Rails has helpers but don’t help in plain ruby
[20:51:45] havenwood: >> require 'date'; Date.new + 7
[20:51:47] ruby[bot]: havenwood: # => #<Date: -4712-01-08 ((7j,0s,0n),+0s,2299161j)> (https://eval.in/591095)
[20:51:51] dsimon: well, you could convert it to a timestamp and then add 60*60*24*7 seconds
[20:51:53] dsimon: ... or that
[20:51:55] dsimon: that works too
[20:52:02] dsimon: ACTION slaps his forehead in that memey way
[20:52:16] Rafcio: ok i’ll try requiring date
[20:52:56] al2o3-cr: has joined #ruby
[20:55:14] Yiota: has joined #ruby
[21:02:52] aryaching_: has joined #ruby
[21:04:01] nankyokusei: has joined #ruby
[21:05:27] elifoster: has joined #ruby
[21:05:46] bmurt: has joined #ruby
[21:06:12] ramfjord_: has joined #ruby
[21:08:38] yfeldblum: has joined #ruby
[21:08:42] sepp2k: has joined #ruby
[21:10:14] GodFather: has joined #ruby
[21:11:49] roamingdog: has joined #ruby
[21:13:27] pietr0: has joined #ruby
[21:15:12] dkam: has joined #ruby
[21:16:53] vipinj: has joined #ruby
[21:17:17] sesquipedalian: has joined #ruby
[21:17:24] eljimmy: has joined #ruby
[21:17:48] cdg: has joined #ruby
[21:19:58] hirvi: has joined #ruby
[21:22:30] ur5us: has joined #ruby
[21:24:01] gnufied__: has joined #ruby
[21:24:36] mshowman: has joined #ruby
[21:25:06] early90spants: has joined #ruby
[21:26:06] lupine: oh no, i'm missing Nordic Ruby
[21:28:06] shevy: is that ruby in the ice?
[21:28:26] bougyman: ruby with manic depression.
[21:29:33] arooni: has joined #ruby
[21:31:02] mistermocha: has joined #ruby
[21:32:41] jancel: has joined #ruby
[21:33:39] Synthead: has joined #ruby
[21:35:28] Zai00: has joined #ruby
[21:40:09] cb: has joined #ruby
[21:40:26] aberen: has joined #ruby
[21:43:37] lightt: has joined #ruby
[21:45:37] slackbotgz: has joined #ruby
[21:47:50] cbyrda: has joined #ruby
[21:49:29] beneggett: has joined #ruby
[21:50:30] mattwashere: has joined #ruby
[21:51:09] dkam: has joined #ruby
[21:54:20] skweek: has joined #ruby
[21:54:35] r1v3r_: has joined #ruby
[21:58:13] arooni: has joined #ruby
[21:58:57] GodFather: has joined #ruby
[22:01:47] r1v3r_: has joined #ruby
[22:02:12] kareeoleez: has joined #ruby
[22:03:12] phoo1234567: has joined #ruby
[22:04:19] early90spants: has left #ruby: ()
[22:06:52] mistermocha: has joined #ruby
[22:11:22] lightt: has joined #ruby
[22:12:29] ramfjord: has joined #ruby
[22:14:18] MrBusiness: has joined #ruby
[22:14:56] snebel: has joined #ruby
[22:15:22] jenrzzz: has joined #ruby
[22:16:12] snebel: may be stupid question but i see it often and i'd like to know...
[22:16:19] snebel: why people extend after require?
[22:16:21] snebel: for exmaple here
[22:16:23] snebel: https://github.com/grosser/parallel/blob/master/lib/parallel.rb
[22:16:36] snebel: require processor_count
[22:16:38] snebel: then extend it
[22:16:44] jancel: has joined #ruby
[22:16:48] workmad3: has joined #ruby
[22:16:50] adaedra: require loads the module (here Parallel::ProcessorCount)
[22:16:54] snebel: shouldn't those module methods be available even if you don't extend?
[22:16:56] adaedra: extend actually inserts it into the class
[22:17:39] snebel: but is doing it just below module Parallel
[22:18:02] snebel: sounds like inserting within the same scope isn't it?
[22:18:44] mattwashere: has joined #ruby
[22:18:49] adaedra: extend inserts the module into the Parallel class
[22:18:57] adaedra: it actually uses it
[22:19:04] mattwashere: has joined #ruby
[22:19:54] adaedra: if you just require it, the module Parallel::ProcessorCount is available but not used; it's like buying a new printer but not plugging it
[22:20:32] kareeoleez: has joined #ruby
[22:21:21] snebel: but in both cases I'd be able to call it and in the same way isn't it?
[22:21:41] mattwashere: has joined #ruby
[22:21:41] snebel: Parallel::Procesorcount.method
[22:23:12] adaedra: But after extend, the methods become available in the scope of Parallel directly, without having to go through Parallel::ProcessorCount
[22:23:36] snebel: that's the trick
[22:23:43] snebel: thanks i got it..
[22:23:54] gooba: has joined #ruby
[22:24:00] adaedra: >> module A; def foo; puts "hello!"; end; end; module B; extend A; foo; end
[22:24:04] ruby[bot]: adaedra: # => hello! ...check link for more (https://eval.in/591142)
[22:24:24] SilverKey: has joined #ruby
[22:24:45] mdw: has joined #ruby
[22:24:51] mwlang: has joined #ruby
[22:24:51] snebel: make sense thanks!
[22:26:11] Hobogrammer: has joined #ruby
[22:27:04] dkam: has joined #ruby
[22:32:31] dh64: has joined #ruby
[22:33:56] hahuang62: has joined #ruby
[22:37:20] benzrf_: has joined #ruby
[22:37:41] benzrf_: i'm having a really fucking weird issue
[22:38:15] KnownSyntax_: has joined #ruby
[22:38:16] benzrf_: an unqualified constant lookup is failing, even though one of the elements of Module.nesting contains a constant by that name
[22:38:44] benzrf_: the method that this is happening in is included via a module rather than declared directly in the class - could that be an issue?
[22:39:00] kareeoleez: has joined #ruby
[22:41:10] aberen: has joined #ruby
[22:41:30] benzrf_: anybody around? :\
[22:41:41] iooner: has joined #ruby
[22:41:54] toretore: benzrf_: code?
[22:42:34] KnownSyntax_: has joined #ruby
[22:43:50] benzrf_: toretore: uh, give me a minute
[22:44:39] toretore: if you include a module in an outer module, the inner module won't have access to it
[22:45:19] toretore: * to the included module's constants
[22:45:41] toretore: or something like that - constant lookup rules are weird and complex
[22:46:03] norc: toretore: They are quite simple actually.
[22:46:12] diegoaguilar: has joined #ruby
[22:46:17] sp4rrow: has joined #ruby
[22:47:10] KnownSyntax: has joined #ruby
[22:47:10] KnownSyntax: has joined #ruby
[22:47:18] benzrf_: managed to make a a more or less minimal example toretore, norc https://gist.github.com/9adb925c41e3ff20be0562df1cd87d64
[22:47:44] toretore: benzrf_: yes, that is exactly what i was talking about
[22:47:48] nettoweb: has joined #ruby
[22:48:05] diegoaguilar: has joined #ruby
[22:48:10] benzrf_: can you rephrase? i didn't really follow sorry
[22:48:12] toretore: intuitively, it should work, but it won't
[22:48:19] toretore: i'm just saying it doesn't work
[22:48:25] benzrf_: well - why?
[22:49:30] benzrf_: norc: can you explain this?
[22:49:36] norc: benzrf_: Yes.
[22:49:56] toretore: if you do V = Val; in Mod::Foo it will work
[22:50:01] toretore: or Val = Val
[22:50:34] dcunit3d: has joined #ruby
[22:51:33] benzrf_: norc: that was an actual request for an explanation, if unclear :(
[22:51:52] norc: benzrf_: I know, Im quite tired and I was just reducing your test case to show.
[22:52:04] norc: benzrf_: https://eval.in/591143
[22:52:31] benzrf_: looking...
[22:52:52] benzrf_: norc: why does that happen!
[22:54:45] Qommand0r: has joined #ruby
[22:55:46] norc: benzrf_: https://eval.in/591144
[22:55:49] norc: benzrf_: This is why.
[22:56:40] norc: benzrf_: If you give me a moment I can give you the exact reason.
[22:56:43] Synthead: has joined #ruby
[22:57:05] benzrf_: norc: yes, but - M2::C *works*
[22:57:07] kareeoleez: has joined #ruby
[22:57:13] benzrf_: so if M2 is in the nesting, shouldnt C be found
[22:58:02] benzrf_: or... wait. does the 'constant in scope' check used in lookup not work the same way as 'constant in module' check used when you try to ::
[22:59:30] norc: benzrf_: Looking at the implementation right now before I say anything wrong.
[22:59:52] benzrf_: "it's simple" my butt :D
[23:01:19] dfockler: has joined #ruby
[23:01:35] dkam: has joined #ruby
[23:02:25] millerti: has joined #ruby
[23:02:33] Madplatypus: has joined #ruby
[23:03:48] mistermocha: has joined #ruby
[23:04:55] nankyokusei: has joined #ruby
[23:06:01] truenito: has joined #ruby
[23:06:39] snath: has joined #ruby
[23:06:53] chipotle: has joined #ruby
[23:09:57] r1v3r: has joined #ruby
[23:10:10] dudepare: has joined #ruby
[23:10:21] benzrf_: norc: still figuring it out?
[23:11:32] jancel: has joined #ruby
[23:12:35] nick_traveling: has joined #ruby
[23:13:16] Omni_: has joined #ruby
[23:15:05] kareeoleez: has joined #ruby
[23:16:39] shevy: he fell asleep
[23:17:41] benzrf_: i think i kind of hate ruby[bot]
[23:18:48] xall: has joined #ruby
[23:19:44] norc: benzrf_: Sorry, I actually almost fell asleep. :|
[23:22:48] norc: benzrf_: The thing about constant resolution is two things. Lexical scope and ancestry.
[23:23:55] unreal_: has joined #ruby
[23:24:42] norc: benzrf_: The thing I cant tell you from the top off my head is why Ruby can actually sometimes find things in an included module - lets ignore this for now.
[23:25:08] norc: benzrf_: In essence what Ruby really does under the hood is recurse the internal representation of rclass and look at its constant table
[23:25:18] norc: (From each rclass to its superclass)
[23:26:30] norc: benzrf_: What you are however trying is to access this by lexical scope - which does not work because an included module is not in lexical scope.
[23:26:44] benzrf_: yeah, but -
[23:26:52] benzrf_: something the *included* the module, *is* in lexical scope
[23:26:59] norc: no it never is in lexical scope.
[23:27:11] benzrf_: something *that *included* the module, *is* in lexical scope
[23:27:16] norc: No it is not.
[23:27:18] Gasher: has joined #ruby
[23:27:21] norc: what you mean is this:
[23:27:22] coyo: has joined #ruby
[23:27:30] norc: >> module A; C = 1; puts C; end
[23:27:30] benzrf_: M2 is in lexical scope
[23:27:32] ruby[bot]: norc: # => 1 ...check link for more (https://eval.in/591167)
[23:27:33] benzrf_: M2 included the module
[23:27:36] norc: benzrf_: ^- that is what you mean.
[23:27:38] benzrf_: therefore, something that included the module is in lexical scope
[23:27:47] norc: Or bad example.
[23:27:56] norc: benzrf_: code example please
[23:28:03] benzrf_: the one you posted
[23:28:12] benzrf_: https://eval.in/591144
[23:29:24] ledestin: has joined #ruby
[23:29:35] norc: benzrf_: Yes, but M1 is not in lexical scope!
[23:29:40] norc: You are not seeing it all.
[23:29:50] norc: Include does not "take the code you are seeing and inject it where you have the include"
[23:30:09] benzrf_: i KnownSyntax
[23:30:18] norc: benzrf_: That last bit is kinda important. :P
[23:30:20] benzrf_: but M2::C works
[23:30:42] benzrf_: is there different code that checks if "M2 has C" in M2::C than in the eval.in
[23:31:35] benzrf_: that is to say - in the posted code, at some point ruby checks whether there is a 'C' in M2, since M2 is in lexical scope. when it does so - it does it differently from when it looks for C in M2 while evaluating the expression M2::C?
[23:33:28] kareeoleez: has joined #ruby
[23:35:08] jpterry: has joined #ruby
[23:37:08] norc: benzrf_: Okay I just brushed up on how ruby actually includes modules.
[23:37:08] roamingdog: has joined #ruby
[23:41:02] [reed]: has joined #ruby
[23:41:26] whiteline: has joined #ruby
[23:41:54] aberen: has joined #ruby
[23:42:41] benzrf_: norc: and?
[23:43:35] krakenr: This is driving me crazy: I'm building a binary tree, and I'm retrieving a node using the depth first search, and it appears that I'm retrieving the right node based on the value, but the object id's are different. Is this due to something I'm messing up, or is it a functino of ruby?
[23:43:42] norc: benzrf_: Let's stop talking about lexical scope because that is a bit confusing.
[23:43:42] krakenr: https://gist.github.com/KrakenHH/22114411ee1116507acfdb7de5508c88
[23:43:59] SirOliver: has joined #ruby
[23:44:02] norc: benzrf_: In a nutshell the lookup just "look at current class if it has it, if not check next class"
[23:44:09] norc: *next superclass
[23:45:23] benzrf_: norc: no, hold on.
[23:45:25] RegulationD: has joined #ruby
[23:45:39] norc: benzrf_: just stick with me.
[23:46:12] benzrf_: *this* works https://eval.in/591172
[23:46:58] norc: benzrf_: ruby has internal pointers for lexical scope.
[23:47:09] benzrf_: i don't know what that means
[23:47:15] dcunit3d: has joined #ruby
[23:47:15] benzrf_: but regardless -
[23:47:23] swills: has joined #ruby
[23:47:27] norc: benzrf_: inside your M3 ruby keeps a pointer that says "nd_class" and one that says "nd_next"
[23:47:40] benzrf_: clearly what's happening is that in the version i just linked, ruby says "ok yes there's a C in M2, so let's return that"
[23:47:42] norc: benzrf_: Now if you nest modules, then nd_next will point at the outer one.
[23:47:52] benzrf_: while in the failing version, ruby says "no, there is not a C in M2"
[23:47:59] benzrf_: *BUT*, "M2::C" will work in *either* case
[23:48:10] benzrf_: am i wrong?
[23:48:21] norc: benzrf_: fully qualified constants will work yes.
[23:48:30] norc: benzrf_: then it just looks for M2
[23:48:30] evansbee: has joined #ruby
[23:48:38] norc: after that it will follow however you specified them
[23:48:58] benzrf_: in either case M2::C works - but in one case, ruby thinks there is no C in M2
[23:49:17] norc: If you specify "C" it can only either a) check in lexical scope, or follow super classes.
[23:49:26] norc: Include does not give you lexical access!
[23:49:32] norc: Let me provide an accurate example that demonstrates this.
[23:49:38] benzrf_: no, i understand what is happening
[23:49:44] benzrf_: you don't understand what i'm asking
[23:50:02] norc: benzrf_: https://eval.in/591179
[23:50:05] benzrf_: sorry, i'm being abrasive - let me try to be less of a dick
[23:50:13] norc: benzrf_: This is what you are doing effectively.
[23:50:20] benzrf_: norc: no, because:
[23:50:32] hahuang62: has joined #ruby
[23:50:41] benzrf_: wait, what?
[23:50:44] benzrf_: no, one second
[23:50:47] norc: It is exactly that!
[23:50:50] benzrf_: no it isn't
[23:50:57] norc: This is not a problem about constants, its about lexical scope!
[23:50:58] benzrf_: 19:46 < benzrf_> *this* works https://eval.in/591172
[23:51:10] pawnbox: has joined #ruby
[23:51:12] norc: benzrf_: yes you are in the same lexical scope!
[23:51:24] norc: actually
[23:51:35] benzrf_: you are *not* in the same lexical scope
[23:51:38] norc: That is nested lexical scope
[23:51:39] kareeoleez: has joined #ruby
[23:51:46] norc: Which for the purpose of this discussion is the same.
[23:51:55] norc: for example
[23:52:25] norc: actually that is the example. :P
[23:52:33] norc: But it is more obvious if you do not reopen the module.
[23:52:35] benzrf_: i am 90% sure i understand exactly what is going on, but i don't think i've managed to get across what i'm trying to say
[23:52:55] benzrf_: so please, listen for a moment
[23:53:15] benzrf_: in the example i just linked, when it looks up "C" on line 8 -
[23:53:15] __ian__r: has joined #ruby
[23:53:52] benzrf_: it initially proceeds by travelling up the chain of modules that line 8 is lexically contained within
[23:53:59] benzrf_: then it tests if each one has 'C'
[23:54:02] norc: No it does not travel the chain of modules.
[23:54:10] norc: It travels the chain of lexical scope.
[23:54:30] benzrf_: "lexical scope" refers to scope that is lexical
[23:54:32] ur5us: has joined #ruby
[23:54:33] benzrf_: this is not lexical
[23:54:38] queequeg1: has joined #ruby
[23:55:03] norc: This is lexical.
[23:55:05] benzrf_: unless you identify modules with scopes
[23:55:14] norc: They are identified with scope.
[23:55:16] Zai00: has joined #ruby
[23:55:22] benzrf_: then why did you say it doesnt travel the chain of modules?
[23:55:34] benzrf_: if modules are identified with scopes, travelling the chain of modules is the same thing as travelling the chain of scopes
[23:55:41] norc: it could be classes too?
[23:55:43] agentmeerkat: has joined #ruby
[23:55:56] norc: do not think of them as modules or classes
[23:55:58] norc: its a lexical issue
[23:56:03] benzrf_: i've been using 'module' this whole time to mean 'either module or class'
[23:56:07] norc: fair enough
[23:56:14] benzrf_: if modules are identified with scopes, travelling the chain of modules is the same thing as travelling the chain of scopes
[23:56:24] benzrf_: so why is it wrong tosay that it travels the chain of modules?
[23:56:32] norc: benzrf_: because its shit when you suddenly define methods.
[23:56:43] norc: because then its "travelling the chain of moduels and method definitions"
[23:56:54] norc: which is just a cumbersume way of saying "lexical scope"
[23:57:08] norc: its shit when you have blocks inside your class bodies.
[23:57:11] benzrf_: i never mentioned modules
[23:57:16] norc: benzrf_: Im just saying.
[23:57:32] startupality: has joined #ruby
[23:57:36] benzrf_: ok, but saying "No it does not travel the chain of modules." is extremely misleading
[23:57:49] benzrf_: it sounds like you're disagreeing with what i mean, not with my choice of words
[23:58:26] norc: benzrf_: https://eval.in/591182
[23:58:37] norc: Fair enough.
[23:58:42] norc: Either way.
[23:58:51] benzrf_: that is the precise behaior i would expect
[23:58:54] benzrf_: i don't know why you're showing me this
[23:59:06] norc: benzrf_: It was an example to show that it recurses lexical scope.
[23:59:13] benzrf_: 19:53 < benzrf_> it initially proceeds by travelling up the chain of modules that line 8 is lexically contained within
[23:59:25] norc: you start from inside a lambda
[23:59:27] benzrf_: "the chain of modules the line 8 *is lexically contained within*"
[23:59:31] benzrf_: please read what i'm writing!