meinside has quit [Quit: Connection closed for inactivity]
Xiti has quit [Ping timeout: 250 seconds]
Xiti has joined #ruby
johnny56 has joined #ruby
jokester has joined #ruby
mat_bug has quit [Ping timeout: 252 seconds]
aupadhye has joined #ruby
clemens3 has joined #ruby
Mortomes|Work has joined #ruby
nowhereman has quit [Ping timeout: 252 seconds]
kristofferR has joined #ruby
ericboehs has quit [Ping timeout: 240 seconds]
kristoff_ has joined #ruby
grvgr has quit [Quit: Connection closed for inactivity]
kristofferR has quit [Ping timeout: 268 seconds]
aufi has joined #ruby
mat_bug has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ruby
AKPWD has quit [Quit: じゃね。]
APK has joined #ruby
ericboehs has joined #ruby
arekushi has quit [Ping timeout: 268 seconds]
jebix666 has joined #ruby
Tuor has joined #ruby
kevinsjoberg has joined #ruby
BH23 has joined #ruby
meinside has joined #ruby
<jebix666>
Hello, trying to get a grasp of the queuing functionality of Ruby. I looked at this example(https://ruby-doc.org/stdlib-2.0.0/libdoc/thread/rdoc/Queue.html) and it works, but I do not understand how. Does the last line “consumer.join” also triggers the producer or what does cause it to ingest into the queue. Sorry in advance for the dumb question.
mat_bug has quit [Remote host closed the connection]
clemens3 has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 244 seconds]
clemens3_ has joined #ruby
dinfuehr has joined #ruby
<tbuehlmann>
the producer threads puts items in the queue and the consumer threads takes items out of the queue. if a program reaches the end of the file, the program will exit and the threads will be killed, even if they are still doing their things. if you want to wait for the threads to finish their things, you can call .join on them, that's what it's for
kristofferR has joined #ruby
<jebix666>
Thanks, so without the join at the end, they are esentially background processes and the script exits immediately but those threads continue working?
kristoff_ has quit [Ping timeout: 240 seconds]
<tbuehlmann>
right, threads run concurrently to your main thread. they will be killed when the program is exited, though, they don't continue
SyedAsif has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
<jebix666>
Ah okay, that makes sense
liya has joined #ruby
bruce_lee has joined #ruby
karochMyaso has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
karochMyaso has quit []
dinfuehr has joined #ruby
mikecmpbll has joined #ruby
jebix666 has quit [Quit: jebix666]
armyriad has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
armyriad has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 268 seconds]
ItsAVortex has quit [Quit: Leaving]
dhollin3 has joined #ruby
dhollinger has quit [Ping timeout: 240 seconds]
Xeago_ has joined #ruby
Xeago has quit [Ping timeout: 250 seconds]
Xeago_ is now known as Xeago
za1b1tsu has joined #ruby
ramfjord has joined #ruby
blackmesa has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
paranoicsan has joined #ruby
cnsvc has quit [Ping timeout: 256 seconds]
scottj has left #ruby [#ruby]
Guest16678 has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
cow[moo] has quit [Read error: Connection reset by peer]
tdy has quit [Quit: WeeChat 1.9.1]
cow[moo] has joined #ruby
blackmesa has joined #ruby
neoma is now known as lunarkitty
za1b1tsu has quit [Remote host closed the connection]
ramfjord has joined #ruby
conta has quit [Ping timeout: 250 seconds]
blackmesa has quit [Ping timeout: 246 seconds]
blackmesa has joined #ruby
ramfjord has quit [Ping timeout: 246 seconds]
akem__ is now known as akem
arekushi has joined #ruby
conta has joined #ruby
ramfjord has joined #ruby
spiette has quit [Ping timeout: 245 seconds]
spiette has joined #ruby
snk has quit [Ping timeout: 240 seconds]
snk has joined #ruby
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
paranoicsan has joined #ruby
AJA4350 has joined #ruby
Mortomes|Work has quit [Ping timeout: 256 seconds]
ramfjord has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
danst has joined #ruby
<danst>
hi, is it possible to ask "TCPSocket.available?" or similar before reading TCPSocket.gets ?
<danst>
I'm trying to avoid threading, so I just do small things in a loop and then read string when done
<danst>
then when nothing available I continue do small things
<danst>
possible with ruby?
<danst>
I think it should be possible to do similar as on arduino with Serial.available?
<danst>
I just want to omit lock on gets
<danst>
so it doesn't wait for input but does something else
<danst>
and reads input only if there's something available on the socket
<danst>
since it's simple irc bot, whenever > 0 bytes available, I can gets
<danst>
the goal of this is to add a timer
<danst>
and I can't really check for elapsed time while gets is hanging the process
<danst>
while channel is idle
Leifr has joined #ruby
<bhaak>
possibly IO.select
<bhaak>
but for a simple IRC bot I wouldn't do any lowlevel network stuff myself but just use cinch
akem has quit [Ping timeout: 244 seconds]
<danst>
bhaal: I've tried ready = IO.select([@socket]); and do @socket.gets if ready[0]
<danst>
but it works same as without it, ready[0] returns [#<TCPSocket:fd 10, AF_INET, 192.168.70.187, 55003>] always
<danst>
it still locks ;s
<bhaak>
have you opened the connection with connect_nonblock?
<danst>
maybe I have to timeout socketwaiting for 0.5 seconds
<al2o3-cr>
danst: what about Socket#nread
<al2o3-cr>
returns the amount of bytes that can be read without blocking
<danst>
I think I'm using TCPSocket
<danst>
found nonblock_read for it
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
paranoicsan has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
ellcs has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
fritzroy15 has joined #ruby
<fritzroy15>
hello, I'm having a hard time installing ruby with rvm on docker, has anyone else gone down that rabbit hole?
akem has joined #ruby
<danst>
oh no it's so bad.... just found it as accepted on stackoverflow: Timeout::timeout(1) { line=io.gets }
nowhereman has joined #ruby
<danst>
well if it works I'm ok with it
<bruce_lee>
fritzroy15:
<bruce_lee>
maybe "chruby" and "ruby-install" are working...
alfiemax_ has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
orbyt_ has joined #ruby
Inline has joined #ruby
orbyt_ has quit [Client Quit]
renich has joined #ruby
renich has quit [Remote host closed the connection]
renich_ has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
renich has joined #ruby
orbyt_ has joined #ruby
za1b1tsu has quit [Ping timeout: 246 seconds]
sagax has quit [Ping timeout: 272 seconds]
krawchyk has joined #ruby
jcarl43 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
\void has joined #ruby
fritzroy15 has quit [Remote host closed the connection]
nowhereman has quit [Ping timeout: 240 seconds]
sagax has joined #ruby
salasrod has quit [Remote host closed the connection]
salasrod has joined #ruby
millerti has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
jamied has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has quit [Quit: krawchyk]
za1b1tsu has joined #ruby
krawchyk has joined #ruby
tdy has joined #ruby
mikecmpbll has quit [Ping timeout: 272 seconds]
orbyt_ has joined #ruby
Guest16678 has quit [Ping timeout: 244 seconds]
alfiemax has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
ellcs has joined #ruby
AJA4350 has quit [Remote host closed the connection]
troulouliou_div2 has joined #ruby
AJA4350 has joined #ruby
reber has joined #ruby
lxsameer has joined #ruby
AJA4351 has joined #ruby
krawchyk has quit [Quit: krawchyk]
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
BTRE has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 240 seconds]
jamied has joined #ruby
ravenousmoose has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
conta has joined #ruby
conta has quit [Ping timeout: 240 seconds]
aufi has joined #ruby
krawchyk has joined #ruby
AJA4351 has joined #ruby
aufi has quit [Ping timeout: 272 seconds]
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
blackmesa1 has joined #ruby
renich_ is now known as renich
cnsvc has joined #ruby
sagax has quit [Ping timeout: 268 seconds]
tankf33der has joined #ruby
blackmesa1 has quit [Ping timeout: 252 seconds]
tarptaeya has joined #ruby
jamied has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby
BTRE has quit [Ping timeout: 244 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
* baweaver
will never beat havenwood to updating a Ruby version
<havenwood>
baweaver: I swear, you did once!
BTRE has joined #ruby
<havenwood>
:P
cubillosxy_py has quit [Quit: leaving]
jgpawletko has quit [Quit: jgpawletko]
solocshaw has joined #ruby
marmotini_ has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
solocshaw has quit [Client Quit]
Fernando-Basso has joined #ruby
marmotini_ has quit [Ping timeout: 246 seconds]
<kevinsjoberg>
Is it possible to retrieve the available `public_methods` in the order they were defined?
<kevinsjoberg>
I'm writing a step based library and would like to use a class instead of a custom DSL to define my steps. But this all come down crashing unless i can retrieve the methods in their defined order.
APK is now known as AKP
AKP is now known as AKPWD
tpanarch1st has joined #ruby
<phaul>
even if there was a way, it just feels error prone
<phaul>
making the code dependent on require order and such
<kevinsjoberg>
phaul: you're right, I'll just stick to a DSL then.
<phaul>
baweaver: I tried to find AST mathing stuff on reddit yesterday for you. I couldn't find it, because that's not where I had seen it. Guess what, it was your github activity :D
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
marmotini_ has joined #ruby
tarptaeya has left #ruby ["Konversation terminated!"]
jsrtr has quit [Remote host closed the connection]
nchambers has joined #ruby
alfiemax has joined #ruby
mikecmpbll has joined #ruby
krawchyk has quit [Quit: krawchyk]
alfiemax has quit [Ping timeout: 244 seconds]
krawchyk has joined #ruby
marmotini_ has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
houhoulis has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 245 seconds]
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 250 seconds]
Dbugger has quit [Remote host closed the connection]
conta has joined #ruby
AJA4351 has joined #ruby
conta has quit [Ping timeout: 244 seconds]
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
ravenousmoose is now known as ravenousmoose[aw
Lewis is now known as Lewix
ravenousmoose[aw has quit [Quit: Taking a quick nap...ZZzzz]
AJA4350 has quit [Ping timeout: 240 seconds]
jgpawletko has joined #ruby
SeepingN has joined #ruby
krawchyk has quit [Quit: krawchyk]
Swyper has joined #ruby
krawchyk has joined #ruby
AJA4350 has joined #ruby
Swyper has quit [Remote host closed the connection]
knueppelspass has joined #ruby
jgpawletko has quit [Quit: jgpawletko]
reber has quit [Remote host closed the connection]
spacesuitdiver has joined #ruby
liya has quit [Quit: ZNC 1.6.5+deb1+deb9u1 - http://znc.in]
Xiti has quit [Quit: Xiti]
houhoulis has joined #ruby
krawchyk has quit [Quit: krawchyk]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 272 seconds]
AJA4351 is now known as AJA4350
jinie has joined #ruby
jcalla has quit [Remote host closed the connection]
cthulchu_ is now known as programm3r
ellcs has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
blackmesa1 has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
programm3r is now known as cthulchu_
krawchyk has joined #ruby
knueppelspass has quit [Quit: Leaving]
gigetoo has quit [Ping timeout: 244 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
agent_white has joined #ruby
AJA4350 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu_ has quit [Read error: Connection reset by peer]
cthulchu_ has joined #ruby
BH23 has joined #ruby
polishdub has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
tpanarch1st has quit [Quit: Thanks for your help, nice to see you, take care.]
<phaul>
oh boy.. TDD ftw. Im just skimming through the solutions of https://www.codewars.com/kata/59dd3ccdded72fc78b000b25 and it's amazing how many ways ppl can fluke it with completely broken code and still pass the tests
za1b1tsu has quit [Remote host closed the connection]
<nchambers>
reminds me of a story I heard about a student who submitted his assignment right at midnight so his hardcoded timestamps passed all of the professors tests
BH23 has quit [Ping timeout: 250 seconds]
gix has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
blackmesa1 has quit [Ping timeout: 252 seconds]
cats has joined #ruby
spacesuitdiver has quit [Ping timeout: 250 seconds]
lxsameer has quit [Quit: WeeChat 2.3]
lxsameer has joined #ruby
blackmesa1 has joined #ruby
tdy has quit [Quit: WeeChat 1.9.1]
Fernando-Basso has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagmz has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
Leifr has quit [Quit: Going offline, see ya! (www.adiirc.com)]
cnsvc has joined #ruby
<cagmz>
How do I "undo" a module `prepend` dynamically at runtime?
<cagmz>
it overrides a method, and then calls `super`, but I only want to cal `super` with the args
Pistos has joined #ruby
<phaul>
I don't think you can undo, or remove stuff of ancestry. You can only add more to it. But what do you mean by "I only want to cal `super` with the args" ?
<Pistos>
How can I take a string "\"<div id=\\\"receipt\\\">\\n\\n" and turn it into "<div id=\"receipt\">\n\n" ?
<phaul>
cagmz: you mean the overriden method would be just def f(*args, &block); super ; end ?