« Back to channel list

#ruby - 04 September 2018

« Back 1 day Forward 1 day »
[00:02:04] tristanp: has joined #ruby
[00:17:16] Nicmavr: has joined #ruby
[00:24:02] Cork: has joined #ruby
[00:28:01] howlcode: has joined #ruby
[00:39:47] iamdevnul: has joined #ruby
[00:39:58] Cork: has joined #ruby
[00:45:29] Arahael: has left #ruby: ("WeeChat 2.0.1")
[00:48:56] orbyt_: has joined #ruby
[00:50:42] dviola: has joined #ruby
[00:50:57] danguita: has joined #ruby
[01:09:40] eckhardt: has joined #ruby
[01:12:32] unCork: has joined #ruby
[01:12:40] mniip: has joined #ruby
[01:16:30] Guest58115: has joined #ruby
[01:47:28] esrse: has joined #ruby
[01:59:00] x0F: has joined #ruby
[02:07:35] eckhardt: has joined #ruby
[02:29:52] orpl: has joined #ruby
[02:49:00] d^sh: has joined #ruby
[02:50:14] BTRE: has joined #ruby
[03:09:39] m4rCsi: has joined #ruby
[03:10:46] braincrash: has joined #ruby
[03:11:02] arescorpio: has joined #ruby
[03:13:42] mroutis: has joined #ruby
[03:17:09] Guest58115: has joined #ruby
[03:24:59] dionysus69: has joined #ruby
[03:30:06] kapil___: has joined #ruby
[03:34:11] Nicmavr: has joined #ruby
[03:36:48] pyrmont: has joined #ruby
[03:47:40] duderonomy: has joined #ruby
[03:52:01] DTZUZO: has joined #ruby
[03:54:14] Johano: has joined #ruby
[04:05:45] mr_rich101: has joined #ruby
[04:15:33] Guest58115: has joined #ruby
[04:22:39] dionysus69: has joined #ruby
[04:30:12] _whitelogger: has joined #ruby
[04:34:16] Johano: has left #ruby: ("Leaving")
[05:00:13] _whitelogger: has joined #ruby
[05:03:35] hahuang65: has joined #ruby
[05:08:55] cschneid_: has joined #ruby
[05:10:40] d^sh: has joined #ruby
[05:11:44] c0ncealed2: has joined #ruby
[05:20:41] danguita: has joined #ruby
[05:22:26] cschneid_: has joined #ruby
[05:29:46] dellavg_: has joined #ruby
[05:31:18] MoritaShinobu: has joined #ruby
[05:38:55] dbz: has joined #ruby
[05:46:50] dionysus69: has joined #ruby
[05:48:30] iamdevnul: has joined #ruby
[05:48:31] Apocalypse: has joined #ruby
[05:49:22] sriehl_: has joined #ruby
[05:49:37] Mutsuhito: has joined #ruby
[05:49:48] justache_: has joined #ruby
[05:50:40] bathtub_shark: has joined #ruby
[05:50:51] lupine: has joined #ruby
[05:51:24] bastilian: has joined #ruby
[05:51:39] oz: has joined #ruby
[05:51:56] justache: has joined #ruby
[05:52:45] Fire-Dragon-DoL: has joined #ruby
[06:11:43] kapil___: has joined #ruby
[06:12:33] aupadhye: has joined #ruby
[06:14:40] cschneid_: has joined #ruby
[06:18:05] Hans-Peter-Ingo: has joined #ruby
[06:18:49] HansPeterIngo: has joined #ruby
[06:26:10] KrzaQ: has joined #ruby
[06:26:40] KrzaQ: it's a bit disappointing that array returned by Time.to_a cannot be used to initialize a new time object
[06:27:07] KrzaQ: I just want to set the hour to something I want, is it not possible in plain Ruby?
[06:33:00] dbz: has joined #ruby
[06:36:16] alex```: has joined #ruby
[06:37:13] roshanavand: has joined #ruby
[06:37:28] lomex: has joined #ruby
[06:43:49] reber: has joined #ruby
[06:44:58] cschneid_: has joined #ruby
[06:50:13] Radar: Anything is possible.
[06:50:45] Radar: KrzaQ: Time.new(2018, 9, 4, 18, 0, 0)
[06:50:49] Mike11: has joined #ruby
[06:51:06] KrzaQ: yes, my point is I want to change one of those values
[06:51:22] baweaver_away: Time.new(2018, 10, 4, 18, 0, 0)
[06:51:33] KrzaQ: I went with arr = my_time.to_a; arr[2] = the_hour_i_want; Time.new *arr[0...6].reverse
[06:51:52] dbz: has joined #ruby
[06:52:38] Radar: KrzaQ: is the hour you want a relative value to the current hour?
[06:52:54] KrzaQ: nor my time is relative to Time.now
[06:53:13] KrzaQ: I just wanted t.hour = x
[06:53:25] doubledup: has joined #ruby
[06:53:51] KrzaQ: double fun is that t.to_a can't be used to initialize new Time object :(
[06:54:40] Radar: I would do: Time.new(my_time.year, my_time.month, my_time.day, my_special_hour, my_time.minute, my_time.second)... but yeah, you're right that it'd be nice to change it
[06:54:45] Radar: ActiveSupport provides .change iirc
[06:54:56] Radar: https://stackoverflow.com/a/9041759/15245
[06:56:37] KrzaQ: hm, I'll always bundle activesupport in the future
[06:57:05] KrzaQ: my software is deployed on a corporate server behind a gazillion firewalls
[06:57:09] Radar: Seems like changing the hour with AS changes the minutes + seconds too
[06:57:14] Radar: irb(main):002:0> t = Time.now
[06:57:14] Radar: => 2018-09-04 16:56:52 +1000
[06:57:14] Radar: irb(main):003:0> t.change(hour: 6)
[06:57:14] Radar: => 2018-09-04 06:00:00 +1000
[06:58:04] KrzaQ: well, my solution works, even if it's ugly and doesn't account for timezones
[06:58:13] KrzaQ: I just wanted to rant a bit ;)
[06:58:32] KrzaQ: I mean, this is something that could perhaps use improvement
[06:59:49] KrzaQ: Speaking of, I'm not certain this FAQ makes sense: https://ruby-doc.org/core-2.4.1/Time.html Time.at(1234).strftime "%M:%S" will break for any number over 3600
[07:02:02] cschneid_: has joined #ruby
[07:08:43] roshanavand: has joined #ruby
[07:11:16] cschneid_: has joined #ruby
[07:14:06] nowhere_man: has joined #ruby
[07:19:16] sysvalve: has joined #ruby
[07:24:23] cschneid_: has joined #ruby
[07:36:52] sameerynho: has joined #ruby
[07:40:29] dbz: has joined #ruby
[07:41:36] cschneid_: has joined #ruby
[07:50:06] tristanp: has joined #ruby
[07:51:07] snickers: has joined #ruby
[07:57:12] yohji: has joined #ruby
[07:58:13] mikecmpbll: has joined #ruby
[07:58:36] drale2k_: has joined #ruby
[08:03:16] cschneid_: has joined #ruby
[08:04:48] dbz: has joined #ruby
[08:20:45] cschneid_: has joined #ruby
[08:20:46] xt233: has joined #ruby
[08:30:30] Guest58115: has joined #ruby
[08:31:45] lomex: has joined #ruby
[08:33:42] cschneid_: has joined #ruby
[08:46:52] cschneid_: has joined #ruby
[08:49:18] clorisu: has joined #ruby
[08:50:41] Beams: has joined #ruby
[08:51:47] prestorium: has joined #ruby
[08:54:41] aufi: has joined #ruby
[08:56:08] nikivi: has joined #ruby
[08:59:58] cschneid_: has joined #ruby
[09:12:56] cschneid_: has joined #ruby
[09:18:39] anikras: has joined #ruby
[09:23:41] drale2k_: has joined #ruby
[09:27:20] roshanavand: has joined #ruby
[09:28:05] xt233: has joined #ruby
[09:32:12] aufi: has joined #ruby
[09:45:32] bomb: has joined #ruby
[09:45:38] Blaguvest: has joined #ruby
[10:02:59] drale2k_: has joined #ruby
[10:19:58] dbz: has joined #ruby
[10:29:24] clorisu: has joined #ruby
[10:32:11] cschneid_: has joined #ruby
[10:40:17] GodFather: has joined #ruby
[10:44:58] cschneid_: has joined #ruby
[10:48:44] psmolen: has joined #ruby
[10:50:59] zapata: has joined #ruby
[10:58:02] cschneid_: has joined #ruby
[11:00:09] thinkpad: has joined #ruby
[11:00:23] ams__: has joined #ruby
[11:02:23] ams__: has joined #ruby
[11:02:58] nikivi: has joined #ruby
[11:03:55] mostlybadfly: has joined #ruby
[11:06:57] jinie: has joined #ruby
[11:11:14] cschneid_: has joined #ruby
[11:18:59] AJA4350: has joined #ruby
[11:24:58] ArahaelPi: has joined #ruby
[11:26:16] psmolen: has joined #ruby
[11:28:43] cschneid_: has joined #ruby
[11:38:57] roshanavand: has joined #ruby
[11:54:31] bomb: has joined #ruby
[11:54:49] cschneid_: has joined #ruby
[11:55:36] roshanavand: has joined #ruby
[12:07:47] cschneid_: has joined #ruby
[12:13:59] dbz: has joined #ruby
[12:15:17] hfp: has joined #ruby
[12:15:47] hfp_work: has joined #ruby
[12:20:51] cschneid_: has joined #ruby
[12:32:48] hfp: has joined #ruby
[12:33:18] hfp_work: has joined #ruby
[12:34:43] dbz: has joined #ruby
[12:46:44] sticaz: has joined #ruby
[12:52:40] Lloyd: has joined #ruby
[12:55:42] dionysus69: has joined #ruby
[12:57:36] donofrio: has joined #ruby
[12:58:29] bmurt: has joined #ruby
[13:03:55] jcalla: has joined #ruby
[13:04:42] sticaz: has joined #ruby
[13:31:43] nicesignal: has joined #ruby
[13:35:54] jane_booty_doe: has joined #ruby
[13:36:47] cschneid_: has joined #ruby
[13:47:26] Lyfe: has joined #ruby
[13:50:13] Rapture: has joined #ruby
[13:52:30] tristanp: has joined #ruby
[13:54:11] Sylario: has joined #ruby
[13:57:22] dbz: has joined #ruby
[14:02:27] gnufied: has joined #ruby
[14:07:37] dbz: has joined #ruby
[14:12:51] Inline: has joined #ruby
[14:14:26] Nicmavr: has joined #ruby
[14:14:37] Inline: has joined #ruby
[14:19:08] cschneid_: has joined #ruby
[14:28:03] dbz: has joined #ruby
[14:29:32] armyriad: has joined #ruby
[14:41:44] ^Fish: has joined #ruby
[14:44:29] mroutis: has joined #ruby
[14:49:43] thejs: has joined #ruby
[14:49:53] akem: has joined #ruby
[14:57:19] rippa: has joined #ruby
[15:05:20] drale2k_: has joined #ruby
[15:22:58] headius: bomb: enebo and others have been maintaining JRubyFX on and off
[15:23:08] headius: https://github.com/jruby/jrubyfx
[15:23:12] dviola: has joined #ruby
[15:23:34] lytol_: has joined #ruby
[15:31:51] duderonomy: has joined #ruby
[15:33:15] ^Fish: if ruby_executable_hooks is in path, what can cause it to not be found when starting something like gitaly?
[15:36:34] bomb: headius: cool!
[15:36:53] j0bk: has joined #ruby
[15:36:56] headius: you can use it as a DSL or with FXML
[15:59:57] Azure: has joined #ruby
[16:07:36] eckhardt: has joined #ruby
[16:07:39] [Butch]: has joined #ruby
[16:21:11] orbyt_: has joined #ruby
[16:38:16] Dbugger: has joined #ruby
[16:39:19] DTZUZO: has joined #ruby
[16:41:24] mrush: has joined #ruby
[16:41:33] conta2: has joined #ruby
[16:53:25] rootsudo: has joined #ruby
[16:56:28] dbz: has joined #ruby
[16:57:57] SeepingN: has joined #ruby
[16:58:05] dbz: has joined #ruby
[16:58:58] dbz: has joined #ruby
[17:02:05] DTZUZO: has joined #ruby
[17:09:39] lalitmee: has joined #ruby
[17:17:58] Kilo`byte: has joined #ruby
[17:26:50] DTZUZO: has joined #ruby
[17:27:51] GodFather: has joined #ruby
[17:28:16] Guest58115: has joined #ruby
[17:30:21] duderonomy: has joined #ruby
[17:33:49] duderonomy: has joined #ruby
[17:34:37] duderonomy: has joined #ruby
[17:35:11] ^Fish: is ruby_executable_hooks part of rvm or is it something different?
[17:35:23] duderonomy: has joined #ruby
[17:36:14] duderonomy: has joined #ruby
[17:38:22] Guest58115: has joined #ruby
[17:41:33] doubledup: has joined #ruby
[17:46:56] samort7: has joined #ruby
[17:48:17] Guest58115: has joined #ruby
[17:58:28] Guest58115: has joined #ruby
[18:02:17] dbz_: has joined #ruby
[18:08:01] mistergibson: has joined #ruby
[18:14:46] Emmanuel_Chanel: has joined #ruby
[18:15:11] duderonomy: has joined #ruby
[18:16:51] cliluw: has joined #ruby
[18:24:37] havenwood: ^Fi, yes, it's part of RVM.
[18:28:26] Xiti: has joined #ruby
[18:34:22] BTRE: has joined #ruby
[18:38:55] ShekharReddy: has joined #ruby
[18:42:37] spiette: has joined #ruby
[18:43:11] cschneid_: has joined #ruby
[18:43:13] Guest58115: has joined #ruby
[18:44:55] MuffinPimp: has joined #ruby
[18:45:09] mikecmpbll: has joined #ruby
[18:46:43] havenwood: https://github.com/rvm/executable-hooks
[18:50:25] lenqbit: has joined #ruby
[18:53:11] Guest58115: has joined #ruby
[18:57:17] Emmanuel_Chanel: has joined #ruby
[19:00:38] Alina-malina: has joined #ruby
[19:03:26] Guest58115: has joined #ruby
[19:06:29] johnny56: has joined #ruby
[19:07:51] typeVoid: has joined #ruby
[19:11:54] typeVoid: I have a User class that inherits from Application record, is the initialize method called when I run User.new? ( https://git.io/fABMC )
[19:13:13] Guest58115: has joined #ruby
[19:14:46] weaksauce: has joined #ruby
[19:15:46] cjohnson: typeVoid: Seems like that should be def initialize not self.?
[19:23:12] Guest58115: has joined #ruby
[19:24:10] jenrzzz: has joined #ruby
[19:24:36] lomex: has joined #ruby
[19:25:56] jenrzzz: does anyone know how to make #collect_concat/#flat_map work on a custom Enumerable class? i'm getting an array of my array-like objects instead of the elements inside them
[19:26:39] typeVoid: I've changed user.rb so that the file looks like ( https://git.io/fABDa ), I know initialize is being run now but when calling user.save! from another file, an error is thrown ( https://git.io/fABDQ )
[19:27:25] jenrzzz: i see here in flat_map_i it checks the array type and then if the type check fails it pushes the yielded value, otherwise it concatenates it. in my case i think it's taking the first branch: https://github.com/ruby/ruby/blob/trunk/enum.c#L551
[19:28:47] thejs: has joined #ruby
[19:28:47] sticaz: has joined #ruby
[19:29:33] cjohnson: typeVoid: You forgot to include the error in your gist
[19:30:50] typeVoid: oops `undefined method `fetch_value' for nil:NilClass`
[19:31:10] cschneid_: has joined #ruby
[19:31:48] typeVoid: full trace ( https://git.io/fAByB )
[19:31:49] cjohnson: Well I don't see fetch_value in your code so not sure how we can help with that
[19:32:17] typeVoid: It's with rails, I don't call the method from my code
[19:33:16] Guest58115: has joined #ruby
[19:37:32] jenrzzz: typeVoid: don't override #initialize on ActiveRecord models
[19:38:05] jenrzzz: typeVoid: use before_create or similar callbacks if you need to do stuff before saving
[19:40:22] cjohnson: Oh and that :)
[19:40:25] typeVoid: Everything's working fine now! Thank you
[19:41:34] jenrzzz: i'm just gonna override #collect_concat in my class #yolo
[19:42:37] cjohnson: When are we gonna see refinements get more love
[19:43:17] Guest58115: has joined #ruby
[19:43:52] jenrzzz: cjohnson: if/when activesupport is rewritten to use them
[19:45:19] cjohnson: I mean at the language level
[19:45:25] cjohnson: They're still fairly limited aren't they
[19:45:40] cjohnson: Like for indirect method calls they don't apply
[19:46:04] zenspider: has joined #ruby
[19:48:01] jenrzzz: cjohnson: yeah... I haven't been following that closely but I think there's a chicken/egg issue of limited adoption discouraging future development on it. need something big like rails going all-in on them. honestly these guys are usually thinking 5-10 years ahead when they add these language features so they might not take off until paradigms shift a bit more
[19:48:44] jenrzzz: the majority of ruby people probably just don't feel like the current system of monkey-patching is all that bad. sure you can code yourself into some really unpleasant situations but there are ways of doing things that avoid that
[19:50:43] WA9ACE: lots of stuff will need to get rewritten with Ruby 3 anyway right? Since autoloading will be gone
[19:51:07] zenspider: meh. that won't affect that much tbh
[19:51:32] apeiros: WA9ACE: hm? where did you read that autoloading will be gone? you are referring to Kernel#autoload, right?
[19:51:39] WA9ACE: apeiros https://bugs.ruby-lang.org/issues/5653
[19:52:40] zenspider: that ball's been rollin' for a while now
[19:53:12] postmodern: has joined #ruby
[19:53:14] apeiros: I've heard (even from matz himself f2f) that he doesn't like autoload, but I've never heard a definitive date of removal
[19:53:22] Guest58115: has joined #ruby
[19:53:22] apeiros: and that bug ticket is 7y old too…
[19:53:32] Emmanuel_Chanel: has joined #ruby
[19:54:02] apeiros: and afaik they even resolved the thread safety issues
[19:54:09] WA9ACE: I could've swore I read something about autoload needing to be removed or reworked to allow for the concurrency changes wanting to be made to MRI
[19:54:20] WA9ACE: oh well I must've missed that
[19:54:36] zenspider: Target version changed from 2.2.0 to Next Major
[19:54:41] zenspider: that was 1 year ago
[19:54:46] redlegion: has joined #ruby
[19:55:15] redlegion: has joined #ruby
[19:56:11] lenqbit: has joined #ruby
[19:59:08] WA9ACE: on an unrelated note, I'm on ruby.social and in here, but are there any other public ruby related hangouts?
[19:59:34] lomex: has joined #ruby
[19:59:47] WA9ACE: for chatting that is, not necessarily places like /r/ruby
[20:03:16] Guest58115: has joined #ruby
[20:03:25] jenrzzz: WA9ACE: there are some slack channels... rubydevelopers.slack.com among others
[20:04:13] jenrzzz: alrighty, I made a gist to show what I'm trying to do: https://gist.github.com/jenrzzz/9e0269d2a8c4e6a564ecc67629cd4fe4
[20:04:22] sameerynho: has joined #ruby
[20:05:03] jenrzzz: basically, call #collect_concat on a regular Array but have the block yield RecordRelation classes and still get them catenated into a regular Array (or RecordRelation for bonus points)
[20:06:52] jenrzzz: i can't tell if the flat_map implementation is checking if the yielded value is a plain Array or just array-like, but it seems to be related to this call to rb_check_array_type: https://github.com/ruby/ruby/blob/trunk/enum.c#L548
[20:12:41] desperek: has joined #ruby
[20:13:16] Guest58115: has joined #ruby
[20:14:52] MuffinPimp: has joined #ruby
[20:22:47] lomex: has joined #ruby
[20:28:13] orbyt_: has joined #ruby
[20:30:26] z3uS: has joined #ruby
[20:31:34] zenspider: has joined #ruby
[20:35:12] samort7: has joined #ruby
[20:35:21] beefjoe: has joined #ruby
[20:37:05] ellcs: has joined #ruby
[20:40:30] alex``: has joined #ruby
[20:40:37] Azure: has joined #ruby
[20:43:04] mroutis: has joined #ruby
[20:55:53] Mike11: has joined #ruby
[21:06:09] jp: has joined #ruby
[21:07:45] jane_booty_doe: has joined #ruby
[21:11:52] beeman: has joined #ruby
[21:18:53] beowuff: has joined #ruby
[21:23:13] mroutis_: has joined #ruby
[21:23:22] akem: has joined #ruby
[21:23:56] baweaver: GOOD AFTERNOON!~
[21:24:45] baweaver: Got permission to translate this into Ruby: https://medium.com/@roman01la/understanding-transducers-in-javascript-3500d3bd9624
[21:27:23] Ron9: has joined #ruby
[21:28:39] alicef: has joined #ruby
[21:29:45] sticaz: has joined #ruby
[21:33:14] leitz: has joined #ruby
[21:34:39] Sembei: has joined #ruby
[21:34:52] leitz: How do you make irb use vim style up-arrows? I had it working great and then upgraded the machine.
[21:36:04] bougyman: leitz: make a ~/.inputrc and set the vi editing mode in that.
[21:36:13] bougyman: which will work for any readline based applications
[21:44:17] alicef: has joined #ruby
[21:45:53] clorisu: has joined #ruby
[21:47:57] lomex: has joined #ruby
[21:52:58] leitz: So far "set editing-mode vi" in both .editrc and .inputrc fails.
[21:53:37] bougyman: works here.
[21:53:41] bougyman: is your ruby built without readline?
[21:56:02] blackjid: has joined #ruby
[22:00:32] yokel: has joined #ruby
[22:01:31] eckhardt: has joined #ruby
[22:02:27] thejs: has joined #ruby
[22:03:03] cthulchu: has joined #ruby
[22:03:30] ellcs: has joined #ruby
[22:16:22] apeiros: has joined #ruby
[22:17:16] Guest58115: has joined #ruby
[22:19:41] bomb: has joined #ruby
[22:21:36] MzrE: has joined #ruby
[22:21:47] nertzy: has joined #ruby
[22:26:31] MuffinPimp: has joined #ruby
[22:29:51] ChrisBr: has joined #ruby
[22:36:51] orbyt_: has joined #ruby
[22:37:43] dionysus69: has joined #ruby
[22:38:22] al2o3-cr: leitz: just use hjkl and be done ;)
[22:39:25] eckhardt: has joined #ruby
[22:44:12] havenwood: Or use with-readline or that other readline command line app I can never remember the name of: with-readline irb
[22:45:41] DTZUZO: has joined #ruby
[22:55:01] ArahaelPi: has joined #ruby
[22:58:51] al2o3-cr: >> [[40,120],[65,145],[20,160],[40,140],[30,101]].each_with_object('') { |(x, y), s| s << (x&y) + ((x^y) >> 1) }
[22:58:55] bomb_: has joined #ruby
[22:59:45] lomex: has joined #ruby
[23:02:57] eckhardt: has joined #ruby
[23:04:06] duderonomy: has joined #ruby
[23:06:00] zenspider: has joined #ruby
[23:07:28] zenspider: has joined #ruby
[23:09:08] ivanskie: has joined #ruby
[23:16:29] stabe: has joined #ruby
[23:18:03] al2o3-cr: >> [[28,128],[63,71],[-33,180],[35,131]].each_with_object('') { |(x, y), s| s << (x&y) + ((x^y) >> 1) }
[23:19:34] clorisu: has joined #ruby
[23:19:39] al2o3-cr: bot broken like me?
[23:19:50] zenspider: the repl has been off and on for a while
[23:20:00] zenspider: might be down for now
[23:20:58] al2o3-cr: zenspider: good to know. thank you.
[23:22:14] al2o3-cr: thought i was unidentified for some reason then.
[23:24:17] daemonwrangler: has joined #ruby
[23:29:17] savolla: has joined #ruby
[23:29:32] al2o3-cr: can anyone test this on bsd/macOS; https://gist.github.com/gr33n7007h/00e79169d888e8ae893fb1ab06fa3158
[23:40:25] Alina-malina: has joined #ruby
[23:42:50] jjman: compiled ruby with readline support but its no keeping history, is this the default?
[23:45:48] jjman: nm, need to create a .irbc
[23:46:23] tty: has joined #ruby
[23:50:31] leitz: Taking a break from study. Readline wasn't found "/usr/local/src/ruby/ext/readline/extconf.rb:62: Neither readline nor libedit was found". readline-devel was not installed. Time to rebuild... is ins