« Back to channel list

#ruby - 23 March 2018

« Back 1 day Forward 1 day »
[00:02:28] stevenhong: has joined #ruby
[00:02:37] jamesyu: has joined #ruby
[00:03:26] milardovich: has joined #ruby
[00:03:36] halbbalda: has joined #ruby
[00:06:32] n0m4d1c: has joined #ruby
[00:08:17] cyberg: has joined #ruby
[00:09:49] voker57: has joined #ruby
[00:09:53] voker57: has joined #ruby
[00:14:05] eckhardt: has joined #ruby
[00:20:08] halbbalda: has joined #ruby
[00:24:50] c0ncealed: has joined #ruby
[00:29:07] jamesyu: has joined #ruby
[00:32:37] chatchatt: has joined #ruby
[00:38:51] shpoont: has joined #ruby
[00:45:23] reusedSalt: has joined #ruby
[00:52:07] redlegion: has joined #ruby
[01:08:47] milardovich: has joined #ruby
[01:14:12] shakes: has joined #ruby
[01:21:14] jenrzzz: has joined #ruby
[01:29:27] alfiemax: has joined #ruby
[01:34:37] Azure: has joined #ruby
[01:37:02] meinside: has joined #ruby
[01:41:58] karapetyan: has joined #ruby
[01:45:01] ledestin: has joined #ruby
[01:47:43] chouhoulis: has joined #ruby
[01:50:29] cpallares: has joined #ruby
[01:50:50] nowhere_man: has joined #ruby
[01:52:46] pabloh: has joined #ruby
[01:53:18] pabloh: Any body knows if is possible to delegate a method preserving the original arity?
[01:53:48] pabloh: or if you have a "new method defined" hook?
[01:55:10] ineb: pablo_: by passing along *args?
[01:55:34] pabloh: but on that case you have compatible arity
[01:55:48] noobineer: has joined #ruby
[01:57:53] pabloh: what I would like is to have "MClass.method(:original).paramters == MClass.method(:delegated).paramters"
[01:58:08] pabloh: or at least "MClass.method(:original).arity == MClass.method(:delegated).arity"
[02:03:03] netherwolfe: has joined #ruby
[02:03:04] ineb: not sure what you are trying to do. alias is not an option here, right?
[02:05:18] white_lilies: has joined #ruby
[02:09:18] pabloh: sadly now, since alias only helps you with method on the same class
[02:10:04] pabloh: I basically want to copy a instance method to the class so it becomes a class method as well
[02:13:04] Azure: has joined #ruby
[02:16:40] workmad3: has joined #ruby
[02:27:28] nowhere_man: has joined #ruby
[02:32:00] orbyt_: has joined #ruby
[02:33:26] coderphive: has joined #ruby
[02:34:42] fiachetti: has joined #ruby
[02:35:24] alfiemax: has joined #ruby
[02:37:02] alfiemax_: has joined #ruby
[02:37:13] gizmore: has joined #ruby
[02:37:59] darkhanb: has joined #ruby
[02:41:42] dinfuehr_: has joined #ruby
[02:43:34] karapetyan: has joined #ruby
[02:48:13] dr3wo: has joined #ruby
[02:48:26] gigetoo: has joined #ruby
[03:03:35] jnollette: has joined #ruby
[03:07:10] jnollette: has joined #ruby
[03:07:22] alfiemax: has joined #ruby
[03:07:28] dstrunk: has joined #ruby
[03:12:42] mrx_: has joined #ruby
[03:15:19] arekushi: has joined #ruby
[03:17:25] jamesaxl: has joined #ruby
[03:18:28] milardovich: has joined #ruby
[03:31:40] howdoi: has joined #ruby
[03:36:11] alfiemax: has joined #ruby
[03:45:05] karapetyan: has joined #ruby
[03:52:09] govg: has joined #ruby
[03:55:53] cschneid: has joined #ruby
[03:57:38] jamesaxl: has joined #ruby
[04:00:04] Tempesta: has joined #ruby
[04:06:15] milardovich: has joined #ruby
[04:07:14] Dimik: has joined #ruby
[04:11:40] alfiemax: has joined #ruby
[04:19:29] arekushi: has joined #ruby
[04:20:54] nadir: has joined #ruby
[04:21:33] yosafbridge: has joined #ruby
[04:22:42] b100s: has joined #ruby
[04:23:23] b100s: hi2all; is it possible to have one endpoint for one net interface and another for second net interface in one ruby sinatra app ?
[04:25:16] trautwein: has joined #ruby
[04:28:16] havenwood: b100s: That sounds quite possible, but I'm not quite sure I know what you're meaning.
[04:29:40] fiachetti: has joined #ruby
[04:29:58] banisterfiend: has joined #ruby
[04:36:16] marius: has joined #ruby
[04:38:07] rikai: has joined #ruby
[04:43:45] cdg: has joined #ruby
[04:44:32] gix-: has joined #ruby
[04:56:09] shuforov: has joined #ruby
[04:59:25] ramfjord: has joined #ruby
[05:06:45] kies: has joined #ruby
[05:08:37] newguy8822: has joined #ruby
[05:09:09] newguy8822: hi guys how do i install a ruby gem?
[05:09:32] havenwood: newguy8822: gem install
[05:09:57] newguy8822: in the cmd or irb?
[05:10:05] havenwood: newguy8822: command line
[05:11:07] havenwood: newguy8822: in irb you can shell out if you want with backticks: `gem install hola`
[05:11:08] havenwood: newguy8822: no prob
[05:11:29] havenwood: or in pry you can use the `gem-install` command to both install then require the gem: gem-install hola
[05:11:34] ruby[bot]: Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
[05:14:05] jenrzzz: has joined #ruby
[05:21:25] newguy8822: i installed nokogiri but cant require it, does anyone know what went wrong? C:/Ruby25-x64/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- nokogiri (LoadError)
[05:24:08] havenwood: newguy8822: What do you get for?: gem which nokogiri
[05:26:35] newguy8822: it works now thanks
[05:29:28] newguy8822: is this a windows bug? 'make' is not recognized as an internal or external command, operable program or batch file.
[05:30:17] jenrzzz: has joined #ruby
[05:35:41] sauvin_: has joined #ruby
[05:35:55] shuforov: has joined #ruby
[05:39:18] arkymad: has joined #ruby
[05:44:19] anisha_: has joined #ruby
[05:44:55] za1b1tsu: has joined #ruby
[05:53:22] PixeLInc: A windows bug? No lol. You have to manually install make on Windows
[06:01:49] eckhardt: has joined #ruby
[06:03:42] b100s: havenwood, thanks: ) by the way, is it possible to get source IP of request ?
[06:09:45] arkymad: has joined #ruby
[06:10:35] sidx64: has joined #ruby
[06:17:05] workmad3: has joined #ruby
[06:21:23] reber: has joined #ruby
[06:21:25] jamesaxl: has joined #ruby
[06:22:09] Xiti`: has joined #ruby
[06:22:34] sidx64: has joined #ruby
[06:32:47] arkymad: has joined #ruby
[06:33:57] karapetyan: has joined #ruby
[06:37:53] za1b1tsu: has joined #ruby
[06:44:21] pavelz: has joined #ruby
[06:46:04] shuforov: has joined #ruby
[06:46:20] za1b1tsu: has joined #ruby
[06:52:53] jcarl43: has joined #ruby
[06:55:23] aufi: has joined #ruby
[07:00:06] alfiemax_: has joined #ruby
[07:03:01] za1b1tsu: has joined #ruby
[07:12:22] za1b1tsu: has joined #ruby
[07:13:12] sidx64: has joined #ruby
[07:15:11] suukim: has joined #ruby
[07:22:05] dionysus69: has joined #ruby
[07:22:09] pavelz: has joined #ruby
[07:26:50] conta: has joined #ruby
[07:30:27] sleetdrop: has joined #ruby
[07:31:06] alex``: has joined #ruby
[07:31:47] sidx64: has joined #ruby
[07:33:49] arkymad: has joined #ruby
[07:35:44] sspreitz: has joined #ruby
[07:36:25] andikr: has joined #ruby
[07:37:48] sidx64: has joined #ruby
[07:38:31] chatchat1: has joined #ruby
[07:44:35] sidx64: has joined #ruby
[07:51:35] schneider: has joined #ruby
[07:53:33] sspreitz: has joined #ruby
[07:54:01] shpoont: has joined #ruby
[08:06:26] yohji: has joined #ruby
[08:08:08] alfiemax: has joined #ruby
[08:12:54] venmx: has joined #ruby
[08:15:22] vondruch: has joined #ruby
[08:16:25] schneider: has joined #ruby
[08:16:26] TomyWork: has joined #ruby
[08:17:17] workmad3: has joined #ruby
[08:17:20] conta1: has joined #ruby
[08:17:55] clemens3: has joined #ruby
[08:18:56] karapetyan: has joined #ruby
[08:22:58] Mosselman: has joined #ruby
[08:25:15] physicist__: has joined #ruby
[08:29:58] Silthias: has left #ruby: ()
[08:39:32] avelldiroll: has joined #ruby
[08:44:03] cdg: has joined #ruby
[08:44:05] jenrzzz: has joined #ruby
[08:44:06] jenrzzz: has joined #ruby
[08:47:50] claudiuinberlin: has joined #ruby
[08:52:23] sidx64: has joined #ruby
[08:59:36] ramfjord: has joined #ruby
[09:07:59] einarj: has joined #ruby
[09:08:40] mikecmpbll: has joined #ruby
[09:11:06] jottr: has joined #ruby
[09:11:51] planigan: has joined #ruby
[09:18:22] milardovich: has joined #ruby
[09:18:43] marr: has joined #ruby
[09:20:23] tomphp: has joined #ruby
[09:20:35] phaul: has joined #ruby
[09:21:00] Mike11: has joined #ruby
[09:26:10] shuforov: has joined #ruby
[09:30:56] arekushi: has joined #ruby
[09:32:19] karapetyan: has joined #ruby
[09:39:12] Papierkorb: has joined #ruby
[09:44:49] Papierkorb: has left #ruby: ("Konversation terminated!")
[09:45:03] gray_-_wolf: has joined #ruby
[09:46:41] dr3wo: has joined #ruby
[09:47:46] riotjones: has joined #ruby
[09:48:14] pavelz: has joined #ruby
[09:50:07] stairmast0r: has joined #ruby
[09:53:09] dr3wo: has joined #ruby
[09:53:14] sidx64: has joined #ruby
[09:58:15] tomphp: has joined #ruby
[10:01:11] venmx: has joined #ruby
[10:02:22] \void: has joined #ruby
[10:02:32] schneider: Someone experienced with Thor for creating CLIs?
[10:03:00] schneider: I have nested subcommands desc goes wrong
[10:03:32] shuforov: has joined #ruby
[10:04:18] schneider: https://pastebin.com/AV1kiUGm
[10:04:18] ruby[bot]: schneider: as I told you already, please use https://gist.github.com
[10:05:20] schneider: I have this small script, and whenever I run "./foo.rb crud create" the documentation shows all the commands omiting "crud" in the first place
[10:06:05] schneider: instead of showing "./foo.rb crud create file # Creating a file" it shows me "./foo.rb create file # Creating a file"
[10:06:17] schneider: I'm doing something wrong here?
[10:10:03] burgestrand: has joined #ruby
[10:13:07] tomphp: has joined #ruby
[10:15:29] gnufied: has joined #ruby
[10:15:57] Mia: has joined #ruby
[10:20:35] sina: has joined #ruby
[10:20:58] tvw: has joined #ruby
[10:22:01] Axy: has joined #ruby
[10:24:47] Axy: has joined #ruby
[10:24:53] Axy: has joined #ruby
[10:25:48] psychicist__: has joined #ruby
[10:26:41] workmad3: has joined #ruby
[10:27:31] shuforov: has joined #ruby
[10:28:35] roshanavand: has joined #ruby
[10:35:34] shpoont: has joined #ruby
[10:45:21] tomphp: has joined #ruby
[10:55:27] duckpuppy: has joined #ruby
[10:57:02] tomphp: has joined #ruby
[10:57:22] conta: has joined #ruby
[10:59:42] ramfjord: has joined #ruby
[11:00:30] Mia: has joined #ruby
[11:05:16] mojtaba: has joined #ruby
[11:09:19] tomphp: has joined #ruby
[11:10:56] shuforov: has joined #ruby
[11:11:30] RougeT430: has joined #ruby
[11:12:34] AJA4350: has joined #ruby
[11:14:38] ferr: has joined #ruby
[11:16:11] conta: has joined #ruby
[11:20:39] ferr: has left #ruby: ("WeeChat 2.1")
[11:20:49] Mosselman: has joined #ruby
[11:20:56] arkymad: has joined #ruby
[11:24:20] mojtaba: has joined #ruby
[11:25:14] theRoUS: has joined #ruby
[11:31:09] theRoUS: has joined #ruby
[11:35:07] dr3wo: has joined #ruby
[11:35:51] dviola: has joined #ruby
[11:39:55] arkymad: has joined #ruby
[11:42:09] noobineer: has joined #ruby
[11:48:54] tomphp: has joined #ruby
[11:49:21] Cavallari: has joined #ruby
[11:49:46] Cavallari1: has joined #ruby
[11:51:23] Mia: has joined #ruby
[11:51:24] Mia: has joined #ruby
[11:52:57] arkymad: has joined #ruby
[11:57:50] synthroid: has joined #ruby
[11:58:13] roshanavand: has joined #ruby
[11:58:27] rshetty: has joined #ruby
[11:59:13] amatas: has joined #ruby
[12:02:32] tcopeland: has joined #ruby
[12:02:45] jcalla: has joined #ruby
[12:02:59] Mosselman: has joined #ruby
[12:07:22] tomphp: has joined #ruby
[12:07:49] anisha_: has joined #ruby
[12:09:18] psychicist__: has joined #ruby
[12:19:08] FactorBrY: has joined #ruby
[12:23:33] milardovich: has joined #ruby
[12:23:48] amelliaa: has joined #ruby
[12:24:15] bmurt: has joined #ruby
[12:28:07] cdg: has joined #ruby
[12:28:14] alfiemax: has joined #ruby
[12:29:27] ecuanaso: has joined #ruby
[12:29:50] shuforov: has joined #ruby
[12:31:34] Mosselman: has joined #ruby
[12:40:50] aotg: has joined #ruby
[12:43:34] Mike11: why would one use send() instead of calling the member function directly?
[12:44:38] z64: send bypasses protection; it can be used to call private methods on a class
[12:44:40] Mike11: is this just about bypassing member access specifiers?
[12:45:00] z64: that is one use
[12:45:12] Mike11: z64: I can not think of anything else
[12:45:33] z64: its used often in metaprogramming concepts in ruby
[12:45:52] z64: where some other code might generate the name of the method to be called
[12:46:10] Mike11: aha, makes sense here...
[12:46:20] Mike11: thanks :)
[12:46:52] z64: you can get pretty creative with it. it can also cause some nasty bugs if you're not careful. no problem
[12:49:57] jecht: has joined #ruby
[12:53:21] jimmylu2333-fedo: has joined #ruby
[12:55:55] John_Ivan: has joined #ruby
[12:55:55] John_Ivan: has joined #ruby
[12:57:07] arkymad: has joined #ruby
[12:57:45] RougeT430: has joined #ruby
[12:59:37] jecht: has joined #ruby
[13:05:26] ineb: Mike11: also sometimes seen in unit tests
[13:05:54] Mike11: ineb: interesting, so why not call the method directly there?
[13:06:28] ineb: for ignoring that it is private ^^
[13:07:10] Mike11: oh, ok :)
[13:07:30] ineb: but there is also public_send which will respect the visibility of methods again
[13:08:08] za1b1tsu: has joined #ruby
[13:09:01] ineb: besides its use in metaprogramming and maybe unit testing, send makes the concept of oop programming clear where messages are 'send' to objects
[13:09:46] suukim: has joined #ruby
[13:09:49] ineb: but you are right that a member function should be called directly whenever possible
[13:10:37] dminuoso: 13:45 z64 | its used often in metaprogramming concepts in ruby
[13:10:52] dminuoso: z64: In almost all cases that equates to shoehorning, not techniques.
[13:13:00] tomphp: has joined #ruby
[13:13:55] bigkevmcd: has joined #ruby
[13:14:34] Azure: has joined #ruby
[13:16:44] DTZUZO: has joined #ruby
[13:17:16] shuforov: has joined #ruby
[13:20:28] gnufied: has joined #ruby
[13:20:54] alfiemax: has joined #ruby
[13:23:47] mojtaba: has joined #ruby
[13:24:29] rippa: has joined #ruby
[13:27:24] karapetyan: has joined #ruby
[13:28:44] kn-928: has joined #ruby
[13:33:07] gnufied: has joined #ruby
[13:34:55] pd: has joined #ruby
[13:37:21] tcopeland: has joined #ruby
[13:40:03] oleo: has joined #ruby
[13:43:54] mojtaba: has joined #ruby
[13:47:05] ecuanaso: has joined #ruby
[13:47:29] mrtAkdeniz: has joined #ruby
[13:47:37] alfiemax_: has joined #ruby
[13:47:53] mrtAkdeniz: guys, I'm so noob on ruby, and just working for little things where bash is not enough...
[13:50:29] mrtAkdeniz: https://gist.github.com/iquad/72072ebbe6986202d9b598ff68357505 here is my problem.. I wrote that `parser.rb` to find and replace on a file, and it works, but only 1 problem
[13:50:57] mrtAkdeniz: on heredoc, it is escaping `\` character... I don't want it to do... My expected result is `expected.php` but real result is `result.php`
[13:51:04] mrtAkdeniz: any help would be awesome
[13:52:09] phaul: you can escape \ with \\
[13:52:52] phaul: >> "x\tx\\x"
[13:52:53] ruby[bot]: phaul: # => "x\tx\\x" (https://eval.in/977580)
[13:53:32] phaul: >> print "x\tx\\x"
[13:53:33] ruby[bot]: phaul: # => x x\xnil (https://eval.in/977583)
[13:54:11] mrtAkdeniz: phaul, if I change line 10 with `\\'public\\'`
[13:54:21] mrtAkdeniz: result becomes something stupid
[13:54:23] mrtAkdeniz: let me show you
[13:56:38] mrtAkdeniz: phaul, https://gist.github.com/iquad/72072ebbe6986202d9b598ff68357505
[13:56:41] mrtAkdeniz: doubleSlash.php
[13:56:46] mrtAkdeniz: nothing more
[13:57:16] Rapture: has joined #ruby
[13:59:51] phaul: interesting. Try enclosing the heredoc marker in single quotes after the <<- (but not at the end).
[14:01:02] ecuanaso: has joined #ruby
[14:01:12] phaul: so do replaceWith = <<-'CODE'
[14:02:39] coderphive: has joined #ruby
[14:05:00] mrtAkdeniz: phaul, let me try ıt
[14:05:53] nowhere_man: has joined #ruby
[14:05:58] mrtAkdeniz: phaul, interesting.. I remember that, I did try that... I mean, 'DOCNAME' part, but was no luck..
[14:06:02] mrtAkdeniz: that time, worked!
[14:06:04] mrtAkdeniz: thank you so much
[14:07:35] Scient: has joined #ruby
[14:09:48] chouhoulis: has joined #ruby
[14:10:43] chouhoulis: has joined #ruby
[14:12:05] milardovich: has joined #ruby
[14:21:09] burgestrand: has joined #ruby
[14:21:35] coderphive: has joined #ruby
[14:24:35] rsh: has joined #ruby
[14:25:29] guille-moe: has joined #ruby
[14:29:07] karapetyan: has joined #ruby
[14:29:08] nikivi: has joined #ruby
[14:30:01] tcopeland: has joined #ruby
[14:36:28] mikecmpb_: has joined #ruby
[14:39:15] netherwolfe: has joined #ruby
[14:44:17] Esa_: has joined #ruby
[14:47:19] KeyJoo: has joined #ruby
[14:48:07] KeyJoo: has joined #ruby
[14:51:01] ecuanaso: has joined #ruby
[14:54:59] burgestrand: has joined #ruby
[14:56:55] arekushi: has joined #ruby
[15:02:01] AJA4350: has joined #ruby
[15:08:57] cschneid: has joined #ruby
[15:12:42] jimmylu2333-fedo: has joined #ruby
[15:15:03] milardovich: has joined #ruby
[15:20:12] jecht: has joined #ruby
[15:21:00] banisterfiend: has joined #ruby
[15:22:16] milardov_: has joined #ruby
[15:30:51] DLSteve: has joined #ruby
[15:32:02] za1b1tsu: has joined #ruby
[15:35:26] za1b1tsu: has joined #ruby
[15:36:30] cthulchu: has joined #ruby
[15:37:41] cdg: has joined #ruby
[15:39:12] ecuanaso: has joined #ruby
[15:43:35] raul782: has joined #ruby
[15:44:35] noobineer: has joined #ruby
[15:48:25] cdg: has joined #ruby
[15:52:26] tolerablyjake: has joined #ruby
[15:53:20] za1b1tsu: has joined #ruby
[15:53:36] cyberg: has joined #ruby
[15:55:03] _codepoet: has joined #ruby
[15:55:34] pastorinni: has joined #ruby
[15:59:16] ldnunes: has joined #ruby
[16:01:21] mikecmpbll: has joined #ruby
[16:01:58] cagomez: has joined #ruby
[16:02:05] milardovich: has joined #ruby
[16:03:15] troys: has joined #ruby
[16:05:26] mikecmpbll: has joined #ruby
[16:06:21] duckpuppy: has joined #ruby
[16:12:20] fiachetti: has joined #ruby
[16:13:33] jcarl43: has joined #ruby
[16:13:41] ramfjord: has joined #ruby
[16:14:33] PixeLInc: has joined #ruby
[16:14:45] troys: has joined #ruby
[16:15:46] darkhanb: has joined #ruby
[16:16:32] tomphp: has joined #ruby
[16:16:54] r2: has joined #ruby
[16:17:01] synthroid: has joined #ruby
[16:17:45] ChickeNES: has joined #ruby
[16:18:07] nug-: has joined #ruby
[16:18:16] schneider: has joined #ruby
[16:19:12] cpallares: has joined #ruby
[16:19:27] Map: has joined #ruby
[16:20:13] duckpuppy: has joined #ruby
[16:20:44] tolerablyjake: has joined #ruby
[16:21:00] Eldritch: has joined #ruby
[16:21:44] Lytol: has joined #ruby
[16:22:01] Eldritch: has joined #ruby
[16:23:01] Eldritch: has joined #ruby
[16:24:06] Eldritch: has joined #ruby
[16:24:12] mfaeh: has joined #ruby
[16:26:37] Eldritch: has joined #ruby
[16:30:57] einarj: has joined #ruby
[16:34:31] Cavallari: has joined #ruby
[16:35:07] milardovich: has joined #ruby
[16:36:25] dviola: has joined #ruby
[16:42:58] alfiemax: has joined #ruby
[16:44:34] workmad3: has joined #ruby
[16:46:07] r2: has joined #ruby
[16:46:16] pd2000: has joined #ruby
[16:50:56] sanscoeur: has joined #ruby
[16:54:17] SuperLag: has joined #ruby
[16:55:01] cthulchu_: has joined #ruby
[16:55:41] Cavallari1: has joined #ruby
[16:55:44] duckpuppy: has joined #ruby
[16:57:23] dionysus69: has joined #ruby
[17:01:16] EXCHGR: has joined #ruby
[17:01:45] cagomez: If I have module Foo::A, Foo::A::Factory, Foo::A::Util. Why can I just reference Util in Foo::A::Factory as Util?
[17:02:18] _codepoet: has joined #ruby
[17:02:37] havenwood: cagomez: Because that'd be: Foo::A::Factory::Util
[17:03:33] havenwood: cagomez: The constants of nested children aren't automagically available.
[17:04:59] GJdan: has joined #ruby
[17:05:25] cagomez: Since Util is a "sibling" (same directory) as Factory, does that make it available?
[17:06:02] eckhardt: has joined #ruby
[17:06:10] jenrzzz: has joined #ruby
[17:06:10] jenrzzz: has joined #ruby
[17:06:22] ecuanaso: has joined #ruby
[17:06:23] cagomez: I reference Util in Factory but am not sure when it actually becomes available. I can see both Factory and Util under `Foo::A.constants`
[17:07:19] havenwood: cagomez: You can see both from `Foo::A` but not under `Foo::A::Factory`.
[17:08:04] havenwood: cagomez: Just like you can't see `Factory` from `Foo::A::Factory`.
[17:08:33] havenwood: cagomez: That'd be: Foo::A::Factory::Factory
[17:08:48] havenwood: cagomez: There's no traversing the namespaces. Just top level or current level.
[17:09:04] mojtaba: has joined #ruby
[17:09:35] harrycs: has joined #ruby
[17:11:21] venmx: has joined #ruby
[17:12:55] jeecht: has joined #ruby
[17:16:17] cagomez: havenwood: If I have classes like Foo::A::Components::Wheel, Foo::A::Components::Door, is there a way to make these constants available in Foo::A::Factory ? using Components.const_get() sometimes finds classes in my app/models folder
[17:16:19] apeiros: havenwood: that's not quite correct.
[17:16:32] havenwood: apeiros: I felt bad after saying it. ;-P
[17:16:41] havenwood: I'm too distracted this morning. More coffee!!
[17:16:45] apeiros: >> module A; X = 1; module B; module C; def self.x; X; end; end; end; A::B::C.x
[17:16:47] ruby[bot]: apeiros: # => /tmp/execpad-51b07dd1a6af/source-51b07dd1a6af:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/977667)
[17:16:57] cagomez: I'm trying to get my Factory to find the constants defined in Foo::A first and not have to reach the "top level"
[17:17:01] apeiros: >> module A; X = 1; module B; module C; def self.x; X; end; end; end; end; A::B::C.x
[17:17:02] ruby[bot]: apeiros: # => 1 (https://eval.in/977668)
[17:17:43] apeiros: >> module A; module B; module C; def self.nesting; Module.nesting; end; end; end; end; A::B::C.nesting
[17:17:44] ruby[bot]: apeiros: # => [A::B::C, A::B, A] (https://eval.in/977669)
[17:18:13] havenwood: apeiros: Ah, nice
[17:18:14] apeiros: >> module A; module B; module C; end; end; end; module A::B::C; def self.nesting; Module.nesting; end; end; A::B::C.nesting
[17:18:15] ruby[bot]: apeiros: # => [A::B::C] (https://eval.in/977670)
[17:18:39] apeiros: in the latter, I would not be able to resolve A::X via just X within C
[17:19:13] jrabe: has joined #ruby
[17:19:15] harrycs: has joined #ruby
[17:19:23] apeiros: dminuoso last time said I was incorrect about Module.nesting but I forgot what his amendment was :-/
[17:20:05] apeiros: it should at the very least be *mostly* correct :D
[17:20:23] jokester: has joined #ruby
[17:20:50] orbyt_: has joined #ruby
[17:21:09] jenrzzz: has joined #ruby
[17:21:35] desperek: has joined #ruby
[17:21:43] karapetyan: has joined #ruby
[17:23:16] harrycs: has joined #ruby
[17:25:14] harrycs: has joined #ruby
[17:26:28] n008f4g_: has joined #ruby
[17:29:14] harrycs: has joined #ruby
[17:29:23] dminuoso: apeiros: Oh I just said that nesting in detail is modified in a stack machine at runtime, so it's not a syntax thing.
[17:29:30] duckpuppy: has joined #ruby
[17:29:37] dminuoso: For most cases the distinction is not useful.
[17:30:09] mojtaba: has joined #ruby
[17:30:34] jecht: has joined #ruby
[17:32:03] dminuoso: ACTION should stop being a pedantric hairsplitter
[17:32:39] KeyJoo: has joined #ruby
[17:32:50] rippa: has joined #ruby
[17:33:17] harrycs: has joined #ruby
[17:33:30] raul782: has joined #ruby
[17:33:40] ski7777: has joined #ruby
[17:37:17] harrycs: has joined #ruby
[17:37:22] bmurt: has joined #ruby
[17:37:48] n0m4d1c: has joined #ruby
[17:38:14] guacamole: has joined #ruby
[17:38:14] guacamole: has joined #ruby
[17:39:17] harrycs: has joined #ruby
[17:41:18] harrycs: has joined #ruby
[17:41:31] jrafanie: has joined #ruby
[17:44:04] ski4x7: has joined #ruby
[17:44:23] Nicholai: has joined #ruby
[17:45:21] cagomez: I have a Module Recipient, Class Factory. Is it bad form to have Module Recipient with Module Factory nested inside, and then have an anonymous class inside Factory?
[17:45:47] Puffball: has joined #ruby
[17:46:02] amelliaa: has joined #ruby
[17:46:41] havenwood: cagomez: See if you can make the whole thing simpler. Try the simplest thing that can possibly work and see how that feels.
[17:48:12] r2: has joined #ruby
[17:48:43] venmx: has joined #ruby
[17:49:25] cagomez: havenwood: Here's my directory structure. https://hastebin.com/yuriqawoye.rb
[17:50:49] cagomez: my issue is that Users::Getters.const_get(:GoodUser) will find the class in my app/models folder. Will placing the "getters" in the same root directory as factory.rb cause those constants to be defined when Factory is ran?
[17:51:17] harrycs: has joined #ruby
[17:53:18] harrycs: has joined #ruby
[17:56:57] n0m4d1c_: has joined #ruby
[17:57:38] cthulchu: has joined #ruby
[17:58:20] WhereIsMySpoon: has joined #ruby
[17:58:20] WhereIsMySpoon: has joined #ruby
[17:58:46] alfiemax: has joined #ruby
[17:58:51] howdoi: has joined #ruby
[17:59:38] tcopeland: has joined #ruby
[18:00:21] jenrzzz: has joined #ruby
[18:02:47] Ryzokuken: has joined #ruby
[18:05:58] harrycs: has joined #ruby
[18:06:20] clemens3: has joined #ruby
[18:09:28] harrycs: has joined #ruby
[18:13:49] Azure: has joined #ruby
[18:15:57] ramfjord: has joined #ruby
[18:16:32] desperek: has joined #ruby
[18:17:05] dtzuzu: has joined #ruby
[18:19:07] jecht: has joined #ruby
[18:19:13] r2: has joined #ruby
[18:19:15] John_Ivan: has joined #ruby
[18:19:31] aroaminggeek: has joined #ruby
[18:20:11] mtkd: has joined #ruby
[18:22:12] cdg: has joined #ruby
[18:25:30] sagax_: has joined #ruby
[18:25:57] jenrzzz: has joined #ruby
[18:25:58] jenrzzz: has joined #ruby
[18:26:57] cdg_: has joined #ruby
[18:29:55] cthulchu_: has joined #ruby
[18:31:26] guacamole: has joined #ruby
[18:31:27] guacamole: has joined #ruby
[18:32:42] tvw: has joined #ruby
[18:33:16] shuforov: has joined #ruby
[18:34:44] ldepandis: has joined #ruby
[18:36:43] Dimik: has joined #ruby
[18:37:23] karapetyan: has joined #ruby
[18:38:00] desperek: has joined #ruby
[18:43:15] tcopeland: has joined #ruby
[18:43:31] rawste: has joined #ruby
[18:45:33] agent_white: has joined #ruby
[18:46:36] jrafanie: has joined #ruby
[18:49:01] n0m4d1c: has joined #ruby
[18:51:33] Axy: has joined #ruby
[18:51:59] cthulchu: has joined #ruby
[18:52:17] sameerynho: has joined #ruby
[18:55:34] banisterfiend: has joined #ruby
[18:58:32] tcopeland: has joined #ruby
[19:01:50] leotaku: has joined #ruby
[19:03:06] alfiemax: has joined #ruby
[19:03:09] mtkd: has joined #ruby
[19:03:59] bmurt: has joined #ruby
[19:04:56] mostlybadfly: has joined #ruby
[19:05:23] RougeT430: has joined #ruby
[19:05:47] psychicist__: has joined #ruby
[19:09:04] raynold: has joined #ruby
[19:13:56] roshanavand: has joined #ruby
[19:16:19] jottr: has joined #ruby
[19:18:06] alfiemax: has joined #ruby
[19:19:01] cagomez: has joined #ruby
[19:19:11] guacamole: has joined #ruby
[19:19:11] guacamole: has joined #ruby
[19:21:47] Mitaka89: has joined #ruby
[19:22:09] n0m4d1c: has joined #ruby
[19:22:21] Mitaka89: has joined #ruby
[19:22:38] jottr: has joined #ruby
[19:22:56] tAn: has joined #ruby
[19:23:09] tcopeland: has joined #ruby
[19:23:44] harrycs: has joined #ruby
[19:26:51] konsolebox: has joined #ruby
[19:28:28] _codepoet: has joined #ruby
[19:28:41] jenrzzz: has joined #ruby
[19:30:03] jottr: has joined #ruby
[19:32:43] milardov_: has joined #ruby
[19:33:43] psychicist__: has joined #ruby
[19:34:36] cagomez: has joined #ruby
[19:34:38] mtkd: has joined #ruby
[19:36:52] shuforov: has joined #ruby
[19:40:35] banisterfiend: has joined #ruby
[19:40:53] tomphp: has joined #ruby
[19:42:58] hinbody: has joined #ruby
[19:44:59] jottr: has joined #ruby
[19:50:26] cagomez: has joined #ruby
[19:50:31] nowhere_man: has joined #ruby
[19:51:26] eckhardt: has joined #ruby
[19:54:45] cagomez: has joined #ruby
[19:55:12] tAn: has joined #ruby
[19:55:13] jecht: has joined #ruby
[19:55:46] cagomez: has joined #ruby
[19:58:22] chouhoul_: has joined #ruby
[20:01:16] banisterfiend: has joined #ruby
[20:01:49] ramfjord: has joined #ruby
[20:02:25] tolerablyjake: has joined #ruby
[20:02:37] _codepoet: has joined #ruby
[20:03:40] eckhardt: has joined #ruby
[20:03:52] sidx64: has joined #ruby
[20:05:27] chouhoulis: has joined #ruby
[20:06:39] dr3wo: has joined #ruby
[20:07:05] nowhere_man: has joined #ruby
[20:07:39] eckhardt: has joined #ruby
[20:11:26] jnollette: has joined #ruby
[20:13:13] d5sx43: has joined #ruby
[20:15:57] dviola: has joined #ruby
[20:17:38] ledestin: has joined #ruby
[20:19:23] banisterfiend: has joined #ruby
[20:19:50] jenrzzz: has joined #ruby
[20:20:11] sidx64: has joined #ruby
[20:22:23] alfiemax_: has joined #ruby
[20:22:38] sepp2k: has joined #ruby
[20:25:00] sanscoeur: has joined #ruby
[20:26:18] tcopeland: has joined #ruby
[20:27:28] sameerynho: has joined #ruby
[20:30:55] eckhardt: has joined #ruby
[20:36:12] clampy: has joined #ruby
[20:36:28] weaksauce: has joined #ruby
[20:37:26] tolerablyjake: has joined #ruby
[20:37:52] jenrzzz: has joined #ruby
[20:37:53] jenrzzz: has joined #ruby
[20:38:42] sidx64_: has joined #ruby
[20:39:12] blackmesa: has joined #ruby
[20:40:07] SeepingN: has joined #ruby
[20:47:36] tolerablyjake: has joined #ruby
[20:47:42] guacamole: has joined #ruby
[20:50:08] aroaminggeek: has joined #ruby
[20:51:21] venmx: has joined #ruby
[20:53:28] pastorinni: has joined #ruby
[20:53:32] gnotc: has joined #ruby
[20:54:32] alfiemax: has joined #ruby
[20:55:11] WhereIsMySpoon: has joined #ruby
[20:55:38] jottr_: has joined #ruby
[20:57:29] schneider: has joined #ruby
[20:59:09] za1b1tsu: has joined #ruby
[20:59:54] za1b1tsu: has joined #ruby
[21:07:39] alfiemax: has joined #ruby
[21:10:40] phenom: has joined #ruby
[21:11:45] dr3w__: has joined #ruby
[21:12:05] synthroid: has joined #ruby
[21:12:54] jeffreylevesque: has joined #ruby
[21:14:54] mojtaba: has joined #ruby
[21:15:25] claudiuinberlin: has joined #ruby
[21:15:25] chouhoul_: has joined #ruby
[21:17:56] dr3wo: has joined #ruby
[21:20:25] alfiemax: has joined #ruby
[21:24:25] mtkd: has joined #ruby
[21:24:54] tomphp: has joined #ruby
[21:25:49] tdy: has joined #ruby
[21:27:53] jrabe: has joined #ruby
[21:30:14] sammi`: has joined #ruby
[21:32:23] mojtaba: has joined #ruby
[21:32:35] sanscoeur: has joined #ruby
[21:34:10] cagomez: has joined #ruby
[21:35:09] p4tch3s: has joined #ruby
[21:37:58] Zaab1t: has joined #ruby
[21:40:19] cagomez: I have classes in a module that map to classes in my app/models. Eg GoodUser model -> MyModule::GoodUserUtil. I have a MyModule::Factory. Is there a way of "selecting" the correct class in my module?
[21:40:34] chamunks: has joined #ruby
[21:41:37] minimalism: has joined #ruby
[21:41:38] alfiemax: has joined #ruby
[21:42:16] apeiros: cagomez: I don't understand what you're looking for. can you make a minimal example which would work except for the "selecting" part?
[21:42:18] tomphp: has joined #ruby
[21:44:14] mikecmpbll: has joined #ruby
[21:45:16] OrangeFlash81: has joined #ruby
[21:45:48] cagomez: apeiros: https://hastebin.com/afuneruhew.rb . so I have a factory that uses a case statement, based on the class of my User, to initialize a Util class
[21:46:29] OrangeFlash81: Hello all, does anybody know if there's a gem which I can use to interact with TWAIN scanners?
[21:46:40] ski7777: has joined #ruby
[21:47:03] r2: has joined #ruby
[21:47:42] apeiros: cagomez: and which part of this paste illustrates your problem?
[21:47:59] cagomez: apeiros: Instead of this case statement, I'd like another approach. I'm trying to avoid adding a method to each of my models, like `def do_something; GoodUserUtil.call; end` on my GoodUser model
[21:48:54] Quentinius: has joined #ruby
[21:49:44] apeiros: cagomez: you still seem to leave away a lot of information (maybe you consider it as self-evident?)
[21:50:49] apeiros: f.ex. what qualifies a class as "the correct class"?
[21:59:03] alfiemax: has joined #ruby
[22:01:00] sanscoeur: has joined #ruby
[22:03:24] sanscoeur: has joined #ruby
[22:03:57] n0m4d1c: has joined #ruby
[22:04:19] ramfjord: cagomez: I'm also not sure exactly what you're trying to do, but if you just want the names to match up (a la rails) you can consider calling #to_s on your class/module, modifying the string, and getting a constant back out of it with Module#const-get (https://ruby-doc.org/core-2.1.0/Module.html#method-i-const_get)
[22:04:57] ramfjord: this is assuming that you can get the correct class programatically from the name of the module, or vice versa
[22:05:04] ramfjord: this still doesn't sound like a super clean way of doing things though
[22:06:01] dminuoso: cagomez: ?xy
[22:06:07] dminuoso: ?xy cagomez
[22:06:07] ruby[bot]: cagomez: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[22:09:03] AndBobsYourUncle: has joined #ruby
[22:10:22] n008f4g_: has joined #ruby
[22:10:38] dminuoso: \o/ zenspider
[22:12:48] guacamole: has joined #ruby
[22:12:48] guacamole: has joined #ruby
[22:14:24] tAn: has joined #ruby
[22:16:01] alfiemax: has joined #ruby
[22:17:12] sanscoeur: has joined #ruby
[22:19:51] Mike11: has joined #ruby
[22:20:43] tAn: has joined #ruby
[22:21:07] duckpuppy: has joined #ruby
[22:23:11] jottr: has joined #ruby
[22:25:57] mikecmpbll: has joined #ruby
[22:26:48] tcopeland: has joined #ruby
[22:28:29] alfiemax: has joined #ruby
[22:30:02] duckpuppy: has joined #ruby
[22:38:31] shpoont: has joined #ruby
[22:40:05] ldepandis: has joined #ruby
[22:43:32] cdg: has joined #ruby
[22:49:06] harrycs: has joined #ruby
[22:52:08] sanscoeur: has joined #ruby
[22:59:25] cschneid: has joined #ruby
[23:00:11] riotjones: has joined #ruby
[23:02:48] cschneid_: has joined #ruby
[23:04:39] duckpuppy: has joined #ruby
[23:05:25] dr3wo: has joined #ruby
[23:07:14] alfiemax: has joined #ruby
[23:07:43] noobineer: has joined #ruby
[23:07:46] suhdood: has joined #ruby
[23:08:22] Paraxial: has joined #ruby
[23:09:44] cloaked1: has joined #ruby
[23:09:53] cloaked1: has joined #ruby
[23:23:52] alfiemax: has joined #ruby
[23:29:41] dstrunk: has joined #ruby
[23:33:59] za1b1tsu: has joined #ruby
[23:35:44] r2: has joined #ruby
[23:36:38] eckhardt: has joined #ruby
[23:36:52] alfiemax: has joined #ruby
[23:46:05] cthulchu_: has joined #ruby
[23:46:25] ruby[bot]: has joined #ruby
[23:46:25] ChanServ: +o ruby[bot]
[23:46:34] SCHAPiE: has joined #ruby
[23:47:05] pastorinni: has joined #ruby
[23:47:29] cthulchu_: has joined #ruby
[23:48:32] ramfjord: has joined #ruby
[23:48:47] cthulchu_: has joined #ruby
[23:50:50] panzi: has joined #ruby
[23:51:08] shpoont: has joined #ruby
[23:51:43] panzi: where is the documentation of File.read? It is not here: http://ruby-doc.org/core-2.2.2/File.html where else can it be!?
[23:53:30] apeiros: panzi: inheritance
[23:55:03] duckpuppy: has joined #ruby