Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
faitswulff has joined #ruby
jdawgaz has joined #ruby
faitswulff has quit [Remote host closed the connection]
brent__ has joined #ruby
faitswulff has joined #ruby
faitswulff has quit [Remote host closed the connection]
wild_buffalo has joined #ruby
tdy1 has quit [Ping timeout: 276 seconds]
<wild_buffalo>
Does anyone know what this means: if args?(args, 3) ...
<wild_buffalo>
I understand that when there is a ?, it means it returns a boolean value, but why is there a (args, 3) after?
<wild_buffalo>
Ah, looks like the ? is part of the function name
\void has quit [Ping timeout: 268 seconds]
<mroutis>
indeed, wild_buffalo, however, I couldn't found info about that function, is it defined elsewhere?
<wild_buffalo>
mroutis: No, it's just part of a library I was looking at
<wild_buffalo>
It's defined at the top, it just checks if the number of arguments were correct
<wild_buffalo>
I was curious about the ?, I thought it was some kind of operator, but if I understand correctly it's just a convention
<mroutis>
wild_buffalo: yes, function names accept a question mark as correct syntax, so it's used for functions that returns a boolean
DblLchn has joined #ruby
<elomatreb>
! as well, btw
thy0 has quit [Quit: TTFN]
<mroutis>
oh, true, elomatreb, the bang (!) convention is for methods that change data in a "destructive" way (modifying the object they are called on, instead of just outputting the result)
<mroutis>
wild_buffalo: ^
<elomatreb>
Not necessarily just that, e.g. Array#pop is destructive but doesn't have a bang
* mroutis
scratches head
<mroutis>
that's true, elomatreb
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elomatreb>
Some styleguides tell you to use it to indicate "dangerous (in some form, e.g. self-modifying or may raise) alternative to the method without the bang"
jdawgaz has joined #ruby
Puffball has joined #ruby
<mroutis>
ohh right, the "may raise", as in "save!" or "create!" in ruby on rails
wild_buffalo has quit [Ping timeout: 244 seconds]
<dbz>
I wish there was an alias
<dbz>
concat! for concat
<dbz>
Because it mutates
wild_buffalo has joined #ruby
<wild_buffalo>
mroutis: oh alright, cheers
<mroutis>
cheers!
bambanx has joined #ruby
faitswulff has joined #ruby
DblLchn has left #ruby ["AndroIRC"]
arescorpio has joined #ruby
\void has joined #ruby
dbz has quit [Remote host closed the connection]
wild_buffalo has quit [Ping timeout: 276 seconds]
mroutis has quit [Ping timeout: 240 seconds]
patr0clus has joined #ruby
ltp has quit [Quit: leaving]
mroutis has joined #ruby
faitswulff has quit [Remote host closed the connection]
mondz has quit [Read error: Connection reset by peer]
wild_buffalo has joined #ruby
AJA4350 has quit [Remote host closed the connection]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
\void has quit [Ping timeout: 240 seconds]
sspreitz has quit [Ping timeout: 276 seconds]
sspreitz has joined #ruby
braincrash has quit [Quit: bye bye]
sshock has quit [Ping timeout: 240 seconds]
braincrash has joined #ruby
patr0clus has quit [Quit: WeeChat 2.1]
\void has joined #ruby
yosafbridge has quit [Quit: Leaving]
mroutis has quit [Remote host closed the connection]
kapil___ has joined #ruby
DTZUZO has joined #ruby
yosafbridge has joined #ruby
Puffball has quit [Remote host closed the connection]
rivalomega has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arescorpio has quit [Quit: Leaving.]
moei has quit [Quit: Leaving...]
wild_buffalo has quit [Ping timeout: 276 seconds]
jdawgaz has joined #ruby
KadotyGamer has quit [Read error: Connection reset by peer]
rivalomega has quit [Read error: Connection reset by peer]
rivalomega has joined #ruby
dbz has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
Azure has joined #ruby
za1b1tsu has joined #ruby
ogres has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
aniarya82 has joined #ruby
code_zombie has joined #ruby
sleetdrop has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent__ has quit [Quit: Connection closed for inactivity]
<nofxx>
weaksauce, thank you, nice read. Adaptive Gains seems like very intersting for my heating scenario
cadillac_ has quit [Ping timeout: 240 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
konsolebox has quit [Read error: Connection reset by peer]
dbz has joined #ruby
kenichi has quit [Remote host closed the connection]
kenichi has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
apeiros has joined #ruby
dbz has quit [Ping timeout: 256 seconds]
bambanx has quit [Quit: Leaving]
Inline has quit [Quit: Leaving]
cadillac_ has joined #ruby
\void has quit [Ping timeout: 240 seconds]
alem0lars has joined #ruby
s2013 has joined #ruby
\void has joined #ruby
eckhardt_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eckhardt_ has quit [Client Quit]
Furai has quit [Quit: WeeChat 2.2]
za1b1tsu has joined #ruby
apeiros has quit [Remote host closed the connection]
Furai has joined #ruby
aupadhye has joined #ruby
Mike11 has joined #ruby
Mike11 has quit [Client Quit]
dionysus69 has quit [Ping timeout: 268 seconds]
pabs has quit [Ping timeout: 240 seconds]
kevinsjoberg has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
Mike11 has joined #ruby
xt233 has joined #ruby
xt233 has quit [Quit: Leaving]
dbz has joined #ruby
dbz has quit [Ping timeout: 276 seconds]
dellavg has joined #ruby
reber has joined #ruby
alem0lars has quit [Ping timeout: 268 seconds]
aniarya82 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
sleetdrop has quit [Quit: Computer has gone to sleep.]
dionysus69 has joined #ruby
TvL2386 has quit [Ping timeout: 260 seconds]
alem0lars has joined #ruby
Burgestrand has joined #ruby
druonysus has quit [Ping timeout: 240 seconds]
kevinsjoberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has quit [Read error: Connection reset by peer]
kevinsjoberg has joined #ruby
dbz has joined #ruby
ogres has quit [Quit: Connection closed for inactivity]
hahuang65 has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
Burgestrand has quit [Quit: Closing time!]
TomyWork has joined #ruby
alem0lars has quit [Ping timeout: 265 seconds]
sleetdrop has joined #ruby
yohji has joined #ruby
aniarya82 has joined #ruby
dellavg has quit [Ping timeout: 240 seconds]
clemens3 has joined #ruby
Burgestrand has joined #ruby
fyrekitty has quit [Ping timeout: 276 seconds]
rivalomega has quit [Remote host closed the connection]
lytol_ has joined #ruby
drale2k_ has joined #ruby
DTZUZO has quit [Ping timeout: 256 seconds]
j416 has joined #ruby
wildermind has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Burgestrand has joined #ruby
dbz has joined #ruby
ferhaty has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
dbz has quit [Ping timeout: 244 seconds]
Dbugger has joined #ruby
moei has joined #ruby
Dbugger has quit [Ping timeout: 276 seconds]
tty has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
fyrekitty has joined #ruby
lipoqil has joined #ruby
drale2k_ has joined #ruby
<za1b1tsu>
I can't seem to force a ruby v to rvm. So I used rvm --default use 2.5.1 rvm use 2.5.1 but when I exit the project folder and then get back in it. It's still an older version. In the gemfile it says ruby 2.5.1. How can I force rvm to use 2.5.1
drale2k_ has quit [Client Quit]
venmx has joined #ruby
Freshnuts has joined #ruby
drale2k_ has joined #ruby
<za1b1tsu>
I needed to change .ruby-version file
tristanp has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tristanp has quit [Ping timeout: 268 seconds]
Freshnuts has quit [Quit: Leaving]
Beams has joined #ruby
drale2k_ has joined #ruby
code_zombie has quit [Quit: Leaving]
sleetdrop has quit [Remote host closed the connection]
rivalomega has joined #ruby
venmx has quit [Ping timeout: 272 seconds]
venmx has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
rivalomega has quit [Ping timeout: 240 seconds]
Dbugger has joined #ruby
dionysus69 has quit [Quit: dionysus69]
dionysus69 has joined #ruby
<livcd>
anyone used imba.io ? :))
kevinsjoberg has quit [Ping timeout: 260 seconds]
Burgestrand has quit [Quit: Closing time!]
alex`` has joined #ruby
aniarya82 has quit [Read error: Connection reset by peer]
cadillac_ has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
DTZUZO has joined #ruby
tristanp has joined #ruby
tristanp has quit [Ping timeout: 244 seconds]
AJA4350 has joined #ruby
donofrio has joined #ruby
faitswulff has joined #ruby
<dionysus69>
god.rb processes start and get terminated in first 1-2 seconds
<dionysus69>
and then they stay dead, logs aren't showing anything interesting, any ideas how can I debug?
Nicmavr has quit [Read error: Connection reset by peer]
apparition47 has joined #ruby
Nicmavr has joined #ruby
clorisu has joined #ruby
clorisu has quit [Client Quit]
Burgestrand has joined #ruby
Zaab1t has joined #ruby
rivalomega has joined #ruby
dionysus69 has quit [Quit: dionysus69]
rivalomega has quit [Remote host closed the connection]
<Criten>
jnor: you would need a redis instance running, and the redis gem
<Criten>
gem install redis
<Criten>
could also use a gemfile to manage dependencies (which is useful)
thy0 has joined #ruby
<jnor>
but when I already have redis installed through apt-get is this not redundant ?
<jnor>
I have little experience with ruby
<Burgestrand>
jnor the redis you see in the script is a library/package that allows ruby to communicate with your running redis server
<Burgestrand>
jnor it is not the redis program/server itself
<jnor>
ah so it's not == to installing redis though ruby
<jnor>
ok I see
<jnor>
thanks for clearing that up
faitswulff has quit [Remote host closed the connection]
<Criten>
correct jnor :)
tristanp has joined #ruby
bmurt has joined #ruby
tristanp has quit [Ping timeout: 244 seconds]
dellavg has joined #ruby
<jnor>
Criten: is this the same for the gem just called "rubygems" ?
<jnor>
a package that allow communication of sorts
<Burgestrand>
jnor it's the name of the ruby package manager (kind of), nowadays require "rubygems" is no longer necessary and it's always loaded
<jnor>
okie ty
<Burgestrand>
jnor it used to be a prerequisite to require (or load, or pull in, or activate) libraries and packages that you had installed through `gem install`
<apeiros>
boxrick: you should carefully read the docs of gsub!
<apeiros>
especially the part about its return value
<boxrick>
Is there any reason that wouldn't work, ie edge cases. I am currently going through someone elses code.
<boxrick>
Ok no problems will do :)
doubledup has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ikbenhet has joined #ruby
ikbenhet has quit [Client Quit]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
nowhereman_ has quit [Ping timeout: 240 seconds]
clemens3 has quit [Ping timeout: 276 seconds]
KidSk8 has joined #ruby
<boxrick>
I assume that exclamation mark is not doing any good
beowuff has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbz has quit [Remote host closed the connection]
<apeiros>
boxrick: well, what did you find out about gsub!'s behavior?
<boxrick>
nil return on no replace from ! is what I see
<apeiros>
yupp. and I wouldn't be surprised if that's what's messing up things for you.
<apeiros>
in general, you should not use gsub! if you care about the return value, since that's only to be used to figure whether something changed, not to get the changed string.
<apeiros>
if you care about the return value, use gsub without bang.
<apeiros>
note that there's a couple more methods working like that in core.
<boxrick>
Ok :)
drale2k_ has joined #ruby
jcarl43 has joined #ruby
Rootsudo has quit [Ping timeout: 244 seconds]
RedNifre has joined #ruby
cthulchu_ has joined #ruby
<RedNifre>
It's a bit weird, but `tail -f some.log | ruby somescript.rb` where somescript.rb does `$stdin.each_line do |line|` seems to hang somehow... am I doing this right?
<al2o3-cr>
jcarl43: i'm cheating, i'm using "\u2122" ;)
<Eiam>
sure to never cause confusion
<al2o3-cr>
not advised.
<Eiam>
look forward to losing an evening debugging that one. /s
Beams has quit [Quit: .]
lxsameer has joined #ruby
<RedNifre>
Hm, still having problems, I cut it down to `tail -f some.log | grep -e "this" -e "that" | ruby myscript.rb` but the $stdin.each_line still seems to hang.
Cthulu201 has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RedNifre>
I mean, if I remove the ruby part, I see each grep output line as they happen without any delay, line by line
<Eiam>
doesn't tail just keep sending you content...
<Eiam>
eventually your each_line is going to be waiting on new input, no?
<RedNifre>
tail -f sends new lines as they are added to the log. that works. The grep part also works.
<RedNifre>
Eiam it never triggers even once, that's the problem.
<Eiam>
yeah feels like something is trying to read all the content in at once or looking for an EOF or something there but, I'll admit I could be misunderstanding it there.
<Eiam>
does $stdin have anything at all?
Freshnuts has joined #ruby
<RedNifre>
I replaced the ruby script with a simple echo like `$stdin.each_line { |line| puts line }` but I still don't see any output.
<al2o3-cr>
RedNifre: are you setting STDIN.sync = true
<Eiam>
if you replace the tail with a cat does it start working?
szulak has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
sameerynho has joined #ruby
venmx has quit [Ping timeout: 272 seconds]
SeepingN has joined #ruby
jottr has joined #ruby
<RedNifre>
as2o3-cr no, never heard of that.
<RedNifre>
Eiam yes, it works with cat
<Eiam>
yeah, thought so.
<RedNifre>
Oh, I let the rubyecho running in background and I now have output. does it do batches?
<RedNifre>
does STDIN.sync = true turn it into line based mode?
<RedNifre>
oh, you mean its actually reading stuff, I just don't see it? okay...
<RedNifre>
i thought puts was always somewhat instant.
<RedNifre>
okay, I'll try...
<RedNifre>
wait, al2o3-cr said STDIN.sync? Or both?
<al2o3-cr>
RedNifre: STDIN.sync = true
<RedNifre>
okay...
<Eiam>
no, I/O is one of the most expensive modern operations on a computer
<Eiam>
you want to avoid it as much as possible
jottr has quit [Ping timeout: 276 seconds]
beeman has quit [Quit: Connection closed for inactivity]
<RedNifre>
well, i want live updates and the log doesn't change that often
<RedNifre>
anyway, it still doesn't work, neither with STDIN nor STDOUT
drale2k_ has joined #ruby
thejs has quit [Ping timeout: 276 seconds]
<RedNifre>
it works with `echo "hey" | ruby rubyecho.rb`, but I guess that's because it notices that the stream ends?
<RedNifre>
Hang on, I think it's the grep
<SeepingN>
STDIN.sync doesn't even makes sense does it?
<RedNifre>
When I do either `tail -f | grep...` or `tail -f | rubyecho` it works, but not with `tail -f | grep | rubyecho` so I guess that grep is buffering it? Hm.
<RedNifre>
yeah, I don't want individual bytes, I want lines.
<RedNifre>
Well, I don't understand why putting a grep between tail -f and the ruby script seems to buffer it, but I guess I can get rid of the grep and do it in ruby? Hm...
<RedNifre>
I don't really understand the problem, but I guess I can solve it by going all ruby then ._.
<RedNifre>
So you guys are doing tail -f | grep | ruby all the time without problems?
<SeepingN>
I doubt it. maybe if you use some of those fancy TTY methods of reading data.
<SeepingN>
but yeah, why bother at all. put it in the script
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 240 seconds]
<RedNifre>
Alright, it works. No idea what grep had to do with it. Thanks a lot!
<al2o3-cr>
RedNifre: ah i see why grep wasn't working, you need --line-buffered
Kilobyte22 has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Eiam>
beat me to it =) got distracted with othe rwork
<al2o3-cr>
Eiam: no worries ;)
<RedNifre>
Eiam because I thought I should give sed and awk a chance, lost motivation, so ruby slowly ate it all away.
<RedNifre>
oh, right, i could even move the tail -f into the ruby script...
<Eiam>
right but by using tail, grep, sed, awk and ruby, you vastly increase the amount of things I need to know to figure out what you've done and how to fix/update it
<Eiam>
not to mention every one of those has its own version that could all be updated independently
r3m_ has joined #ruby
<RedNifre>
don't worry, it's just a toy project just for myself, I won't outsource it to you...
<Eiam>
its the philosophical "I"
thy0 has quit [Quit: TTFN]
<Eiam>
its the you in 2 years, its the co-worker next month
<RedNifre>
In this case, the philosophical "I" is just "me"
<RedNifre>
no, I won't be using this thing in 2 years
<Eiam>
famous last words
<Eiam>
;)
<RedNifre>
It's a moot point since it's just tail -f some.log | ruby myscript.rb now, I'm sure I'll figure the tail -f out in 2 years ;)
r3m has quit [Ping timeout: 240 seconds]
r3m_ is now known as r3m
Sina has quit [Quit: Connection closed for inactivity]
nowhereman_ has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
thy0 has joined #ruby
yeeter has joined #ruby
dbz has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
DTZUZO has joined #ruby
dbz has joined #ruby
yeeter has quit [Quit: Leaving]
thejs has joined #ruby
s2013 has joined #ruby
eddof13 has quit [Ping timeout: 268 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
teej has joined #ruby
lxsameer has joined #ruby
weaksauce has joined #ruby
za1b1tsu has joined #ruby
wildermind has quit [Quit: Connection closed for inactivity]
lxsameer has quit [Ping timeout: 240 seconds]
dellavg has quit [Ping timeout: 240 seconds]
impermanence has joined #ruby
dviola has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jottr has joined #ruby
dbz has quit [Remote host closed the connection]
<RedNifre>
hmmm... is there something special in regexes with "#"? I want to match "aoeh o9uoe#8o" so I try [\w #]+ or [\w \#]+ but something weird is happening...