« Back to channel list

#ruby - 19 April 2018

« Back 1 day Forward 1 day »
[00:09:12] chaos95: mroutis: I have done for a few of the individual checks but the checks used by each method differ slightly. Where there is some commonality I've abstracted them appropriately but I feel like there's got to be a better way to do it - coming from C# I would have previously done it with decorators
[00:09:21] chaos95: (or, you know, static typing)
[00:10:19] mroutis: sorry, chaos95, it's far from my knowledge, maybe if you throw in a code example I can understand your issue better
[00:11:12] erlend: has joined #ruby
[00:15:26] chaos95: mroutis: no worries :) it's a pretty minor concern in an otherwise quite messy codebase :)
[00:18:01] yxhuvud: has joined #ruby
[00:20:15] kapil___: has joined #ruby
[00:21:03] arescorpio: has joined #ruby
[00:21:46] cagomez: has joined #ruby
[00:22:14] cliluw: has joined #ruby
[00:26:07] chouhoulis: has joined #ruby
[00:26:14] yxhuvud: has joined #ruby
[00:33:44] lupine: has joined #ruby
[00:35:14] mlkkk: has joined #ruby
[00:36:52] jready: has joined #ruby
[00:37:02] whathappens: has joined #ruby
[00:37:27] Guest9502: has joined #ruby
[00:39:44] n0m4d1c: has joined #ruby
[00:46:05] jottr: has joined #ruby
[00:47:32] justinfaler: has joined #ruby
[00:47:38] ResidentBiscuit: has joined #ruby
[00:50:50] yxhuvud: has joined #ruby
[00:58:15] yxhuvud: has joined #ruby
[00:58:51] amar: has joined #ruby
[01:00:29] netherwolfe: has joined #ruby
[01:01:37] duderonomy: has joined #ruby
[01:04:25] yxhuvud: has joined #ruby
[01:08:55] jamesaxl: has joined #ruby
[01:13:22] whathapp_: has joined #ruby
[01:18:05] gizmore|2: has joined #ruby
[01:18:36] jalcine: has joined #ruby
[01:18:37] jalcine: has joined #ruby
[01:19:16] whathappens: has joined #ruby
[01:21:44] yxhuvud: has joined #ruby
[01:22:03] cthulchu_: has joined #ruby
[01:22:07] whathapp_: has joined #ruby
[01:22:45] linetrac1: has joined #ruby
[01:27:58] bmurt: has joined #ruby
[01:28:34] yxhuvud: has joined #ruby
[01:32:27] herbmillerjr: has joined #ruby
[01:32:40] banisterfiend: has joined #ruby
[01:34:39] jnollette: has joined #ruby
[01:37:46] bmurt: has joined #ruby
[01:38:52] ramfjord: has joined #ruby
[01:40:14] lupine: has joined #ruby
[01:40:21] white_lilies: has joined #ruby
[01:41:55] noobineer: has joined #ruby
[01:43:48] workmad3: has joined #ruby
[01:43:54] dinfuehr_: has joined #ruby
[01:49:51] Janky: has joined #ruby
[01:50:26] nowhereman_: has joined #ruby
[01:50:34] jcarl43: has joined #ruby
[01:52:14] lupine: has joined #ruby
[01:52:15] Radar: chaos95: Take a look at using dry-transaction. You could use `Failure("msg")` as a way of bailing out early.
[01:53:36] Radar: chaos95: here's an example from a codebase that I have: https://gist.github.com/radar/ab9c9be144474ba8a6be4a04b004b425
[01:54:47] alfiemax: has joined #ruby
[02:03:59] whathappens: has joined #ruby
[02:08:08] alfiemax: has joined #ruby
[02:15:55] cagmz: has joined #ruby
[02:17:10] cagomez: has joined #ruby
[02:18:32] cagomez: how do I apply some transformation to a hash value before setting it as a value? is it possible to set this behavior on the hash itself (ie subclass Hash and define my own setter?)
[02:19:34] baweaver: cagomez: why?
[02:19:35] haraoka: has joined #ruby
[02:19:43] baweaver: What problem are you trying to solve?
[02:19:49] cagomez: for example, I'd like to do this: hash[1] = 'a' => hash[1] = 'A'
[02:19:56] erlend: has joined #ruby
[02:20:38] alfiemax: has joined #ruby
[02:20:52] Radar: cagomez: Is this behaviour the same for all keys? Capitalise their values?
[02:21:14] cagomez: yup! I just want to call a method on these objects before setting them as the value for a key
[02:21:21] m27frogy: has joined #ruby
[02:21:25] baweaver: I'd also loop back to what problem exactly are you trying to solve for?
[02:21:33] baweaver: because the answer may vary a bit depending
[02:22:09] chaos95: Radar: interesting, thanks!
[02:22:20] baweaver: whoopsie, train arriving, off I go for a few
[02:22:39] cagomez: I currently have to call the .as_json (for example) on these objects after accessing them from my_hash. I'd rather call .as_json before storing them in the hash, but I was wondering if Hash could do that
[02:25:02] konsolebox: has joined #ruby
[02:26:36] GodFather: has joined #ruby
[02:27:11] yxhuvud: has joined #ruby
[02:31:15] meadmoon: has joined #ruby
[02:39:04] whathappens: has joined #ruby
[02:39:54] jordanm: has joined #ruby
[02:39:56] jordanm: has joined #ruby
[02:40:19] jordanm: has joined #ruby
[02:40:27] alfiemax: has joined #ruby
[02:52:08] lele: has joined #ruby
[02:52:46] jottr: has joined #ruby
[02:55:37] Azure: has joined #ruby
[02:57:31] whathappens: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:03:00] NewbiePat: has joined #ruby
[03:06:25] chouhoulis: has joined #ruby
[03:07:20] NewbiePat: I'm fairly new to coding and ruby. I'm working on a simple program just to see what I can make it into. I seem to be having trouble with the OR operator in if statements and while loops. Would anyone be able to lend a guiding hand?
[03:08:12] mozzarella: what's the problem?
[03:09:36] NewbiePat: im setting a variable called fifty50, and then I'm writing a while loop to make sure that the user entered either a "y" or "no" for that variable, however I my while loop keeps repeating even if what I think is correct is entered.
[03:09:50] NewbiePat: for example: fifty50 = gets.chomp.downcase.to_s
[03:09:57] NewbiePat: while fifty50 != "y" || "n"
[03:10:25] NewbiePat: i'm assuming its some syntax i'm not fully grasping but i've been playing with it for a little while and getting nowhere
[03:10:34] jordanm: has joined #ruby
[03:11:04] mozzarella: yeah, it doesn't do what you think it does
[03:13:00] mozzarella: while fifty50 != 'y' && fifty50 != 'n'
[03:14:51] NewbiePat: got it and now my program is proceding, thank you very much. I'm sure that will be very useful, i didn't realize I would have to declare the fifty50 again after the operator.
[03:16:34] orbyt_: has joined #ruby
[03:17:15] mozzarella: just remember that && and || are boolean operators, and that they expect a true/false value on each side
[03:17:33] gix-: has joined #ruby
[03:18:03] mozzarella: though you can pass anything you want
[03:18:54] NewbiePat: i will keep that in mind, and thank you again for the lesson and assistance :)
[03:21:18] mozzarella: strings will always be "true", so that's your problem right here
[03:23:06] konsolebox: || has lower precedence than &&
[03:24:52] NewbiePat: thanks again :) that helped a lot and will learn from this :)
[03:29:28] mozzarella: only false and nil are "falsey", everything else is "truthy", IIRC
[03:29:41] ramfjord: has joined #ruby
[03:36:05] BTRE: has joined #ruby
[03:42:35] alfiemax: has joined #ruby
[03:42:58] workmad3: has joined #ruby
[03:44:34] claw: has joined #ruby
[03:50:18] nowhereman_: has joined #ruby
[03:53:01] ramfjord: has joined #ruby
[03:56:50] guacamole: has joined #ruby
[03:56:50] guacamole: has joined #ruby
[04:00:22] Ryzokuken: has joined #ruby
[04:01:59] bmurt: has joined #ruby
[04:05:50] MyMind: has joined #ruby
[04:07:30] schneider: has joined #ruby
[04:09:51] DTZUZO: has joined #ruby
[04:10:51] n3b: has joined #ruby
[04:12:41] jottr: has joined #ruby
[04:19:54] jeffreylevesque: has joined #ruby
[04:22:11] Dykam: has joined #ruby
[04:28:37] erlend: has joined #ruby
[04:30:41] mlkkk: has joined #ruby
[04:43:33] alfiemax: has joined #ruby
[04:46:23] mlkkk: has joined #ruby
[04:54:12] mlkkk: has joined #ruby
[04:54:35] VladGh: has joined #ruby
[04:57:34] chmurifree: has joined #ruby
[04:58:08] venmx: has joined #ruby
[04:58:48] samort7: has joined #ruby
[04:59:38] d_kam_: has joined #ruby
[05:02:33] n008f4g_: has joined #ruby
[05:02:33] amar: has joined #ruby
[05:03:24] ur5us: has joined #ruby
[05:06:07] jalcine: has joined #ruby
[05:06:08] jalcine: has joined #ruby
[05:11:28] mlkkk: has joined #ruby
[05:12:00] reber: has joined #ruby
[05:15:32] kapil___: has joined #ruby
[05:18:38] jalcine: has joined #ruby
[05:18:39] jalcine: has joined #ruby
[05:20:45] camonz: has joined #ruby
[05:22:03] alfiemax: has joined #ruby
[05:25:05] sauvin: has joined #ruby
[05:27:14] mlkkk: has joined #ruby
[05:27:20] anisha: has joined #ruby
[05:31:10] jeen: has joined #ruby
[05:38:43] mlkkk: has joined #ruby
[05:40:41] d_kam_: has joined #ruby
[05:42:06] workmad3: has joined #ruby
[05:42:45] d_kam__: has joined #ruby
[05:43:42] sidx64: has joined #ruby
[05:44:43] d_kam___: has joined #ruby
[05:46:05] aupadhye: has joined #ruby
[05:46:44] d_kam____: has joined #ruby
[05:49:11] dionysus69: has joined #ruby
[05:50:58] d_kam_____: has joined #ruby
[05:52:44] d_kam______: has joined #ruby
[05:54:46] d_kam_______: has joined #ruby
[05:56:45] d_kam________: has joined #ruby
[05:56:51] schneider: has joined #ruby
[06:00:27] d_kam________: has joined #ruby
[06:01:16] jeen: has joined #ruby
[06:02:46] d_kam_________: has joined #ruby
[06:04:42] d_kam__________: has joined #ruby
[06:06:14] alex``: has joined #ruby
[06:08:22] shiroeni: has joined #ruby
[06:13:08] d_kam__________: has joined #ruby
[06:14:16] jottr: has joined #ruby
[06:17:55] d_kam___________: has joined #ruby
[06:25:23] jeen: has joined #ruby
[06:29:00] schneider: has joined #ruby
[06:29:24] shiroeni: has joined #ruby
[06:31:53] venmx: has joined #ruby
[06:33:14] karapetyan: has joined #ruby
[06:37:24] erlend: has joined #ruby
[06:38:29] sidx64_: has joined #ruby
[06:41:17] shiroeni_: has joined #ruby
[06:42:31] apeiros: has joined #ruby
[06:42:53] roshanavand: has joined #ruby
[06:43:28] sidx64: has joined #ruby
[06:43:53] roshanavand: has joined #ruby
[06:46:22] tAn: has joined #ruby
[06:47:53] phaul: has joined #ruby
[06:49:11] trautwein: has joined #ruby
[06:51:31] roshanavand: has joined #ruby
[06:52:56] andikr: has joined #ruby
[06:53:06] mikhael_k33hl: has joined #ruby
[06:54:11] mikhael_k33hl: Why am I getting an error: No live threads left. Deadlock? (fatal) when trying to wait(join) for a thread: https://gist.github.com/marzdgzmn/19e7bed23a86c95bf9a47f0202bd877b
[06:55:18] dminuoso: mikhael_k33hl: because you have been naughty.
[06:56:13] schneider: has joined #ruby
[06:56:28] mikhael_k33hl: dminuoso: what do you mean?
[06:58:27] NL3limin4t0r_afk: has joined #ruby
[06:59:19] Naeblis: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[07:03:22] amar: has joined #ruby
[07:06:02] ramfjord: has joined #ruby
[07:06:47] phaul: concurency is hard. It's very difficult to see if your program is deadlock free, and when it's not there is no guarantee that you can cath the bug either. In haskell world they thought transactional memory was the answer. Im not sure what happened to that idea
[07:07:04] dminuoso: phaul: concurrency is not hard.
[07:07:11] dminuoso: manual mutex lockery is just hard.
[07:08:21] suukim: has joined #ruby
[07:08:32] phaul: I stand corrected :) manual mutex lockery is hard...
[07:08:49] _aeris_: has joined #ruby
[07:10:02] phaul: there is concurrent-ruby ... that can do STM.
[07:10:38] phaul: mikhael_k33hl: it might be worth taking a look^. No locks, no deadlocks.
[07:11:50] mikhael_k33hl: phaul: Yeah, I was using that before, I was thinking of doing this manually since this is just a bit simple script, and just to dirty my hands with concurrency :)
[07:11:55] Bish: has joined #ruby
[07:12:37] metalmouth: has joined #ruby
[07:12:45] metalmouth: has left #ruby: ()
[07:12:55] dminuoso: mikhael_k33hl: get them dirty with stm.
[07:13:06] dminuoso: stm is easier and less painful
[07:13:49] aufi: has joined #ruby
[07:13:53] burgestrand: has joined #ruby
[07:14:17] mikhael_k33hl: dminuoso: what's stm? software transactional memory?
[07:14:32] sidx64_: has joined #ruby
[07:14:39] clemens3_: has joined #ruby
[07:15:40] claudiuinberlin: has joined #ruby
[07:16:05] phaul: mikhael_k33hl: yes
[07:19:58] dminuoso: phaul: I wonder, the stm doesnt look very complete though
[07:20:58] minimalism: has joined #ruby
[07:23:32] phaul: you mean STM in concurrent-ruby? They need 3 things iirc. atomically do ; end, tvar, retry. I've found atomically, and tvar. Looking for retry..
[07:24:29] dminuoso: phaul: I was talking about retry
[07:24:37] dminuoso: Without retry the whole thing becomes a bit.. lackluster..
[07:25:19] mikhael_k33hl: just a bit tempting to make this code work though hehe
[07:26:40] amar: has joined #ruby
[07:27:08] burgestrand: has joined #ruby
[07:28:52] dminuoso: phaul: it looks as if you are supposed to use a loop yourself..
[07:29:34] jottr: has joined #ruby
[07:31:41] totimkopf: has joined #ruby
[07:36:54] cadillac_: has joined #ruby
[07:41:17] workmad3: has joined #ruby
[07:42:27] alfiemax: has joined #ruby
[07:44:16] physicist__: has joined #ruby
[07:47:17] phaul: I'm trying to understand their model by reading the STM implementation... It's quite short and conciese...
[07:54:08] schneider: has joined #ruby
[07:54:34] Ryzokuken: has joined #ruby
[07:55:22] phaul: retry is as simple as raise Transaction::AbortError. I have no idea why they didn't expose it on the API
[07:55:27] Pisuke: has joined #ruby
[07:56:03] phaul: oh they did. abort_transaction is retry!
[07:56:10] phaul: bad naming...
[07:58:54] dminuoso: ACTION sighs
[07:59:36] dminuoso: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/lib/concurrent/tvar.rb#L119-L124
[08:02:07] hkais: has joined #ruby
[08:07:16] apeiros: and there I thought "rollback" was established terminology wrt transactions 😅
[08:07:42] dminuoso: apeiros: not rollback. it should be "retry"
[08:07:52] apeiros: though retry and abort_transaction imply two different things?
[08:08:28] apeiros: I mean one is "do it again" and the other is "undo"
[08:08:43] dminuoso: apeiros: abort_transaction means retry.
[08:08:58] dminuoso: leave_transaction means abort..
[08:09:03] apeiros: dminuoso: if it in fact re-tries, that's a terrible misnomer :-O
[08:09:20] dminuoso: apeiros: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/lib/concurrent/tvar.rb#L108-L136
[08:09:22] dminuoso: just check it out :D
[08:09:29] mikecmpbll: has joined #ruby
[08:09:52] dminuoso: the hilarious thing is is that if clause at the end
[08:11:22] apeiros: ACTION no like `Transaction::current`
[08:11:26] apeiros: (code style)
[08:11:52] dminuoso: apeiros: using concurrent-ruby is painful too
[08:12:04] apeiros: that's sad to hear
[08:13:26] dminuoso: apeiros: https://gist.github.com/dminuoso/11982e915db178db5b06514e5c223d12 here's some naive STM code from Haskell. So from outside I can just do `withToken "apeiros" doStuff` and I can atomically handle the "apeiros" resource. =)
[08:13:28] apeiros: https://github.com/ruby-concurrency/concurrent-ruby/blob/master/lib/concurrent/tvar.rb#L113 - I now wonder about the code backing transaction=
[08:15:42] apeiros: omg, something I never wanted to read in ruby: "It is undefined behaviour to"
[08:16:05] apeiros: (though I can imagine it'd be incredibly hard to have the behavior defined in the case they mention)
[08:16:11] dminuoso: apeiros: Honestly in concurrency there are certain contracts.
[08:16:21] dminuoso: Some things are simply honor bound.
[08:17:16] apeiros: sure. but breaking the contract should not result in undefined behavior. just like real contracts. but as said, I understand that there's cases where that's probably unreasonably hard, if not even impossible.
[08:17:30] apeiros: at least I have no idea how I'd handle "rogue" callcc
[08:17:33] dminuoso: well callcc I get at least.
[08:18:16] livcd: we will get parallelism with graal! get excited
[08:18:38] mr-robert: don't we have that with jruby already
[08:18:58] apeiros: 𝄞 I'm so excited ♫ I just can't hide it ♬
[08:19:18] apeiros: mr-robert: yes, we do :)
[08:19:46] NL3limin4t0r_afk: has joined #ruby
[08:21:02] amar: has joined #ruby
[08:22:08] reusedSalt: has joined #ruby
[08:22:39] karapetyan: has joined #ruby
[08:23:59] TomyWork: has joined #ruby
[08:24:49] livcd: well it looks like much more performant
[08:25:21] guille-moe: has joined #ruby
[08:27:02] amar: has joined #ruby
[08:28:59] alfiemax: has joined #ruby
[08:34:25] sidx64: has joined #ruby
[08:35:54] tomphp: has joined #ruby
[08:45:25] RougeR: has joined #ruby
[08:45:25] RougeR: has joined #ruby
[08:45:41] erlend: has joined #ruby
[08:53:30] venmx: has joined #ruby
[08:53:36] tomphp: has joined #ruby
[08:57:09] Beams: has joined #ruby
[09:01:59] alfiemax: has joined #ruby
[09:07:38] marr: has joined #ruby
[09:09:22] meinside: has joined #ruby
[09:12:26] tomphp: has joined #ruby
[09:20:22] rabajaj: has joined #ruby
[09:23:30] tomphp: has joined #ruby
[09:28:12] zautomata2: has joined #ruby
[09:31:38] tomphp: has joined #ruby
[09:35:06] banisterfiend: has joined #ruby
[09:37:05] tomphp: has joined #ruby
[09:40:10] tomphp: has joined #ruby
[09:40:11] karapetyan: has joined #ruby
[09:40:25] workmad3: has joined #ruby
[09:41:09] ur5us: has joined #ruby
[09:41:28] alfiemax: has joined #ruby
[09:41:41] tvw: has joined #ruby
[09:41:51] zautomata: has joined #ruby
[09:42:42] nowhereman_: has joined #ruby
[09:44:10] UncleCid__: has joined #ruby
[09:45:09] burgestrand: has joined #ruby
[09:55:33] dminuoso: >> [true, false, false, false].reduce(&:|)
[09:55:34] ruby[bot]: dminuoso: # => true (https://eval.in/991040)
[09:58:07] apeiros: >> [true, false, false, false].reduce(&:^)
[09:58:08] ruby[bot]: apeiros: # => true (https://eval.in/991042)
[09:58:23] SynSynack: has joined #ruby
[10:00:54] ferr1: has joined #ruby
[10:01:00] ferr1: has left #ruby: ()
[10:01:07] dminuoso: Man I wish we could just do
[10:02:41] dminuoso: >> or = -> a, b { a || b }; [true, false, false, false].reduce(or)
[10:02:42] ruby[bot]: dminuoso: # => /tmp/execpad-e8189fcb9637/source-e8189fcb9637:2: syntax error, unexpected keyword_or ...check link for more (https://eval.in/991048)
[10:02:54] dminuoso: >> or_ = -> a, b { a || b }; [true, false, false, false].reduce(or_)
[10:02:55] ruby[bot]: dminuoso: # => #<Proc:0x420fda10@/tmp/execpad-d6bebbf373c4/source-d6bebbf373c4:2 (lambda)> is not a symbol nor a st ...check link for more (https://eval.in/991049)
[10:02:59] shinnya: has joined #ruby
[10:03:03] dminuoso: Maybe Ill just make the necessary change
[10:03:23] dminuoso: Most HOFs should take a proc..
[10:05:29] ltem: has joined #ruby
[10:11:31] apeiros: dminuoso: hm? that almost works. all it costs you is an & more
[10:11:43] phaul: I have a weird feeling in the message sending model. To me it feels like that the receiver is special not like the rest of the arguments. So the whole thing is a bit clunky in the functional world. Like Array#zip shows that the best.
[10:12:13] phaul: should it be Array.zip(*arrays) ?!
[10:12:34] c0ncealed1: has joined #ruby
[10:12:53] anisha: has joined #ruby
[10:12:55] apeiros: phaul: heh, I have wondered about this too and never came to a good answer. Array.zip certainly makes some sense as it's in a the construction of an array.
[10:13:39] apeiros: and iirc I had Hash::zip(keys, values) in my 1.8 monkey patches
[10:14:10] amar: has joined #ruby
[10:15:19] dminuoso: apeiros: It does not really work in stdlib/core much
[10:15:30] sanscoeur: has joined #ruby
[10:15:31] dminuoso: apeiros: The & adds too much noise and it's annoying if you want to do
[10:15:34] dminuoso: foo.map(bar * quux)
[10:15:44] dminuoso: Suddenly you not only need & but extra noise for parens
[10:15:52] dminuoso: foo.map(&(bar * quux))
[10:16:09] apeiros: ah, good old "we need -> instead of *(foo.bar)". yeah, I see what you mean.
[10:16:12] dminuoso: apeiros: Just consider that symbols are accepted
[10:16:21] dminuoso: foo.map(:bar) is fine
[10:16:27] dminuoso: great, so why not foo.map(someProc)
[10:16:35] dminuoso: ruby could just unconditionally to_proc whatever it gets
[10:17:05] dminuoso: apeiros: (*foo).bar =P
[10:17:21] apeiros: are you saying all my C code is broken?!?
[10:17:28] apeiros: (yeah, goes to show how little C I code)
[10:18:19] dminuoso: apeiros: I think Ill make my case with Proc#* on the bug tracker soon.
[10:18:30] dminuoso: We already have #curry, might as well complete the set of functional tools.
[10:20:08] rabajaj: has joined #ruby
[10:20:39] workmad3: has joined #ruby
[10:22:07] cadillac_: has joined #ruby
[10:23:03] schneider: has joined #ruby
[10:23:24] rahul_bajaj: has joined #ruby
[10:24:17] karapetyan: has joined #ruby
[10:26:21] tomphp: has joined #ruby
[10:26:25] rabajaj: has joined #ruby
[10:27:11] nadir: has joined #ruby
[10:29:02] tomphp: has joined #ruby
[10:29:14] burgestrand: has joined #ruby
[10:31:33] pb122: has joined #ruby
[10:32:52] pb122: has joined #ruby
[10:34:40] tomphp: has joined #ruby
[10:38:56] tAn: has joined #ruby
[10:39:16] karapetyan: has joined #ruby
[10:44:54] psychicist__: has joined #ruby
[10:48:59] tomphp: has joined #ruby
[10:50:44] apparition: has joined #ruby
[10:50:46] meadmoon: has joined #ruby
[10:51:19] karapetyan: has joined #ruby
[10:51:37] meadmoon: has joined #ruby
[10:51:38] ellcs: has joined #ruby
[10:51:48] roshanavand1: has joined #ruby
[10:51:57] dang`r`us: has joined #ruby
[10:52:07] dang`r`us: what does "reduced accuracy" here mean? https://apidock.com/ruby/DateTime/strftime
[10:52:13] roshanavand: has joined #ruby
[10:52:42] kurko_: has joined #ruby
[10:53:53] erlend: has joined #ruby
[10:56:01] canton7: dang`r`us, from looking at that table, looks like "X, reduced accuracy" means "X, but with the most accurate portion removed"
[10:56:19] canton7: so if X is a year-month-date, the "reduced accuracy" removes the date component, leaving just year-month
[10:56:35] canton7: likewise if X is hours-mins-secs, the "reduced accuracy" removes the secs, leaving hours-mins
[11:01:29] aufi_: has joined #ruby
[11:02:23] dr3wo: has joined #ruby
[11:07:09] donofrio: has joined #ruby
[11:10:36] amelliaa: has joined #ruby
[11:11:29] noobineer: has joined #ruby
[11:14:01] AJA4350: has joined #ruby
[11:18:15] amatas: has joined #ruby
[11:23:49] tomphp: has joined #ruby
[11:24:32] tomphp: has joined #ruby
[11:25:16] RougeR: has joined #ruby
[11:27:02] cadillac__: has joined #ruby
[11:28:30] banisterfiend: has joined #ruby
[11:28:38] zeffy: has joined #ruby
[11:31:21] amar: has joined #ruby
[11:35:26] rabajaj: has joined #ruby
[11:35:55] Cavallari: has joined #ruby
[11:39:24] Emmanuel_Chanel: has joined #ruby
[11:39:56] Emmanuel_Chanel: has joined #ruby
[11:40:15] dang`r`us: canton7, thx!
[11:42:36] supergeek: has joined #ruby
[11:50:29] apparition: has joined #ruby
[11:52:18] ldnunes: has joined #ruby
[11:54:35] dang`r`us: has left #ruby: ("WeeChat 2.0.1")
[12:01:35] em: has joined #ruby
[12:02:11] rabajaj: has joined #ruby
[12:03:50] em: has joined #ruby
[12:04:45] sidx64: has joined #ruby
[12:05:03] samwheel: has joined #ruby
[12:06:07] samwheel: has joined #ruby
[12:06:36] alex``: has joined #ruby
[12:07:20] duderonomy: has joined #ruby
[12:07:43] synthroid: has joined #ruby
[12:07:45] jerematic: has joined #ruby
[12:09:33] clemens3_: has joined #ruby
[12:10:37] samwheel: has joined #ruby
[12:11:19] giraffe: has joined #ruby
[12:11:43] samwheel: has joined #ruby
[12:12:23] tpendragon: has joined #ruby
[12:15:25] amar: has joined #ruby
[12:19:11] karapety_: has joined #ruby
[12:19:28] bmurt: has joined #ruby
[12:20:51] burgestrand: has joined #ruby
[12:21:52] karapety_: has joined #ruby
[12:22:32] Cavallari1: has joined #ruby
[12:25:59] shtirlic_: has joined #ruby
[12:26:08] guacamole: has joined #ruby
[12:26:08] guacamole: has joined #ruby
[12:28:47] Psybur: has joined #ruby
[12:31:33] maufart__: has joined #ruby
[12:33:56] sidx64: has joined #ruby
[12:36:03] vondruch_: has joined #ruby
[12:44:08] shtirlic_: has joined #ruby
[12:46:22] gr33n7007h: has joined #ruby
[12:47:14] ElFerna: has joined #ruby
[12:48:54] camilasan: has joined #ruby
[12:50:45] vondruch_: has joined #ruby
[12:52:17] ltem: has joined #ruby
[12:58:00] zautomata: has joined #ruby
[12:58:02] camilasan: has joined #ruby
[13:01:56] GodFather: has joined #ruby
[13:02:12] lele: has joined #ruby
[13:02:36] erlend: has joined #ruby
[13:21:03] kn-928: has joined #ruby
[13:23:37] kn-928: has joined #ruby
[13:23:52] nowhereman_: has joined #ruby
[13:24:13] duderonomy: has joined #ruby
[13:26:18] kn-928: has joined #ruby
[13:28:54] dr3wo: has joined #ruby
[13:32:23] zacts: has joined #ruby
[13:34:47] k0mpa: has joined #ruby
[13:36:16] burgestrand: has joined #ruby
[13:37:23] bmurt: has joined #ruby
[13:37:29] amatas: has joined #ruby
[13:44:06] ellcs: has joined #ruby
[13:50:05] NL3limin4t0r_afk: has joined #ruby
[13:51:58] apeiros__: has joined #ruby
[13:56:24] grilix_: has joined #ruby
[13:57:30] guacamole: has joined #ruby
[13:58:53] vondruch_: has joined #ruby
[13:58:59] aufi_: has joined #ruby
[14:00:33] GodFather: has joined #ruby
[14:01:53] chouhoulis: has joined #ruby
[14:03:04] cschneid_: has joined #ruby
[14:03:07] duderonomy: has joined #ruby
[14:03:11] phaul: has joined #ruby
[14:04:18] Rapture: has joined #ruby
[14:06:44] yeticry: has joined #ruby
[14:07:30] pastorinni: has joined #ruby
[14:11:12] Mikasi: has joined #ruby
[14:12:27] nowhereman_: has joined #ruby
[14:16:18] Esa_: has joined #ruby
[14:17:11] pb122: has joined #ruby
[14:17:58] GodFather_: has joined #ruby
[14:23:44] dr3wo: has joined #ruby
[14:25:19] konsolebox: has joined #ruby
[14:25:26] netherwolfe: has joined #ruby
[14:26:04] schneider: has joined #ruby
[14:27:56] stormpack: has joined #ruby
[14:38:10] suukim: has joined #ruby
[14:40:05] chouhoulis: has joined #ruby
[14:46:49] cyberg: has joined #ruby
[14:49:04] troulouliou_div2: has joined #ruby
[14:53:52] roshanavand: has joined #ruby
[14:54:23] roshanavand: has joined #ruby
[14:55:34] roshanavand: has joined #ruby
[14:56:08] apeiros: has joined #ruby
[14:56:47] minimalism: has joined #ruby
[14:59:48] synthroid: has joined #ruby
[15:05:12] cschneid_: has joined #ruby
[15:10:28] jerematic: has joined #ruby
[15:11:21] erlend: has joined #ruby
[15:11:37] rippa: has joined #ruby
[15:11:57] jerematic: has joined #ruby
[15:12:23] whathappens: has joined #ruby
[15:16:22] dcunit3d: has joined #ruby
[15:18:58] jeffreylevesque: has joined #ruby
[15:24:16] n008f4g_: has joined #ruby
[15:31:03] troulouliou_div2: hi i have a file of few line; how can i select strings that match a certain regexp
[15:31:07] whathappens: has joined #ruby
[15:32:06] troulouliou_div2: i mean while gets and regexp or lines.find regexp ?
[15:33:41] karapetyan: has joined #ruby
[15:34:26] guacamole: has joined #ruby
[15:34:26] guacamole: has joined #ruby
[15:36:38] guacamole: has joined #ruby
[15:36:38] guacamole: has joined #ruby
[15:38:18] PsionTheory: has joined #ruby
[15:39:31] roshanavand: has joined #ruby
[15:42:55] Vaevictus: has left #ruby: ()
[15:47:04] dionysus69: has joined #ruby
[15:49:39] cliluw: has joined #ruby
[15:52:28] karapetyan: has joined #ruby
[15:56:05] jcarl43: has joined #ruby
[15:57:50] tolerablyjake: has joined #ruby
[15:58:42] jerematic: has joined #ruby
[16:00:27] cagomez_: has joined #ruby
[16:03:47] workmad3: has joined #ruby
[16:05:59] suukim: has joined #ruby
[16:08:29] amar: has joined #ruby
[16:09:25] amar_: has joined #ruby
[16:10:15] cthulchu: has joined #ruby
[16:11:46] ltem: has joined #ruby
[16:15:19] bmurt: has joined #ruby
[16:15:44] darkhanb: has joined #ruby
[16:19:33] nicesignal: has joined #ruby
[16:23:25] oleo: has joined #ruby
[16:23:45] grilix_: has joined #ruby
[16:26:26] wilbert: has joined #ruby
[16:29:10] mkaito: has joined #ruby
[16:29:10] mkaito: has joined #ruby
[16:30:28] dr3w__: has joined #ruby
[16:32:47] troulouliou_div2: has joined #ruby
[16:36:46] orbyt_: has joined #ruby
[16:41:23] inerthia: has joined #ruby
[16:42:00] RougeR: has joined #ruby
[16:42:00] RougeR: has joined #ruby
[16:45:22] synthroid: has joined #ruby
[16:50:34] sanscoeur: has joined #ruby
[16:51:09] sanscoeur: has joined #ruby
[16:57:55] ramfjord: has joined #ruby
[17:05:12] dionysus69: has joined #ruby
[17:05:47] marxarelli: has joined #ruby
[17:05:53] dr3wo: has joined #ruby
[17:07:20] alfiemax: has joined #ruby
[17:07:39] marxarelli: has joined #ruby
[17:08:44] alfiemax: has joined #ruby
[17:10:48] guacamole: has joined #ruby
[17:10:48] guacamole: has joined #ruby
[17:12:56] clemens3_: has joined #ruby
[17:14:22] pilne: has joined #ruby
[17:19:42] amar: has joined #ruby
[17:20:07] erlend: has joined #ruby
[17:21:34] GodFather_: has joined #ruby
[17:24:28] nb_bez________: has joined #ruby
[17:25:02] claudiuinberlin: has joined #ruby
[17:26:19] Ryzokuken: has joined #ruby
[17:29:08] pb122: has joined #ruby
[17:29:15] kapil___: has joined #ruby
[17:30:46] karapetyan: has joined #ruby
[17:34:17] guacamole: has joined #ruby
[17:34:17] guacamole: has joined #ruby
[17:34:58] troulouliou_div2: has joined #ruby
[17:36:44] troulouliou_div2: hi whi does this function output an array : "[test]".scan(/\[(.*?)\]/).first.class
[17:37:00] troulouliou_div2: to get the first math i need to do "[test]".scan(/\[(.*?)\]/).first.first
[17:38:36] phaul: scan gives a sequence (array) of matches that's what its for
[17:38:40] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/openssl/rdoc/OpenSSL/X509/Name/RFC2253DN.html#method-i-scan
[17:38:58] phaul: ri String#scan
[17:39:02] phaul: &ri String#scan
[17:39:02] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-scan
[17:39:24] chouhoul_: has joined #ruby
[17:39:48] phaul: you can use String#[] with regexp to get a match
[17:41:11] phaul: >> "blah"[/a./]
[17:41:12] ruby[bot]: phaul: # => "ah" (https://eval.in/991411)
[17:42:10] apeiros: troulouliou_div2: scan yields an array if you have capturing groups in your regex
[17:42:22] apeiros: and since you have one -> array of arrays
[17:42:40] troulouliou_div2: phaul, apeiros ok thanks
[17:42:51] apeiros: >> "[test]".scan(/\[.*?\]/).first.class
[17:42:52] ruby[bot]: apeiros: # => String (https://eval.in/991412)
[17:43:11] apeiros: also, [^\]] is usually better than .*?
[17:43:21] apeiros: errr, lacks a quantifier
[17:47:24] Orxata_: has joined #ruby
[17:47:40] Rr4sT: has joined #ruby
[17:47:41] Orxata_: I get this error when I'm trying to execute a rake:
[17:47:45] Orxata_: TypeError: can't convert Fixnum into String
[17:47:49] Orxata_: the line is:
[17:47:57] Orxata_: end_date = Date.parse(format("%04d-%02d-%02d",y,m,Date.civil(y,m,-1).day.to_s))
[17:48:01] Orxata_: where y and m are both numbers
[17:48:19] Orxata_: e,g: end_date = Date.parse(format("%04d-%02d-%02d",2018,4,Date.civil(2018,4,-1).day.to_s))
[17:48:26] vutral|kali: has joined #ruby
[17:48:28] Orxata_: however that same line is used in another rake and it does not cause any problem
[17:48:35] vutral|kali: in which variable is the version of ruby?
[17:49:33] alex``: has joined #ruby
[17:49:39] Orxata_: what do you mean?
[17:51:18] apeiros: what the heck?
[17:51:43] apeiros: that line is ridiculous
[17:52:01] apeiros: rube goldberg style date creation
[17:53:19] apeiros: >> y = 2018; m = 1; Date.parse(format("%04d-%02d-%02d",y,m,Date.civil(y,m,-1).day.to_s)) == Date.civil(y,m,-1)
[17:53:20] ruby[bot]: apeiros: # => uninitialized constant Date ...check link for more (https://eval.in/991417)
[17:53:26] apeiros: >> require 'date'; y = 2018; m = 1; Date.parse(format("%04d-%02d-%02d",y,m,Date.civil(y,m,-1).day.to_s)) == Date.civil(y,m,-1)
[17:53:27] ruby[bot]: apeiros: # => true (https://eval.in/991418)
[17:53:31] apeiros: Orxata_: ^
[17:53:55] apeiros: most of the code in that line is superfluous
[17:55:55] mikecmpbll: has joined #ruby
[17:56:19] ramfjord: has joined #ruby
[17:56:39] n008f4g_: has joined #ruby
[17:56:49] unreal_: has joined #ruby
[17:57:26] havenwood: vutral|kali: RUBY_VERSION
[17:57:40] alfiemax: has joined #ruby
[18:05:50] shmoon: has joined #ruby
[18:05:55] shmoon: has left #ruby: ()
[18:06:11] Orxata_: ArgumentError: wrong number of arguments (2 for 1)
[18:06:11] Orxata_: /usr/lib/ruby/1.8/date.rb:398:in `method_missing'
[18:06:11] Orxata_: /usr/lib/ruby/1.8/date.rb:398:in `civil_to_jd'
[18:06:11] Orxata_: /usr/lib/ruby/1.8/date.rb:632:in `valid_civil?'
[18:06:11] Orxata_: /usr/lib/ruby/1.8/date.rb:751:in `civil'
[18:06:45] karapetyan: has joined #ruby
[18:07:01] Orxata_: apeiros: what I'm doing here is (2017..2018.each do |y| (1..12).each do |m| end_date = Date.civil(y,m,-11)
[18:07:01] apeiros: ruby 1.8 is *ancient*. use a ruby which is not EOL.
[18:07:03] millerti: has joined #ruby
[18:07:15] Orxata_: Date.civil(y,m,-1)
[18:08:48] chouhoulis: has joined #ruby
[18:08:54] apeiros: `(2017..2018).each do |y| (1..12).each do |m| Date.civil(y,m,-1) end end` runs fine in ruby 2.5, and I can't help you with problems in ruby <2.3
[18:10:44] apeiros: if you can make a snippet which reproduces your problem in 2.3+, I can try to help
[18:12:23] apeiros: though, later. afk for ~50min
[18:15:48] jerematic: has joined #ruby
[18:18:15] duderonomy: has joined #ruby
[18:23:50] karapetyan: has joined #ruby
[18:23:56] venmx: has joined #ruby
[18:31:51] dc1: has joined #ruby
[18:33:53] synthroid: has joined #ruby
[18:35:27] guacamole: has joined #ruby
[18:35:27] guacamole: has joined #ruby
[18:37:22] bungfish: has joined #ruby
[18:38:02] karapety_: has joined #ruby
[18:38:11] sameerynho: has joined #ruby
[18:38:27] SeepingN: has joined #ruby
[18:38:56] mistergibson: has joined #ruby
[18:39:07] karapety_: has joined #ruby
[18:44:48] eckhardt: has joined #ruby
[18:49:10] duderonomy: has joined #ruby
[18:49:20] ronron: has joined #ruby
[18:59:39] apeiros: wow, accurate estimation :D
[19:02:59] bmurt: has joined #ruby
[19:03:02] Bish: depepnds on what you did
[19:03:13] Bish: have been watching the clock for 50 minutes ⇒ not so impressive
[19:03:34] Bish: ACTION sees himself out
[19:11:32] AJA4350: has joined #ruby
[19:12:34] nowhereman_: has joined #ruby
[19:16:37] apeiros: Bish: been jogging
[19:17:34] Bish: wish i did that
[19:17:36] Bish: but i am lazy
[19:18:50] dionysus69: whats up with <2.3, just curious
[19:19:12] cagomez_: has joined #ruby
[19:21:40] apeiros: dionysus69: what do you mean?
[19:22:28] dionysus69: you said you couldn't help with problems in ruby <2.3, in regards to Date.civil
[19:22:31] cadillac_: has joined #ruby
[19:22:39] dionysus69: just wonder why wouldnt that work in <2.3 :D
[19:22:53] apeiros: no, I said I can't help with problems which don't reproduce in 2.3+
[19:23:20] apeiros: and the reason is that <2.3 is *old* and I'm not going to install ancient rubies just to help some people who can't be arsed to upgrade.
[19:23:39] dionysus69: haha, I see :)
[19:24:14] dionysus69: I didn't consider 2.3 to be that old though, that was source of my wonder x)
[19:26:10] n3b: has joined #ruby
[19:27:05] apeiros: I need to add a ruboto command `!age 2.1` -> "Ruby 2.1 was released 2013-12-25, more than 4 years and 3 months ago."
[19:27:43] Eiam: oh dear 2.3 is old? I think i just updated a project to it =(
[19:27:49] apeiros: hm, maybe + " and is no longer maintained" / " and is still maintained" / "and end of maintenance is planned for …"
[19:27:59] Eiam: 2.5.1. damn.
[19:28:54] erlend: has joined #ruby
[19:30:28] Bored1238: has joined #ruby
[19:31:07] dionysus69: has joined #ruby
[19:35:23] n0m4d1c: has joined #ruby
[19:35:48] cagomez_: has joined #ruby
[19:36:36] apeiros: Eiam: 2.3 is still supported and IMHO fine
[19:37:53] hkais: has joined #ruby
[19:51:28] cagomez_: has joined #ruby
[19:52:34] alfiemax: has joined #ruby
[19:53:29] tAn: has joined #ruby
[19:55:32] eckhardt: has joined #ruby
[19:56:54] yosafbridge: has joined #ruby
[19:57:36] orbyt_: has joined #ruby
[20:06:49] cagomez_: has joined #ruby
[20:08:01] sidx64: has joined #ruby
[20:08:59] grilix: has joined #ruby
[20:10:06] sidx64_: has joined #ruby
[20:11:14] guacamole: has joined #ruby
[20:11:14] guacamole: has joined #ruby
[20:15:28] nadir: has joined #ruby
[20:16:28] tAn: has joined #ruby
[20:21:24] ellcs: has joined #ruby
[20:24:55] dr3wo: has joined #ruby
[20:26:12] synthroid: has joined #ruby
[20:28:08] pastorinni: has joined #ruby
[20:33:08] tomphp: has joined #ruby
[20:37:44] RougeR: has joined #ruby
[20:37:44] RougeR: has joined #ruby
[20:40:45] nightman: has joined #ruby
[20:42:23] alfiemax: has joined #ruby
[20:45:07] roshanavand: has joined #ruby
[20:51:51] tomphp: has joined #ruby
[20:54:06] Azure: has joined #ruby
[20:55:05] konsolebox: has joined #ruby
[20:56:08] jeffreylevesque: has joined #ruby
[20:58:43] coderphive: has joined #ruby
[20:59:33] ciscam: has joined #ruby
[21:06:15] \void: has joined #ruby
[21:07:18] tomphp_: has joined #ruby
[21:09:24] ramfjord: has joined #ruby
[21:11:40] orbyt_: has joined #ruby
[21:16:49] cschneid_: has joined #ruby
[21:17:47] d3mon: has joined #ruby
[21:17:53] sameerynho: has joined #ruby
[21:18:07] d3mon: has left #ruby: ()
[21:18:09] cschneid_: has joined #ruby
[21:20:21] dr3wo: has joined #ruby
[21:29:14] reber: has left #ruby: ("Leaving")
[21:31:21] ur5us: has joined #ruby
[21:37:37] erlend: has joined #ruby
[21:38:55] pabs: has joined #ruby
[21:39:51] ramfjord: has joined #ruby
[21:42:38] dgarstang: has joined #ruby
[21:43:21] dgarstang: Ruby makes me sad. Trying to get response from rest-client gem. If I use puts resp.body I see it but if I do puts ">>> #{resp.body} <<<" i don't. Why?
[21:44:16] konsolebox: has joined #ruby
[21:46:01] dgarstang: and why does puts.resp show me {"modified":"EA7SNK"} whereas puts.resp['modified'] shows me nothing. How can that be!?
[21:47:08] cliluw: has joined #ruby
[21:48:47] konsolebox: what's puts.resp.class
[21:49:37] dgarstang: konsolebox: RestClient::Response
[21:49:49] konsolebox: maybe it has a modified []
[21:50:36] dgarstang: It looks like I have to JSON.parse(resp) ...
[21:51:27] konsolebox: puts.resp.class.instance_method[:[]].owner
[21:51:53] konsolebox: the output of that is the class/module you might have to examine
[21:54:35] tdy: has joined #ruby
[21:54:45] MoskitoHero: has joined #ruby
[21:56:12] chouhoul_: has joined #ruby
[22:01:26] SynSynack: has joined #ruby
[22:02:26] roshanavand: has joined #ruby
[22:02:46] RougeR: has joined #ruby
[22:03:19] quobo: has joined #ruby
[22:12:12] cagomez_: has joined #ruby
[22:15:17] cagomez_: has joined #ruby
[22:20:08] ramfjord: has joined #ruby
[22:20:24] bambanx: has joined #ruby
[22:23:29] bambanx_: has joined #ruby
[22:23:55] dr3wo: has joined #ruby
[22:25:11] baweaver: 2.6 > (1..)
[22:26:24] n0m4d1c: has joined #ruby
[22:32:19] n008f4g_: has joined #ruby
[22:35:16] banisterfiend: has joined #ruby
[22:40:02] venmx: has joined #ruby
[22:40:17] cschneid_: has joined #ruby
[22:40:41] n008f4g_: has joined #ruby
[22:41:05] ramfjord: has joined #ruby
[22:41:37] d_kam___________: has joined #ruby
[22:42:02] rwb: has joined #ruby
[22:44:42] John_Ivan: has joined #ruby
[22:47:16] xt233: has joined #ruby
[22:59:49] bzb: has joined #ruby
[23:03:13] alfiemax: has joined #ruby
[23:03:51] cschneid_: has joined #ruby
[23:04:37] guacamole: has joined #ruby
[23:04:37] guacamole: has joined #ruby
[23:05:30] jeffreylevesque: has joined #ruby
[23:07:30] baweaver: Viva la revolution!
[23:09:07] ramfjord: has joined #ruby
[23:10:44] karapetyan: has joined #ruby
[23:10:52] jeen: has joined #ruby
[23:13:48] dc1: has joined #ruby
[23:14:34] tAn: has joined #ruby
[23:18:26] ramfjord: has joined #ruby
[23:18:31] d_kam___________: has joined #ruby
[23:21:25] Azure: has joined #ruby
[23:24:20] ramfjord: has joined #ruby
[23:26:49] amar: has joined #ruby
[23:26:58] yxhuvud: has joined #ruby
[23:28:53] arooni: question Could not find gem 'capistrano (~> 2.15.9)' in any of the gem sources listed in your Gemfile. ;; even when i have specifically tried specifying both https:http versions of rubygems
[23:30:03] jerematic: has joined #ruby
[23:31:21] ramfjord: has joined #ruby
[23:31:56] orbyt_: has joined #ruby
[23:36:05] schneider: has joined #ruby
[23:36:58] Mrgoose: has joined #ruby
[23:37:12] jeen: has joined #ruby
[23:39:17] d_kam___________: has joined #ruby
[23:39:27] duderonomy: has joined #ruby
[23:40:55] wilbert: has joined #ruby
[23:46:09] aarkerio: has joined #ruby
[23:46:16] cagomez_: has joined #ruby
[23:46:22] erlend: has joined #ruby
[23:48:36] jerematic: has joined #ruby
[23:50:56] aarkerio: quick question, I see: 13975487002892.to_s(36) = "4yc904i6k"
[23:51:18] aarkerio: where I can see all possible .to_s parameters?
[23:51:33] aarkerio: what's "36"?
[23:52:29] cagomez__: has joined #ruby
[23:54:30] xt233: has joined #ruby
[23:56:01] headius: aarkerio: base
[23:56:18] headius: so 36 is 0-9a-z for digits
[23:58:36] orbyt_: has joined #ruby
[23:59:18] aarkerio: hmmm, I see, thanks headius!
[23:59:31] n0m4d1c: has joined #ruby