havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
perrierjouet has quit [Quit: WeeChat 3.4.1]
infinityfye has quit [Quit: Leaving]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex8 has joined #ruby
ur5us has joined #ruby
markong has quit [Ping timeout: 272 seconds]
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
ferr_ has joined #ruby
fercell has quit [Ping timeout: 252 seconds]
gr33n7007h has quit [Ping timeout: 256 seconds]
gr33n7007h has joined #ruby
Thanzex8 has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
<havenwood> wand: If you're using Threads for I/O, consider Async Fibers instead.
Tasi has joined #ruby
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
tweaks has quit [Quit: tweaks]
Tasi has quit [Quit: Leaving]
Rounin has quit [Ping timeout: 260 seconds]
tweaks has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
hanzo has joined #ruby
gr33n7007h has quit [Read error: Connection reset by peer]
gr33n7007h has joined #ruby
mooff has quit [Remote host closed the connection]
mooff has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
duds- has quit [Ping timeout: 252 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
duds- has joined #ruby
quintasan has quit []
quintasan has joined #ruby
eddof13 has joined #ruby
o|||||o has quit [Ping timeout: 272 seconds]
gr33n7007h has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
hd1 has joined #ruby
hanzo has quit [Quit: Connection closed for inactivity]
hd1 has quit [Quit: Connection closed]
gr33n7007h has quit [Ping timeout: 240 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
gr33n7007h has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
John_Ivan has quit [Ping timeout: 240 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
gr33n7007h has quit [Ping timeout: 260 seconds]
gr33n7007h has joined #ruby
roadie has joined #ruby
ur5us has joined #ruby
dionysus69 has joined #ruby
gr33n7007h has quit [Ping timeout: 260 seconds]
gr33n7007h has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
oxfuxxx has joined #ruby
teclator has joined #ruby
gr33n7007h has quit [Ping timeout: 256 seconds]
oxfuxxx has quit [Ping timeout: 260 seconds]
gr33n7007h has joined #ruby
oxfuxxx has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
oxfuxxx has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
d-s has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gr33n7007h has joined #ruby
oxfuxxx has quit [Ping timeout: 260 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Client Quit]
Rounin has joined #ruby
oxfuxxx has joined #ruby
nmollerup has quit [Quit: Leaving]
oxfuxxx has quit [Ping timeout: 245 seconds]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
oxfuxxx has joined #ruby
oxfuxxx has quit [Remote host closed the connection]
oxfuxxx has joined #ruby
gr33n7007h has quit [Ping timeout: 260 seconds]
nmollerup has joined #ruby
gr33n7007h has joined #ruby
oxfuxxx has quit [Ping timeout: 272 seconds]
oxfuxxx has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
oxfuxxx has quit [Remote host closed the connection]
gr33n7007h has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
lunarkitty has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Remote host closed the connection]
oxfuxxx has joined #ruby
tuxcrafter has quit [Quit: Client closed]
legit has quit [Quit: WeeChat 2.8]
oxfuxxx has quit [Ping timeout: 250 seconds]
gr33n7007h has quit [Ping timeout: 250 seconds]
legit has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
oxfuxxx has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
gr33n7007h has quit [Ping timeout: 272 seconds]
roadie has joined #ruby
Thanzex has joined #ruby
gr33n7007h has joined #ruby
oxfuxxx has quit [Ping timeout: 260 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 252 seconds]
oxfuxxx has joined #ruby
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
oxfuxxx has quit [Ping timeout: 268 seconds]
perrierjouet has joined #ruby
gr33n7007h has quit [Ping timeout: 272 seconds]
jhawthorn_ has joined #ruby
jhawthorn has quit [Ping timeout: 256 seconds]
perrierjouet has quit [Quit: WeeChat 3.4.1]
perrierjouet has joined #ruby
oxfuxxx has joined #ruby
perrierjouet has quit [Quit: WeeChat 3.4.1]
oxfuxxx has quit [Ping timeout: 256 seconds]
d-s has quit [Remote host closed the connection]
perrierjouet has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
oxfuxxx has joined #ruby
markong has joined #ruby
o|||||o has joined #ruby
In0perable has quit [Quit: All your buffer are belong to us!]
Inoperable has joined #ruby
oxfuxxx has quit [Ping timeout: 245 seconds]
lunarkitty has quit [Quit: Connection closed for inactivity]
d-s has joined #ruby
d-s has quit [Read error: Connection reset by peer]
oxfuxxx has joined #ruby
d-s has joined #ruby
oxfuxxx has quit [Ping timeout: 260 seconds]
reset has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
oxfuxxx has joined #ruby
d-s has quit [Quit: Leaving...]
d-s has joined #ruby
oxfuxxx has quit [Ping timeout: 260 seconds]
Guest35 has joined #ruby
Guest35 has quit [Client Quit]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
<adam12> morning
John_Ivan has joined #ruby
gr33n7007h has quit [Ping timeout: 250 seconds]
gr33n7007h has joined #ruby
bit4bit has joined #ruby
<oz> o/
<adam12> oz: how goes
<wand> adam12: ok thanks
<wand> mooff: thanks for the tip
<wand> havenwood: I am using them for IO. I'll check out async fibers, thanks
roadie has quit [Ping timeout: 252 seconds]
wand is now known as teard0wn
teard0wn is now known as teardown
<oz> adam12: so far so good. I'm done porting Ruby 2 for this week. :)
<adam12> oz: Porting where?
<adam12> oz: Oh, were you fixing the kwargs to Ruby 3?
<oz> adam12: that would be me yeah. I'm done porting ruby 2 stuff to ruby 3 for now. :)
<adam12> oz: Fun.
<adam12> oz: I have a long running project that's similar.
<adam12> oz: I'm actually fairly close myself. All internal code is fixed, and almost _every_ dependency except Que. And it doesn't look long for Que now.
teardown has quit [Quit: leaving]
<adam12> If you haven't already, I suggest enabling deprecation warnings during tests. Warning[:deprecated] = true
wand has joined #ruby
<adam12> Lest someone starts adding deprecations when you're not paying attention.
wand has quit [Client Quit]
<oz> oh yeah, definitely. Another project's stuck in 2.x land because of a dependency on Sneaker. The maintainer seems unresponsive lately. Not a good sign.
<adam12> That sucks.
<adam12> I walf on this every once in a while, but lately I'm hardcore wrapping all my external dependencies. It's the only sane way.
<adam12> Then at least I can just update my API in one single spot. It's hard because not all team members across projects know how or can do the same.
<adam12> I'm not sure how you'd wrap Sneaker tho :\
Guest193 has joined #ruby
<Guest193> hi guys!
<adam12> Guest193: Hello!
wand has joined #ruby
Guest193 has quit [Client Quit]
<adam12> :\
<oz> heh.
roadie has joined #ruby
<oz> maintaining a gem is work, I don't think the author gets paid to do it, or maybe not anymore.
<adam12> oz: Totally.
<mooff> neat. #then returns an Enumerator if you call it without a block.
<mooff> so you can do for example: 1.then.detect(&:odd?) # => 1
<mooff> 2.then.detect(&:odd?) # => nil
<oz> neat. :)
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
<adam12> mooff: That's cool.
michigan has joined #ruby
<libsys> hello people... I'm having a difficulty with Sequel... I have a model with a field I'm storing as JSON on database (but I'm not using JSON plugins)
<libsys> When I try to update that model, the one with custom logic doesn't update, abeit it's triggered
<libsys> I'll paste some code to show the problem, just 1 minute
<libsys> here it is: https://pastebin.com/pXsi9BKx
<libsys> BTW, I'm not even sure if directly editing @values is the way to do this, it only seemed logic
<adam12> libsys: You might have to indicate the column has changed
<adam12> Actually, I think you need to still do that, but that might not be your issue.
<adam12> I'll look after my meeting.
<adam12> libsys: Does it work if you do self[:options] =
gr33n7007h has quit [Ping timeout: 260 seconds]
<libsys> indeed that works
<libsys> so... that's the canonical way to use custom setters?
<adam12> libsys: It's generally the way I do it.
<adam12> libsys: you might be able to super(val) too. I sometimes do that.
<libsys> ok, thanks :)
<wand> does Thread include a way to timeout a thread
oxfuxxx has joined #ruby
<adam12> wand: No. You want Timeout.timeout, which also uses a Thread.
<adam12> wand: Tho if you're doing IO work, you should prefer that for timing out over other solutions.
oxfuxxx has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
* mooff searches Google for "yard rake"
* mooff quickly sees his folly
<adam12> lol
<oz> :D
<wand> thanks adam12
<wand> it works well
oxfuxxx has quit [Ping timeout: 256 seconds]
oxfuxxx has joined #ruby
tuxcrafter has joined #ruby
maroloccio has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
<adam12> wand: Just in case my last line wasn't clear: if you're doing IO work, prefer the IO timeout builtins where possible. Timeout.timeout only if not.
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
howdoi has joined #ruby
erts has joined #ruby
michigan has quit [Quit: Connection closed for inactivity]
fef has joined #ruby
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
_ht has joined #ruby
hololeap has joined #ruby
markong has quit [Ping timeout: 240 seconds]
___nick___ has joined #ruby
ged has joined #ruby
justOkay has quit [Read error: Connection reset by peer]
justOkay has joined #ruby
mdemo has joined #ruby
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
d-s has quit [Remote host closed the connection]
d-s has joined #ruby
___nick___ has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
___nick___ has joined #ruby
___nick___ has joined #ruby
<ox1eef> IO.select with a timeout is a pretty easy way to do that; i dont know if the other way really, just something to do with IO::WaitReadable
ralu has quit [Ping timeout: 252 seconds]
bit4bit has quit [Quit: Leaving]
roadie has quit [Ping timeout: 268 seconds]
roadie has joined #ruby
ralu has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Client Quit]
dionysus69 has quit [Ping timeout: 272 seconds]
hololeap has quit [Ping timeout: 240 seconds]
maroloccio has quit [Quit: WeeChat 3.0]
dionysus69 has joined #ruby
leah2_ has joined #ruby
howdoi_ has joined #ruby
<wand> thanks ox1eef, adam12.
<wand> for now I'm using Timout.timeout and it works fine
leah2 has quit [Ping timeout: 260 seconds]
howdoi has quit [Read error: Connection reset by peer]
howdoi_ is now known as howdoi
<wand> But I'm spawning 8 consumer threads to act as workers. is there a way to get a thread id for each?
<wand> i'm trying to log which worker / consumer thread gets which job from a queue
___nick___ has quit [Ping timeout: 272 seconds]
hololeap has joined #ruby
<mooff> wand: you can get the current thread with Thread.current
<mooff> can get and set the name of a thread with Thread#name, Thread#name=
<wand> mooff: thank you
<wand> cool
roadie has joined #ruby
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
pgib has quit [Ping timeout: 260 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
leah2_ is now known as leah2
fef has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
fef has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
markong has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
<newton> is there a recommended way to parse query params to hash besides CGI.parse or is that the thing to use?
perrierjouet has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 268 seconds]
roadie has joined #ruby
<adam12> newton: Is this a client or server? You could probably use Rack if it's the server.
roadie has quit [Ping timeout: 240 seconds]
<newton> yeah, parsing some params in a rails test case
<adam12> newton: Maybe just CGI.parse then. I'm not sure I'd use Rack for that.
<newton> got it
<newton> thx
markong has quit [Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/]
<ox1eef> rack will be available then - see https://rubydoc.info/gems/rack/Rack/Utils#parse_query-class_method (and parse_nested_query above)
<ox1eef> i think parse_nested_query supports foo[bar]=1 (Hash) and foo[]=1,2,3 (Array)
<leah2> really?
<leah2> you want foo[]=1&foo[]=2&foo[]=3
<newton> I do prefer parse_nested_query
<ox1eef> leah2: indeed, it is as you say.
roadie has joined #ruby
<leah2> adding that to rack was a mistake :p
roadie has quit [Ping timeout: 240 seconds]
<newton> why?
<leah2> because it belongs to rails
<leah2> nothing else uses these conventions, and the implementation caused some issues
roadie has joined #ruby
<newton> got it, thx :)
<ox1eef> through rails i think it became an established pattern, i see it as nice to have available regardless of framework.
roadie has quit [Ping timeout: 260 seconds]
tuxcrafter has quit [Quit: Client closed]
tuxcrafter has joined #ruby
perrierjouet has joined #ruby
roadie has joined #ruby
reset has quit [Quit: reset]
roadie has quit [Ping timeout: 240 seconds]