« Back to channel list

#ruby - 11 March 2017

« Back 1 day Forward 1 day »
[00:00:57] ozcanesen: has joined #ruby
[00:02:53] postmodern: has joined #ruby
[00:03:52] br0d1n: has joined #ruby
[00:04:54] allisio: Nah, you can still blame him.
[00:05:15] bg: i use 8 space indent when writing ruby
[00:05:56] allisio: You'll burn in hell.
[00:06:42] allisio: josh25: You wouldn't.
[00:07:08] username1: has joined #ruby
[00:07:17] jhack: Are there any gems/resources out there that can help me understand the source code of a production application quicker? (Ex: Providing documentation based on the code/routes)
[00:09:46] allisio: josh25: If you can be sure that all the elements of `list` are unique, `list.delete prod` should work, but modifying a collection while you're iterating over it is generally a bad idea.
[00:11:10] baweaver: &ri Enumerable#select
[00:11:10] `derpy: http://ruby-doc.org/core-2.4.0/Enumerable.html#method-i-select
[00:12:05] ColeHub: has joined #ruby
[00:12:06] allisio: But then his body is gonna be some gross `if yada; false; else; mutate some state; true; end`.
[00:29:09] ruid_: has joined #ruby
[00:32:25] arescorpio: has joined #ruby
[00:33:13] hutch34: has joined #ruby
[00:34:15] mwlang: has joined #ruby
[00:37:00] guacamole: has joined #ruby
[00:37:22] ruid: has joined #ruby
[00:38:37] ResidentBiscuit: has joined #ruby
[00:43:32] grant: has joined #ruby
[00:44:59] nOwz: has joined #ruby
[00:45:10] ResidentBiscuit: has joined #ruby
[00:46:12] AndBobsYourUncle: has joined #ruby
[00:48:00] PaulCapestany: has joined #ruby
[00:52:37] j2k: has joined #ruby
[00:53:14] montanonic: has joined #ruby
[00:53:31] PaulCapestany: has joined #ruby
[00:56:10] j2k_: has joined #ruby
[00:56:13] eclecticjohny: has joined #ruby
[00:57:22] j2k_: has joined #ruby
[01:00:28] pawnbox: has joined #ruby
[01:01:34] aibot: has joined #ruby
[01:05:22] pilne: has joined #ruby
[01:11:13] grant: has joined #ruby
[01:13:38] jhack: has joined #ruby
[01:13:39] jhack: has joined #ruby
[01:17:40] ColeHub: has joined #ruby
[01:17:47] rkazak_: has joined #ruby
[01:28:10] abdulmugni: has joined #ruby
[01:28:12] raspado: has joined #ruby
[01:28:51] juggler: has joined #ruby
[01:28:51] hxegon_AFK: has joined #ruby
[01:32:30] despai: has joined #ruby
[01:40:08] pawnbox: has joined #ruby
[01:43:11] bmurt: has joined #ruby
[01:49:45] CloCkWeRX: has joined #ruby
[01:50:14] CloCkWeRX: has left #ruby: ()
[01:50:31] ColeHub: has joined #ruby
[01:56:19] bmurt: has joined #ruby
[01:59:14] BackEndCoder: has joined #ruby
[02:06:57] djbkd: has joined #ruby
[02:07:08] Trynemjoel: has joined #ruby
[02:11:12] despai: has left #ruby: ("Leaving")
[02:13:18] duderonomy: has joined #ruby
[02:14:37] Channel6: has joined #ruby
[02:15:54] ahrs: has joined #ruby
[02:20:19] chouhoulis: has joined #ruby
[02:21:14] hutch34: has joined #ruby
[02:24:49] skweek: has joined #ruby
[02:25:11] Derperperd: has joined #ruby
[02:28:28] marcdel: has joined #ruby
[02:29:13] d^sh: has joined #ruby
[02:33:55] montanonic: has joined #ruby
[02:37:42] solocshaw: has joined #ruby
[02:44:07] enterprisey: has joined #ruby
[02:46:37] solocshaw1: has joined #ruby
[02:50:27] rhyselsmore: has joined #ruby
[02:51:34] ramfjord: has joined #ruby
[02:51:35] solocshaw: has joined #ruby
[02:56:52] bocaneri: has joined #ruby
[02:59:41] milardovich: has joined #ruby
[03:07:09] libastral: has joined #ruby
[03:09:27] pawnbox: has joined #ruby
[03:11:04] optiz0r: has joined #ruby
[03:14:10] enterprisey: has joined #ruby
[03:15:28] xall: has joined #ruby
[03:19:45] griffindy: has joined #ruby
[03:22:07] mula: has joined #ruby
[03:24:18] hotpancakes: has joined #ruby
[03:25:03] bg: why isn't there #to_i on TrueClass and FalseClass
[03:26:40] marcdel: has joined #ruby
[03:33:25] Jameser: has joined #ruby
[03:33:52] hotpancakes: has joined #ruby
[03:34:16] petrichorx_: has joined #ruby
[03:35:58] marcdel: has joined #ruby
[03:36:26] hotpancakes: has joined #ruby
[03:37:46] chihhsin: has joined #ruby
[03:39:25] pawnbox: has joined #ruby
[03:39:55] SeepingN: has joined #ruby
[03:43:55] havenwood: >> class FalseClass; def to_i; 0 end end; !!false.to_i # it's confusing for `false` to become something truthy
[03:43:56] ruby[bot]: havenwood: # => true (https://eval.in/752673)
[03:47:36] grant: has joined #ruby
[03:54:50] hotpancakes: has joined #ruby
[03:55:12] hotpancakes: has joined #ruby
[03:56:46] rhyselsmore: has joined #ruby
[04:07:28] eclecticjohny: has joined #ruby
[04:14:24] Tempesta: has joined #ruby
[04:30:05] maloik: has joined #ruby
[04:34:23] Jameser: has joined #ruby
[04:35:40] gix: has joined #ruby
[04:38:18] gusrub: has joined #ruby
[04:39:03] rhyselsmore: has joined #ruby
[04:43:44] rhyselsmore: has joined #ruby
[04:46:01] b4udv8: has joined #ruby
[04:46:24] nOwz: has joined #ruby
[04:50:39] pulkit4tech: has joined #ruby
[04:53:52] Tempesta_: has joined #ruby
[04:54:06] chouhoulis: has joined #ruby
[05:02:15] cschneid_: has joined #ruby
[05:02:49] b4udv8: has left #ruby: ("WeeChat 1.4")
[05:06:40] jenrzzz: has joined #ruby
[05:06:41] jenrzzz: has joined #ruby
[05:09:30] Tempesta: has joined #ruby
[05:11:10] raul782: has joined #ruby
[05:14:54] matthewd: Also there would be people with fairly strong opinions both ways on whether true.to_i should be 1 or -1
[05:18:21] pawnbox: has joined #ruby
[05:23:51] Derperperd: has joined #ruby
[05:25:22] milardovich: has joined #ruby
[05:32:30] shinnya: has joined #ruby
[05:35:08] bkxd_: has joined #ruby
[05:35:14] Jameser: has joined #ruby
[05:44:02] elifoster: has joined #ruby
[05:45:33] ResidentBiscuit: has joined #ruby
[05:46:16] petrichorx_: has joined #ruby
[05:52:29] dstrunk: has joined #ruby
[05:54:37] allisio: matthewd: No, there wouldn't.
[05:56:38] matthewd: allisio: Are you at least going to tell me which category you think everyone would be in? :P
[05:56:52] allisio: matthewd: That you could reasonably guess is my defense.
[05:58:41] matthewd: I genuinely don't know. I'm on team -1.
[05:59:18] elomatreb: A C programmer might say true/false should be 1/0
[06:00:27] matthewd: More accurately, I'm on team ~0
[06:01:45] matthewd: But yes, I think it's going to come down to your [potentially quite distant] background
[06:05:38] allisio: matthewd: What're some languages that use -1 for "true"?
[06:06:33] matthewd: In my case it's a BASICism
[06:07:42] matthewd: `False = 0; True = Not False`
[06:09:34] matthewd: It's always seemed so intuitively reasonable to me, I've just assumed it's a not-uncommon choice elsewhere. Maybe I'm more alone than I thought.
[06:25:17] xall: has joined #ruby
[06:27:22] ebcz: has joined #ruby
[06:29:49] Jameser: has joined #ruby
[06:33:39] jenrzzz: has joined #ruby
[06:33:39] jenrzzz: has joined #ruby
[06:38:48] jamesaxl: has joined #ruby
[06:46:11] CloCkWeRX: has joined #ruby
[06:46:15] CloCkWeRX: has left #ruby: ()
[06:51:12] _whitelogger: has joined #ruby
[06:54:29] nOwz: has joined #ruby
[07:02:05] rippa: has joined #ruby
[07:14:15] CloCkWeRX: has joined #ruby
[07:31:01] Jameser: has joined #ruby
[07:34:15] renchan: has joined #ruby
[07:35:10] pawnbox: has joined #ruby
[07:42:11] _whitelogger: has joined #ruby
[07:46:26] ResidentBiscuit: has joined #ruby
[07:50:34] dionysus69: has joined #ruby
[07:50:57] brent__: has joined #ruby
[07:51:00] jenrzzz: has joined #ruby
[07:51:00] jenrzzz: has joined #ruby
[07:53:18] d0nn1e: has joined #ruby
[07:53:22] dlitvak: has joined #ruby
[07:54:00] electrostat: has joined #ruby
[07:56:22] xall: has joined #ruby
[07:57:19] tildes_: has joined #ruby
[08:03:54] khaki: has joined #ruby
[08:04:08] TomyLobo: has joined #ruby
[08:05:31] jenrzzz: has joined #ruby
[08:10:00] milardovich: has joined #ruby
[08:11:51] nofxxx: has joined #ruby
[08:19:21] Derperperd: has joined #ruby
[08:24:35] cschneid_: has joined #ruby
[08:26:59] SuperLag_: has joined #ruby
[08:29:30] pawnbox: has joined #ruby
[08:31:28] Axy: has joined #ruby
[08:32:29] hotpancakes: has joined #ruby
[08:34:56] SuperLag: has joined #ruby
[08:35:30] Qchmqs: has joined #ruby
[08:37:54] jackjackdripper: has joined #ruby
[08:41:53] hotpancakes: has joined #ruby
[08:42:27] xall: has joined #ruby
[08:44:27] Jackneill: has joined #ruby
[08:47:49] milardovich: has joined #ruby
[08:54:11] Pumukel: has joined #ruby
[09:00:29] jgnagy: has joined #ruby
[09:03:02] Pumukel: has joined #ruby
[09:05:33] hotpancakes: has joined #ruby
[09:05:47] conta: has joined #ruby
[09:15:25] bruce_lee: has joined #ruby
[09:17:24] xall: has joined #ruby
[09:18:53] tomphp: has joined #ruby
[09:19:11] toretore: has joined #ruby
[09:19:50] TomyLobo: has joined #ruby
[09:19:51] Pumukel: has joined #ruby
[09:20:37] tildes_: has joined #ruby
[09:22:34] cschneid_: has joined #ruby
[09:23:07] certainty: has joined #ruby
[09:23:09] TomyLobo: has joined #ruby
[09:24:12] TomyLobo: has joined #ruby
[09:24:50] milardovich: has joined #ruby
[09:26:00] Pumukel: has joined #ruby
[09:28:29] hotpancakes: has joined #ruby
[09:32:27] Jameser: has joined #ruby
[09:32:43] hogetaro: has joined #ruby
[09:36:31] jenrzzz: has joined #ruby
[09:36:31] jenrzzz: has joined #ruby
[09:37:13] Pumukel: has joined #ruby
[09:39:33] duderonomy: has joined #ruby
[09:41:29] hotpancakes: has joined #ruby
[09:42:20] Pumukel: has joined #ruby
[09:42:32] pawnbox: has joined #ruby
[09:43:54] jenrzzz: has joined #ruby
[09:45:04] certainty: has joined #ruby
[09:46:27] romain_t: has joined #ruby
[09:46:56] ResidentBiscuit: has joined #ruby
[09:47:39] pandaant: has joined #ruby
[09:48:02] Pumukel: has joined #ruby
[09:49:17] quaristice: has joined #ruby
[09:53:17] Pumukel: has joined #ruby
[09:56:26] zeroDi: has joined #ruby
[09:58:09] acalycine: has joined #ruby
[09:58:52] Pumukel: has joined #ruby
[10:00:07] Arpanet69: has joined #ruby
[10:02:26] milardovich: has joined #ruby
[10:04:12] Pumukel: has joined #ruby
[10:04:30] cfec0b8d: has joined #ruby
[10:05:10] hotpancakes: has joined #ruby
[10:06:40] brent__: has joined #ruby
[10:07:05] d^sh: has joined #ruby
[10:10:57] lxsameer: has joined #ruby
[10:12:45] BackEndCoder: has joined #ruby
[10:13:00] quaristice: has joined #ruby
[10:15:48] pawnbox: has joined #ruby
[10:19:30] JeanCarloMachado: has joined #ruby
[10:26:06] makkuzin: has joined #ruby
[10:26:21] Pumukel: has joined #ruby
[10:26:58] nowhere_man: has joined #ruby
[10:29:56] makkuzin: has joined #ruby
[10:31:42] Bounga: has joined #ruby
[10:31:44] loechel: has joined #ruby
[10:37:27] Pumukel: has joined #ruby
[10:39:22] milardovich: has joined #ruby
[10:39:27] shinnya: has joined #ruby
[10:42:39] nowhere_man: has joined #ruby
[10:42:49] Pumukel: has joined #ruby
[10:43:18] oetjenj: has joined #ruby
[10:44:58] morfin: has joined #ruby
[10:45:11] morfin: you can clone class and then add methods in it?
[10:47:32] hotpancakes: has joined #ruby
[10:48:39] Pumukel: has joined #ruby
[10:51:16] matthewd: morfin: If that was a question.. yes.
[10:51:26] yusrideb: has joined #ruby
[10:51:42] dminuoso: morfin: Everything (well almost) is an object, even classes.
[10:51:48] dminuoso: morfin: And objects you can clone/dup
[10:54:29] Pumukel: has joined #ruby
[10:54:30] matthewd: (well most objects)
[10:55:17] dminuoso: matthewd: Mmm right, you cant clone symbols. Anything else worth mentioning here?
[10:55:19] nowhere_man: has joined #ruby
[10:55:58] matthewd: Methods would be the relevant nearby one
[10:56:38] matthewd: (especially as immediates like symbols, integers, true/false/nil now [pretend to] support dup in 2.4)
[10:58:54] dminuoso: >> ObjectSpace.each_object.select { |o| begin; o.dup; false; rescue; true; end }.map(&:class).uniq
[10:58:55] ruby[bot]: dminuoso: # => [Class, Bignum, Encoding, Complex, RubyVM::Env, Thread, RubyVM, Float, Data, File] (https://eval.in/752862)
[10:59:02] dminuoso: matthewd: ^- easy.
[10:59:23] dminuoso: Well its not exactly comprehensive, but well
[11:00:16] Pumukel: has joined #ruby
[11:00:43] dminuoso: matthewd: Why can't you clone a thread?
[11:01:29] dminuoso: That's something I would have expected to work actually.
[11:01:50] matthewd: I'd guess related to the fact it has a C stack.. what would it even mean? Like a thread-level fork, that you could perform from the outside?
[11:02:45] matthewd: Class is in the above list because you can't dup a singleton class; regular ones you can
[11:03:02] hotpancakes: has joined #ruby
[11:03:04] dminuoso: take the whole iseq inside the block that defines the thread, and start a new one?
[11:03:13] matthewd: (and it obviously misses immediates, because each_object won't find any)
[11:03:30] dminuoso: Well and it will miss all the fancy things that are not constructed yet
[11:04:01] dminuoso: Let me run this in my uber sized Rails application, surely that's more generous in ObjectSpace
[11:04:22] dminuoso: NotImplementedError: need to define `__setobj__' from ...rubies/ruby-2.3.3/lib/ruby/2.3.0/delegate.rb:168:in `__setobj__'
[11:04:43] dminuoso: That is un-rescueable.
[11:05:03] matthewd: It's not unrescueable, it just doesn't inherit StandardError
[11:05:24] vuoto: has joined #ruby
[11:05:54] matthewd: .. and it really shouldn't be used there, which is interesting, given it's stdlib
[11:06:25] dminuoso: [RubyVM::Env, Class, Encoding, Complex, Symbol, Bignum, Thread, RubyVM, Thread::ConditionVariable, Float, Data, Thread::Backtrace::Location, UnboundMethod, RubyVM::DebugInspector, NameError::message, ActiveSupport::Deprecation, FFI::Function, FFI::DynamicLibrary::Symbol, FFI::Pointer, PaperTrail::Config, Rational, Sprockets::LegacyTiltProcessor, Method, Thread::Queue, Mime::AllType]
[11:06:45] dminuoso: That's more like it.
[11:07:35] dminuoso: matthewd: So rescue without a filter just catches StandardError ?
[11:08:07] matthewd: "Things you should be able to recover from", vs.. other
[11:08:13] dminuoso: >> begin raise Class.new; rescue; puts "caught" end
[11:08:14] ruby[bot]: dminuoso: # => caught ...check link for more (https://eval.in/752863)
[11:08:18] dminuoso: matthewd: ^-
[11:08:34] matthewd: That's not rescuing what you think it is
[11:08:41] szulak: has joined #ruby
[11:08:52] dminuoso: >> begin raise Class.new; rescue; p $!; end
[11:08:53] ruby[bot]: dminuoso: # => #<TypeError: exception class/object expected> ...check link for more (https://eval.in/752864)
[11:08:56] j416: dminuoso: I think it's nice to explicitly say that you're rescuing StandardError; makes it more readable
[11:09:34] dminuoso: matthewd: Not so long ago I tricked baweaver into this:
[11:09:34] j416: (and obvious, since perhaps StandardError is not what you want to rescue most of the time)
[11:09:44] matthewd: Thus NotImplementedError being a bit of a trap: it looks like you want it to mean "my method doesn't support this yet", but it's supposed to be used only for things the *runtime* hasn't implemented
[11:10:12] dminuoso: >> [{}, {}] == {[] => []} || true
[11:10:13] ruby[bot]: dminuoso: # => true (https://eval.in/752865)
[11:10:22] dminuoso: I still feel proud for tricking him with that.
[11:10:48] j416: it's an array and a map how can they be equal
[11:11:15] Pumukel: has joined #ruby
[11:11:32] dminuoso: j416: ponder about it for a while, and it will become obvious
[11:11:35] j416: s/how can they be/what would make one think they are/
[11:11:45] j416: dminuoso: hmm
[11:12:20] j416: >> [{}, {}] == {[] => []}
[11:12:21] ruby[bot]: j416: # => false (https://eval.in/752866)
[11:12:25] oetjenj: has joined #ruby
[11:12:28] j416: so not a true/true case
[11:12:38] j416: ACTION doesn't get it :/
[11:12:53] elomatreb: Precedence, false || true
[11:13:13] oetjenj: has joined #ruby
[11:13:32] j416: ah, the idea was that == has less precedence than ||
[11:13:48] dminuoso: j416: That's what allows you to write code without it looking like LISP
[11:13:56] j416: I don't know lisp
[11:14:04] j416: ah, parentheses you mean
[11:14:21] elomatreb: And no precendence rules at all IIRC
[11:14:27] j416: interesting choice
[11:15:45] dminuoso: elomatreb: right because everything has to be an S-expression
[11:15:47] milardovich: has joined #ruby
[11:16:35] elomatreb: I'm currently in my second semester CompSci and I haven't seen a single line of LISP code yet
[11:16:39] patarr: has joined #ruby
[11:16:42] Pumukel: has joined #ruby
[11:16:51] j416: how'd that ruby image get there o_O https://dl.dropboxusercontent.com/u/3207594/30d/ruby.png I wonder if it's my chat client that puts it there just because of the channel name. Or is it some magic channel meta?
[11:17:52] dminuoso: elomatreb: That's a bummer. In particular because S-expressions give LISP a special property called homoiconicity.
[11:17:58] jenrzzz: has joined #ruby
[11:18:41] dminuoso: elomatreb: Do they have self-modifying programs on your class schedule at any point?
[11:19:21] ddffg: has joined #ruby
[11:19:57] elomatreb: I have a module next semester titled "Advanced Practical Programming" that is supposed be about functional languages, maybe they'll touch on such topics in there. Mostly just basics/framework so far
[11:20:19] elomatreb: I.e. first semester was learning how a CPU works, second how an OS works, etc
[11:20:52] sid_fules: has joined #ruby
[11:27:57] Pumukel: has joined #ruby
[11:33:30] Pumukel: has joined #ruby
[11:34:01] Jameser: has joined #ruby
[11:34:38] hotpancakes: has joined #ruby
[11:35:06] oetjenj: has joined #ruby
[11:37:36] DoubleMalt: has joined #ruby
[11:40:01] dionysus69: has joined #ruby
[11:45:06] Pumukel: has joined #ruby
[11:47:43] hotpancakes: has joined #ruby
[11:50:31] Pumukel: has joined #ruby
[11:50:31] JeanCarloMachado: has joined #ruby
[11:53:22] milardovich: has joined #ruby
[11:56:13] Pumukel: has joined #ruby
[12:01:41] Pumukel: has joined #ruby
[12:03:34] pawnbox: has joined #ruby
[12:03:37] ddffg: has joined #ruby
[12:03:37] rolls: has joined #ruby
[12:03:55] esObe_: has joined #ruby
[12:05:28] hotpancakes: has joined #ruby
[12:05:35] pawnbox: has joined #ruby
[12:06:00] conta: has joined #ruby
[12:06:00] Jackneill: has joined #ruby
[12:06:57] Pumukel: has joined #ruby
[12:07:24] Qchmqs: has joined #ruby
[12:10:01] nettoweb: has joined #ruby
[12:12:07] pawnbox: has joined #ruby
[12:12:31] millerti: has joined #ruby
[12:12:38] Pumukel: has joined #ruby
[12:13:43] spicerack: has joined #ruby
[12:13:57] nowhere_man: has joined #ruby
[12:15:08] jenrzzz: has joined #ruby
[12:15:08] jenrzzz: has joined #ruby
[12:19:28] petrichorx_: has joined #ruby
[12:19:44] raul782: has joined #ruby
[12:22:41] sid_fules: has joined #ruby
[12:28:27] patarr: has joined #ruby
[12:29:24] milardovich: has joined #ruby
[12:35:05] Pumukel: has joined #ruby
[12:37:52] bg: has joined #ruby
[12:39:19] ruid: has joined #ruby
[12:39:19] ruid: has joined #ruby
[12:42:44] hotpancakes: has joined #ruby
[12:44:21] schickung: has joined #ruby
[12:45:28] Pumukel: has joined #ruby
[12:45:53] Guest24: has joined #ruby
[12:47:44] Jameser: has joined #ruby
[12:49:30] pawnbox: has joined #ruby
[12:49:38] griffindy: has joined #ruby
[12:50:40] Pumukel: has joined #ruby
[12:50:59] brent__: has joined #ruby
[12:56:07] Pumukel: has joined #ruby
[12:56:52] Jameser: has joined #ruby
[12:57:22] hfp_work: has joined #ruby
[13:03:01] kotk: has joined #ruby
[13:06:56] milardovich: has joined #ruby
[13:09:31] User458764: has joined #ruby
[13:10:23] Jameser: has joined #ruby
[13:10:49] cibs: has joined #ruby
[13:12:11] jenrzzz: has joined #ruby
[13:12:11] jenrzzz: has joined #ruby
[13:12:28] User458764: Hi, i would like to generate a 16 chars random string containing (A..Z )or (1..9) ?
[13:12:53] Pumukel: has joined #ruby
[13:13:30] User458764: How could I do that knowin the use case is for namin folders
[13:13:50] matthewd: User458764: What do you have so far?
[13:14:50] User458764: matthewd several ways to achieve this but too far complex IMO
[13:15:18] pawnbox: has joined #ruby
[13:17:04] User458764: I can do this with Array#sample method but I thought at a more low level way
[13:17:41] bmurt: has joined #ruby
[13:19:19] nettoweb: has joined #ruby
[13:20:14] matthewd: There's SecureRandom.hex, which could simplify your implementation at the cost of losing most of the alphabet
[13:20:19] pilne: has joined #ruby
[13:20:53] matthewd: rand(36).to_s(36) comes to mind too
[13:23:25] nettoweb: has joined #ruby
[13:25:09] User458764: (0...8).map { (49 + rand(52)).chr }.join does this valid the ASCII 8bits alphabet?
[13:26:29] matthewd: >> (0...8).map { (49 + rand(52)).chr }.join
[13:26:30] ruby[bot]: matthewd: # => "R958A?RO" (https://eval.in/752916)
[13:28:57] Pumukel: has joined #ruby
[13:30:03] elomatreb: You can use 8.times instead of the range, feels cleaner imo
[13:32:56] User458764: elomatreb yes thanks for the notice
[13:33:44] apeiros: `Array.new(8) {` >> `(0...8).map {` IMO
[13:34:19] pawnbox: has joined #ruby
[13:34:21] Pumukel: has joined #ruby
[13:34:49] sid_fules: has joined #ruby
[13:37:20] matthewd: User458764: If it wasn't clear from ruby[bot]'s output, the answer to your question was "no".
[13:39:58] Pumukel: has joined #ruby
[13:40:33] Jameser: has joined #ruby
[13:40:46] ruid: has joined #ruby
[13:40:50] ruid: has joined #ruby
[13:40:53] ddffg: >> [*('A'..'Z'),*('0'..'9')].shuffle[0,8].join
[13:43:55] milardovich: has joined #ruby
[13:45:27] hfp_work: has joined #ruby
[13:45:37] Pumukel: has joined #ruby
[13:47:03] canton7: ddffg, that only gives you 1 of each letter
[13:51:20] Pumukel: has joined #ruby
[13:52:05] milardovich: has joined #ruby
[13:54:02] AngryNorseMn: has joined #ruby
[13:54:55] ddffg: canton7, for folder names is better to have distinct letters
[13:55:26] canton7: on what basis?
[13:55:47] ddffg: more stable
[13:56:15] canton7: "stable"? Do your folders often fall ove?
[13:56:39] Jameser: has joined #ruby
[13:58:58] bg: has joined #ruby
[14:00:30] Derperperd: has joined #ruby
[14:01:52] lightheaded: has joined #ruby
[14:02:53] matju: has joined #ruby
[14:03:07] Arpanet69: has joined #ruby
[14:05:07] millerti: has joined #ruby
[14:06:34] jhack: has joined #ruby
[14:06:50] matthewd: If the names are going to be seen anywhere (so not just local tempfiles -- and if they are, maybe you should be using Tempfile), there are other potential concerns with giving it the full alphabet to play with
[14:07:49] Pumukel: has joined #ruby
[14:07:59] conta: has joined #ruby
[14:09:29] jenrzzz: has joined #ruby
[14:09:29] jenrzzz: has joined #ruby
[14:12:05] shinnya: has joined #ruby
[14:13:21] Pumukel: has joined #ruby
[14:17:58] raul782: has joined #ruby
[14:18:48] Pumukel: has joined #ruby
[14:18:59] psychicist__: has joined #ruby
[14:24:10] sid_fules: has joined #ruby
[14:24:42] matthewd: has joined #ruby
[14:24:42] Pumukel: has joined #ruby
[14:26:55] Blaguvest: has joined #ruby
[14:29:48] aesthetikx: has joined #ruby
[14:29:51] JoshS: has joined #ruby
[14:30:21] Pumukel: has joined #ruby
[14:32:04] millerti: has joined #ruby
[14:34:25] ss_much: has joined #ruby
[14:34:49] User458764: has joined #ruby
[14:38:30] cdg: has joined #ruby
[14:39:04] slackR: has joined #ruby
[14:39:33] bkxd: has joined #ruby
[14:40:41] schickung_: has joined #ruby
[14:43:21] bg: has joined #ruby
[14:44:41] bg: ruby folks
[14:45:15] bg: why would you use #zero? instead of == 0?
[14:46:48] Pumukel: has joined #ruby
[14:46:52] apeiros: mostly a matter of style, whether you consider it to express intent more clearly
[14:47:48] millerti: has joined #ruby
[14:48:22] Jameser: has joined #ruby
[14:48:23] hotpancakes: has joined #ruby
[14:51:53] Pumukel: has joined #ruby
[14:52:03] teddysmoker: has joined #ruby
[14:52:18] jeffreylevesque: has joined #ruby
[14:52:33] jeffreylevesque: one of my first ruby scripts - https://bpaste.net/show/62df0075b9a7
[14:52:48] jeffreylevesque: is that array implementation ok?
[14:52:58] milardovich: has joined #ruby
[14:53:38] canton7: jeffreylevesque, 1) use File.join on line 7, 2) use `servers.map` instead of creating an array and when adding to it in that `each`
[14:55:57] bg: another question for you folks (i asked this last night but i fell asleep so i apologize if it was answered) -- what don't TrueClass and FalseClass have #to_i so i can get 1 or 0 from a boolean?
[14:56:06] bg: why don't*
[14:56:23] jeffreylevesque: changed it with your recommendations - https://bpaste.net/show/d95367a0e1d8
[14:56:53] bg: you didn't use File.join where canton7 said you should have
[14:56:56] matthewd: bg: I claimed that 1 isn't necessarily the only reasonable answer for true.to_i
[14:57:07] slackR: jeffreylevesque, no need to push, you'll get back the array
[14:57:09] bg: and you missed the point of map
[14:57:39] User458764: has joined #ruby
[14:57:46] bg: matthewd: certainly the most generally useful one. and it's better than not having #to_i at all
[14:57:46] matthewd: bg: But I think the fact `? 1 : 0` is basically the same length as `.to_i` would be a factor too
[14:58:22] matthewd: I can't think of many occasions where I've needed such a thing
[14:58:26] bougyman: bg: [4] pry(main)> true.to_i
[14:58:27] A124: has joined #ruby
[14:58:29] slackR: jeffreylevesque, https://ruby-doc.org/core-2.2.0/Array.html#method-i-map.
[14:58:37] bg: bougyman: what!!
[14:58:38] matthewd: .. and those I can think of have all involved golfing
[14:58:46] bougyman: (because I did ) [3] pry(main)> class TrueClass; def to_i; 1; end; end
[14:58:51] bougyman: if you want it, do it.
[14:59:00] bougyman: ruby doesn't stop you, even when you want to do foolish shit like that.
[14:59:01] jeffreylevesque: slackR: so just `YAML.load_file("#{current_dir}/hiera/nodes/#{server}.mongodb.com.yaml"` in the map?
[14:59:10] jeffreylevesque: am i referencing the yaml correctly?
[14:59:12] bg: bougyman: how is it foolish?
[14:59:23] bougyman: bg: because you already have a real boolean.
[14:59:27] bougyman: and you're turning it into a fake one.
[14:59:30] bougyman: which is foolish.
[14:59:35] bg: it's not a fake boolean. it's an integer.
[14:59:42] bg: i want to do arithmetic with it.
[14:59:45] bougyman: ok, what's the use case for it?
[15:00:05] bougyman: if you want to do arithmetic why not just use 1 and 0 ?
[15:00:17] jgnagy: has joined #ruby
[15:00:19] matthewd: That sounds like a plan for obfuscating what should be a clearer ?: further up the expression
[15:00:27] slackR: jeffreylevesque, ye, will do.
[15:01:11] bougyman: jeffreylevesque: you should use #join for your paths.
[15:01:25] bg: bougyman: that doesn't make any sense
[15:01:40] matthewd: bg: Do you have an actual example we can talk about?
[15:01:44] quaristice: has joined #ruby
[15:01:49] bg: i've got this boolean from somewhere else, where it *does* make sense as a boolean. then i want to get an integer i can do arithmetic with.
[15:02:05] bg: matthewd: yes, i did have one. i'm trying to remember what it was. i'm looking for it now.
[15:02:12] jeffreylevesque: bougyman: do i replace something by implementing `join`?
[15:02:19] matthewd: "do arithmetic with" == "multiply it by a number"?
[15:03:00] matthewd: `bool.to_i * 7 + 3` vs `bool ? 10 : 3`, I know which I prefer
[15:04:03] bougyman: jeffreylevesque: wut?
[15:04:04] bougyman: [11] pry(main)> Pathname(current_dir).join('hiera', 'nodes', "#{server}.mongodb.com.yaml")
[15:04:08] bougyman: => #<Pathname:/here/hiera/nodes/theserver.mongodb.com.yaml>
[15:04:10] bg: matthewd: note that you can't simplify it like that if you don't know the number. what if it's a complex expression?
[15:04:20] bougyman: course you can just use File.join without requiring pathname.
[15:04:33] bougyman: I'm just a pathname fanatic since I was a common-lisper.
[15:04:46] matthewd: I generally wouldn't bother with File.join, fwiw
[15:04:51] bg: `bool.to_i * f(a[b], c) + 3` vs. `bool ? f(a[b], c) + 3 : 3`
[15:05:06] adam12: Is there a definitive guide to Ruby path handlng
[15:05:13] DLSteve: has joined #ruby
[15:05:23] adam12: I've been doing this a long time and I still can never remember expand_path, join, etc use cases.
[15:05:34] matthewd: `(bool ? f(..) : 0) + 3` ¯\_(ツ)_/¯
[15:06:06] matthewd: bg: I'd still argue you're hiding a conditional inside a multiplication, which feels... C-ish
[15:07:06] bg: it feels "C-ish" and that makes it bad?
[15:07:32] slackR: bougyman, would it be bad? if he used heira instead of current directory, as he's using it at multiple places.
[15:07:34] matthewd: Insofar as that implies it's unrubyish, yes
[15:07:43] bg: why can't it be both?
[15:07:44] Pumukel: has joined #ruby
[15:08:03] slackR: bg, because we are nice and we are not into language wars.
[15:08:03] matthewd: If it were, I wouldn't be describing it as C-ish
[15:08:22] eclecticjohny: has joined #ruby
[15:08:38] matthewd: `a * b` isn't both C-ish and ruby-ish, it.. just is.
[15:09:57] bg: i don't consider it "hiding" a conditional
[15:10:59] bg: actually i think it's the best way of expressing it, because it's strictly less powerful than general purpose branching structures like `?:` or `if`.
[15:11:05] alan_w: has joined #ruby
[15:11:36] bg: if you can express your branching with a multiplication, it says something about your program
[15:12:00] bougyman: It says: Screw the next guy who has to maintain this.
[15:12:29] matthewd: bg: This is the problem with "why" questions.
[15:13:25] bg: bougyman: no it doesn't.
[15:13:30] matthewd: bg: I can tell you why I, as a rubyist, would find that method to be odd... as a best-attempt approximation of why some other people might have chosen for it to not exist
[15:13:39] Pumukel: has joined #ruby
[15:14:23] matthewd: bg: But you trying to counter-argue that I'm wrong doesn't get us anywhere. Even if you managed to convince me, the best possible scenario is I agree with you the method should exist, while it continues to not be there.
[15:15:14] sid_fules: has joined #ruby
[15:15:27] hotpancakes: has joined #ruby
[15:16:03] bg: well the reason i asked is in case there were a really good reason that i hadn't considered
[15:16:10] nettoweb: has joined #ruby
[15:18:12] matthewd: Setting aside what such a "really good reason" could possibly look like... how would that help anyway?
[15:18:26] bg: i'd learn something
[15:18:59] Pumukel: has joined #ruby
[15:19:29] naprimer_3: has joined #ruby
[15:20:17] slackR: bg, maybe you might be interested to look in here(if you haven't already -> https://bugs.ruby-lang.org/issues/7978)
[15:20:32] User458764: has joined #ruby
[15:21:33] Psy-Q: has joined #ruby
[15:22:44] joelwallis: has joined #ruby
[15:24:27] Pumukel: has joined #ruby
[15:24:55] nettoweb: has joined #ruby
[15:25:20] muelleme: has joined #ruby
[15:28:31] nettoweb: has joined #ruby
[15:36:37] _aeris_: has joined #ruby
[15:39:50] nettoweb: has joined #ruby
[15:40:30] Bounga: has joined #ruby
[15:41:12] bg: slackR: wow i lost respect for Matz reading that
[15:42:12] matthewd: Were you expecting him to agree with you? :/
[15:42:38] hotpancakes: has joined #ruby
[15:42:39] bg: no, but his argument makes no sense
[15:42:50] slackR: bg, was just pointing the inconsistencies
[15:43:39] bg: i feel like if _Bool were not an integer type in C, he'd be more open to the idea of #to_i on booleans. which doesn't really make sense. it seems like he just wants to distance ruby from C rather than making it the best it can be.
[15:44:19] psychicist__: has joined #ruby
[15:45:25] canton7: in C, 0 is falsy. In ruby, 0 is truthy
[15:45:27] canton7: I agree with him
[15:45:42] raul782: has joined #ruby
[15:45:55] slackR: canton7, nil is falsy, nil.to_i is truthy isn't that funny?
[15:46:30] canton7: yeah, I'm not sure I agree with nil.to_i either :P
[15:46:38] quaristice: has joined #ruby
[15:49:19] matthewd: bg: It's not an argument, it's an explanation. The argument presented was "1 and 0 are fairly common numeric values for false and true [in other, e.g. C-like, languages]". Matz explained why that argument was not persuasive to him.
[15:51:34] milardovich: has joined #ruby
[15:52:08] GodFather: has joined #ruby
[15:53:06] hutch34: has joined #ruby
[15:55:58] szulak: has joined #ruby
[15:57:16] hotpancakes: has joined #ruby
[15:58:14] quaristice: has joined #ruby
[16:00:28] fold4: has joined #ruby
[16:03:39] jenrzzz: has joined #ruby
[16:05:45] oetjenj: has joined #ruby
[16:05:55] sid_fules: has joined #ruby
[16:06:12] hotpancakes: has joined #ruby
[16:07:21] MasterRex: has joined #ruby
[16:07:25] Pumukel: has joined #ruby
[16:08:08] matthewd: has joined #ruby
[16:08:57] psychici1t__: has joined #ruby
[16:09:31] Bounga: has joined #ruby
[16:11:47] mula: has joined #ruby
[16:13:10] Pumukel: has joined #ruby
[16:13:28] Fernando-Basso: has joined #ruby
[16:16:51] hotpancakes: has joined #ruby
[16:18:17] renchan: has joined #ruby
[16:18:36] Pumukel: has joined #ruby
[16:19:52] Qommand0r: has joined #ruby
[16:21:56] bmurt: has joined #ruby
[16:23:08] conta: has joined #ruby
[16:23:36] doublemalt_: has joined #ruby
[16:24:35] SCHAAP137: has joined #ruby
[16:25:51] dar123: has joined #ruby
[16:26:27] Bounga: has joined #ruby
[16:27:00] mgorbach: has joined #ruby
[16:27:14] hotpancakes: has joined #ruby
[16:28:25] govg: has joined #ruby
[16:30:35] dcluna: has joined #ruby
[16:30:44] _joes__: has joined #ruby
[16:33:55] _joes___: has joined #ruby
[16:37:30] hutch34: has joined #ruby
[16:38:03] morfin: dminuoso, i know everything is an object )
[16:38:28] leitz: has joined #ruby
[16:38:48] leitz: Do you have to have Ruby on a machine to compile Ruby?
[16:39:04] havenwood: leitz: Nope.
[16:39:06] morfin: and i like this more than PHP principle - something is scalar, something is an object
[16:39:20] allisio: morfin: Almost everything.
[16:39:56] Pumukel: has joined #ruby
[16:40:01] leitz: havenwood, thanks! Watching the make messages scroll by...
[16:40:51] hotpancakes: has joined #ruby
[16:41:19] leitz: Well, seeing lots of errors, too.
[16:44:12] szulak: has joined #ruby
[16:44:15] Bounga: has joined #ruby
[16:45:52] JoeSa: has joined #ruby
[16:47:30] pawnbox: has joined #ruby
[16:47:42] eclecticjohny: has joined #ruby
[16:47:59] cibs: has joined #ruby
[16:49:56] User458764: has joined #ruby
[16:53:12] ramfjord: has joined #ruby
[16:55:49] hotpancakes: has joined #ruby
[16:59:35] matthewd: There are plenty of things that aren't objects, if you get sufficiently pedantic. But everything you can store in a variable is an object.
[17:00:47] jenrzzz: has joined #ruby
[17:00:47] jenrzzz: has joined #ruby
[17:01:17] allisio: Is inheritance an object?
[17:01:39] Pumukel: has joined #ruby
[17:01:43] matthewd: Can you store it in a variable?
[17:02:00] sepp2k: has joined #ruby
[17:02:51] allisio: I think so?
[17:04:25] hotpancakes: has joined #ruby
[17:04:46] bg: allisio: are you joking?
[17:04:56] allisio: bg: How do you mean?
[17:05:13] bg: how can you store inheritance in a variable
[17:05:15] workmad3: has joined #ruby
[17:05:18] matthewd: Inheritance is a concept.. I don't know how you'd put it in a variable, or even what that means
[17:06:09] bg: inheritance = Integer.ancestors; ^___^
[17:06:22] allisio: I can do better than that.
[17:06:44] jackjackdripper: has joined #ruby
[17:06:45] matthewd: I was targeting the "blocks aren't objects" argument, but apparently we're getting all metaphysical up in here :P
[17:07:26] Pumukel: has joined #ruby
[17:07:44] muelleme: has joined #ruby
[17:08:08] djbkd: has joined #ruby
[17:10:23] allisio: Does this count as "storing inheritance in a variable"? https://eval.in/752955
[17:10:26] psychicist__: has joined #ruby
[17:11:39] matthewd: Only if `a = 1 + 2` means we're storing addition in a variable (and that's not an object either!)
[17:11:42] hotpancakes: has joined #ruby
[17:12:41] aesthetikx: has joined #ruby
[17:12:47] Pumukel: has joined #ruby
[17:13:36] vict83: has joined #ruby
[17:17:51] Rutix: has joined #ruby
[17:17:51] Rutix: has joined #ruby
[17:20:31] User458764: has joined #ruby
[17:21:13] BTRE: has joined #ruby
[17:21:44] morfin: blocks are weird things
[17:23:35] allisio: How's that?
[17:24:47] sid_fules: has joined #ruby
[17:24:58] dviola: has joined #ruby
[17:25:35] xenops: has joined #ruby
[17:25:55] eclecticjohny: has joined #ruby
[17:26:59] bg: allisio: they are funny things
[17:27:00] Bounga: has joined #ruby
[17:27:27] Hanmac: has joined #ruby
[17:27:33] allisio: They're closures; that's hardly an otherworldly notion.
[17:27:43] bg: not just closures
[17:27:50] bg: >> [1, 2, 3].map { break 42 }
[17:27:51] ruby[bot]: bg: # => 42 (https://eval.in/752956)
[17:27:52] sagax: has joined #ruby
[17:28:13] bg: like what. i put 'break' in my block and it causes some kind of non-local return?
[17:28:38] twistedpixels_: has joined #ruby
[17:29:07] morfin: wait a second
[17:29:15] allisio: >> [1, 2, 3].map &-> x { break 42 }
[17:29:16] ruby[bot]: allisio: # => [42, 42, 42] (https://eval.in/752957)
[17:29:16] morfin: but they do capture scope
[17:29:19] allisio: Just sayin'.
[17:29:26] morfin: right? i forgot
[17:29:26] Pumukel: has joined #ruby
[17:29:51] allisio: They do have an "environment" but, as bg pointed out, they also interact with the rest of Ruby in characteristically stateful ways.
[17:31:17] mula: has joined #ruby
[17:31:41] BTRE: has joined #ruby
[17:31:49] psychici1t__: has joined #ruby
[17:32:20] JoeSa: has joined #ruby
[17:32:47] noan: dear santa: for christmas I want to know if the topleft pixel in rmagic is 0, 0, or 1, 1
[17:33:51] montanonic: has joined #ruby
[17:34:02] DARPA: has joined #ruby
[17:34:20] JoeSa: has joined #ruby
[17:34:57] Xiti: has joined #ruby
[17:35:35] hongkongphooy: has joined #ruby
[17:35:43] enterprisey: has joined #ruby
[17:41:24] rkazak_: has joined #ruby
[17:41:57] cfec0b8d: has joined #ruby
[17:42:32] twistedpixels_: has joined #ruby
[17:42:36] _joes__: has joined #ruby
[17:43:54] rkazak_: has joined #ruby
[17:45:56] bougyman: has joined #ruby
[17:45:56] bougyman: has joined #ruby
[17:48:47] sparr: when I raise an exception inside a block being passed to a function, the outermost layer of my backtrace points to the line starting the function call, not the problematic line inside the block. Is there any way to augment that with more useful information?
[17:48:56] tildes_: has joined #ruby
[17:50:16] sparr: sorry, I don't mean that my code intentionally raises an exception. I mean something further down in the call stack from my block raises it.
[17:50:52] aesthetikx: I find myself doing array_of_hashes.map { |h| h['name'] } like 100 times a day, is there any syntax sugar I am unaware of to shorten this, like .map(&:[], 'name') or similar
[17:51:01] gk-: has joined #ruby
[17:51:25] aesthetikx: til array_of_hashes.pluck('name'), nvm :)
[17:54:20] gk-: has joined #ruby
[17:57:47] jenrzzz: has joined #ruby
[17:58:03] matthewd: sparr: Got an example? The backtrace should point to the actual line that's at fault, unless something's choosing to mangle it.
[17:58:42] t-recx: has joined #ruby
[17:59:00] gk-: has joined #ruby
[17:59:21] matthewd: aesthetikx: pluck is a Rails-ism, but yeah, a handy one
[17:59:54] sparr: matthewd: https://boardgamegeek.com/article/25316300#25316300
[18:00:09] sparr: unfortunately I don't have the exact code that person is running, but I generally know what it looks like
[18:00:10] ujjain: has joined #ruby
[18:00:11] ujjain: has joined #ruby
[18:00:53] Arpanet69: has joined #ruby
[18:01:20] sparr: it should look something like this: https://gist.github.com/andymeneely/d2bb2eb028b27cf1dace#file-_part2_01_factions-rb
[18:02:04] matthewd: The error is on https://github.com/andymeneely/squib/blob/master/lib/squib/layout_parser.rb#L84 .. seems right to me
[18:02:23] sparr: I don't I have encountered this behavior myself as well, but don't have a test case handy. What's ahppening is that some library code is raising an exception somewhere inside the code block attached to Decknew(), and then the backtrace just calls out the deck.new() call instead of the line inside the block where the problem was.
[18:02:51] matthewd: So, the problem is the DSL implementation
[18:03:02] sparr: right, but what line inside Deck.new() leads to the call to the call to the call to the call to layout_parser.rb?
[18:03:04] matthewd: The line that's *causing* the problem is one of the lines inside the DSL
[18:03:18] matthewd: But the exception isn't occurring while that line is running
[18:03:51] sparr: let me make a test case to ask my question better
[18:03:53] joelwallis: has joined #ruby
[18:05:35] gk-: has joined #ruby
[18:07:02] baweaver: dminuoso / matthewd: I am not me without coffee in the mornings. *curses 5AM wakeup*
[18:07:27] Pumukel: has joined #ruby
[18:07:56] matthewd: ACTION looks at the clock
[18:08:37] muelleme: has joined #ruby
[18:08:59] baweaver: was replying to message from a while back
[18:09:02] sparr: damn, I can't reproduce it in a trivial test case
[18:09:35] sparr: https://gist.github.com/sparr/00faa4feb3fd443b90cd05b6e35af3b5 was my test case attempt, but in this situation the information I want is present, the trace DOES mention line 11.
[18:09:57] sparr: next time I encounter a trace that doesn't have that information, I'll try to reduce it to a test case
[18:10:14] matthewd: sparr: That's what I'm saying, though
[18:10:54] sparr: I keep encountering traces where only line 9 gets mentioned, not line 11 (relatively speaking)
[18:10:59] joelwallis: has joined #ruby
[18:11:37] matthewd: sparr: https://gist.github.com/matthewd/d95d14e67edb06498a8c130934a747c8
[18:11:49] sid_fules: has joined #ruby
[18:12:38] matthewd: sparr: That's what the squib example boils down to
[18:12:57] sparr: I'll be back with a better example
[18:12:59] matthewd: sparr: The exception points at line 3 (inside the library) then line 9 in the app code
[18:13:07] Pumukel: has joined #ruby
[18:13:15] matthewd: sparr: The line at *fault* is line 7, but it can't know that
[18:14:14] User458764: has joined #ruby
[18:14:19] psychicist__: has joined #ruby
[18:14:23] pawnbox: has joined #ruby
[18:16:55] joelwallis: has joined #ruby
[18:18:21] szulak: has joined #ruby
[18:19:41] conta: has joined #ruby
[18:21:09] MasterRex: has joined #ruby
[18:22:13] gk-: has joined #ruby
[18:22:52] Silthias: has joined #ruby
[18:22:54] jhack: has joined #ruby
[18:24:32] sid_fules: has joined #ruby
[18:24:41] Pumukel: has joined #ruby
[18:27:45] Bounga: has joined #ruby
[18:28:36] vuoto: has joined #ruby
[18:30:25] Pumukel: has joined #ruby
[18:30:52] bestel: has joined #ruby
[18:31:44] sid_fules: has joined #ruby
[18:35:49] bg: hi bestel
[18:36:11] Pumukel: has joined #ruby
[18:37:42] bg: bestel: how are you today
[18:37:45] bg: hi jamesaxl
[18:37:58] bestel: NIce, u?)
[18:37:59] hotpancakes: has joined #ruby
[18:38:29] muelleme: has joined #ruby
[18:38:29] bg: how are you jamesaxl
[18:40:25] irc2000: has joined #ruby
[18:40:27] irc2000: Am I racist if I only have bad experience of black people where I've met 10 of them ever and 10 of them were serial killers? Does that make me a racist?
[18:40:40] ujjain: has joined #ruby
[18:41:14] pawnbox: has joined #ruby
[18:41:50] bg: how could that possibly make you a racist
[18:41:57] Pumukel: has joined #ruby
[18:42:12] bg: your scenario didn't include any of your thoughts or actions
[18:42:32] bg: racists are characterized by their behavior and their beliefs
[18:42:35] ujjain: has joined #ruby
[18:42:42] bg: simply having something happen to you can't make you a racist
[18:42:49] bestel: bg: I'm newbie in ruby. How record a result every time a cycle is traversed?
[18:43:04] irc2000: bg: well, I beleive that 10 of those BLACK PEOPLE were serial killers (which has been proven). Am I a racist then?
[18:43:21] bg: if you hate black people because 100% of the black people you've met are serial killers, does that make you racist? that's a more interesting question
[18:43:49] bg: irc2000: are you a racist for believing something that has been proven? hardly
[18:44:08] bg: bestel: what is a cycle?
[18:44:44] ChanServ: +o matthewd
[18:45:02] irc2000: bg: well, matthewd seems to think that I'm racist
[18:45:08] irc2000: bg: he'll ban me for racism
[18:45:12] bg: well you're off-topic, that's for sure
[18:45:41] bg: bestel: what does it mean to record a result?
[18:45:45] irc2000: bg: if I was talking about how great is particular choice of religion is instead, he wouldn't ban me
[18:46:08] User458764: has joined #ruby
[18:46:39] irc2000: I am black and you matthewd is a racist for banning me.
[18:47:49] irc2000: has left #ruby: (requested by matthewd (irc2000))
[18:47:53] matthewd: +b *!*@gateway/tor-sasl/*
[18:47:54] ruby[bot]: -b+b *!*@gateway/tor-sasl/* *!*@gateway/tor-sasl/*$#ruby-banned
[18:48:13] tildes__: has joined #ruby
[18:48:22] raul782: has joined #ruby
[18:50:56] psychicist__: has joined #ruby
[18:52:30] nadir: has joined #ruby
[18:53:34] griffindy: has joined #ruby
[18:55:03] jenrzzz: has joined #ruby
[18:55:03] jenrzzz: has joined #ruby
[18:56:33] psychicist__: has joined #ruby
[18:57:13] sparr: are there ruby libraries that can manipulate SVG files to the depth of being able to split a <path> or <polyline> in half?
[18:57:17] mula: has joined #ruby
[18:57:19] Channel6: has joined #ruby
[18:57:27] houhoulis: has joined #ruby
[18:58:43] Pumukel: has joined #ruby
[18:59:22] jhack_: has joined #ruby
[19:00:13] bestel: bg: an array changes in my loop 3 times, [1,2,3], [2,1,3], [2,3,1]. How can I add this array in other array in every iteration?? result << [1,2,3], result << [2,1,3], result << [2,3,1]
[19:00:32] jhack: has joined #ruby
[19:01:16] szulak: has joined #ruby
[19:02:31] nightfog: has joined #ruby
[19:02:52] bg: bestel: it sounds like you already know how...
[19:03:01] bg: result << a every time a changes
[19:03:16] allisio: bestel: There's probably a much better way to do what you're trying to do.
[19:03:39] bg: looks like some kind of next_permutation algorithm
[19:04:10] Pumukel: has joined #ruby
[19:04:28] millerti: has joined #ruby
[19:04:50] bestel: bg: I know .permutation method, but need to do it without it(
[19:09:46] bestel: bg: https://repl.it/GRLn
[19:09:56] Pumukel: has joined #ruby
[19:11:02] matthewd: > need to do it without it
[19:11:06] matthewd: Is this homework?
[19:11:48] bestel: matthewd: no :)
[19:11:48] matthewd: -b *!*@gateway/tor-sasl/*$#ruby-banned
[19:11:55] ChanServ: -o matthewd
[19:12:12] bg: bestel: result << arr.clone
[19:13:47] bestel: bg: Thank you so much !!!!
[19:15:13] bestel: bg: I'm learning loops and algos and want to write own method like .permutation
[19:15:25] Pumukel: has joined #ruby
[19:15:34] bg: ok -- but you know that's not equivalent to generating permutations, right?
[19:15:34] bestel: bg: cheers;)
[19:16:29] bestel: bg: of course
[19:17:32] cfec0b8d: has joined #ruby
[19:17:39] bestel: I like the open and friendly ruby community
[19:18:04] bg: i love this community too
[19:18:33] bg: i'm new to ruby but with the help of these lovely people i am improving
[19:18:36] ResidentBiscuit: has joined #ruby
[19:19:53] sid_fules: has joined #ruby
[19:20:17] nightfog: has joined #ruby
[19:23:18] JeanCarloMachado: has joined #ruby
[19:23:21] enterprisey: has joined #ruby
[19:24:11] bestel: bg: I'm with ruby 5 month only, thanks for the mentoring
[19:25:41] zeroDi: has joined #ruby
[19:27:15] ResidentBiscuit: has joined #ruby
[19:28:36] Bounga: has joined #ruby
[19:32:06] rippa: has joined #ruby
[19:32:09] Pumukel: has joined #ruby
[19:32:18] eclecticjohny: has joined #ruby
[19:33:30] Guest9: has joined #ruby
[19:34:39] Guest32509: has joined #ruby
[19:37:57] Pumukel: has joined #ruby
[19:38:37] hotpancakes: has joined #ruby
[19:39:19] mr_rich101: has joined #ruby
[19:43:50] Pumukel: has joined #ruby
[19:45:43] alan_w: has joined #ruby
[19:49:53] Derperperd: has joined #ruby
[19:50:55] Mon_Ouie: has joined #ruby
[19:52:07] jenrzzz: has joined #ruby
[19:52:42] ozcanesen: has joined #ruby
[19:54:32] aesthetikx: has joined #ruby
[19:55:08] Pumukel: has joined #ruby
[19:57:01] mjolnird: has joined #ruby
[19:57:49] jenrzzz: has joined #ruby
[19:57:49] jenrzzz: has joined #ruby
[20:00:58] Pumukel: has joined #ruby
[20:03:44] leitz: Since the actual code has /usr/bin/env ruby, why does this file use /usr/bin/ruby?
[20:03:47] leitz: https://github.com/LeamHall/CT_Character_Generator/blob/master/toys/Chargen#L1
[20:04:49] matthewd: leitz: The better question would be: how did that file end up there? :/
[20:04:51] leitz: More to the point, how do I fix the gem to make it work properly.
[20:05:06] tomphp: has joined #ruby
[20:05:32] leitz: matthewd, I dunno. I copied it from /usr/bin/Chargen to toys to push it up to github. I'm new to gems, so it's probably operator error. Just not sure how to fix it.
[20:06:07] leitz: When I did the original install there was a /usr/bin/ruby. Now there's not. Does the gem install chose the first Ruby in the path?
[20:06:33] leitz: Wait, scratch that; i removed the old ruby before the gem install this time.
[20:06:45] Pumukel: has joined #ruby
[20:07:07] workmad3: has joined #ruby
[20:07:26] matthewd: gem install will use the ruby it's running under
[20:07:43] matthewd: But you shouldn't be committing that file. It will, as you saw, get generated when the gem is installed.
[20:08:14] ResidentBiscuit: has joined #ruby
[20:09:23] m_31: has joined #ruby
[20:10:34] leitz: Well, maybe it's supposed to... I removed old ruby versions and then installed the gem. The /usr/bin/Chargen may have been left over, but I removed it and removed the gem and reinstalled. /usr/bin/Chargen was not put back in place.
[20:12:32] Pumukel: has joined #ruby
[20:12:57] matthewd: It'll be put in the appropriate place depending on how rubygems is configured
[20:13:22] matthewd: Point is, it's generated on install. It even has a comment describing that fact.
[20:13:45] sid_fules: has joined #ruby
[20:14:09] ResidentBiscuit: has joined #ruby
[20:15:27] leitz: I can edit the file and put it in place and things work.
[20:16:32] leitz: So the first hurdle is making sure the gem puts the file in place. Have a pointer to a tutorial on that?
[20:17:10] matthewd: `gem env` should tell you where it'll put it
[20:18:04] nofxx: has joined #ruby
[20:18:27] Pumukel: has joined #ruby
[20:18:54] leitz: Okay, cool. That's /usr/local/bin, and the Chargen is there. However, it's again using the hard coded ruby path.
[20:18:59] leitz: Is there a way to fix that?
[20:19:11] matthewd: It's working correctly
[20:19:14] matthewd: There's nothing to fix
[20:19:38] leitz: It's hard coding a path, no way to make it use "/usr/bin/env ruby"?
[20:19:52] matthewd: I'm not sure how else I can say it
[20:20:02] matthewd: It is doing the right thing. There is not a way for you to break it.
[20:20:33] leitz: It is doing the expected thing. However, if someone wants to be able to use different ruby versions it is broken.
[20:20:35] esObe_: has joined #ruby
[20:22:24] andrevan: Try rvm or rbenv
[20:23:09] matthewd: If someone is using a ruby version switcher, they'll be managing their bin directories appropriately
[20:23:32] leitz: http://stackoverflow.com/questions/11495893/when-why-to-use-env-shebang-with-ruby-gems
[20:23:45] Arpanet69: Go up a notch and youre ready for a gang-!
[20:23:58] Arpanet69: owh wrong channel
[20:24:09] Pumukel: has joined #ruby
[20:24:26] allisio: That'll be three Hail Marys.
[20:25:32] leitz: Ah, so use the E install option. That solves my problem.
[20:26:09] quaristice: has joined #ruby
[20:26:31] leitz: Yeah, this can be fun...
[20:26:44] JeanCarloMachado: has joined #ruby
[20:28:12] leitz: On to the next issue...
[20:28:33] havenwood: leitz: `gem install` takes a -E or --env-shebang flag
[20:29:11] leitz: havenwood, yup. Just found that, and I have to admit to some appreciation to the rubygems folks. Nice docs!
[20:29:12] havenwood: leitz: you can set it for all gem commands in your ~/.gemrc: gem: "--env-shebang"
[20:29:21] Bounga: has joined #ruby
[20:29:48] leitz: Ooohh...didn't know that.
[20:30:24] Pumukel: has joined #ruby
[20:32:05] workmad3: has joined #ruby
[20:35:58] Pumukel: has joined #ruby
[20:36:45] elomatreb: has joined #ruby
[20:36:53] psychicist__: has joined #ruby
[20:38:26] zeroDi: has joined #ruby
[20:38:29] sid_fules: has joined #ruby
[20:41:44] bkxd: has joined #ruby
[20:41:46] Pumukel: has joined #ruby
[20:42:38] leitz: Okay, time for my next question. I've been saving them up while trying to do python at work.
[20:42:50] Derperperd: has joined #ruby
[20:43:03] coatezy: has joined #ruby
[20:43:40] leitz: In Ruby 1.8.7 (RHEL 6), this line returns a string. In Ruby 2.4.0 it returns a string that looks like an array.. Even trying to set a new variable fails. https://github.com/LeamHall/CT_Character_Generator/blob/master/lib/Tools/Name.rb#L76
[20:44:30] leitz: Even though it's classed as a string, it looks like: ["Carli"] ["Ray"]
[20:44:46] elomatreb: has joined #ruby
[20:46:09] leitz: This has the same result: new_name = f_name + " " + l_name
[20:47:29] Pumukel: has joined #ruby
[20:48:07] leitz: Tried join but it failed.
[20:48:19] leitz: The string itself includes the brackets and quotes.
[20:49:09] leitz: Is there a better solution than gsub?
[20:51:06] psychicist__: has joined #ruby
[20:52:36] adam12: leitz: I bet it is a string, but your call to `to_s` was somehow mangled by SQLite3, which turned a single element array into a string that looked like a single element array
[20:52:51] adam12: leitz: Tho I don't use SQLite3 directly (normally through Sequel) so I'd say I'm guessing at this.
[20:53:12] d0nn1e: has joined #ruby
[20:53:26] Pumukel: has joined #ruby
[20:54:12] darix: leitz: i am sure those are arrays.
[20:55:01] jenrzzz: has joined #ruby
[20:55:06] leitz: darix, if I "puts f_name.class" it comes back as a string. I can use /[[:alpha:]]+/.match(first_name(gender,species)) in line 74 to pull out the string.
[20:55:22] adam12: leitz: how about last_name[0].to_s (line 69)
[20:55:29] leitz: They *look* like arrays...
[20:55:36] adam12: or last_name.first.to_s
[20:56:29] leitz: adam12, you are too cool!
[20:56:37] leitz: the last_name[0] works.
[20:57:23] adam12: I bet to_s is calling inspect internally, which turns ["Some Name"] into "[\"Some Name\"]"
[20:57:32] kalib: has joined #ruby
[20:57:48] kalib: Hello guys. I am receiving the error: Could not find RedCloth-4.2.9 in any of the sources
[20:57:50] kalib: Run `bundle install` to install missing gems.
[20:57:57] kalib: but I do have RedCLouth:
[20:58:08] kalib: bundle-2.1 show RedCloth
[20:58:09] kalib: /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/RedCloth-4.2.9
[20:58:21] adam12: kalib: What's the line in the Gemfile for `RedCloth`
[20:58:37] kalib: bundle-2.1 show RedCloth
[20:58:39] kalib: /opt/ruby2.1/lib/ruby/gems/2.1.0/gems/RedCloth-4.2.9
[20:58:41] kalib: ops..sorry
[20:58:53] elomatreb: has joined #ruby
[20:58:59] kalib: gem 'RedCloth', '~> 4.2.9' adam12
[20:59:20] Pumukel: has joined #ruby
[20:59:26] matthewd: Are you running through bundle exec?
[21:00:04] Suslov: has joined #ruby
[21:00:25] adam12: kalib: What's the source line at the top of the Gemfile look like
[21:00:35] kalib: matthewd: I am trying to run rake-21 generate
[21:01:00] kalib: adam12: here it is: https://paste.ofcode.org/3bjTCPeEJE6kW6NTBwscTJg
[21:01:02] kalib: my gemfile
[21:01:06] leitz: adam12, immortalized you in the commit statement and issue closure. :) BTW, I loved that show.
[21:01:17] adam12: leitz: Hah! Cheers.
[21:01:43] bpmedley: has joined #ruby
[21:02:02] adam12: kalib: anything wrong when you run `bundle doctor`?
[21:02:25] kalib: bundle doctor or bundle-2.1 doctor ?
[21:02:41] adam12: I guess bundle-2.1. I use direnv and chruby so I am not 100% sure.
[21:02:48] kalib: $ bundle-2.1 doctor
[21:02:49] kalib: The Gemfile's dependencies are satisfied
[21:02:51] kalib: No issues found with the installed bundle
[21:03:07] adam12: And what command are you running when you experience the error? rake-2.1 generate?
[21:03:14] kalib: adam12: yes
[21:03:16] elomatreb: has joined #ruby
[21:03:28] kalib: $ rake-2.1 generate
[21:03:30] kalib: ## Generating Site with Jekyll
[21:03:32] kalib: Could not find RedCloth-4.2.9 in any of the sources
[21:03:34] kalib: Run `bundle install` to install missing gems.
[21:03:58] adam12: How about `bundle-2.1 exec rake generate`?
[21:05:02] Pumukel: has joined #ruby
[21:05:36] elifoster: has joined #ruby
[21:05:50] kalib: adam12: tried with three ways... here it is: https://paste.ofcode.org/39s5GUcb4NwNrCUmmqHWdjT
[21:06:51] adam12: kalib: what OS are you using? And if Linux, what distro? Something seems janky. Do you run any other Ruby code on this machine?
[21:07:36] kalib: adam12: I don't run ruby projects.. The only thing I use ruby for is for octopress. It's an Arch Linux machine.
[21:08:57] adam12: Did you just install Ruby?
[21:09:43] kalib: adam12: giving you some context.. I didn't update my octopress site for the last 1 year or so..
[21:09:53] kalib: So I decided to update it now. And I couldn't.
[21:10:09] kalib: And I realized that it was because I only had ruby 2.4 here..
[21:10:21] kalib: But this would need ruby 2.1, because of the version of my rake, bundle and everything..
[21:10:26] nightfog: has joined #ruby
[21:10:38] kalib: so I installed ruby2.1-bundler and ruby2.1
[21:10:55] adam12: kalib: I'm just surprised that bundle-2.1 exec rake failed, as rake is a dependency in your Gemfile. Which is what makes me wonder.
[21:10:57] Pumukel: has joined #ruby
[21:11:09] adam12: kalib: Let's try this. `bundle-2.1 install --binstubs ; bin/rake generate`
[21:12:04] kalib: including the ` `
[21:12:24] adam12: Sorry no - that's just to indicate start/end of the command I want you to run
[21:12:30] kalib: ok, sorry.
[21:12:52] Fernando-Basso: has joined #ruby
[21:12:53] kalib: adam12: https://paste.ofcode.org/FpsJxiCChqqrqgtvXMqaY2
[21:13:25] Silthias1: has joined #ruby
[21:13:55] adam12: kalib: My guess is this - the `generate` task is calling back out to another command, and it's not using the right version of Ruby.
[21:14:24] adam12: kalib: That's the only reason why I think you'd be seeing this funky error.
[21:14:45] blackwind_123: has joined #ruby
[21:15:55] kalib: adam12: hum.. any idea on where I could check that?
[21:16:06] adam12: kalib: I'm looking at source of Jekyll now, but your version is ancient :P
[21:16:12] adam12: https://github.com/jekyll/jekyll/tree/v0.12.1
[21:16:20] kalib: is it possible to update my version?
[21:16:40] Pumukel: has joined #ruby
[21:16:54] adam12: kalib: Probably. I'm not a Jekyll user so I am not sure.
[21:16:59] adam12: kalib: Do you have a Rakefile in your project folder?
[21:17:34] workmad3: has joined #ruby
[21:17:54] kalib: adam12: yes..
[21:17:55] kalib: let me show you
[21:19:38] kalib: adam12: http://pastebin.com/u9ny5gfA
[21:19:39] ruby[bot]: kalib: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[21:20:51] adam12: kalib: Kinda hacky, but on line 55 and 56, insert `bundle-2.1 exec` before the commands. so `system "bundle-2.1 exec original-string-here"`
[21:22:22] kalib: ok.. let me give it a try..
[21:22:24] Pumukel: has joined #ruby
[21:22:43] enterprisey: has joined #ruby
[21:23:36] Rodya_: has joined #ruby
[21:23:49] kalib: adam12: did it and tried to run rake-2.1 generate
[21:23:51] kalib: https://paste.ofcode.org/GxnUWfbPmY9EPV7RsNvN4j
[21:24:16] kalib: I think on lines 55 and 56
[21:24:27] kalib: I need to give the full path for jekyll and compass
[21:24:32] kalib: since it's not finding it.
[21:24:41] kalib: let me try
[21:24:45] millerti: has joined #ruby
[21:25:13] adam12: kalib: Unfortunately I think you have some weird problems with your Ruby.
[21:25:25] adam12: But you might get lucky by changing to full path.
[21:25:47] adam12: "NoMethodError: undefined method `activate_bin_path' for Gem:Module" <!-- this error stinks.
[21:25:57] tenderlo_: has joined #ruby
[21:27:21] allisio: Is there some incantation to make String#unpack handle "leftovers"?
[21:28:19] Pumukel: has joined #ruby
[21:28:19] kalib: adam12: I tried giving /usr/bin/jekyll and the same for compass... didn't work.. than I trie dto give /opt/ruby2.1/bin/jekyll and the same for compass.. and got..
[21:28:38] kalib: https://paste.ofcode.org/mxaBVBhjyVr6DtcfT6ay5U
[21:28:49] sid_fules: has joined #ruby
[21:28:54] adam12: Well I guess you're closer?
[21:29:39] adam12: My suggestion, albeit maybe unpopular, is to abandon that version of Jekyll for something much more recent - not something I can assist with tho.
[21:30:18] kalib: that's a valid point.. I'll check how can I do that.
[21:31:04] kalib: I'll check this: http://hiltmon.com/blog/2014/06/21/upgrading-octopress-to-jekyll-2-dot-0/
[21:31:06] JoshS: has joined #ruby
[21:31:25] Bounga: has joined #ruby
[21:32:20] kalib: I think I can start removing this crap I installed today, right?! ruby-2.1 and ruby-bundle-2.1
[21:32:31] kalib: ruby --version
[21:32:55] adam12: kalib: Likely.
[21:34:12] Pumukel: has joined #ruby
[21:34:15] kalib: but thanks for your time adam12 ;]
[21:34:20] adam12: kalib: yw.
[21:35:49] workmad3: has joined #ruby
[21:37:54] Tau: has joined #ruby
[21:40:00] Pumukel: has joined #ruby
[21:40:35] Silthias: has joined #ruby
[21:41:31] tenderlove: has joined #ruby
[21:45:21] jhack_: has joined #ruby
[21:45:21] esObe_: has joined #ruby
[21:45:42] Pumukel: has joined #ruby
[21:46:46] sid_fules: has joined #ruby
[21:46:59] Lord_of_Life: has joined #ruby
[21:47:40] whiteline: has joined #ruby
[21:47:56] psychicist__: has joined #ruby
[21:48:59] kalib: adam12: It seems I received new versions when pulling from octopress.. Also removed the packages ruby2.1 and ruby-bundle2.1..
[21:49:26] kalib: now, When I try to run `bundle install`
[21:49:36] kalib: I get error with yajl-ruby
[21:49:49] kalib: An error occurred while installing yajl-ruby (1.1.0), and Bundler cannot continue.
[21:49:51] kalib: Make sure that `gem install yajl-ruby -v '1.1.0'` succeeds before bundling.
[21:50:25] esObe__: has joined #ruby
[21:51:01] raul782: has joined #ruby
[21:51:05] kalib: and when tryin got install with gem install, I got error:
[21:51:10] kalib: https://paste.ofcode.org/qfVKu2SBXWbLatQ6ReDUnY
[21:51:30] Pumukel: has joined #ruby
[21:52:02] workmad3: kalib: looks like that gem won't work on ruby 2.4
[21:52:15] allisio: Not that version, anyway.
[21:52:24] allisio: They fixed it in 1.3.
[21:52:25] workmad3: kalib: as it's trying to use Fixnum in a C extension, and that class got removed in 2.4
[21:52:55] kalib: yes..when I run just gem install yajl-ruby
[21:52:57] kalib: it works..
[21:53:00] kalib: and I receive 1 gem installed
[21:53:17] kalib: how can I see which version I have installed?
[21:53:33] allisio: `gem -v foo`
[21:53:56] kalib: ok.. 2.6.8
[21:54:07] kalib: how can I tell to this project that that's the version I should look for?
[21:54:09] kalib: any idea?
[21:54:38] workmad3: allisio: that gives the rubygems version, not the installed gem versions
[21:54:52] allisio: workmad3: Is `foo` not a placeholder anymore?
[21:55:04] workmad3: kalib: `gem list -l <foo>`
[21:55:12] workmad3: allisio: no, I mean `gem -v` only gives the rubygems version
[21:55:17] allisio: Oh, you're right. Sorry.
[21:55:17] workmad3: doesn't matter about the placeholder
[21:56:03] kalib: $ gem list -l yajl-ruby
[21:56:05] kalib: *** LOCAL GEMS ***
[21:56:07] kalib: yajl-ruby (1.3.0)
[21:57:18] Pumukel: has joined #ruby
[21:57:28] workmad3: kalib: so, as expected, you have 1.3.0, which makes sense as 1.1.0 won't install on ruby 2.4.0
[21:57:32] tenderlove: has joined #ruby
[21:57:37] __Yiota: has joined #ruby
[21:57:45] kalib: workmad3: I just need this octopress project to work with it.
[21:58:10] workmad3: kalib: any reason you're trying to force it on ruby 2.4? Things would probably work easier on 2.3
[21:58:30] kalib: workmad3: no reason.. that's the default ruby version for my arch system
[21:58:32] kalib: that's why
[21:58:40] kalib: can I change that?
[21:58:51] workmad3: probably... not used arch much though
[21:59:38] allisio: kalib: I recomend chruby + ruby-install.
[21:59:57] kalib: don't get it
[22:00:14] workmad3: kalib: you could also try `bundle update yajl-ruby` in the project... but that runs the risk that the project won't work with the updated version
[22:00:40] havenwood: kalib: Here's a nice setup with archlinux and chruby: https://gist.github.com/jhass/8839655bb038e829fba1
[22:01:08] kalib: workmad3: bundle update yajl-ruby
[22:01:09] kalib: This Bundle hasn't been installed yet. Run `bundle install` to update and install the bundled gems.
[22:01:22] kalib: o.O what a fuck.. but we saw that it is installed
[22:01:33] szulak: has joined #ruby
[22:01:58] allisio: We saw that yajl-ruby was installed.
[22:02:21] renchan: has joined #ruby
[22:03:01] Pumukel: has joined #ruby
[22:03:08] ruid: has joined #ruby
[22:03:08] ruid: has joined #ruby
[22:03:25] hutch34: has joined #ruby
[22:03:33] kalib: so I'm stuck.. I can't run bundle install, because it will give me the error saying that couldn't find yajl-ruby (1.1.0).
[22:04:04] allisio: You need to relax the restriction on that dependency.
[22:04:53] kalib: how can I do that?
[22:05:06] kalib: I may also consider trying chruby
[22:05:10] allisio: The project will have a Gemfile and/or a gemspec that explicitly forbids 1.3 from satisfying the dependency.
[22:05:14] allisio: Find that and change it. :)
[22:05:20] kalib: I have a GemFile
[22:05:24] kalib: already checked it..
[22:05:30] kalib: but I can't find yajl-ruby there
[22:05:47] allisio: Then something else is asking for it and you're in dependency hell. :/
[22:06:18] kalib: allisio: https://paste.ofcode.org/35wcCPimbaWTksMFqBfHk5L
[22:08:14] sid_fules: has joined #ruby
[22:08:52] Pumukel: has joined #ruby
[22:09:18] kalib: havenwood: this link you provided is weird in this line: Edit your ~/.$SHELLrc and add:
[22:09:26] kalib: what file is that? it doesn't seem correct to me
[22:09:39] allisio: kalib: `echo $SHELL`
[22:09:50] havenwood: kalib: ~/.bashrc or ~/.zshrc are contemplated
[22:12:00] mula: has joined #ruby
[22:12:05] Fischmiep: has joined #ruby
[22:12:55] Mon_Ouie: has joined #ruby
[22:14:33] Pumukel: has joined #ruby
[22:17:58] DarthGandalf: has joined #ruby
[22:19:13] GodFather: has joined #ruby
[22:19:58] Pumukel: has joined #ruby
[22:25:28] Pumukel: has joined #ruby
[22:25:29] kalib: havenwood: ok, I have the chruby installed.. I don't see the difference. rake still seems to be trying to use the new version of ruby
[22:25:41] Elvin_: has joined #ruby
[22:26:13] kalib: although I created the .ruby-version file, as suggested on that link.
[22:28:17] Silthias1: has joined #ruby
[22:29:55] marsjaninzmarsa: has joined #ruby
[22:30:59] Pumukel: has joined #ruby
[22:31:20] kalib: ok, got it working.. creating symlinks worked fine.
[22:32:12] Bounga: has joined #ruby
[22:38:46] esObe_: has joined #ruby
[22:40:40] sid_fules: has joined #ruby
[22:41:26] ResidentBiscuit: has joined #ruby
[22:42:12] Pumukel: has joined #ruby
[22:43:55] skweek: has joined #ruby
[22:49:41] lxsameer: has joined #ruby
[22:50:49] leitz: I'm still learning class variables, I suppose. Could use some help. https://gist.github.com/LeamHall/618be95bed5e745d884e4b432aeaab75
[22:51:55] aesthetikx: has joined #ruby
[22:52:44] milardovich: has joined #ruby
[22:53:07] elomatreb: leitz: Two things: You can't initialize instance (not class!) variables like that (See here: https://eval.in/753027)
[22:53:14] mostlybadfly: has joined #ruby
[22:53:36] atmosx: has joined #ruby
[22:53:41] elomatreb: Uh, I guess that's one thing. learn2countpls
[22:55:00] adaedra: There are 2 hard things in programming: naming things, cache invalidation, and off-by-one errors.
[22:55:56] leitz: ACTION chuckles
[22:56:23] matthewd: The second thing would be "don't use class variables".. but you're not, so that's okay :)
[22:57:49] leitz: Well, I'm trying to set the child class array and then call a parent class method using the child class array. Obviosly I'm missing something.
[22:58:11] hutch34: has joined #ruby
[22:58:33] Pumukel: has joined #ruby
[22:58:41] leitz: ACTION erases the second @ before matthewd notices...
[22:59:08] allisio: leitz: You need a Firster#initialize.
[22:59:19] elomatreb: https://eval.in/753029 -- This shows why your attempt doesn't work as expected
[22:59:27] allisio: As it stands, you're setting an instance variable on the Firster class, not an instance thereof.
[22:59:51] leitz: Ah....that works.
[23:00:00] elomatreb: Ruby classes are objects too, instances of the class `Class` in fact
[23:00:04] matthewd: .. which seems like it might be what you intend. You just need to read it from the same place.
[23:00:14] sid_fules: has joined #ruby
[23:02:17] allisio: leitz: This is in line with what matthewd is suggesting: https://eval.in/753030
[23:02:54] allisio: You'd have to get your hands unnecessarily dirty if you really want it to be a class-level instance variable.
[23:04:13] elomatreb: I'd probably just define a method that just returns that array
[23:07:57] leitz: The entire process is to create an object that modified another object. So there are lots of variables to be set, depending on the sub-class.
[23:08:55] DaleK5whr: has joined #ruby
[23:08:55] leitz: The varaibles will only be used inside the class activities, if that makes sense.
[23:09:06] DaleK5whr: has left #ruby: ()
[23:12:15] leitz: And porting the "def initialize" suggestion into the code works. Yay!
[23:12:35] agent_white: has joined #ruby
[23:12:48] allisio: It's not what you actually want, though.
[23:13:06] allisio: Why should all Firster instances use a different @skill_options Array that contains the same data?
[23:14:16] Silthias: has joined #ruby
[23:14:16] leitz: allisio, the Firster would only get initialized once, but another career like "Marine" might also get initialized. Both would have @skill_options, but they would be different.
[23:14:37] allisio: leitz: You're only gonna have a single Firster? Then why is it a Class?
[23:15:28] leitz: So it can inherit from Career.
[23:15:36] leitz: As can the other classes.
[23:17:09] leitz: The actual code trail starts here: https://github.com/LeamHall/CT_Character_Generator/blob/multi_career/bin/Chargen#L59
[23:17:21] milardovich: has joined #ruby
[23:17:24] acalycine: has joined #ruby
[23:17:26] leitz: "Firster" is the only career that works with the new stuff.
[23:18:51] tomphp: has joined #ruby
[23:19:05] sid_fules: has joined #ruby
[23:19:56] leitz: This is a major re-work of code I started learning Ruby on over two years ago.
[23:19:58] ahrs_: has joined #ruby
[23:20:24] leitz: Hence the "What the heck did he do that for?" factor.
[23:20:41] Pumukel: has joined #ruby
[23:26:07] Trynemjoel: has joined #ruby
[23:26:12] Pumukel: has joined #ruby
[23:27:43] minimalism: has joined #ruby
[23:27:53] ruid: has joined #ruby
[23:30:44] grant: has joined #ruby
[23:31:43] Pumukel: has joined #ruby
[23:33:01] Bounga: has joined #ruby
[23:36:35] ahrs: has joined #ruby
[23:37:14] Pumukel: has joined #ruby
[23:38:09] milardovich: has joined #ruby
[23:41:18] hogetaro: has joined #ruby
[23:41:36] mula: has joined #ruby
[23:42:26] mula: has joined #ruby
[23:42:40] Pumukel: has joined #ruby
[23:43:15] mula: has joined #ruby
[23:44:05] mula: has joined #ruby
[23:44:50] mula: has joined #ruby
[23:45:40] mula: has joined #ruby
[23:46:30] mula: has joined #ruby
[23:48:11] Pumukel: has joined #ruby
[23:48:48] allisio: How do I String#unpack a single 24-bit value?
[23:49:32] Silthias: has joined #ruby
[23:49:37] sid_fules: has joined #ruby
[23:50:52] allisio: The "problem": https://eval.in/753036
[23:51:04] mula: has joined #ruby
[23:51:07] sid_fules: has joined #ruby
[23:52:06] allisio: For 'notgood', 'L*SC' results in three values; is there some way to tell #unpack to combine them?
[23:53:37] Pumukel: has joined #ruby
[23:55:09] sepp2k: has joined #ruby
[23:56:07] sid_fules: has joined #ruby
[23:57:03] matthewd: I think your options would be ("\0" + x).unpack("N") or x.unpack("C3") and combine them yourself.
[23:58:56] milardovich: has joined #ruby