« Back to channel list

#ruby - 19 July 2016

« Back 1 day Forward 1 day »
[00:02:30] ReK2: has joined #ruby
[00:02:55] ghr: has joined #ruby
[00:03:39] wedgie: hello, i'm working with chef and frequently see loops of the form 'something.each do |foo, bar|' in examples. I can't for the life of me find the documentation for what the 'bar' actually means. Can anyone provide a link? I'm just failing at finding it somehow
[00:04:02] ReK2: has joined #ruby
[00:04:02] ReK2: has joined #ruby
[00:05:51] wrkrcoop: how do i create a class with a class variable?
[00:06:07] ReK2: has joined #ruby
[00:06:07] ReK2: has joined #ruby
[00:07:03] Mirubiri: wrkrcoop: Constant = Class.new
[00:08:31] mdw: has joined #ruby
[00:09:27] Mirubiri: wedgie: what do you mean? don't you know what the word 'bar' means, or what it should contain?
[00:09:33] flashpoint9: has joined #ruby
[00:09:50] wedgie: Mirubiri: what it should contain.
[00:10:01] Mirubiri: wedgie: it depends on the 'something'
[00:10:28] Mirubiri: on what something yields
[00:11:55] wedgie: Mirubiri: i'm looking at this https://www.linode.com/docs/applications/chef/creating-your-first-chef-cookbook#configure-virtual-hosts Step 8 has th snippet i'm trying to understand
[00:13:30] Mirubiri: sitename and data
[00:14:12] Mirubiri: sitename i guess is the url of the site, and 'data' is a hash containing some information about that site
[00:14:30] Mirubiri: like the 'port'
[00:14:34] flashpoint9: has joined #ruby
[00:15:05] Mirubiri: node yields sitename and data, and that's the way to extract that info
[00:16:29] wedgie: ... i think i'm being unclear in my question. From the context i can kinda see what's happening, but i'm unsure of the semantics of the ruby syntax. I'd like to understand better what ruby is actually doing. I see .each do |foo| all over the place, but no docs for when there is a second item inside the pipes e.g., |foo, bar|
[00:16:55] Mirubiri: is the same
[00:18:14] Mirubiri: http://www.tutorialspoint.com/ruby/ruby_blocks.htm
[00:18:23] Mirubiri: read the section about the yield statement
[00:19:11] wedgie: ok, reading. Thanks
[00:19:18] Mirubiri: it is only a methods which yields two variables instead of one
[00:19:25] Mirubiri: it is essentialy the same
[00:24:26] ghr: has joined #ruby
[00:24:27] wedgie: Mirubiri: ok, so check my understanding: the .each in this case is returning a hash and the key is being put into sitename, and the value (which appens to be an array(?)) is put into data?
[00:24:31] ReK2: has joined #ruby
[00:24:31] ReK2: has joined #ruby
[00:25:03] flashpoint9: has joined #ruby
[00:25:34] Mirubiri: wedgie: nope, it is returning two variables, an url and a hash
[00:25:35] cyphase: has joined #ruby
[00:25:35] wedgie: aha, http://ruby-doc.org/core-2.2.0/Hash.html#method-i-each
[00:26:18] Mirubiri: that's the each method for a hash
[00:26:33] Mirubiri: if node is a hash, then maybe
[00:27:18] wedgie: i apologize if this is getting chef-specific, but what kind of structure is being defined here: default["lamp-stack"]["sites"]["example.com"] = { "port" => 80, "servername" => "example.com", "serveradmin" => "webmaster@example.com" }
[00:28:20] wedgie: cause it looks like it's treating "example.com" as sitename, and then port, servername, etc as some sort of hash in "data"
[00:28:54] Mirubiri: wedgie: in this case default looks like a hash of hashes
[00:29:02] zacts: has joined #ruby
[00:29:52] Mirubiri: default = { 'lamp-stack:{ "sites:{ "example":{} }}}
[00:30:00] zacts: hi rubyists
[00:30:24] Mirubiri: so you are assigning {port.....} to "example":{---}
[00:30:42] Mirubiri: inside all of that structure
[00:30:47] wedgie: ok, i think that makes sense
[00:31:04] wedgie: Mirubiri: thanks for taking the time to explain this stuf to me. I really appreciate it :)
[00:31:13] Mirubiri: it allows you to do the same for lots of urls
[00:31:22] Mirubiri: you're very welcome!
[00:31:30] wedgie: in case it wasn't painfully obvious i had no prior ruby experience until i started playing with chef last week
[00:31:45] Mirubiri: well i have no experience in chef..
[00:32:14] ElFerna: has joined #ruby
[00:32:28] Mirubiri: wedgie: invest some time learning about ruby basics it helps a lot
[00:32:53] Mirubiri: not difficult
[00:33:01] wedgie: alright, well i think that gets me started. Just trying to take the "magic" out of the examples i've been using. Thanks again.
[00:33:10] wedgie: and will-do. Learning a new language is never bad
[00:35:58] mikeiniowa: has joined #ruby
[00:36:56] ghr: has joined #ruby
[00:37:04] blackmesa: has joined #ruby
[00:38:42] ICantCook: depends on the language ;)
[00:39:30] Mirubiri: programming languaje wars begin
[00:40:13] Mirubiri: hey, i learned ms-dos
[00:40:32] Mirubiri: it was my first programming languaje
[00:40:43] ICantCook: I had to learn and work with xslt for a while
[00:41:18] zacstewart: has joined #ruby
[00:42:10] MOgolid: c++ is my weapon
[00:42:33] SilverKey: has joined #ruby
[00:43:36] Mirubiri: someday i will learn it
[00:43:40] ekinmur: has joined #ruby
[00:43:47] Mirubiri: but i don't know what to do
[00:43:54] Mirubiri: C or C++ thats the...
[00:44:35] MOgolid: thats the shit
[00:44:57] djbkd: has joined #ruby
[00:45:14] MOgolid: "Google is your friend"
[00:45:56] Mirubiri: Google is a compulsive liar many times
[00:46:04] MOgolid: duckduckgo
[00:46:14] MOgolid: disconnect(darkweb
[00:46:29] MOgolid: Use your search engine
[00:46:57] ghr: has joined #ruby
[00:47:15] Mirubiri: Google was only a foo var in that statement lol
[00:47:37] MOgolid: Mirubiri: use FTp
[00:47:58] MOgolid: ftp / pastebin
[00:48:26] Mirubiri: i think that's the way to go
[00:48:29] ElFerna: has joined #ruby
[00:49:16] hxegon: Thinking about using forwardable to extend a class with OpenStruct methods, thoughts?
[00:49:28] Mirubiri: no, seriously. For parallel processing I think that C will do better than C#
[00:49:48] hxegon: OpenStruct.new(hash) that is
[00:51:29] rodfersou: has joined #ruby
[00:51:30] MOgolid: need ircop? Qme
[00:51:44] minimalism: has joined #ruby
[00:54:42] cd-rum: has joined #ruby
[00:56:03] jaguarmagenta: has joined #ruby
[00:58:45] AndrewIsHere: has joined #ruby
[00:58:58] cd-rum_: has joined #ruby
[00:59:00] antgel: has joined #ruby
[01:01:00] ghr: has joined #ruby
[01:02:51] xall_: has joined #ruby
[01:03:44] flashpoint9: has joined #ruby
[01:05:34] enterprisey: has joined #ruby
[01:09:23] CloCkWeRX: has joined #ruby
[01:10:19] User458764: has joined #ruby
[01:10:28] ghr: has joined #ruby
[01:12:18] RegulationD: has joined #ruby
[01:12:26] cyphase: has joined #ruby
[01:14:01] karapetyan: has joined #ruby
[01:14:04] zacts: has joined #ruby
[01:21:32] moeabdol3: has joined #ruby
[01:21:59] Radar: ?offtopic MOgolid
[01:21:59] ruby[bot]: MOgolid: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[01:24:28] A_Drone: has joined #ruby
[01:24:29] ghr: has joined #ruby
[01:25:33] nankyokusei: has joined #ruby
[01:27:37] rodorgas: has joined #ruby
[01:32:59] hellcode: has joined #ruby
[01:34:00] ghr: has joined #ruby
[01:35:45] arescorpio: has joined #ruby
[01:37:03] jaguarmagenta: has joined #ruby
[01:37:47] A_Drone: has joined #ruby
[01:38:51] cdg: has joined #ruby
[01:39:39] blackmesa: has joined #ruby
[01:41:12] hutch34: has joined #ruby
[01:43:30] ghr: has joined #ruby
[01:44:43] singalaut: has joined #ruby
[01:47:53] jsdfkl: has joined #ruby
[01:48:36] SilverKey: has joined #ruby
[01:50:42] roamingdog: has joined #ruby
[01:51:25] techietrash: has joined #ruby
[01:52:05] underplank: has joined #ruby
[01:52:47] sdothum: has joined #ruby
[01:55:21] paradisaeidae_: has joined #ruby
[01:55:31] ghr: has joined #ruby
[01:56:44] A_Drone: has joined #ruby
[01:56:58] xall_: has joined #ruby
[01:58:28] ekinmur: has joined #ruby
[02:00:03] AndrewIsHere: has joined #ruby
[02:02:33] A_Drone_: has joined #ruby
[02:05:20] A_Drone: has joined #ruby
[02:09:45] zacstewart: has joined #ruby
[02:10:05] ghr: has joined #ruby
[02:12:49] hellcode: has joined #ruby
[02:18:39] xall_: has joined #ruby
[02:19:02] mattwashere: has joined #ruby
[02:19:32] ghr: has joined #ruby
[02:22:57] jackjackdripper: has joined #ruby
[02:24:03] A_Drone: has joined #ruby
[02:25:00] ekinmur: has joined #ruby
[02:25:27] drtwo: has joined #ruby
[02:26:06] weaksauce: has joined #ruby
[02:27:15] ellisTAA: has joined #ruby
[02:29:11] NorstaR: has joined #ruby
[02:29:33] ghr: has joined #ruby
[02:30:09] nando293921: has joined #ruby
[02:31:09] ellisTAA: has left #ruby: ()
[02:31:37] GnuYawk: has joined #ruby
[02:31:47] nando294021: has joined #ruby
[02:32:01] phredus: has joined #ruby
[02:32:55] hdlbrkr: has joined #ruby
[02:37:04] jameswatling: has joined #ruby
[02:39:19] tmtwd: has joined #ruby
[02:39:54] A_Drone_: has joined #ruby
[02:40:53] nettoweb: has joined #ruby
[02:41:02] blackmesa: has joined #ruby
[02:41:41] enterprisey: has joined #ruby
[02:44:36] ghr: has joined #ruby
[02:45:49] edwinvdgraaf: has joined #ruby
[02:46:02] A_Drone: has joined #ruby
[02:46:05] benlieb: has joined #ruby
[02:47:46] zacstewart: has joined #ruby
[02:48:59] dkam: has joined #ruby
[02:54:04] ghr: has joined #ruby
[02:54:23] astrobun_: has joined #ruby
[02:55:49] A_Drone: has joined #ruby
[02:56:46] araujo__: has joined #ruby
[02:58:43] ekinmur: has joined #ruby
[02:59:15] CodingWolf: has joined #ruby
[03:00:39] hinbody: has joined #ruby
[03:02:12] cd-rum: has joined #ruby
[03:03:59] A_Drone: has joined #ruby
[03:04:24] aries_liuxueyang: has joined #ruby
[03:06:05] ghr: has joined #ruby
[03:07:56] leea: has joined #ruby
[03:08:47] leea: Anyone know of OS projects that need support?
[03:11:31] voodoofish4301: has joined #ruby
[03:11:43] pawnbox: has joined #ruby
[03:11:47] bokayio: has joined #ruby
[03:13:03] pawnbox: has joined #ruby
[03:14:34] voodoofish4302: has joined #ruby
[03:16:06] ghr: has joined #ruby
[03:16:20] braincrash: has joined #ruby
[03:17:19] A_Drone: has joined #ruby
[03:19:57] zacts: has joined #ruby
[03:20:01] shevy: OS? with ruby or independent of ruby?
[03:21:00] k3rn31: has joined #ruby
[03:22:28] jaguarmagenta: has joined #ruby
[03:23:15] jishankai: has joined #ruby
[03:23:21] treaki__: has joined #ruby
[03:25:27] pabs: has joined #ruby
[03:26:22] nankyokusei: has joined #ruby
[03:28:26] A_Drone_: has joined #ruby
[03:30:36] ghr: has joined #ruby
[03:31:40] leea: ruby OS projects
[03:32:34] A_Drone: has joined #ruby
[03:32:39] shevy: there used to be heretix
[03:33:04] shevy: https://distrowatch.com/table.php?distribution=heretix
[03:33:20] shevy: perhaps via mruby there may be some new interest in a ruby OS again
[03:33:49] shevy: until then I guess the best, simplest and most sustainable way would be to write as much ruby code as possible and enable whatever may be useful in a modular, lego-brick like fashion
[03:34:14] leea: oh i meant open source, not operating system
[03:35:04] shevy: now that will have a lot more projects that may need help
[03:35:28] shevy: this one may need help https://github.com/jordansissel/fpm
[03:35:47] shevy: lots of open issues and only one main dev in his spare time
[03:36:30] leea: I'll take a look after finishing dinner :D, thanks
[03:37:23] hutch34: has joined #ruby
[03:37:58] shevy: I just found another one perhaps by epitron :D
[03:38:02] shevy: http://www.rubydoc.info/gems/epitools/frames
[03:38:07] shevy: reminds me a bit of the old facets gem
[03:38:18] shevy: perhaps some more ruby games
[03:38:41] zacts: has joined #ruby
[03:39:00] shevy: leea btw if you can not find any project to add code to, it may also be useful if you will test some promising projects and supply feedback to the author - that one of course depends on an author willing to listen too, before you can do so, otherwise it may be wasted effort
[03:39:36] leea: is there an index of these projects?
[03:40:38] shevy: I don't think so in the sense of an index or a page where you can see which projects may need help
[03:41:22] shevy: perhaps scanning on https://www.ruby-toolbox.com/ may be useful, in particular for when projects are semi-popular and semi-active or more than that
[03:41:47] blackmesa: has joined #ruby
[03:43:43] A_Drone: has joined #ruby
[03:43:49] bokayio: has joined #ruby
[03:45:35] AndrewIsHere: has joined #ruby
[03:47:12] LoneHermit: has joined #ruby
[03:48:47] A_Drone: has joined #ruby
[03:51:06] astrobun_: has joined #ruby
[03:51:07] ghr: has joined #ruby
[03:58:40] chequers: has joined #ruby
[03:59:15] gix: has joined #ruby
[03:59:32] chequers: hi all, I'm working with the AWS API and I find myself writing multiple levels of looping to access the data I want, like this https://gist.github.com/alexjurkiewicz/94676d3e8b39969dce6e30f8fe7dc187 . Is there a better way which requires less indentation?
[03:59:34] mattwashere: has joined #ruby
[04:00:11] enterprisey: has joined #ruby
[04:00:37] ghr: has joined #ruby
[04:01:05] shevy: I don't know the data structure and objects used there, but perhaps via .select
[04:02:57] Guest60828: has joined #ruby
[04:05:50] skweek: has joined #ruby
[04:05:51] drtwo: has left #ruby: ()
[04:06:37] connor_goodwolf: has joined #ruby
[04:07:35] CloCkWeRX: has joined #ruby
[04:10:38] ghr: has joined #ruby
[04:11:17] yadobujo: has joined #ruby
[04:11:25] hk238: has joined #ruby
[04:11:34] daffy_duck_2: has joined #ruby
[04:13:08] djbkd: has joined #ruby
[04:13:15] RegulationD: has joined #ruby
[04:16:07] ewilliam: has joined #ruby
[04:18:30] xall_: has joined #ruby
[04:21:09] ghr: has joined #ruby
[04:21:39] zacstewart: has joined #ruby
[04:23:52] rumia: has joined #ruby
[04:25:12] devbug: has joined #ruby
[04:27:17] chequers: has left #ruby: ()
[04:28:48] whathappens: has joined #ruby
[04:29:12] Hyuk: has joined #ruby
[04:29:13] astrobun_: has joined #ruby
[04:31:11] ghr: has joined #ruby
[04:35:14] dkam: has joined #ruby
[04:35:43] tmtwd: has joined #ruby
[04:36:10] A_Drone: has joined #ruby
[04:38:03] skweek: has joined #ruby
[04:39:02] ReK2GnULinuX: has joined #ruby
[04:40:18] pabs: has joined #ruby
[04:40:40] ghr: has joined #ruby
[04:41:00] vuoto: has joined #ruby
[04:42:57] rann: has joined #ruby
[04:43:10] blackmesa: has joined #ruby
[04:44:12] devbug: has joined #ruby
[04:48:15] aries_liuxueyang: has joined #ruby
[04:48:35] LoneHermit: has joined #ruby
[04:48:45] shinnya: has joined #ruby
[04:50:14] ghr: has joined #ruby
[04:50:41] nerium: has joined #ruby
[04:51:15] HammyJammy: has joined #ruby
[04:55:06] AndrewIsHere: has joined #ruby
[04:56:54] dminuoso: has joined #ruby
[05:02:11] ghr: has joined #ruby
[05:03:18] Hyuk: has joined #ruby
[05:04:15] leea: shevy I'm looking into fpm, do you use it?
[05:04:32] Es0teric: has joined #ruby
[05:05:35] harfangk: has joined #ruby
[05:09:26] Hyuk: has joined #ruby
[05:11:13] Silthias: has joined #ruby
[05:11:41] ghr: has joined #ruby
[05:13:13] armyriad: has joined #ruby
[05:13:49] alfiemax: has joined #ruby
[05:13:51] Beverage: has joined #ruby
[05:15:53] sucks: has joined #ruby
[05:15:57] roamingdog: has joined #ruby
[05:17:43] Silthias1: has joined #ruby
[05:20:27] whathappens: has joined #ruby
[05:21:08] skweek: has joined #ruby
[05:21:12] ghr: has joined #ruby
[05:21:53] craigp: has joined #ruby
[05:22:32] A_Drone: has joined #ruby
[05:22:54] Hyuk: has joined #ruby
[05:24:30] Technodrome: has joined #ruby
[05:24:34] wald0: has joined #ruby
[05:27:15] nankyokusei: has joined #ruby
[05:31:09] wrkrcoop: has joined #ruby
[05:31:26] wrkrcoop: how can i go about getting audio from a user using ruby?
[05:31:42] wrkrcoop: i want to write a function that turns on the mic and lets the user record something
[05:34:13] ghr: has joined #ruby
[05:34:13] Sashimi: has joined #ruby
[05:36:52] yeticry: has joined #ruby
[05:37:29] lxsameer: has joined #ruby
[05:38:01] futilegames: has joined #ruby
[05:38:24] A_Drone: has joined #ruby
[05:39:47] Sashimi: has joined #ruby
[05:40:07] futilegames: has joined #ruby
[05:41:43] aupadhye: has joined #ruby
[05:42:46] Hyuk: has joined #ruby
[05:43:18] Sashimi: has joined #ruby
[05:43:43] ghr: has joined #ruby
[05:44:24] nerium: has joined #ruby
[05:44:33] blackmesa: has joined #ruby
[05:45:58] ninjaaron: has joined #ruby
[05:46:28] Sashimi: has joined #ruby
[05:47:12] davedev24: has joined #ruby
[05:47:43] futilegames: has joined #ruby
[05:47:53] futilegames: has left #ruby: ()
[05:48:44] ninjaaron: Quick question about the ruby data model: Is it like Python, where every name is just a reference to an anonymous object, or is it more like Perl, where variables are bound more closely to the object unless they are explicitely made to be references?
[05:49:35] ninjaaron: (i.e. can you do the same shenanigans with mutible objects as in python)
[05:49:35] dminuoso: has joined #ruby
[05:49:48] A_Drone: has joined #ruby
[05:50:20] Sashimi: has joined #ruby
[05:51:06] dionysus69: has joined #ruby
[05:52:20] Hyuk: has joined #ruby
[05:52:35] ninjaaron: I have hardly any experience with Ruby, but my gut says it's more like everything is a reference to an anonymous object.
[05:52:48] govg: has joined #ruby
[05:52:48] ninjaaron: but my google-foo is bad with regards to this topic.
[05:52:58] harfangk: ninjaaron http://stackoverflow.com/questions/1872110/is-ruby-pass-by-reference-or-by-value
[05:53:01] yadobujo: has joined #ruby
[05:53:17] harfangk: see if this discussion answers your uery
[05:54:05] Sashimi: has joined #ruby
[05:54:14] ghr: has joined #ruby
[05:54:29] JammyHammy: has joined #ruby
[05:56:52] A_Drone_: has joined #ruby
[05:57:02] Sashimi: has joined #ruby
[05:57:55] Cohedrin: has joined #ruby
[05:58:40] ninjaaron: harfangk: Yes. looks like Ruby is the same as Python in this regard. The more I learn Ruby, the more I feel like it's... the same as Python; I mean, with blocks instead of comprehensions and regex literals, and more emphasis on OO design patterns.
[05:58:46] ninjaaron: But a lot the same.
[05:58:54] Dimik--: has joined #ruby
[05:59:03] harfangk: haha yeah hence they're often discussed in the same context
[05:59:29] harfangk: they have slightly different philosphies tho
[05:59:34] harfangk: my favorite analogy is this:
[05:59:35] xall_: has joined #ruby
[05:59:42] ericsupreme: has joined #ruby
[05:59:57] harfangk: if you like playing with lego, go with python; if you like playing with clay or playdough, go with ruby
[06:00:12] dminuoso: As pretty as that analogy may be, it is also utterly useless.
[06:00:29] Macaveli: has joined #ruby
[06:00:38] Mon_Ouie: has joined #ruby
[06:01:08] dminuoso: ninjaaron: Can you elaborate on your initial question?
[06:01:56] blaxter: has joined #ruby
[06:02:09] ninjaaron: I feel like the main philosophical difference is that python focuses on readability, where ruby focuses on writeablility (though, there is a lot of overlap in those two goals)
[06:02:23] ninjaaron: dminuoso: I think I understand now.
[06:03:01] ninjaaron: I was just wondering if everything in Ruby is like a pointer, or more like a real value.
[06:03:11] yfeldblum: has joined #ruby
[06:03:16] ninjaaron: Sounds like they are more like pointers.
[06:03:18] dminuoso: ninjaaron: The word "reference" majorly sucks though, because its meaning depends on the context. (Java for example uses the term reference on opposite terms from C++ perspective)
[06:03:50] dminuoso: It's probably better to say all variables/parameters/constants behave like pointers.
[06:04:01] ninjaaron: dminuoso: yeah.
[06:04:15] ghr: has joined #ruby
[06:06:14] ninjaaron: dminuoso: I assume that goes for class and function names as well?
[06:06:30] dminuoso: ninjaaron: classes are just objects like anything else.
[06:06:47] A_Drone: has joined #ruby
[06:06:50] dminuoso: The fact that you (usually) use upper case names for them, just makes it a constant holding a class object
[06:07:26] dminuoso: ninjaaron: and methods (ruby has no "functions") are a bit tricky, in a nutshell invoking a method is just object.send(:method)
[06:07:43] dminuoso: (A feat inherited from Smalltalk I believe)
[06:08:43] dminuoso: Methods in Ruby are not first-class functions.
[06:09:01] ninjaaron: Are there first-class functions?
[06:09:11] pawnbox_: has joined #ruby
[06:09:16] dminuoso: ninjaaron: Generally you mean?
[06:10:04] ninjaaron: Like, there must be a way to write a closure.
[06:10:21] ninjaaron: I'm sure I read about it somewhere.
[06:10:23] dminuoso: ninjaaron: Sure, either you use a Proc or you can build a Method from an actual method
[06:10:37] dminuoso: (That last bit shows that you can actually turn Ruby methods into first-class citizens after all)
[06:11:13] dminuoso: In short: There is 3 things that are not immediate objects. Variables, blocks and methods.
[06:12:16] ninjaaron: Ok, so it is a bit different from Python in that way.
[06:12:58] mistermocha: has joined #ruby
[06:13:00] ninjaaron: (Sorry for thinking about everything in terms of Python)
[06:13:02] dminuoso: ninjaaron: Though the Ruby way uses blocks generally for closures - which is its trademark.
[06:13:11] moeabdol: has joined #ruby
[06:13:15] dminuoso: for example: array.map { |e| e * 2 }
[06:13:45] ghr: has joined #ruby
[06:14:21] RegulationD: has joined #ruby
[06:15:10] ninjaaron: I see. Blocks are something I'm still figuring out. I know some cases where you use them, but I wouldn't say I grok them. Probably needs more practice.
[06:15:35] dminuoso: ninjaaron: Once you get the hang out of them they become quite natural. It's a fairly elegant solution at inline lambdas basically.
[06:15:45] dminuoso: One that is readable, writeable and chainable!
[06:15:47] A_Drone: has joined #ruby
[06:16:34] havenwood: ninjaaron: Here are a few examples of differences between blocks, procs and lambdas in Ruby: https://gist.github.com/havenwood/f80308141c8460e3d181
[06:17:36] dminuoso: ninjaaron: A Proc is just an objectified Block - so they are the same except you can treat a Proc as an actual object. ;-)
[06:17:52] dminuoso: (And a Lambda is a kind of Proc with some subtle difference in how it behaves)
[06:18:00] dminuoso: Though havenwood's gist nicely shows that.
[06:18:14] havenwood: ninjaaron: Or a bit of lambda calculus fun (great talk in the link): https://gist.github.com/havenwood/fd96e63ec60c15e07af85fc2f76f8ed7
[06:18:48] ninjaaron: I do have a penchant for chainable code structures. I'm all into shell pipes, and I sort of wish everything worked that way. Streem looks like a very exciting concept to me.
[06:19:23] dminuoso: >> [1,2,3,4,5,6,7,8,8].select { |e| e % 2 == 0 }.map { |e| e * 2 }.any? { |e| e > 10 }
[06:19:24] ruby[bot]: dminuoso: # => true (https://eval.in/607540)
[06:19:29] dminuoso: You can chain them all day long. :)
[06:20:23] roamingdog: has joined #ruby
[06:20:51] ninjaaron: ACTION gives thumbs-up
[06:21:12] dminuoso: Gotta blaze, later.
[06:21:20] KnownSyntax_: has joined #ruby
[06:21:20] KnownSyntax_: has joined #ruby
[06:21:26] ninjaaron: bye, and thanks.
[06:23:12] zacstewart: has joined #ruby
[06:23:22] UserInneed: has joined #ruby
[06:24:15] dminuoso_: has joined #ruby
[06:24:35] dminuoso_: Still have to get used to having so much free WiFi on trains. :-)
[06:24:38] woodruffw: has joined #ruby
[06:24:54] firstdayonthejob: has joined #ruby
[06:25:09] woodruffw: has joined #ruby
[06:25:47] ghr: has joined #ruby
[06:26:02] dminuoso_: ninjaaron: The way that Ruby works with blocks and other things also easily allows for DSLs to be implemented, if that is your sort of things.
[06:26:17] yfeldblum: has joined #ruby
[06:28:11] conta: has joined #ruby
[06:28:19] A_Drone: has joined #ruby
[06:28:47] Sashimi: has joined #ruby
[06:30:24] NorstaR: has joined #ruby
[06:31:15] mistermocha: has joined #ruby
[06:32:26] Sashimi: has joined #ruby
[06:33:24] blackgoat: has joined #ruby
[06:35:46] ghr: has joined #ruby
[06:35:57] Sashimi: has joined #ruby
[06:36:32] ur5us: has joined #ruby
[06:37:03] PaulCapestany: has joined #ruby
[06:39:26] Sashimi: has joined #ruby
[06:39:34] dionysus69: has joined #ruby
[06:40:11] Nuck: has joined #ruby
[06:40:29] mark_66: has joined #ruby
[06:41:34] AlexJakeGreen: has joined #ruby
[06:41:42] MikeIon: has joined #ruby
[06:42:57] Sashimi: has joined #ruby
[06:45:01] jishankai: has joined #ruby
[06:45:37] TomyWork: has joined #ruby
[06:45:58] blackmesa: has joined #ruby
[06:46:08] Sashimi: has joined #ruby
[06:47:18] paradisaeidae_: has left #ruby: ()
[06:49:59] Sashimi: has joined #ruby
[06:50:03] LoneHermit: has joined #ruby
[06:50:39] AlexJakeGreen: has joined #ruby
[06:51:17] ghr: has joined #ruby
[06:53:03] atomx: has joined #ruby
[06:53:10] Sashimi: has joined #ruby
[06:53:47] miskatonic: has joined #ruby
[06:54:34] edwinvdgraaf: has joined #ruby
[06:55:14] anisha: has joined #ruby
[06:56:23] AndrewIsHere: has joined #ruby
[06:56:46] Sashimi: has joined #ruby
[06:56:48] LoneHerm_: has joined #ruby
[06:56:53] livcd: has joined #ruby
[06:56:58] dminuoso: has joined #ruby
[06:57:23] livcd: Hi guys. Why do you think Rubymotion is not more popular ?
[06:57:45] finnnnnnnnnnn: has joined #ruby
[06:58:02] c0mrad3: has joined #ruby
[06:59:21] ejnahc: has joined #ruby
[07:00:18] A_Drone_: has joined #ruby
[07:00:48] ghr: has joined #ruby
[07:01:34] ICantCook: does that use Ruboto?
[07:02:04] Hounddog: has joined #ruby
[07:02:20] ICantCook: I played around with Ruboto last year. Seemed clunky having to install the Ruboto app on the phone to get my app to work
[07:02:52] watersoul: has joined #ruby
[07:02:58] dminuoso: livcd: There is a long list of things that don't make it ideal, to buggy even.
[07:03:36] Sashimi: has joined #ruby
[07:03:59] sarlalian: has joined #ruby
[07:04:16] ICantCook: yeah, unfortunately; Ruby seems to be getting niche
[07:04:34] dminuoso: livcd: Debugging RubyMotion applications is tricky and there are no tools to really help you, there are unfixed bugs where objects are GCed too early, etc.
[07:04:53] ICantCook: with the lack of support in AWS Lambda, lack of ML and polished mobile support
[07:05:08] shevy: sounds like a buggy software
[07:05:15] aganov: has joined #ruby
[07:06:50] Madplatypus: has joined #ruby
[07:06:52] dminuoso: livcd: Another thing, it cant hide things like Cocoa from you.
[07:07:28] dminuoso: For other things than quickly prototyping example software, I do not see RubyMotion to have a serious use in production apps.
[07:08:00] A_Drone: has joined #ruby
[07:09:37] vdamewood: has joined #ruby
[07:09:50] anisha: has joined #ruby
[07:11:53] raeoks: has joined #ruby
[07:12:05] A_Drone_: has joined #ruby
[07:12:45] dminuoso: jhass: Okay, I'm sold. Crystal is sexy.
[07:12:56] anisha: has joined #ruby
[07:13:18] dminuoso: Overloading is what convinced me to try out Crystal now. :)
[07:13:42] xall_: has joined #ruby
[07:14:50] ghr: has joined #ruby
[07:16:37] thoraxe: has joined #ruby
[07:18:19] blackmesa: has joined #ruby
[07:19:06] livcd: dminuoso: Is it really that clunky ?
[07:19:48] dminuoso: livcd: Id say just give it a try. There is nothing wrong with it immediately.
[07:21:09] jhass: dminuoso: <3
[07:21:17] dminuoso: livcd: It took Trolltech and others over 25 years to produce a cross-platform framework that works reliably and feels right. RubyMotion is extremely new, so I guess I should be careful to judge it too early.
[07:24:19] ghr: has joined #ruby
[07:24:22] zacstewart: has joined #ruby
[07:24:48] solars: has joined #ruby
[07:25:40] A_Drone: has joined #ruby
[07:26:18] pawnbox: has joined #ruby
[07:27:11] antgel: has joined #ruby
[07:28:06] nankyokusei: has joined #ruby
[07:28:09] pawnbox: has joined #ruby
[07:29:47] A_Drone_: has joined #ruby
[07:30:43] Mon_Ouie: has joined #ruby
[07:30:47] tvw: has joined #ruby
[07:32:10] Devalo: has joined #ruby
[07:34:49] A_Drone: has joined #ruby
[07:36:53] troulouliou_div2: has joined #ruby
[07:39:23] cyphase: has joined #ruby
[07:40:19] AlexJakeGreen: has joined #ruby
[07:41:50] ghr: has joined #ruby
[07:42:40] ericlee: has joined #ruby
[07:42:46] A_Drone: has joined #ruby
[07:43:20] ponga: has joined #ruby
[07:44:02] ericlee: Hi, in Line #17 it is always failed and I'm sure the var "match" it will be 1. But why the statement is failed? https://paste.fedoraproject.org/392380/46891414/
[07:45:54] al2o3-cr: ericlee: match against string not integer
[07:46:29] ericlee: al2o3-cr, so how can I fix that?
[07:46:53] al2o3-cr: if match == "1"
[07:47:21] ericlee: oh this I have tried, does not work/
[07:47:59] al2o3-cr: well then the match is not what you think it is
[07:48:30] ericlee: al2o3-cr, let me show u
[07:49:08] Hanmac: ericlee: you need to strip it first before you compare it with "1"
[07:49:29] k3rn31: has joined #ruby
[07:49:30] ericlee: hanmac, oh damn, the '\n'
[07:49:39] al2o3-cr: hanmac: good call
[07:49:53] Hanmac: hm or use Integer() to transform it, but that might be not safe from crashs
[07:50:08] iMadper: has joined #ruby
[07:50:32] dminuoso: ericlee: Here is a tip: Install pry, and then drop in a binding.pry at a code position where you are getting an error or unexpected behavior from.
[07:50:49] dminuoso: You can then interactively inspect the environment and related objects and try out what might be wrong with it.
[07:50:58] dminuoso: (You could also do this with plain irb if you wanted)
[07:51:05] shevy: like a doctor fixing patients!
[07:51:50] multi_io: has joined #ruby
[07:53:51] ghr: has joined #ruby
[07:53:57] peteretep: Are there other common ways - other than `rake test` to run a test suite made up of say RSpec and Test::Unit tests?
[07:54:14] the_drow: has joined #ruby
[07:54:56] A_Drone: has joined #ruby
[07:55:56] troulouliou_div2: has joined #ruby
[07:57:02] troulouliou_divn: has joined #ruby
[07:57:49] A_Drone: has joined #ruby
[07:57:58] manveru: peteretep: you mean both at the same time?
[07:58:57] pawnbox: has joined #ruby
[07:59:04] manveru: that's gonna be a bit difficult :)
[07:59:50] manveru: can you look at the test task?
[08:03:07] peteretep: I guess my question really is: "Do people always rely on `rake` to run their test suites" and the answer seems to mostly be yes
[08:03:26] edwinvdg_: has joined #ruby
[08:04:05] dminuoso: peteretep: I just use the rspec binstub, being completely ignorant about what it does.
[08:04:21] peteretep: Do you do that in Jenkins, too?
[08:04:27] peteretep: eg shell out to that as part of your build?
[08:04:44] dminuoso: I don't do Jenkins.
[08:05:04] biberu: has joined #ruby
[08:05:06] haxrbyte: has joined #ruby
[08:06:08] armyriad: has joined #ruby
[08:06:13] peteretep: Man, Ruby is weird
[08:06:58] dminuoso: peteretep: You have no idea.
[08:07:16] peteretep: ACTION is writing a comparative piece about Ruby/Python/Perl testing
[08:07:40] dminuoso: peteretep: Most of the quirks and weirdnesses are not very apparent though.
[08:08:16] dminuoso: My biggest headache came from a simple bug, where I accidentally used super instead of super().
[08:08:33] peteretep: I think there's this heirachy of Python -> Perl -> Ruby, where people think "there are some cool features in that language, but it's being used by KIDS"
[08:08:50] peteretep: Python is dull as all shit, but largely sensible
[08:09:01] peteretep: Perl has some cool features but encourages people to be less sensible
[08:09:10] peteretep: Ruby has some cooler features still, but WTF.
[08:09:19] haxrbyte_: has joined #ruby
[08:09:21] dminuoso: What WTF are you getting from Ruby?
[08:09:33] roshanavand: has joined #ruby
[08:09:41] peteretep: Well the fact that there are 4 or 5 completely uninteroperable testing libraries
[08:09:43] dminuoso: Most of the quirks that I have seen are contributed to historical reasons and a tendency to keep backwards compatiblity high.
[08:10:03] peteretep: Python and Perl testing libraries put a large focus on interoperability
[08:10:16] dminuoso: peteretep: interoperability between what?
[08:10:54] peteretep: At its most basic level, let's say you've written a testing assertion that looks at - say - Levenstein distance between two strings
[08:11:05] peteretep: And you can say "If differences are > 5 then fail"
[08:11:16] peteretep: But you've also written some sensible debug stuff for it
[08:11:28] peteretep: In Ruby, you then have to integrate that assertion differently in to each testing library
[08:11:42] dminuoso: Different frameworks are used differently. I don't know what your point is.
[08:12:07] peteretep: in Perl, you'd get Test::Differences::Levenstein and Perl's Cucumber library would be able to use it, Perl's Capybara equivalent would be able to use it, Perl's RSpec library would be able to use it, Perl's xUnit library would be able to use it
[08:12:09] dminuoso: Would you try compiling Qt with Gtk header directories as your include directories? Probably not.
[08:12:48] peteretep: You could run a test suite using the whole thing with the single unified test runner, and get the output as JUnit or HTML or anything else
[08:12:57] peteretep: Python is almost the same
[08:13:43] peteretep: That's what I mean by interoperable
[08:13:43] dminuoso: peteretep: Im not sure how you see 4 or 5 testing libraries though.
[08:13:55] Kedare: has joined #ruby
[08:14:05] dminuoso: Realistically there is only 2 (well 3 if you count test-unit) frameworks.
[08:14:17] peteretep: What do you think the 2 are?
[08:14:24] dminuoso: rspec and minitest?
[08:14:42] peteretep: Why wouldn't you include test-unit?
[08:14:58] dminuoso: It's not widely used.
[08:15:09] frozengeek: has joined #ruby
[08:15:14] RegulationD: has joined #ruby
[08:15:19] dminuoso: From the top off my head I can come up with only one well known project that uses it.
[08:15:38] manveru: all my projects use either rspec or bacon :)
[08:16:07] peteretep: Is bacon compatible with other RSpec tools?
[08:16:13] tmtwd: has joined #ruby
[08:16:14] dminuoso: peteretep: bacon is a mini rspec clone.
[08:16:28] manveru: you can make them compatible usually without much effort though
[08:16:37] jaruga___: has joined #ruby
[08:16:41] peteretep: Let's say you've written a nice test summary tool that outputs HTML
[08:16:53] peteretep: If you want to use it with bacon, you have to write a special adaptor
[08:17:03] DoubleMalt: has joined #ruby
[08:17:14] peteretep: You say "of course", but that's not true for Python and Perl
[08:17:22] peteretep: Which is my point :-)
[08:17:34] manveru: like you'd have to do if you want to use it with minitest, test::unit, or spinach...
[08:17:36] dminuoso: peteretep: If you feel like this could be a useful thing, then go write some adaptor library that lets you interface with any supported framework the way you like
[08:17:51] peteretep: manveru: yep
[08:17:55] manveru: for the web there's rack, but no such thing exists for testing
[08:17:58] pandaant: has joined #ruby
[08:18:15] peteretep: dminuoso: I suspect that ship has sailed, and there's too much code written to make it feasible
[08:18:19] manveru: which is sad, but not something i've spent more than a few hours on in the past years
[08:18:55] LoneHerm_: has joined #ruby
[08:19:13] peteretep: Anyway, that's the Ruby WTF I had in mind :)
[08:20:04] peteretep: What I have discovered is across all three languages, most developers don't really know how their testing tools work
[08:20:21] peteretep: And also don't have any visibility of how the testing tools in other languages work
[08:20:26] manveru: that's kinda sad indeed :|
[08:20:33] peteretep: Which makes this a great basis for my MSc project :D
[08:20:59] manveru: maybe take a look at go and elixir testing too
[08:21:03] dminuoso: peteretep: That is not a Ruby WTF.
[08:21:04] manveru: they're kinda cool
[08:21:06] dminuoso: peteretep: That is a library WTF.
[08:21:12] dminuoso: peteretep: So place the blame where it belongs.
[08:21:37] Couch: has joined #ruby
[08:21:41] peteretep: The core team who added and removed test-unit like 10 times in the last 10 years? :D
[08:21:42] yeticry: has joined #ruby
[08:22:07] manveru: it's been in stdlib for as long as i can remember
[08:22:55] peteretep: ACTION is going from http://www.slideshare.net/kou/rubykaigi-2015
[08:23:04] peteretep: Perhaps it's wrong
[08:25:17] zacstewart: has joined #ruby
[08:25:17] manveru: https://github.com/ruby/ruby/commit/5995377228b166f8906ec07d4024474ec0f349b6
[08:26:16] peteretep: the source I gave claims it was then removed again
[08:26:18] manveru: that's not actually Test::Unit though, just the first time it was used inside ruby itself, afaik
[08:26:22] peteretep: but whatever
[08:27:08] pawnbox: has joined #ruby
[08:27:13] yeticry: has joined #ruby
[08:27:45] A_Drone: has joined #ruby
[08:28:00] manveru: maybe that was in relation with minitest?
[08:28:14] manveru: pretty sure zenspider would know more
[08:28:57] manveru: i rather write my own testing lib before i'd use test::unit anyway...
[08:30:47] snowy: has joined #ruby
[08:31:28] senayar: has joined #ruby
[08:31:28] senayar: has joined #ruby
[08:31:35] rumia: [ https://a.pomf.cat/hirzih.jpg ] [ https://a.pomf.cat/uiywqg.jpg ] [ https://a.pomf.cat/nmhsiv.jpeg ] [ https://a.pomf.cat/losaig.png ]
[08:34:18] toretore: has joined #ruby
[08:35:09] ur5us: has joined #ruby
[08:38:19] blackgoat: has joined #ruby
[08:39:29] TheHodge: has joined #ruby
[08:39:34] armyriad: has joined #ruby
[08:40:27] A_Drone: has joined #ruby
[08:41:05] rumia: has left #ruby: ("Leaving")
[08:41:25] vondruch: has joined #ruby
[08:41:36] aufi: has joined #ruby
[08:43:26] vondruch_: has joined #ruby
[08:43:31] A_Drone: has joined #ruby
[08:43:38] ixti: has joined #ruby
[08:46:12] yfeldblum: has joined #ruby
[08:46:23] Mon_Ouie: has joined #ruby
[08:46:50] pawnbox: has joined #ruby
[08:46:57] DaniG2k: has joined #ruby
[08:47:15] blackgoat: has joined #ruby
[08:49:04] pawnbox: has joined #ruby
[08:51:21] moei: has joined #ruby
[08:53:14] A_Drone_: has joined #ruby
[08:54:38] matp: has joined #ruby
[08:56:45] haxrbyte: has joined #ruby
[08:57:36] A_Drone: has joined #ruby
[08:58:36] haxrbyte: has joined #ruby
[09:01:04] A_Drone: has joined #ruby
[09:03:13] Dimik: has joined #ruby
[09:03:44] blackmesa: has joined #ruby
[09:03:45] sindork: has joined #ruby
[09:07:17] drewo: has joined #ruby
[09:12:41] codecop: has joined #ruby
[09:14:22] blackmesa: has joined #ruby
[09:15:43] jaguarmagenta: has joined #ruby
[09:19:06] kedare1: has joined #ruby
[09:20:03] LoneHermit: has joined #ruby
[09:20:23] haxrbyte: has joined #ruby
[09:21:51] urtokk: has joined #ruby
[09:25:39] zacstewart: has joined #ruby
[09:27:42] A_Drone: has joined #ruby
[09:28:23] alfiemax: has joined #ruby
[09:28:40] workmad3: has joined #ruby
[09:28:57] nankyokusei: has joined #ruby
[09:33:33] hubert: has joined #ruby
[09:36:26] Mia: has joined #ruby
[09:36:26] Mia: has joined #ruby
[09:39:17] tamole: has joined #ruby
[09:45:29] daffy_duck_3: has joined #ruby
[09:45:57] AlexJakeGreen: has joined #ruby
[09:50:00] A_Drone: has joined #ruby
[09:51:19] tris: has joined #ruby
[09:52:40] mistermocha: has joined #ruby
[09:56:44] Mon_Ouie: has joined #ruby
[10:01:34] drewo: has joined #ruby
[10:03:11] webus: has joined #ruby
[10:04:41] webus: has joined #ruby
[10:04:57] sdothum: has joined #ruby
[10:05:09] A_Drone: has joined #ruby
[10:07:14] mikecmpbll: has joined #ruby
[10:12:03] A_Drone: has joined #ruby
[10:13:40] A_Drone: has joined #ruby
[10:16:04] RegulationD: has joined #ruby
[10:16:13] k3dare: has joined #ruby
[10:16:49] blackmesa: has joined #ruby
[10:16:56] cgfbee: has joined #ruby
[10:21:07] LoneHermit: has joined #ruby
[10:21:24] flashpoint9: has joined #ruby
[10:26:20] xall_: has joined #ruby
[10:27:21] zacstewart: has joined #ruby
[10:29:08] mistermocha: has joined #ruby
[10:32:46] chosen1: has joined #ruby
[10:33:45] Silthias: has joined #ruby
[10:36:31] andikr: has joined #ruby
[10:37:32] Wildfyr: has joined #ruby
[10:37:32] Wildfyr: has joined #ruby
[10:39:28] My_Hearing: has joined #ruby
[10:40:44] vdamewood: has joined #ruby
[10:41:05] aazsdk: has joined #ruby
[10:42:25] Guest683: has joined #ruby
[10:42:44] k3rn31: has joined #ruby
[10:44:26] johnmilton: has joined #ruby
[10:44:56] marr: has joined #ruby
[10:47:47] chosen1_: has joined #ruby
[10:47:53] mdw: has joined #ruby
[10:49:14] aazsdk: has joined #ruby
[10:51:05] Jet4Fire: has joined #ruby
[10:51:10] skade: has joined #ruby
[10:52:35] Juanchito: has joined #ruby
[10:55:43] drewo: has joined #ruby
[10:57:04] rodfersou: has joined #ruby
[10:57:26] kermal: has joined #ruby
[10:57:49] kermal: Hi, when trying to call "Hash.new" I run into a NPE (ailure/Error: Unable to find org.jruby.ir.operands.CurrentScope.retrieve(CurrentScope.java to read failed line
[10:57:49] kermal: Java::JavaLang::NullPointerException)"
[10:58:33] shevy: is this a jruby problem, in this case you should try on #jruby possibly so
[10:58:40] AndrewIsHere: has joined #ruby
[10:58:46] kermal: alright, thanks
[11:00:42] GodFather: has joined #ruby
[11:04:37] blackgoat: has joined #ruby
[11:05:15] anisha: has joined #ruby
[11:06:33] dstarh: has joined #ruby
[11:08:39] stardiviner: has joined #ruby
[11:09:20] edwinvdgraaf: has joined #ruby
[11:11:21] yfeldblum: has joined #ruby
[11:12:19] AlexJakeGreen: has joined #ruby
[11:13:09] stardiviner: has left #ruby: ()
[11:16:18] dionysus69: has joined #ruby
[11:16:30] jaguarmagenta: has joined #ruby
[11:19:05] JeanCarloMachado: has joined #ruby
[11:21:07] mistermocha: has joined #ruby
[11:22:31] blackmesa: has joined #ruby
[11:27:27] zacstewart: has joined #ruby
[11:29:46] nankyokusei: has joined #ruby
[11:34:20] madgen: has joined #ruby
[11:37:09] LoneHerm_: has joined #ruby
[11:37:29] codecop: has joined #ruby
[11:37:57] ldnunes: has joined #ruby
[11:40:34] nettoweb: has joined #ruby
[11:41:39] Hanmac: has joined #ruby
[11:46:32] karapetyan: has joined #ruby
[11:49:49] drewo: has joined #ruby
[11:50:35] hk238: has joined #ruby
[11:51:59] AngryBuzzy: has joined #ruby
[11:56:18] umdstu: has joined #ruby
[11:57:31] ghr: has joined #ruby
[11:58:18] conta1: has joined #ruby
[11:59:32] nando293921: has joined #ruby
[12:00:26] AlexJakeGreen: has joined #ruby
[12:03:58] pdoherty: has joined #ruby
[12:05:01] karapetyan: has joined #ruby
[12:05:29] eizua: has joined #ruby
[12:07:02] nando293921: has joined #ruby
[12:07:52] karapety_: has joined #ruby
[12:07:52] AlexJakeGreen: has joined #ruby
[12:12:11] jmignault: has joined #ruby
[12:12:20] nando293921: has joined #ruby
[12:13:14] ixti: has joined #ruby
[12:14:57] karapetyan: has joined #ruby
[12:15:01] ponga: has joined #ruby
[12:16:05] synthroid: has joined #ruby
[12:16:57] RegulationD: has joined #ruby
[12:18:12] yfeldblum: has joined #ruby
[12:23:53] blackmesa: has joined #ruby
[12:24:00] snowy: has joined #ruby
[12:25:27] lxsameer: has joined #ruby
[12:29:11] ElFerna: has joined #ruby
[12:31:19] skade: has joined #ruby
[12:33:21] ziyan_: has joined #ruby
[12:34:59] ziyan_: Hi there. I am wondering if there is a way to assign in an if condition and use it in as a return. Ex: `a = { 'new' => 10, 'used' => 0 }; %w(new used).map{ |i| val if (val = a[i]) > 0 }`
[12:35:36] c355E3B: has joined #ruby
[12:36:13] shevy: I have not tested it but this should work right ziyan_?
[12:36:25] jhass: ziyan_: should work, weird way to write .values.select {|v| v > 0 } though
[12:37:04] dminuoso: jhass: Well, it's almost the same. This will leave nil for the elements less than 0.
[12:37:21] dminuoso: But I just assume that your solution is what he actually wanted.
[12:37:25] ziyan_: shevy: jhass: i get this error 'undefined local variable or method `val' for main:Object' (just tried it in the console)
[12:37:41] dminuoso: ziyan_: yes, that is a result of how variables are implemented in Ruby.
[12:38:00] dminuoso: ziyan_: A variable is only a variable if an assignment to it appears lexigraphically first.
[12:38:15] jhass: ah, right
[12:38:17] ziyan_: dminuoso: makes sense, thought as much
[12:38:26] ziyan_: thanks a lot
[12:38:34] jhass: ziyan_: does that actually resemble your actual code though? there's likely a nicer way
[12:39:51] ziyan_: jhass: that is not my actual code. i think you are saying about select, goign to give it a try
[12:40:25] chrisseaton: Anyone interested in JRuby+Truffle? Like talk on Graal (the wider ecosystem around it) about to start here https://ventotene.conf.meetecho.com/room2/
[12:40:57] chrisseaton: Live talk, not like talk
[12:41:12] jhass: ziyan_: well, if you share your actual input(s) and the desired output we might find something nice ;)
[12:41:16] dminuoso: ziyan_: You can use a little trick though by specifying val to be a block parameter.
[12:41:40] dminuoso: i.e. .map { |i, v| v if (v = a[i]) > 0 }
[12:41:58] jhass: .map {|i; v| } rather, the way to declare block locals
[12:42:03] dminuoso: chrisseaton: Expected duration?
[12:42:20] hutch34: has joined #ruby
[12:42:30] ziyan_: i was going to test it before i wrote, just was curioud
[12:42:40] ziyan_: dminuoso: jhass: will give it a look, thanks
[12:43:11] ziyan_: works, great!!! thanks guys
[12:43:54] drewo: has joined #ruby
[12:44:01] chrisseaton: dminuoso: 30 mins I guess
[12:44:22] jhass: ziyan_: I still think it's ugly though ;)
[12:44:37] dminuoso: chrisseaton: Fair enough. By the way, we talked about JIT and some project you were working on a while ago.
[12:44:40] dminuoso: How is that going?
[12:45:23] chrisseaton: dminuoso: had some bigger fish to fry for a while, still working on it though
[12:45:37] dminuoso: Very well, Ill stay tuned then. :)
[12:45:57] JakFrist: has joined #ruby
[12:47:57] cd-rum: has joined #ruby
[12:52:44] matp: has joined #ruby
[12:53:22] mattwashere: has joined #ruby
[12:57:37] troulouliou_div2: has joined #ruby
[12:59:56] AndrewIsHere: has joined #ruby
[13:01:01] ziyan_: jhass: ha ha, fortunately i didn't need it, just a `map` and a `compact`.
[13:01:30] jhass: ACTION still is in the select.map camp
[13:03:22] Macaveli: has joined #ruby
[13:04:10] ziyan_: this is what i ended doing... `%w(new used rent).map{ |condition, price| condition if rush.send("#{ condition }_price") > 0 }.compact`. Given an object has methods like 'new_price' 'used_price' etc... I need the 'conditions' (ex: new, used) etc which have a price > 0
[13:04:15] ziyan_: jhass: ^^
[13:04:22] dminuoso: ziyan_: So yes. use .select
[13:04:27] tamole: has joined #ruby
[13:05:18] jhass: what's with the , price?
[13:05:36] xall_: has joined #ruby
[13:05:49] jhass: %w(new used rent).select {|condition| rush.public_send("#{condition}_price") }
[13:06:37] jhass: are new_price, used_price, rent_price implemented manually or backed by a hash or similar?
[13:06:57] ziyan_: jhass: its a product (AR object) record.
[13:07:12] jhass: %w(new used rent).select {|condition| rush["#{condition}_price"] } then
[13:07:51] ziyan_: let me try,
[13:08:28] ChiefAlexander: has joined #ruby
[13:09:03] chip_: has joined #ruby
[13:09:21] dminuoso: ziyan_: It's cleaner to simply use %i(new_price used_price rent_price).select { |c| rush.public_send(c) }
[13:10:14] jhass: s/public_send/[]/
[13:10:34] karapetyan: has joined #ruby
[13:10:42] dminuoso: Either way, this weird string interpolation is unnecessary and makes it less readable.
[13:10:51] ramortegui: has joined #ruby
[13:11:40] synthroid: has joined #ruby
[13:12:51] synthroid: has joined #ruby
[13:13:13] karapetyan: has joined #ruby
[13:14:48] fmcgeough: has joined #ruby
[13:15:58] ziyan_: dminuoso: Thanks, looks nice (y), learnt some new stuff today. the fields are defaulted to 0, and 0 is evaluated kind of true so had to do a comparison there. `%i(new_price used_price rent_price).select { |c| rush.public_send(c) > 0 }`
[13:16:42] dminuoso: ziyan_: Like jhass said, %w(new_price used_price rent_price).select { |c| rush[c] > 0 } is even cleaner.
[13:17:11] jaguarmagenta: has joined #ruby
[13:17:13] speakingcode: has joined #ruby
[13:17:32] nerium: has joined #ruby
[13:17:57] isberg: has joined #ruby
[13:18:38] ekinmur: has joined #ruby
[13:23:36] dvinciguerra_: has joined #ruby
[13:24:57] troulouliou_div2: has joined #ruby
[13:26:16] conta1: has joined #ruby
[13:26:19] yfeldblum: has joined #ruby
[13:26:20] dminuoso: chrisseaton: That was a great and informative talk, thank you. Now that I have a rough idea of what graal/truffle is - I am genuinely interested.
[13:26:59] blackmesa: has joined #ruby
[13:27:37] aegis3121: has joined #ruby
[13:28:10] mikejw: has joined #ruby
[13:28:34] mikejw: mailcatcher doens't seem to run properly on port 25
[13:29:01] mikejw: I'm getting /usr/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize': Connection refused - connect(2) for "127.0.0.1" port 1025 (Errno::ECONNREFUSED) from /usr/lib/ruby/2.1.0/net/smtp.rb:541:in `open'
[13:29:14] zacstewart: has joined #ruby
[13:29:18] jhass: 1025 != 25 ?
[13:29:24] mikejw: even though I'm starting mailcatcher with --smtp-port 25
[13:29:44] mikejw: php is configured to connect to sendmail on port 25
[13:30:22] jhass: what exactly is producing that error message?
[13:30:40] mikejw: and I'm using sendmail_path = /usr/bin/env catchmail -f --smtp-port 25 some@cat.example.org
[13:30:40] conta1: has joined #ruby
[13:30:42] nankyokusei: has joined #ruby
[13:30:54] mikejw: the error is coming through the apache logs
[13:31:13] bkxd: has joined #ruby
[13:31:54] malconis: has joined #ruby
[13:32:01] jhass: -f expects an argument
[13:32:06] jhass: https://github.com/sj26/mailcatcher/blob/master/bin/catchmail#L32
[13:32:32] mostlybadfly: has joined #ruby
[13:32:47] yadobujo: has joined #ruby
[13:33:25] skade: has joined #ruby
[13:34:38] mikejw: ok it's working
[13:35:04] malconis: has joined #ruby
[13:35:21] aupadhye: has joined #ruby
[13:35:45] rodorgas: has joined #ruby
[13:36:27] vuoto: has joined #ruby
[13:37:42] ericsupreme: has joined #ruby
[13:38:01] drewo: has joined #ruby
[13:38:08] conta1: has joined #ruby
[13:38:56] zacstewart: has joined #ruby
[13:39:23] A_Drone: has joined #ruby
[13:44:09] karapetyan: has joined #ruby
[13:45:03] swills: has joined #ruby
[13:45:08] SilverKey: has joined #ruby
[13:45:20] vuoto: has joined #ruby
[13:45:40] vuoto: has joined #ruby
[13:48:17] jegarcia: has joined #ruby
[13:49:01] shevy: ruby ruby rbuy
[13:49:02] karapetyan: has joined #ruby
[13:49:05] shevy: with typo!
[13:49:32] AlexJakeGreen: has joined #ruby
[13:49:49] howdoi: has joined #ruby
[13:51:00] alfiemax: has joined #ruby
[13:51:19] yxhuvud: has joined #ruby
[13:53:31] bnjf: has joined #ruby
[13:54:53] karapetyan: has joined #ruby
[13:56:07] l4v2: has joined #ruby
[13:56:55] noregret: has joined #ruby
[13:57:29] noregret: how i can index a byte string? e.g. str.index("PK\x01\x02") is failing
[13:58:56] floatingpoint: has joined #ruby
[13:59:28] hutch34: has joined #ruby
[14:01:15] xall_: has joined #ruby
[14:04:23] nerium: has joined #ruby
[14:04:53] isberg: has joined #ruby
[14:06:55] nmollerup: has joined #ruby
[14:08:05] Bish: has joined #ruby
[14:10:02] jhass: failing how?
[14:10:43] jhass: >> "abPK\x01\x02".index("PK\x01\x02")
[14:10:44] ruby[bot]: jhass: # => 2 (https://eval.in/607972)
[14:10:58] flashpoint9: has joined #ruby
[14:11:15] noregret: jhass: no implicit conversion of Fixnum into String
[14:11:43] jhass: I don't think that error comes from the code you posted
[14:12:08] noregret: ok, let me check
[14:14:42] jhack: has joined #ruby
[14:14:48] noregret: oops, nevermind =)
[14:14:48] Bish: has joined #ruby
[14:15:01] isberg: has joined #ruby
[14:15:17] eljimbo: has joined #ruby
[14:15:23] shinnya: has joined #ruby
[14:17:50] RegulationD: has joined #ruby
[14:17:56] AlexJakeGreen: has joined #ruby
[14:17:57] karapetyan: has joined #ruby
[14:18:05] whathappens: has joined #ruby
[14:21:04] vuoto: has joined #ruby
[14:21:27] agent_white: has joined #ruby
[14:23:06] pdoherty: has joined #ruby
[14:23:15] karapetyan: has joined #ruby
[14:23:55] pdoherty: has joined #ruby
[14:24:52] pdoherty: has joined #ruby
[14:25:34] CodingWolf: has joined #ruby
[14:27:53] yfeldblum: has joined #ruby
[14:28:20] blackmesa: has joined #ruby
[14:28:40] vuoto: has joined #ruby
[14:29:02] anisha: has joined #ruby
[14:29:05] karapetyan: has joined #ruby
[14:31:42] Silthias: has joined #ruby
[14:31:45] zenlot: has joined #ruby
[14:32:01] ekinmur: has joined #ruby
[14:32:05] karapetyan: has joined #ruby
[14:32:07] drewo: has joined #ruby
[14:32:19] hays: has joined #ruby
[14:32:38] GodFather: has joined #ruby
[14:32:38] Es0teric: has joined #ruby
[14:32:57] johnny56_: has joined #ruby
[14:32:59] isberg: has joined #ruby
[14:33:03] zenlot: has joined #ruby
[14:33:04] yadobujo: has joined #ruby
[14:33:09] braderhart: has joined #ruby
[14:33:32] braderhart: has joined #ruby
[14:33:39] pawnbox: has joined #ruby
[14:33:46] ifsp: has joined #ruby
[14:33:51] aryaching: has joined #ruby
[14:34:08] Polysics: has joined #ruby
[14:34:17] karapetyan: has joined #ruby
[14:34:20] zrl: has joined #ruby
[14:34:22] olivierjanss: has joined #ruby
[14:34:40] Guest4184_______: has joined #ruby
[14:35:06] dn`: has joined #ruby
[14:35:22] bedouin: has joined #ruby
[14:35:23] vuoto_: has joined #ruby
[14:35:26] AlexJakeGreen: has joined #ruby
[14:35:45] Bish: has joined #ruby
[14:37:02] rabbite_: has joined #ruby
[14:38:38] pawnbox_: has joined #ruby
[14:39:47] z3uS: has joined #ruby
[14:39:53] dminuoso: has joined #ruby
[14:41:29] underplank: has joined #ruby
[14:43:12] iceden: has joined #ruby
[14:43:45] MissionCritical: has joined #ruby
[14:43:52] shevy: agent_white! you have come to rescue us
[14:44:09] agent_white: ACTION puts on cape, hands shevy cape
[14:44:54] shevy: is this where I open the cape
[14:48:11] rippa: has joined #ruby
[14:49:37] AngryBuzzy: has joined #ruby
[14:50:11] flashpoint9: has joined #ruby
[14:50:27] e4xit: has joined #ruby
[14:50:38] LvcasX1: has joined #ruby
[14:53:20] mistermocha: has joined #ruby
[14:53:59] Terens: has joined #ruby
[14:53:59] Guest60828: has joined #ruby
[14:54:48] Akuma: has joined #ruby
[14:59:43] kab: has joined #ruby
[15:02:17] isberg: has joined #ruby
[15:03:01] hutch34_: has joined #ruby
[15:04:58] dionysus69: has joined #ruby
[15:06:56] mattwashere: has joined #ruby
[15:07:43] ChiefAlexander: has joined #ruby
[15:07:55] Devalo: has joined #ruby
[15:08:10] `tim`: has joined #ruby
[15:09:05] yadobujo: has joined #ruby
[15:11:36] yadobujo_: has joined #ruby
[15:12:47] jtdowney: has joined #ruby
[15:12:47] jtdowney: has joined #ruby
[15:13:48] dunpeal: has joined #ruby
[15:14:12] dunpeal: Is there a syntax like %w() for Sets?
[15:14:21] mistermocha: has joined #ruby
[15:14:37] vuoto: has joined #ruby
[15:15:00] jhass: isn't Set even standard library still even, not core?
[15:15:10] karapetyan: has joined #ruby
[15:15:54] huesaurus: has joined #ruby
[15:16:15] huesaurus: any one has any experience with sensu plugins ?
[15:16:21] ruby[bot]: Just ask your question, if anyone has, is or can, they will respond.
[15:17:03] giz|work: has joined #ruby
[15:17:24] huesaurus: im trying to use the following plugin to pull JSON values https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json.rb and it gives me thef ollowing error Check failed to run: undefined method `each' for nil:NilClass,
[15:17:45] huesaurus: sorry https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json-deep.rb
[15:18:13] Bish: has joined #ruby
[15:18:20] polishdub: has joined #ruby
[15:18:40] RegulationD: has joined #ruby
[15:21:20] isberg: has joined #ruby
[15:21:40] jhass: please gist the full error output
[15:21:42] ruby[bot]: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[15:22:30] karapetyan: has joined #ruby
[15:25:14] skade: has joined #ruby
[15:26:12] drewo: has joined #ruby
[15:26:45] flashpoint9: has joined #ruby
[15:28:24] huesaurus: jhass, https://gist.github.com/anonymous/3a13b2b395c9693a6b773a4145a830c0
[15:28:53] synthroid: has joined #ruby
[15:29:08] jhass: huesaurus: it looks like config[:root] does not return a valid key for the response at config[:url]
[15:29:29] ccooke: has joined #ruby
[15:29:30] yfeldblum: has joined #ruby
[15:29:44] blackmesa: has joined #ruby
[15:29:46] jhass: double check you specified the right root key
[15:30:25] mattwashere: has joined #ruby
[15:31:32] nankyokusei: has joined #ruby
[15:31:59] ur5us: has joined #ruby
[15:32:47] dminuoso: has joined #ruby
[15:32:50] singalaut: has joined #ruby
[15:32:55] huesaurus: jhass, here's what happens when I specify a root key, it returns the value along with an error https://gist.github.com/anonymous/2d6cce222de679a32fbded82d068e988
[15:33:17] huesaurus: 4 is the correct value, is it because it's a string ?
[15:33:42] jhass: maybe the plugin is not the right one?
[15:33:49] jhass: for the structure you have
[15:35:04] jhass: it expects something like {"foo": {"keys": "and", "values": "you", "want": "to return"}, "possibly": "other stuff"}
[15:35:30] jhass: there root key would be foo
[15:35:46] huesaurus: oh, I don't have a root key like "foo", just {"keys": "and", "values": "you", "want": "to return"} and when I did a mock test with a root key it also returned with an error
[15:36:11] cdg: has joined #ruby
[15:36:20] SilverKey: has joined #ruby
[15:36:41] jhass: well, it certainly can't work with a flat key
[15:37:02] jhass: https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json-deep.rb#L67 https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json-deep.rb#L119
[15:37:26] jhass: in the last line metrics is the parsed json, it unconditionally accesses into that with a root key, "value" if none given
[15:37:51] amclain: has joined #ruby
[15:38:15] workmad3_: has joined #ruby
[15:38:33] grill: has joined #ruby
[15:38:41] huesaurus: makes sense, but I think this one should work with flat key https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json.rb
[15:39:13] huesaurus: it just expects key/values
[15:39:22] jhass: yes, though you have to list all explicitly
[15:39:26] jhass: comma separated
[15:39:42] jhass: https://github.com/sensu-plugins/sensu-plugins-http/blob/master/bin/metrics-http-json.rb#L76-L78
[15:39:43] Vingador: has joined #ruby
[15:40:37] JeanCarloMachado: has joined #ruby
[15:41:25] huesaurus: oh metricname::jsonkey ?
[15:41:46] skade: has joined #ruby
[15:42:09] huesaurus: weird, it just returns nothing :/
[15:42:12] mattwashere: has joined #ruby
[15:42:25] jhass: probably wrong parameters ;)
[15:44:57] tophat: has joined #ruby
[15:45:24] DaniG2k: has joined #ruby
[15:47:07] huesaurus: guess it also needs a root key, Check failed to run: undefined method `each' for "3":String,
[15:47:32] workmad3: has joined #ruby
[15:47:48] jhass: shouldn't
[15:47:53] AndrewIsHere: has joined #ruby
[15:47:56] jhass: only if you give object
[15:48:01] jhass: but it's optional
[15:48:33] jhass: or I guess that was the intention
[15:48:38] jhass: the code is quite terrible tbh
[15:48:44] huesaurus: currently that's what i'm passing it for a test /opt/sensu/embedded/bin/metrics-http-json.rb -u 'http://echo.jsontest.com/key/3/one/4' -s hostname.name -m 'ametric::key,one'
[15:49:26] jhass: I think there's a missing else between line 84 and 85
[15:49:31] xall_: has joined #ruby
[15:49:32] [Butch]: has joined #ruby
[15:49:33] drewo: has joined #ruby
[15:52:39] rodorgas: has joined #ruby
[15:52:42] PostApo: has joined #ruby
[15:54:30] troulouliou_div2: has joined #ruby
[15:56:28] isberg: has joined #ruby
[15:58:10] DaniG2k: has joined #ruby
[15:59:19] davedev24: has joined #ruby
[15:59:37] mistermocha: has joined #ruby
[15:59:52] aep-shoutlet: has joined #ruby
[16:00:10] davedev24: has joined #ruby
[16:01:07] shevy: saurier always go via if clauses, never via the else clauses
[16:01:11] shevy: that is why they went extinct
[16:01:21] Es0teric: has joined #ruby
[16:02:42] dennisvennink: has joined #ruby
[16:03:07] whathapp_: has joined #ruby
[16:03:25] karapetyan: has joined #ruby
[16:04:06] SilverKey: has joined #ruby
[16:04:07] whathappens: has joined #ruby
[16:05:02] LoneHermit: has joined #ruby
[16:05:02] harfangk: has joined #ruby
[16:05:29] karapetyan: has joined #ruby
[16:09:50] AnoHito: has joined #ruby
[16:11:06] madgen: has joined #ruby
[16:11:46] dminuoso: has joined #ruby
[16:12:33] karapetyan: has joined #ruby
[16:13:36] macsteps: has joined #ruby
[16:14:41] Es0teric: has joined #ruby
[16:14:59] omphe: has joined #ruby
[16:16:35] Silthias: has joined #ruby
[16:17:24] RegulationD: has joined #ruby
[16:18:07] Ishido: has joined #ruby
[16:19:00] iceden: has joined #ruby
[16:19:49] karapetyan: has joined #ruby
[16:20:01] rodorgas: has joined #ruby
[16:20:20] astrobunny: has joined #ruby
[16:21:03] fredolinhares: has joined #ruby
[16:22:29] karapetyan: has joined #ruby
[16:24:02] mistermocha: has joined #ruby
[16:24:07] troulouliou_div2: has joined #ruby
[16:24:31] blackmesa: has joined #ruby
[16:24:50] Cohedrin: has joined #ruby
[16:26:06] xue: has joined #ruby
[16:27:43] SCHAAP137: has joined #ruby
[16:31:34] aryaching: has joined #ruby
[16:31:37] yfeldblum: has joined #ruby
[16:32:34] pawnbox: has joined #ruby
[16:32:36] wald0: has joined #ruby
[16:32:54] ramfjord: has joined #ruby
[16:34:13] roamingdog: has joined #ruby
[16:37:21] mistermo_: has joined #ruby
[16:41:27] kriskropd: has joined #ruby
[16:42:11] craigp: has joined #ruby
[16:43:12] LoneHerm_: has joined #ruby
[16:47:00] karapetyan: has joined #ruby
[16:47:13] spiette: has joined #ruby
[16:47:42] ziyan_: has joined #ruby
[16:52:25] aryaching: has joined #ruby
[16:52:26] duoi: has joined #ruby
[16:53:08] zacts: has joined #ruby
[16:53:28] arnonhongklay: has joined #ruby
[16:53:37] mistermocha: has joined #ruby
[16:56:28] tomchapin: has joined #ruby
[16:57:10] strongcode: has joined #ruby
[16:57:53] LoneHerm_: has joined #ruby
[16:58:29] marxarelli: has joined #ruby
[16:58:39] macsteps: has joined #ruby
[16:58:59] mistermo_: has joined #ruby
[17:00:57] jackjackdripper: has joined #ruby
[17:01:49] mattwashere: has joined #ruby
[17:03:37] harfangk: has joined #ruby
[17:04:37] nennes: has joined #ruby
[17:09:03] jhack_: has joined #ruby
[17:09:39] dennisvennink: has joined #ruby
[17:10:12] araujo: has joined #ruby
[17:10:56] firstdayonthejob: has joined #ruby
[17:12:17] jaguarmagenta: has joined #ruby
[17:14:12] jaguarma_: has joined #ruby
[17:15:33] dionysus69: has joined #ruby
[17:15:33] leea: has joined #ruby
[17:16:05] wsewolod: has joined #ruby
[17:19:56] drewo: has joined #ruby
[17:20:08] SilverKey: has joined #ruby
[17:20:17] conta: has joined #ruby
[17:21:03] troulouliou_div2: has joined #ruby
[17:21:18] zacts|pi: has joined #ruby
[17:21:24] rcvalle: has joined #ruby
[17:21:57] pawnbox: has joined #ruby
[17:23:18] mostlybadfly: has joined #ruby
[17:24:50] ericsupreme: has joined #ruby
[17:24:53] zacts_raincity: has joined #ruby
[17:26:12] kab: has joined #ruby
[17:26:56] Emmanuel_Chanel: has joined #ruby
[17:27:05] aegis3121: has joined #ruby
[17:27:34] zacts: has joined #ruby
[17:27:44] rodorgas: has joined #ruby
[17:27:51] Emmanuel_Chanel: has joined #ruby
[17:28:17] kab: has joined #ruby
[17:29:23] Dimik: has joined #ruby
[17:29:32] zacts|pi: has joined #ruby
[17:30:02] xall_: has joined #ruby
[17:31:08] mattwashere: has joined #ruby
[17:31:54] flashpoint9: has joined #ruby
[17:32:56] hahuang61: has joined #ruby
[17:33:12] HULK_SMASH: has joined #ruby
[17:37:56] spudowiar: has joined #ruby
[17:39:58] skade: has joined #ruby
[17:40:21] Silthias1: has joined #ruby
[17:40:35] djbkd: has joined #ruby
[17:42:00] nhhc: has joined #ruby
[17:42:16] kavanagh: has joined #ruby
[17:46:20] nerium: has joined #ruby
[17:47:08] sepp2k: has joined #ruby
[17:49:47] weaksauce: has joined #ruby
[17:50:57] bathtub_shark: has joined #ruby
[17:51:01] karapetyan: has joined #ruby
[17:52:33] malconis: has joined #ruby
[17:55:14] karapetyan: has joined #ruby
[17:55:58] Cohedrin: has joined #ruby
[17:57:18] zacts: has joined #ruby
[17:58:47] cyphase: has joined #ruby
[17:58:54] RegulationD: has joined #ruby
[18:00:24] kirun: has joined #ruby
[18:00:48] roamingdog: has joined #ruby
[18:00:49] ramfjord_: has joined #ruby
[18:03:12] speakingcode: has joined #ruby
[18:03:43] zacts: has joined #ruby
[18:04:07] codecop: has joined #ruby
[18:04:57] ekinmur: has joined #ruby
[18:05:43] irregular: has joined #ruby
[18:06:32] irregular: Hi guys, I have a class API with @cached_ids instance variable, is there a way to access the instance variable outside the class? i.e. API.cached_ids (this doesn't work though) or do I have to add a getter method
[18:07:25] mistermocha: has joined #ruby
[18:07:47] mistermocha: has joined #ruby
[18:09:20] zacts: has joined #ruby
[18:09:48] aegis3121: has joined #ruby
[18:10:03] shevy: irregular have you tried .instance_variable_get() yet?
[18:11:10] devbug: has joined #ruby
[18:11:10] jhass: irregular: if you consider it public API to read the variable you should add a getter
[18:11:56] shevy: zacts is in the house
[18:12:03] shevy: reading his 35th ruby book
[18:12:32] zacts: I'm working on RSpec right now, but via the pluralsight tutorials and not the outdated book
[18:12:34] irregular: shevy:just tried it, thank you!!
[18:12:48] zacts: (dude, I even know ruby books so well now to know that the RSpec book is officially outdated by pragmatic)
[18:13:02] zacts: I'm the channel ruby bibliophile
[18:13:02] irregular: jhass:it will only be used in one place so for now I will just use instance variable get
[18:13:12] jhass: irregular: bad reason
[18:14:11] shevy: high quality books are awesome but most books I found are sorta average or just slightly above average. I liked the original pickaxe in 2005 or so. Did not like any books afterwards really. The worst was a rails book ... how to build a webshop, it was so boring that I did not make it to page 100
[18:16:43] zacts: shevy: which rails book was it?
[18:16:46] zacts: was it by hartl?
[18:17:01] zacts: I'm making a list of books I don't like to save other's time too
[18:17:31] shevy: zacts I don't even remember the name
[18:17:38] shevy: I think it was... from 2007 or 2008 or so
[18:18:04] ineb: shevy: i know what book youre talking about. and the same happened to me there. dont know exactly were i stopped, but it was definitely below page 100
[18:18:22] ineb: alas i forgot the title aswell
[18:20:28] zacts: shevy: sounds like hartl. yeah
[18:20:56] zacts: I think eventually it gets to a point to where you just read official doc rather than books
[18:21:53] shevy: precisely!
[18:22:02] shevy: or, no more docs reading and just wild tinkering
[18:23:35] zacts: shevy: eventually just pure perfect coding the 1st time, and no bugs. (as linus claims he can do...)
[18:23:39] zacts: (don't quote me on it though)
[18:24:37] ineb: using ed as editor.
[18:25:51] Bish: has joined #ruby
[18:25:59] brianpWins: has joined #ruby
[18:26:24] rodferso1: has joined #ruby
[18:28:52] astrobunny: has joined #ruby
[18:32:34] pdoherty: has joined #ruby
[18:34:16] dionysus69: has joined #ruby
[18:34:38] CodeAleks: has joined #ruby
[18:36:07] et09: has joined #ruby
[18:36:17] mdw: has joined #ruby
[18:36:49] et09: im having a really weird problem, i define a proc and then do myarray.map{|x| myproc.call(x)} - and every item in the result array is based on the last item in the source array
[18:36:54] finnnnnnnnnnn: has joined #ruby
[18:37:26] ruby[bot]: We can't help you without your code, please post it to https://gist.github.com
[18:38:16] hammond: ok I have a array of Threads. why can't I use arr[index].join ? and I'm forced to use arr.each { |t| t.join } instead
[18:38:34] hammond: the arr is an array. right?
[18:38:35] tmtwd: has joined #ruby
[18:39:00] jhass: how should we know? you never showed its definition
[18:39:03] eam: why is File.exists? deprecated?
[18:39:04] jhass: what do you mean you can't?
[18:39:24] jhass: eam: naming policies, File.exist? shouldn't
[18:39:44] eam: *oh* exist vs exists
[18:39:54] xall_: has joined #ruby
[18:40:03] eam: I missed the "s" in casually reading the docs and thought the entire thing was going away
[18:40:52] et09: i can't post the code :( it's proprietary
[18:41:06] et09: but shouldn't that be impossible ??
[18:41:44] eam: et09: no, not at all
[18:41:56] eam: are your items complex structures?
[18:41:57] ChiefAlexander: has joined #ruby
[18:42:03] et09: they're hashes
[18:42:14] eam: you're probably dealing with a single hash reference inside your proc
[18:42:35] et09: a single hash reference?
[18:42:36] r_rios: has joined #ruby
[18:42:46] eam: >> a = {}; b = [a, a]; a[1] = 2; b
[18:43:07] eam: well, run that code, look at b - I bet you're doing something similar
[18:43:32] eam: also, you need to be able to simplify your problem into something generic you can share
[18:43:45] eam: it's a good process to go through just purely for the sake of debugging
[18:44:18] et09: it's an array of separate hashes with no circular references
[18:44:31] eam: has joined #ruby
[18:44:52] eam: what's the object id of each element?
[18:45:15] et09: the object id?
[18:45:27] jhass: &ri Object#object_id
[18:45:27] `derpy: http://ruby-doc.org/core-2.3.1/Object.html#method-i-object_id
[18:45:35] eam: puts myarray.map(&:object_id)
[18:46:09] et09: result.map(&:object_id).uniq.count is the same as result.count
[18:46:39] eam: no, I want to know what the object_id of each element is
[18:46:46] eam: oh, but you're saying they differ
[18:46:53] eam: dunno then - post code ;)
[18:47:13] et09: (grinds teeth)
[18:47:58] eam: et09: I deal with code under nda all the time. It's never stopped me from reproducing a generic, isolated test case
[18:48:08] eam: 99% of the time I discover the issue as I construct the test case, fwiw
[18:50:12] mistermocha: has joined #ruby
[18:50:40] spider-mario: has joined #ruby
[18:51:00] LoneHermit: has joined #ruby
[18:52:41] skade: has joined #ruby
[18:52:43] dn`: has joined #ruby
[18:52:49] jhass: yeah, I do that for code I can share too, it prevents the question more often than not
[18:53:55] et09: i think i actually hit a bug in ruby
[18:54:05] et09: either that or this code really does not work as expected
[18:54:06] SilverKey: has joined #ruby
[18:55:45] KnownSyntax: has joined #ruby
[18:55:45] KnownSyntax: has joined #ruby
[18:56:00] mistermocha: has joined #ruby
[18:57:00] nerium_: has joined #ruby
[18:57:14] macsteps: has joined #ruby
[18:59:09] et09: like if i do
[18:59:24] et09: result_array = result.map{|x| myproc.call(x)}
[18:59:28] et09: i actually get a different result than
[18:59:38] ruby[bot]: If you cannot share your code, we cannot help you. Create a complete, executable example that you can share and that reproduces your issue, or hire a consultant.
[18:59:39] et09: result_array = []; result.each{|x| result_array << myproc.call(x)}
[19:00:03] finnnnnnnnnnn: has joined #ruby
[19:01:24] cyphase: has joined #ruby
[19:04:18] KnownSyntax_: has joined #ruby
[19:04:18] KnownSyntax_: has joined #ruby
[19:10:11] chosen1: has joined #ruby
[19:11:22] dionysus69: has joined #ruby
[19:11:41] zeroDi: has joined #ruby
[19:12:05] ElFerna: has joined #ruby
[19:12:10] smathy: has joined #ruby
[19:12:51] mistermocha: has joined #ruby
[19:14:36] SilverKey: has joined #ruby
[19:15:44] karapetyan: has joined #ruby
[19:15:55] jenrzzz: has joined #ruby
[19:16:39] jackjackdripper: has joined #ruby
[19:20:30] dikaio: has joined #ruby
[19:20:45] Beverage: has joined #ruby
[19:20:53] banisterfiend: has joined #ruby
[19:21:38] djbkd: has joined #ruby
[19:22:43] roamingdog: has joined #ruby
[19:23:07] irregular: for @array[:variable], how can do that but with variable actually being a variable (with different values)?
[19:23:38] irregular: I can do @array[variable] but the resulting array is slightly different than I want
[19:23:51] Mirubiri: has joined #ruby
[19:24:14] elomatreb: If you're absolutely sure it's what you want, you can do [variable.to_sym]
[19:24:26] jhass: ACTION has a dejavu
[19:24:42] elomatreb: Ah, it's a array, I'm an idiot
[19:25:00] jhass: irregular: what do you get, what do you expect?
[19:26:14] aegis3121: has joined #ruby
[19:26:23] irregular: jhass:actually I'm not sure if this is the problem but each time I do @array[:id] = someid then that same thing again, it doesn't override the previous :id like a map, but appends to it hmm
[19:26:31] Es0teric: has joined #ruby
[19:26:50] jhass: {this: is, a: hash}, [this, is, an, array]
[19:26:53] jhass: what do you have?
[19:27:11] Es0teric: has joined #ruby
[19:27:12] jhass: what's p @array.class ?
[19:27:39] elomatreb: If you're doing @var[:something] = ... and it doesn't error, you likely have a Hash
[19:27:56] Es0teric: has joined #ruby
[19:28:11] irregular: when I print it out it looks like {"startDate"=>"2016-06-01", "startTime"=>"10:00", "durationMinutes"=>60, :startDate=>"2016-7-19", :startTime=>"15:19", :durationMinutes=>1}
[19:28:31] fmcgeough: has joined #ruby
[19:28:37] Es0teric: has joined #ruby
[19:28:40] jhass: that's ah hash
[19:28:40] elomatreb: That's a Hash, not an Array
[19:28:49] jhass: but please answer my question
[19:28:52] Mirubiri: has joined #ruby
[19:28:56] jhass: what's p @array.class ?
[19:28:57] ekinmur: has joined #ruby
[19:29:26] jhass: oh I think I see
[19:29:40] irregular: h/o let me print that out
[19:30:04] jhass: do you expect @whatever[:startDate] = whatever to overwrite "startDate"=>"2016-06-01" ?
[19:30:16] jhass: >> "startDate" == :startDate
[19:30:17] ruby[bot]: jhass: # => false (https://eval.in/608163)
[19:30:32] irregular: I want one to override the other, either one is fine
[19:30:41] jhass: no, you don't
[19:30:51] jhass: just use @whatever["startDate"] = whatever
[19:31:27] tomchapin: has joined #ruby
[19:31:51] irregular: jhass:how would I have it the other way around? overriding the :key
[19:32:23] jhass: there's no :key, you add it by doing @whatever[:startDate] = whatever
[19:32:32] jhass: so no need to overwrite it
[19:32:33] elomatreb: :startDate is a symbol, a data type basically like a string, but slightly different
[19:32:35] ekinmur: has joined #ruby
[19:32:55] irregular: the key is passed in as a variable to a function then @array[key] is done, how would I turn that key into a :key?
[19:33:17] jhass: its usecases are largely orthogonal to strings, comparison to it just confuses people who didn't understand symbols yet IME
[19:33:21] eam: irregular: to_sym
[19:33:30] jhass: wrong direction.
[19:33:42] astrobunny: has joined #ruby
[19:33:56] jhass: if you do indeed get passed a symbol and _cannot change that_, call .to_s
[19:34:12] elomatreb: jhass: Are you sure? I found symbols to be very confusing, until I understood that they're basically lighter strings
[19:34:13] irregular: jhass:we're using factory girl and there's already code utilizing :keyorsymbol so I think i'll try the to_sym to fit into that
[19:35:08] jhass: elomatreb: yes, comparing it to enums works better IME
[19:35:18] jhass: or magic numbers/values
[19:35:33] postmodern: has joined #ruby
[19:35:36] jhass: because that's what they are, named magic numbers
[19:35:48] jhass: and that's what they're best used for
[19:36:05] jhass: if people start to think of them as strings, they end up doing string operations on them
[19:36:12] elomatreb: I guess if you have previous programming experience, you're right. I got into Ruby just knowing how to write HTML and CSS
[19:36:16] eam: ENUM, really
[19:36:47] banisterfiend: has joined #ruby
[19:36:57] elomatreb: If you don't have that experience, I doubt I'd understand why magic numbers warrant a special data type
[19:38:34] astrobunny: has joined #ruby
[19:39:16] xall_: has joined #ruby
[19:40:12] moeabdol: has joined #ruby
[19:41:10] kavanagh: has joined #ruby
[19:42:02] leea: has joined #ruby
[19:43:57] irregular: actually it was the other way around, the keys were "key" already but newly added (overlapping keys) were being put in as :key. I had to do @array["#{key}"] to properly override the "key" value
[19:44:24] irregular: there mustve been some implicit conversion or something idk
[19:45:38] jaguarmagenta: has joined #ruby
[19:47:02] karapetyan: has joined #ruby
[19:47:21] jhass: irregular: just .to_s
[19:47:29] jhass: "#{key}" -> key.to_s
[19:52:03] LoneHermit: has joined #ruby
[19:52:19] tomaz_b: has joined #ruby
[19:53:41] dionysus69: has joined #ruby
[19:54:25] mistermocha: has joined #ruby
[19:55:02] irregular: would you know if there's a method to turn all the keys to string keys from symbol keys?
[19:55:31] LoneHerm_: has joined #ruby
[19:56:25] mistermocha: has joined #ruby
[19:56:47] dionysus69: has joined #ruby
[19:57:07] karapetyan: has joined #ruby
[19:57:30] havenwood: irregular: Is Rails involved or are you otherwise using ActiveSupport?
[19:57:35] havenwood: irregular: {'aim' => true}.map { |k, v| [k.to_sym, v] }.to_h
[19:57:36] pwnd_nsfw: has joined #ruby
[19:57:42] djbkd: has joined #ruby
[19:57:54] havenwood: irregular: {'aim' => true}.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
[19:57:57] ChiefAlexander: has joined #ruby
[19:58:36] havenwood: irregular: with ActiveSupport: {'aim' => true}.symbolize_keys
[19:59:02] ecnalyr: has joined #ruby
[20:00:05] crystal77: has joined #ruby
[20:00:28] GodFather: has joined #ruby
[20:00:42] djbkd: has joined #ruby
[20:00:43] ur5us: has joined #ruby
[20:02:15] madgen: has joined #ruby
[20:02:21] macsteps: has joined #ruby
[20:03:23] finnnnnnnnnnn: good evening all, anyone have any advice on best pracise then filtering models? I have a series of select boxes listing my model IDs and I want to submit them with a GET to a controller that reads the IDs and then returns the filtered set of models. I’m wondering how to contruct the form. I’m using check_box_tag but I’ve read it’s not best practise to pass an array in params using check_box_tag/
[20:03:25] irregular: actually it may be better if I change this yml file. the initial array values are loaded from YAML.load_file("path/to/file"), the file looks like startDate: "2016-06-01", and a few more key value pairs, is there a way to modify the yml file so that the resulting array looks like :startDate=>"2016-06-01" instead of "startDate"=>"2016-06-01"
[20:03:34] solars: has joined #ruby
[20:03:54] cyphase: has joined #ruby
[20:06:08] kitikonti: has joined #ruby
[20:06:37] vuoto: has joined #ruby
[20:06:48] griffindy: has joined #ruby
[20:07:55] aegis3121: has joined #ruby
[20:08:01] mattwashere: has joined #ruby
[20:08:29] havenwood: finnnnnnnnnnn: You might have better luck with Rails-specific questions in the #RubyOnRails channel.
[20:08:48] roshanavand: has joined #ruby
[20:08:52] kitikonti: in middleman i define string translations in a yml file. if i want to use this strings in my template i need to write <%= t(:apple) %>
[20:09:07] kitikonti: in my case i want to use multiple levels in the yml file
[20:10:14] pwnd_nsfw`: has joined #ruby
[20:10:21] kitikonti: if i now write <%= t(:apple) %> i get a array like this {:color=>"red", :size=>"big"}
[20:10:41] kitikonti: what do i have to write to get the color?
[20:10:44] finnnnnnnnnnn: havenwood: ooops, thought I was in the rails room. thanks!
[20:10:45] troulouliou_div2: has joined #ruby
[20:10:54] havenwood: kitikonti: That looks like a Hash not an Array
[20:11:00] kitikonti: <%= t(:apple:color) %> dont work
[20:11:16] irregular: nvm i found symbolize_keys() did the job
[20:11:34] kitikonti: havenwood but how do i get the color out of this?
[20:11:58] ramfjord: has joined #ruby
[20:12:00] havenwood: >> {:color=>"red", :size=>"big"}[:color] # kitikonti
[20:12:01] ruby[bot]: havenwood: # => "red" (https://eval.in/608188)
[20:12:28] kitikonti: havenwood ahhh again, yesterday i have made the same mistake
[20:12:53] kitikonti: i always write the idetifier inside the function call (function parameter)
[20:13:16] ghr: has joined #ruby
[20:15:45] jackjackdripper: has joined #ruby
[20:16:44] mikecmpbll: has joined #ruby
[20:17:20] jaguarmagenta: has joined #ruby
[20:19:07] pwnd_nsfw: has joined #ruby
[20:19:28] blackgoat: has joined #ruby
[20:22:34] swills: has joined #ruby
[20:23:04] pawnbox: has joined #ruby
[20:24:33] madgen: has joined #ruby
[20:25:21] pwnd_nsfw`: has joined #ruby
[20:26:27] ramfjord: has joined #ruby
[20:34:56] karapetyan: has joined #ruby
[20:35:32] ekinmur: has joined #ruby
[20:35:45] jaguarmagenta: has joined #ruby
[20:35:56] karapetyan: has joined #ruby
[20:36:27] fmcgeough: has joined #ruby
[20:38:34] devbug: has joined #ruby
[20:43:42] ramfjord: has joined #ruby
[20:44:00] maloik: has joined #ruby
[20:45:02] jenrzzz: has joined #ruby
[20:45:02] jenrzzz: has joined #ruby
[20:48:49] bmurt: has joined #ruby
[20:53:16] solars: has joined #ruby
[20:56:19] smathy: kitikonti, t("apple.color") will also work.
[20:57:07] et09: eam: i figured out the problem
[20:57:32] et09: the proc generator was not instantiating a new object for its assignments each time, it was using the same one
[20:57:52] et09: 3 hours down the drain, just needed to add a ".dup" ;____;
[20:58:01] kitikonti: smathy thx, this looks a bit nicer
[20:58:22] smathy: kitikonti, it's more idiomatic for the I18n stuff.
[20:59:16] jaguarmagenta: has joined #ruby
[21:00:55] safetypin: has joined #ruby
[21:01:29] AngryBuzzy: has joined #ruby
[21:03:11] marr: has joined #ruby
[21:05:49] dunpeal: has joined #ruby
[21:06:12] hipertracker: has joined #ruby
[21:06:35] whathappens: has joined #ruby
[21:07:33] spudowiar1: has joined #ruby
[21:09:08] edwinvdgraaf: has joined #ruby
[21:11:21] yfeldblum: has joined #ruby
[21:11:33] spudowiar2: has joined #ruby
[21:11:53] leea: has joined #ruby
[21:12:23] finnnnnnnnnnn: has joined #ruby
[21:13:12] Guest60828: has joined #ruby
[21:13:28] johnmilton: has joined #ruby
[21:13:38] roshanavand: has joined #ruby
[21:14:04] finisherr: has joined #ruby
[21:14:08] ChiefAlexander: has joined #ruby
[21:17:15] aegis3121: has joined #ruby
[21:17:55] workmad3: has joined #ruby
[21:19:35] johnmilton: has joined #ruby
[21:21:53] GnuYawk: has joined #ruby
[21:21:55] whathappens: has joined #ruby
[21:22:38] Madplatypus: has joined #ruby
[21:29:08] eam: et09: figured it was the same reference ;)
[21:29:31] et09: it was deceptive because the proc instantiation itself was creating that object which the reference went to
[21:29:36] ruby-lang795: has joined #ruby
[21:30:13] spudowiar: has joined #ruby
[21:30:36] ruby-lang795: Does anyone know the best way to convert a string into a hash? Given this string: "{\"test\"=>nil, \"test2\"=>nil, \"test3\"=>nil}"
[21:30:51] ruby-lang795: The best method I can come up with is using eval(string)
[21:31:07] et09: it was deceptive because the proc instantiation itself was creating that object which the reference went to
[21:31:28] araujo: has joined #ruby
[21:31:54] havenwood: >> eval "{\"test\"=>nil, \"test2\"=>nil, \"test3\"=>nil}" # ruby-lang795
[21:31:55] ruby[bot]: havenwood: # => {"test"=>nil, "test2"=>nil, "test3"=>nil} (https://eval.in/608232)
[21:32:17] et09: ruby-lang795: is it a one dimensional hash
[21:32:29] ruby-lang795: Yeah, just a one dimensional hash
[21:32:35] et09: then split by comma
[21:32:42] ruby-lang795: Isn't it pretty taboo to use Eval?
[21:32:44] LoneHerm_: has joined #ruby
[21:32:48] et09: yeah it's unsafe
[21:32:55] Mon_Ouie: ruby-lang795: Where does that string come from?
[21:32:58] Guest60828: has joined #ruby
[21:33:03] istrasci: has joined #ruby
[21:33:13] ruby-lang795: It comes from a database text field using ActiveRecord::Base
[21:33:28] ruby-lang795: The app isn't using Rails though so I don't think serialize is an option
[21:33:41] Mon_Ouie: Why are you storing a hash like that in a database?
[21:33:48] dunpeal: has joined #ruby
[21:34:01] ruby-lang795: Good question, wish I could have asked the guy myself :/
[21:34:05] ses1984: has joined #ruby
[21:34:09] Xiti: has joined #ruby
[21:34:15] istrasci: Using ruby 2.3.1, why is
[21:34:15] istrasci: > {'a': 1} == {'a' => 1}
[21:34:37] Mon_Ouie: istrasci: The first one has a symbol as a key, the second one uses a string.
[21:35:08] et09: is it a ruby hash to begin with?
[21:35:10] istrasci: So using the : syntax in a Hash forces the key to be a symbol?
[21:35:13] et09: or a json hash perhaps?
[21:35:23] ruby-lang795: I believe it's a ruby hash to begin with
[21:35:25] et09: n/m i see nil, not null
[21:35:38] LoneHerm_: has joined #ruby
[21:35:39] jaguarmagenta: has joined #ruby
[21:35:51] Mon_Ouie: ruby-lang795: The real solution would be to use a more suitable way to encode your data, but if you have to deal with this encoding, there are no safe built-in methods to read Ruby literals
[21:36:30] ruby-lang795: Ah ok, that's what I was afraid of. Thank you for the help! I'll probably start some refactoring haha
[21:36:31] Mon_Ouie: You could build a parser that only parses some literals without running dangerous code, but that's quite a bit of work (not sure if there are gems doing this)
[21:37:14] et09: how many records are you dealing with
[21:37:29] ruby-lang795: only a few 100 for now
[21:37:36] et09: then change the code dealing with their format asap
[21:37:39] Xeago: has joined #ruby
[21:37:44] et09: if you're using postgresql you can use json/jsonb types
[21:37:53] havenwood: ruby-lang795: which db?
[21:37:56] et09: automatically (de)serialized to activerecord and vice versa
[21:38:09] et09: they have it too now
[21:38:10] et09: as of 5.7.8
[21:38:52] ruby-lang795: Nice! shouldn't be too difficult to get it switched and migrated then
[21:39:35] et09: since you can visually inspect the data set, you can easily run eval against it during the migration, if you determine it's safe (which god knows it prob is)
[21:40:00] replay: has joined #ruby
[21:40:16] Puffball: has joined #ruby
[21:40:16] aryaching: has joined #ruby
[21:40:24] havenwood: Mon_Ouie: there's literal_parser: https://github.com/apeiros/literal_parser
[21:42:06] phredus_: has joined #ruby
[21:42:54] finnnnnnnnnnn: has joined #ruby
[21:45:00] flashpoint9: has joined #ruby
[21:45:57] freeman1337: has joined #ruby
[21:47:06] ruby-lang834: has joined #ruby
[21:48:04] ruby-lang834: has left #ruby: ()
[21:48:16] devbug: has joined #ruby
[21:49:54] Bish: has joined #ruby
[21:50:51] leea: has joined #ruby
[21:51:24] omphe: has joined #ruby
[21:53:29] shevy: this is for how apeiros becomes famous
[21:53:33] em0ral: has joined #ruby
[21:53:33] shevy: that - and halsbe
[21:53:33] crystal77: has joined #ruby
[21:53:47] cd-rum: has joined #ruby
[21:54:35] karapetyan: has joined #ruby
[21:55:06] JesseH: has joined #ruby
[21:55:50] cd-rum_: has joined #ruby
[21:56:16] postmodern: has joined #ruby
[21:57:17] Trynemjoel: has joined #ruby
[22:00:43] dfockler: has joined #ruby
[22:01:39] blackgoat: has joined #ruby
[22:07:07] SilverKey: has joined #ruby
[22:07:09] flashpoint9: has joined #ruby
[22:07:23] cyphase: has joined #ruby
[22:08:19] cd-rum: has joined #ruby
[22:08:37] shinnya: has joined #ruby
[22:08:49] jenrzzz: has joined #ruby
[22:08:54] jenrzzz: has joined #ruby
[22:10:05] hutch34_: has joined #ruby
[22:11:45] Azure: has joined #ruby
[22:14:01] banisterfiend: has joined #ruby
[22:14:42] postmodern: has joined #ruby
[22:16:24] dennisvennink: has joined #ruby
[22:20:03] nando293921: has joined #ruby
[22:21:38] mattwashere: has joined #ruby
[22:22:56] reaVer: has joined #ruby
[22:26:28] Xeago: has joined #ruby
[22:27:50] istrasci: has left #ruby: ()
[22:29:56] nando293921: has joined #ruby
[22:31:16] troulouliou_div2: has joined #ruby
[22:32:33] elifoster: has joined #ruby
[22:33:07] chipotle: has joined #ruby
[22:33:36] jenrzzz_: has joined #ruby
[22:35:26] LoneHerm_: has joined #ruby
[22:47:43] crystal77: has joined #ruby
[22:49:51] macsteps: has joined #ruby
[22:51:08] dminuoso: has joined #ruby
[22:53:35] eljimbo: has joined #ruby
[23:01:31] karapetyan: has joined #ruby
[23:01:42] fmcgeough: has joined #ruby
[23:03:42] l4v2: has joined #ruby
[23:04:01] DeltaHeavy: has joined #ruby
[23:04:27] DeltaHeavy: I have a Jekyll project and I'm wondering if the things in my Gemfile will be installed system wide. If so do I want this? Generally things should be for the specific repo no?
[23:06:16] edwinvdgraaf: has joined #ruby
[23:07:23] havenwood: DeltaHeavy: or set BUNDLE_PATH or use --deployment for ./vendor/bundle
[23:07:54] havenwood: DeltaHeavy: But the Bundle will ensure you're using the correct versions even if they're installed in GEM_PATH.
[23:09:52] DeltaHeavy: havenwood Is using --path not enough?
[23:10:47] isberg: has joined #ruby
[23:11:15] dennisvennink: has joined #ruby
[23:11:30] havenwood: DeltaHeavy: --path should do the trick - just remember it's a "remembered" setting so it'll end up in your bundler conf file
[23:12:16] MrBusiness2: has joined #ruby
[23:12:28] havenwood: so just omitting --path won't go back to system, but maybe that's what you want
[23:13:23] havenwood: bundle config path
[23:13:51] DeltaHeavy: havenwood Got it, I figured it's best to have all my gems specific to this project local as I do with other platforms. If that's different for Ruby let me konw.
[23:15:24] havenwood: DeltaHeavy: Some folk just use the gem install location since Bundler will still select the exact gems and versions from the Gemfile.lock.
[23:15:35] havenwood: DeltaHeavy: It's perfectly fine to install the gems locally to the project as well though.
[23:15:58] davedev24: has joined #ruby
[23:16:34] leea: shevy do you have any advice on how to get used to a codebase of such size like fpm?
[23:20:40] Bish: has joined #ruby
[23:22:52] dennisvennink: has joined #ruby
[23:23:23] edwinvdgraaf: has joined #ruby
[23:23:32] Vingador: has joined #ruby
[23:24:15] shevy: leea haha :)
[23:24:22] shevy: I struggle with that myself... it's on my todo list
[23:24:35] shevy: leea in the past I tried to adapt the style to my style
[23:24:42] shevy: but that requires a lot of time to invest so that is not good
[23:26:33] leea: I mean there are a lot of moving parts
[23:26:53] mistermocha: has joined #ruby
[23:26:55] leea: hmm do you have any thoughts on a better workflow than
[23:27:08] shevy: not really, I struggle with this on my big projects too
[23:27:22] shevy: for small projects this is usually simple
[23:27:33] leea: do you have any tools you like to use for debug?
[23:27:36] shevy: like "do one thing and do it well"
[23:28:03] shevy: I am like tenderlove here! let me fetch the post he wrote about debugging...
[23:28:28] shevy: https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debuggerer.html
[23:28:44] elomatreb: Not strictly a debug tool, but I really enjoy occasionally running my apps through stackprof
[23:29:09] shevy: I tend to use pp though, and colourize the problem + output the line and class of what is going awry. And I try to have code so dumb that I never have to guess what it does
[23:29:26] drbrain: ↑ good techniques here
[23:29:30] elomatreb: Also, a "real" debugger like byebug is a blessing, imo
[23:29:35] shevy: oh actually, he also outputs a spacer, from the blog:
[23:29:37] shevy: puts "#" * 90
[23:30:17] shevy: I never got into that breakpoints-business of debugging
[23:30:45] elomatreb: Neither did I in other languages, I just use byebug like a much more convenient print statement
[23:32:00] leea: not sure if i should ask here on on #fpm, but how would i run this thing? since it's a gem
[23:32:04] leea: or it builds into a gem
[23:37:37] DeltaHeavy: Is Jekyll kinda dead?
[23:38:06] elomatreb: Jekyll is one of those OS projects that you could almost call "finished"
[23:40:20] LoneHerm_: has joined #ruby
[23:46:17] macsteps: has joined #ruby
[23:46:23] SuperLag: has joined #ruby
[23:50:45] Bish: has joined #ruby
[23:52:59] rodorgas: has joined #ruby
[23:53:31] shevy: leea if it is a gem, "gem install fpm" should work
[23:54:39] shevy: leea https://rubygems.org/gems/fpm - you can also try the updated github source, "download as zip", extract it... then, well, you can install it as a gem if you build it or you can use setup.rb - I personally use setup.rb, it is not as clean, since you have to do a manual removal but this I can do easily... I go into the site dir of ruby and remove fpm/ and fpm.rb
[23:54:57] shevy: https://github.com/jordansissel/fpm
[23:55:06] shevy: but it was just one example, perhaps you can find smaller projects
[23:55:18] Mirubiri: has joined #ruby
[23:55:32] leea: I'll make at least 1 PR :)
[23:55:33] pdoherty: has joined #ruby
[23:55:37] shevy: I mentioned it largely because being able to generate .deb .rpm etc... is on my todo list... so I would either have to do it on my own from scratch or make use of something that already exists
[23:55:46] SuperLag_: has joined #ruby
[23:55:51] leea: I mean I'll probably deal with this in industry right? learning new big code bases
[23:56:50] shevy: yeah, not a lot of fun IMO :\
[23:58:15] shevy: if your goal is heavily inspired by industry, you may try to get good at testing
[23:58:37] leea: what do you mean by testing? like rspec and that?
[23:58:41] shevy: I remember perhaps 3 years ago or so, for a ruby job in milano, it was pointed out that writing specs/tests was mandatory
[23:59:16] shevy: it still was a niche area though, related to bioinformatics. there is evidently more going on in the www/rails world
[23:59:26] KnownSyntax: has joined #ruby
[23:59:26] KnownSyntax: has joined #ruby