justache_ has quit [Remote host closed the connection]
bathtub_shark has quit [Ping timeout: 260 seconds]
Fire-Dragon-DoL has quit [Ping timeout: 260 seconds]
justache has quit [Ping timeout: 260 seconds]
bastilian has quit [Ping timeout: 260 seconds]
bathtub_shark has joined #ruby
lupine has joined #ruby
bastilian has joined #ruby
oz has joined #ruby
justache has joined #ruby
Fire-Dragon-DoL has joined #ruby
kapil___ has joined #ruby
aupadhye has joined #ruby
cschneid_ has joined #ruby
Hans-Peter-Ingo has joined #ruby
Hans-Peter-Ingo has quit [Client Quit]
HansPeterIngo has joined #ruby
cschneid_ has quit [Ping timeout: 245 seconds]
KrzaQ has joined #ruby
<KrzaQ>
it's a bit disappointing that array returned by Time.to_a cannot be used to initialize a new time object
<KrzaQ>
I just want to set the hour to something I want, is it not possible in plain Ruby?
zenspider has quit [Read error: Connection reset by peer]
dbz has joined #ruby
alex``` has quit [Ping timeout: 240 seconds]
dbz has quit [Remote host closed the connection]
alex``` has joined #ruby
roshanavand has joined #ruby
lomex has joined #ruby
reber has joined #ruby
cschneid_ has joined #ruby
roshanavand has quit [Ping timeout: 246 seconds]
<Radar>
Anything is possible.
<Radar>
KrzaQ: Time.new(2018, 9, 4, 18, 0, 0)
mike11 has joined #ruby
<KrzaQ>
yes, my point is I want to change one of those values
<baweaver_away>
Time.new(2018, 10, 4, 18, 0, 0)
<KrzaQ>
I went with arr = my_time.to_a; arr[2] = the_hour_i_want; Time.new *arr[0...6].reverse
baweaver_away is now known as baweaver
dbz has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
<Radar>
KrzaQ: is the hour you want a relative value to the current hour?
<KrzaQ>
no
<KrzaQ>
nor my time is relative to Time.now
<Radar>
fun
<KrzaQ>
I just wanted t.hour = x
doubledup has joined #ruby
<KrzaQ>
double fun is that t.to_a can't be used to initialize new Time object :(
doubledup has quit [Client Quit]
<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
<KrzaQ>
hm, I'll always bundle activesupport in the future
<KrzaQ>
my software is deployed on a corporate server behind a gazillion firewalls
<Radar>
Seems like changing the hour with AS changes the minutes + seconds too
<Radar>
irb(main):002:0> t = Time.now
<Radar>
=> 2018-09-04 16:56:52 +1000
<Radar>
=> 2018-09-04 06:00:00 +1000
<Radar>
irb(main):003:0> t.change(hour: 6)
cschneid_ has quit [Ping timeout: 252 seconds]
<KrzaQ>
ugh
<KrzaQ>
well, my solution works, even if it's ugly and doesn't account for timezones
<KrzaQ>
I just wanted to rant a bit ;)
<KrzaQ>
I mean, this is something that could perhaps use improvement
<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
cschneid_ has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
cschneid_ has joined #ruby
nowhere_man has joined #ruby
sysvalve has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
HansPeterIngo has quit [Read error: Connection reset by peer]
sameerynho has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
cschneid_ has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
dbz has quit [Ping timeout: 252 seconds]
sameerynho has quit [Ping timeout: 260 seconds]
code_zombie has quit [Quit: Leaving]
tristanp has joined #ruby
snickers has joined #ruby
tristanp has quit [Ping timeout: 260 seconds]
yohji has joined #ruby
mikecmpbll has joined #ruby
drale2k_ has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
dbz has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
cschneid_ has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
xt233 has joined #ruby
xt233 has quit [Remote host closed the connection]
cschneid_ has quit [Ping timeout: 252 seconds]
Guest58115 has joined #ruby
lomex has joined #ruby
cschneid_ has joined #ruby
lomex has quit [Client Quit]
cschneid_ has quit [Ping timeout: 240 seconds]
Freshnuts has quit [Quit: Leaving]
cschneid_ has joined #ruby
clorisu has joined #ruby
Beams has joined #ruby
clorisu has quit [Read error: Connection reset by peer]
prestorium has joined #ruby
nikivi has quit [Quit: ZNC is awesome]
aufi has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
nikivi has joined #ruby
cschneid_ has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 246 seconds]
cschneid_ has joined #ruby
anikras has joined #ruby
drale2k_ has joined #ruby
roshanavand has joined #ruby
xt233 has joined #ruby
xt233 has quit [Client Quit]
aufi has quit [Remote host closed the connection]
aufi has joined #ruby
GodFather has quit [Ping timeout: 252 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Read error: Connection timed out]
prestorium has quit [Quit: prestorium]
bomb has joined #ruby
Blaguvest has joined #ruby
drale2k_ has joined #ruby
esrse has quit [Ping timeout: 246 seconds]
dbz has joined #ruby
dbz has quit [Ping timeout: 260 seconds]
clorisu has joined #ruby
cschneid_ has joined #ruby
GodFather has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
cschneid_ has joined #ruby
psmolen has quit [Ping timeout: 246 seconds]
psmolen has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
thinkpad has quit [Quit: lawl]
cschneid_ has quit [Ping timeout: 246 seconds]
nikivi has quit [Quit: ZNC is awesome]
roshanavand has quit [Ping timeout: 272 seconds]
cschneid_ has joined #ruby
thinkpad has joined #ruby
ams__ has joined #ruby
ams__ has quit [Client Quit]
ams__ has joined #ruby
nikivi has joined #ruby
mostlybadfly has joined #ruby
cschneid_ has quit [Ping timeout: 244 seconds]
jinie has joined #ruby
ArahaelPi has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
AJA4350 has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
ArahaelPi has joined #ruby
psmolen has quit [Ping timeout: 260 seconds]
psmolen has joined #ruby
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
roshanavand has joined #ruby
Blaguvest has quit [Ping timeout: 252 seconds]
bomb has quit [Ping timeout: 260 seconds]
roshanavand has quit [Ping timeout: 260 seconds]
bomb has joined #ruby
cschneid_ has joined #ruby
roshanavand has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
cschneid_ has joined #ruby
ArahaelPi has quit [Ping timeout: 260 seconds]
dbz has joined #ruby
hfp has joined #ruby
hfp_work has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
roshanavand has quit [Read error: Connection reset by peer]
dbz has quit [Ping timeout: 240 seconds]
cschneid_ has joined #ruby
hfp has quit [Ping timeout: 250 seconds]
hfp_work has quit [Ping timeout: 250 seconds]
hfp has joined #ruby
hfp_work has joined #ruby
dbz has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
sticaz has joined #ruby
Lloyd has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
donofrio has joined #ruby
sticaz has quit [Quit: sticaz]
bmurt has joined #ruby
jcalla has joined #ruby
sticaz has joined #ruby
snickers has quit [Ping timeout: 260 seconds]
mike11 has quit [Read error: Connection reset by peer]
cschneid_ has quit [Ping timeout: 260 seconds]
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
jane_booty_doe has joined #ruby
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 272 seconds]
Lyfe has joined #ruby
Rapture has joined #ruby
tristanp has joined #ruby
sylario has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
dbz has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
gnufied has joined #ruby
dbz has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
dbz has quit [Ping timeout: 245 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
Inline has joined #ruby
mrush has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 240 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbz has joined #ruby
anikras has quit [Quit: Ex-Chat]
armyriad has quit [Ping timeout: 240 seconds]
armyriad has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
akem__ has quit [Ping timeout: 244 seconds]
^Fish has joined #ruby
mroutis has joined #ruby
thejs has joined #ruby
akem has joined #ruby
rippa has joined #ruby
drale2k_ has joined #ruby
dionysus69 has quit [Ping timeout: 245 seconds]
<headius>
bomb: enebo and others have been maintaining JRubyFX on and off
johnny56 has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
Guest58115 has quit [Ping timeout: 245 seconds]
Alina-malina has joined #ruby
Guest58115 has joined #ruby
johnny56 has joined #ruby
Guest58115 has quit [Ping timeout: 244 seconds]
typeVoid has joined #ruby
lenqbit has quit [Ping timeout: 245 seconds]
<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 )
Guest58115 has joined #ruby
weaksauce has joined #ruby
<cjohnson>
typeVoid: Seems like that should be def initialize not self.?
Guest58115 has quit [Ping timeout: 240 seconds]
cschneid_ has quit [Remote host closed the connection]
Guest58115 has joined #ruby
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
lomex has joined #ruby
<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
<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 )
<typeVoid>
*Line 26
<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
Guest58115 has quit [Ping timeout: 260 seconds]
thejs has joined #ruby
sticaz has joined #ruby
<cjohnson>
typeVoid: You forgot to include the error in your gist
<typeVoid>
oops `undefined method `fetch_value' for nil:NilClass`
<cjohnson>
Well I don't see fetch_value in your code so not sure how we can help with that
<typeVoid>
It's with rails, I don't call the method from my code
Guest58115 has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jenrzzz>
typeVoid: don't override #initialize on ActiveRecord models
Guest58115 has quit [Ping timeout: 245 seconds]
<jenrzzz>
typeVoid: use before_create or similar callbacks if you need to do stuff before saving
<cjohnson>
Oh and that :)
<typeVoid>
Everything's working fine now! Thank you
<jenrzzz>
i'm just gonna override #collect_concat in my class #yolo
<cjohnson>
When are we gonna see refinements get more love
Guest58115 has joined #ruby
<jenrzzz>
cjohnson: if/when activesupport is rewritten to use them
<cjohnson>
I mean at the language level
<cjohnson>
They're still fairly limited aren't they
<cjohnson>
Like for indirect method calls they don't apply
zenspider has joined #ruby
Guest58115 has quit [Ping timeout: 252 seconds]
<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
<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
Rootsudo has quit [Ping timeout: 260 seconds]
<WA9ACE>
lots of stuff will need to get rewritten with Ruby 3 anyway right? Since autoloading will be gone
redlegion has quit [Ping timeout: 256 seconds]
<zenspider>
meh. that won't affect that much tbh
<apeiros>
WA9ACE: hm? where did you read that autoloading will be gone? you are referring to Kernel#autoload, right?
<zenspider>
that ball's been rollin' for a while now
postmodern has joined #ruby
<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
Guest58115 has joined #ruby
<apeiros>
and that bug ticket is 7y old too…
Emmanuel_Chanel has joined #ruby
<apeiros>
and afaik they even resolved the thread safety issues
<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
<WA9ACE>
oh well I must've missed that
<zenspider>
Target version changed from 2.2.0 to Next Major
<zenspider>
that was 1 year ago
redlegion has joined #ruby
redlegion has quit [Excess Flood]
redlegion has joined #ruby
lenqbit has joined #ruby
Guest58115 has quit [Ping timeout: 260 seconds]
<WA9ACE>
on an unrelated note, I'm on ruby.social and in here, but are there any other public ruby related hangouts?
lomex has joined #ruby
<WA9ACE>
for chatting that is, not necessarily places like /r/ruby
Guest58115 has joined #ruby
lomex has quit [Client Quit]
<jenrzzz>
WA9ACE: there are some slack channels... rubydevelopers.slack.com among others
<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)
<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
thejs has quit [Remote host closed the connection]
Alina-malina has joined #ruby
<jjman>
compiled ruby with readline support but its no keeping history, is this the default?
<jjman>
nm, need to create a .irbc
tty has joined #ruby
<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
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]