baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
jdawgaz has joined #ruby
marvin2 has left #ruby [#ruby]
Azure has joined #ruby
tdy1 has joined #ruby
cadillac_ has quit [Ping timeout: 276 seconds]
dviola has quit [Quit: WeeChat 2.2]
cadillac_ has joined #ruby
dviola has joined #ruby
nadir has joined #ruby
darkhanb has joined #ruby
RedNifre_ has left #ruby ["WeeChat 1.9.1"]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
mroutis has joined #ruby
elomatreb has quit [Quit: ZNC - https://znc.in]
elomatreb has joined #ruby
jshjsh has quit [Quit: Leaving]
sshock has joined #ruby
jdawgaz has joined #ruby
t0xik has joined #ruby
dbz has joined #ruby
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…]
s2013 has joined #ruby
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
dionysus69 has joined #ruby
ur5us has joined #ruby
ur5us has quit [Ping timeout: 272 seconds]
dbz has quit [Remote host closed the connection]
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]
jdawgaz has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.github.io]
paraxial has joined #ruby
jdawgaz has quit [Ping timeout: 260 seconds]
faitswulff has quit [Remote host closed the connection]
ikbenhet has joined #ruby
tristanp has joined #ruby
Sina has joined #ruby
t0xik has quit [Quit: Connection closed for inactivity]
tristanp has quit [Ping timeout: 272 seconds]
dbz has joined #ruby
dbz has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
jcalla has quit [Ping timeout: 240 seconds]
faitswulff has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnor has joined #ruby
<jnor> hi, this ruby script http://download.redis.io/redis-stable/src/redis-trib.rb has: "require 'redis'" so would I have to install redis through ruby, and no apt-get, in order to use the script without modifications?
<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`
drale2k_ has joined #ruby
drale2k_ has quit [Client Quit]
jcalla has joined #ruby
Stimpy_2000 has joined #ruby
drale2k_ has joined #ruby
IanMalcolm has joined #ruby
za1b1tsu has quit [Ping timeout: 272 seconds]
jnor has quit [Quit: WeeChat 2.2]
lupine has quit [Ping timeout: 272 seconds]
lupine has joined #ruby
blackbaba has joined #ruby
blackbaba has quit [Client Quit]
[Butch] has joined #ruby
faitswulff has joined #ruby
Inline has joined #ruby
aupadhye_ has joined #ruby
za1b1tsu has joined #ruby
aupadhye has quit [Ping timeout: 272 seconds]
tristanp has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
faitswulff has quit [Remote host closed the connection]
tristanp has quit [Remote host closed the connection]
[Butch] has joined #ruby
croberts has joined #ruby
apeiros has joined #ruby
Rapture has joined #ruby
ruby[bot] has joined #ruby
aupadhye_ has quit [Ping timeout: 276 seconds]
faitswulff has joined #ruby
aupadhye_ has joined #ruby
Rootsudo has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
aupadhye_ has quit [Ping timeout: 256 seconds]
noidedsuper has joined #ruby
cschneid_ has joined #ruby
apparition47 has quit [Quit: Bye]
faitswulff has quit [Remote host closed the connection]
augcesar has joined #ruby
rivalomega has joined #ruby
Alina-malina has quit [Ping timeout: 260 seconds]
gnufied has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
ikbenhet has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has joined #ruby
Stimpy_2000 has quit [Ping timeout: 260 seconds]
tdy1 has joined #ruby
wild_buffalo has joined #ruby
eddof13 has joined #ruby
Yxhuvud has quit [Remote host closed the connection]
ferhaty has quit [Quit: ferhaty]
polishdub has joined #ruby
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
weaksauce has quit [Ping timeout: 244 seconds]
spider-mario has quit [Read error: Connection reset by peer]
Burgestrand has quit [Quit: Closing time!]
Yxhuvud has joined #ruby
Mike11 has quit [Quit: Leaving.]
kapil___ has quit [Quit: Connection closed for inactivity]
dbz has joined #ruby
r29v has joined #ruby
r29v has quit [Client Quit]
jottr has joined #ruby
<boxrick> Hello folks, I have the following line 'current_role = current_role.gsub!(/[^0-9A-Za-z]/, '')'
<boxrick> Which seems to generate all sorts of errors randomly depending on the system
rippa has joined #ruby
beowuff has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<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?
<RedNifre> ...to be precise it's actually `tail -f some.log | somesedinabashscript | ruby ...`
darkhanb has joined #ruby
<RedNifre> so, my question is: why does it seem to hang on $stdin.each_line even though I pipe lines into it?
<apeiros> the $stdin.each_line should only block until a full line is in the buffer
<RedNifre> some people on the internet says that it buffers 20 lines for them... hm...
rivalomega has quit [Remote host closed the connection]
rivalomega has joined #ruby
<apeiros> are you sure the buffering happens on the ruby side?
IanMalcolm has joined #ruby
<RedNifre> hang on, I'll make sure...
patr0clus has joined #ruby
hell0h0la has joined #ruby
tdy1 is now known as tdy
hell0h0la has quit [Quit: Me piro, Vampiro]
IanMalcolm has quit [Ping timeout: 260 seconds]
<RedNifre> tatsache, es haengt irgendwie am sed fest... seltsam
IanMalcolm has joined #ruby
<RedNifre> oops, sorry
<RedNifre> indeed, it somehow hangs in sed... weird
ule has joined #ruby
<RedNifre> guess I'll trash sed and do it all in ruby
<ule> Hey guys. I'm using OpenStruct to dimanically convert a hash like: ':foo => "bar"' into something like: MyOpenStruct.foo
<ule> My question is how would you convert nested hashes as well? When I do OpenStruct.new(my_hash) it only converts the top level keys
* apeiros hands ule a "y" and an "n" for dynamically
<apeiros> though, manically doing stuff might be interesting too
<ule> apeiros: (: thanks
<apeiros> you'd write a recursive method
<ule> I'm creating a wrapper to the SpaceX Api
r29v has joined #ruby
s2013 has joined #ruby
<RedNifre> oh, does that api allow you to drive cars in space? or what does it do?
<ule> apeiros: I'm wondering if there is a kind of ruby magic oneline method that digs into all nested hash keys "Dynamically"
cadillac_ has joined #ruby
<ule> RedNifre: it will display launches data, it is really cool
<apeiros> ule: there are gems which do that if you don't want to write it yourself
<apeiros> I think one is named "hashy" or "hashie" or somesuch. maybe "mashy"?
<Criten> neat, didnt realize spacex had an api like that
<Criten> super cool
helloh0la has joined #ruby
<ule> Ohh. I know Hashie gem. I didn't know I could do that with it
<ule> apeiros: thanks
<ule> Criten: exactly what I need. Thanks!
<ule> Criten: so cool eh?
* apeiros prefers launching kerbals into space instead of using spacex api
druonysus has joined #ruby
<helloh0la> hi im new
<ule> Hi new, I'm ule
r29v has quit [Quit: r29v]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Criten> hi ule i'm helloh0la
lxsameer has quit [Ping timeout: 276 seconds]
<ule> man this Hashie gem has a lot of cool stuff
krawchyk has joined #ruby
<helloh0la> Hello ule, this is first time
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ule> wtf is that? a chatbot?
<ule> :D
Yxhuvud has quit [Remote host closed the connection]
<Criten> helloh0la: new to ruby? or IRC?
s2013 has joined #ruby
<helloh0la> Criten:in the IRC
<Criten> helloh0la: where are you from?
yohji has quit [Remote host closed the connection]
dbz has joined #ruby
lxsameer has joined #ruby
<helloh0la> Criten: Argentina
TomyWork has quit [Ping timeout: 240 seconds]
<ule> Hashie::Mash.new(foo = {a: 123, b: { c: 456 } }).b.c
<ule> 456
<ule> a w e s o m e
<apeiros> why'd you do `foo =` there?
<apeiros> it's confusing at best, wrong at worst.
Xiti has quit [Quit: Xiti]
<Criten> helloh0la: neat, i've never been there
jottr has quit [Ping timeout: 256 seconds]
nowhereman_ has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
<helloh0la> what IDE of ruby recommend me for a begginer ?
eckhardt_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
<RedNifre> I'm only doing hack jobs with ruby and I use vim, but many say rubymine is a good IDE
IanMalcolm has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
<helloh0la> ohh nice, now i use sublime text 3
Alina-malina has joined #ruby
Yxhuvud has joined #ruby
Xiti has joined #ruby
al2o3-cr has joined #ruby
<apeiros> helloh0la: I'd recommend a plaintext editor over an IDE for a beginner. sublime text 3 is quite nice.
<dbz> I don't think it matters if you use a plaintext editor nor an IDE as long as you learn something
<dbz> +1 to Rubymine and +100 to vim
<al2o3-cr> ule: check this out.
<al2o3-cr> >> require 'json'; JSON.parse({a: 123, b: {c: 456}}.to_json, object_class: OpenStruct).b.c
<ruby[bot]> al2o3-cr: # => 456 (https://eval.in/1049242)
za1b1tsu has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
lxsameer has quit [Ping timeout: 276 seconds]
k0mpa has quit [Remote host closed the connection]
Cthulu201 has quit [Ping timeout: 272 seconds]
ivanskie has joined #ruby
eckhardt has quit [Disconnected by services]
eckhardt_ is now known as eckhardt
hell0h0la has joined #ruby
<jcarl43> Is is possible to have dash in block arguments (eg.: ... do |var-name|)? I get a syntax error with this.
szulak has quit [Ping timeout: 256 seconds]
<Yxhuvud> no
patr0clus has quit [Quit: WeeChat 2.1]
<Yxhuvud> you can have underscores though
thejs has joined #ruby
<ule> oh yeah my bad, I don't need to "foo ="
<hell0h0la> hi
<ule> al2o3-cr: just using json lib eh, nice
hell0h0la has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<ule> RedNifre: I use vim as well. Love it
<al2o3-cr> >> (1..3).map { |var−name| var−name * 3 }
<ruby[bot]> al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
IanMalcolm has quit [Ping timeout: 256 seconds]
<al2o3-cr> >> (1..3).map { |var−name| var−name * 3 }
<ruby[bot]> al2o3-cr: # => [3, 6, 9] (https://eval.in/1049246)
<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?
<al2o3-cr> RedNifre: when set to true all output in buffer is immediately flush to the OS.
<Eiam> removes buffering
<SeepingN> STDOUT.sync... not STDIN
helloh0la has quit [Quit: helloh0la]
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<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]
<al2o3-cr> RedNifre: so; `tail -f log | grep --lined-buffered "foo" | ruby script.rb
druonysus has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
<RedNifre> ah, thanks al2o3-cr, that seems to explain it!
<RedNifre> ...but it's too late, it's all ruby now anyway ;)
<al2o3-cr> RedNifre: cool ;)
wild_buffalo has quit [Ping timeout: 272 seconds]
<al2o3-cr> SeepingN: i don't know what i was thinking with STDIN.sync = true there i must be honest ;?
sauvin has quit [Remote host closed the connection]
timmow has quit [Ping timeout: 256 seconds]
timmow has joined #ruby
Freshnuts has quit [Quit: Leaving]
patr0clus has joined #ruby
orbyt_ has joined #ruby
dionysus69 has joined #ruby
icarus has joined #ruby
<Eiam> why don't you just have ruby do all the work
<Eiam> instead of piping shit into a ruby script at the end
<Eiam> just have ruby do the file.open etc...
<al2o3-cr> Eiam: they are now ;)
<Eiam> ah, sorry
<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…]
nowhereman_ has quit [Ping timeout: 256 seconds]
s2013 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
Guest23176 has joined #ruby
DTZUZO has quit [Ping timeout: 256 seconds]
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
Guest23176 has quit [Ping timeout: 256 seconds]
catsed has joined #ruby
cats has quit [Ping timeout: 256 seconds]
dviola has quit [Read error: Connection reset by peer]
catsed is now known as cats
x0f_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has quit [Remote host closed the connection]
dviola has joined #ruby
dbz_ has joined #ruby
haylon_ has joined #ruby
APK has joined #ruby
alnewkir1 has joined #ruby
jyaworski_ has joined #ruby
x0f has quit [Ping timeout: 256 seconds]
mr_rich101 has quit [Ping timeout: 256 seconds]
spectra has quit [Ping timeout: 256 seconds]
jyaworski has quit [Ping timeout: 256 seconds]
dbz has quit [Ping timeout: 256 seconds]
drbrain has quit [Ping timeout: 256 seconds]
ArahaelPi has quit [Ping timeout: 256 seconds]
Criten has quit [Ping timeout: 256 seconds]
haylon has quit [Ping timeout: 256 seconds]
priodev has quit [Ping timeout: 256 seconds]
alnewkirk has quit [Ping timeout: 256 seconds]
AKPWD has quit [Ping timeout: 256 seconds]
irick has quit [Ping timeout: 256 seconds]
NightMonkey has quit [Quit: ZNC - http://znc.in]
beowuff has quit [Remote host closed the connection]
croberts has quit [Quit: No Ping reply in 180 seconds.]
jyaworski_ is now known as jyaworski
drbrain has joined #ruby
NightMonkey has joined #ruby
priodev has joined #ruby
irick has joined #ruby
spectra has joined #ruby
zenspider has quit [Ping timeout: 260 seconds]
ArahaelPi has joined #ruby
dbz_ has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 240 seconds]
dbz has joined #ruby
dionysus69 has joined #ruby
d^sh has joined #ruby
cats has quit [Ping timeout: 240 seconds]
yo61_ has joined #ruby
yo61 has quit [Ping timeout: 256 seconds]
AndroidKitKat has quit [Ping timeout: 256 seconds]
yo61_ is now known as yo61
AndroidKitKat has joined #ruby
nowhereman_ has joined #ruby
bove has quit [Ping timeout: 256 seconds]
venmx has joined #ruby
bove has joined #ruby
thinkpad has quit [Ping timeout: 260 seconds]
x0f_ has quit [Ping timeout: 260 seconds]
IanMalcolm has joined #ruby
x0f has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
thinkpad has joined #ruby
dr3w_ has joined #ruby
cats has joined #ruby
thejs has quit [Ping timeout: 256 seconds]
Guest23176 has joined #ruby
s2013 has joined #ruby
dbz has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest23176 has quit [Ping timeout: 268 seconds]
DTZUZU has quit [Quit: WeeChat 1.9]
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
dbz has joined #ruby
dminuoso has left #ruby ["WeeChat 2.0.1"]
t0xik has joined #ruby
gizmore has joined #ruby
s2013 has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.2]
<gizmore> > byebug
<gizmore> < byebug
<gizmore> >> 3 +3
<ruby[bot]> gizmore: # => 6 (https://eval.in/1049256)
<gizmore> >> byebug
<ruby[bot]> gizmore: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
clemens3 has joined #ruby
akaiiro has joined #ruby
<apeiros> ?experiment gizmore
<ruby[bot]> gizmore: Please use your local irb or pry (see ?pry) to experiment, ruby[bot]'s eval functionality is for demonstration purposes only.
<gizmore> just wanted to say good evening :) sorry
faitswulff has joined #ruby
jottr has joined #ruby
gr33n7007h has joined #ruby
thejs has joined #ruby
postmodern has joined #ruby
bmurt has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 276 seconds]
cadillac_ has joined #ruby
Guest23176 has joined #ruby
gr33n7007h is now known as al2o3-cr
sameerynho has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
doubledup has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r29v has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
Guest23176 has quit [Ping timeout: 244 seconds]
arup_r has quit []
Freshnuts has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s2013 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
faitswulff has quit [Read error: Connection reset by peer]
faitswulff has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
ivanskie has joined #ruby
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...
<weaksauce> try rubular
<weaksauce> seems like a pretty permissive match though
nowhereman_ has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
dionysus69 has quit [Ping timeout: 244 seconds]
<RedNifre> yeah, hmmmm...
<weaksauce> what are you trying to match on?
<weaksauce> is there something more useful to act as boundary conditions?
teej has quit []
<RedNifre> Yeah, I think like I might not understand regexes enough...
krawchyk has quit [Quit: krawchyk]
<RedNifre> The string looks somewhat like " 234 bla bleh blu#9e for " and my regex looks like / (\d+) ([\w# ]+) for / in the middle...
<RedNifre> It fails for something that looks like " 1 Bla Bleh#3y for "...
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Guest23176 has joined #ruby
faitswulff has quit [Remote host closed the connection]
<weaksauce> it should work for both of those
<RedNifre> Yeah... is # something special maybe?
impermanence has quit [Remote host closed the connection]
jottr has joined #ruby
<weaksauce> not really no
<weaksauce> does the second example actually have whitespace around the numbers?
<weaksauce> your regex is expecting whitespace before and after the numbers
<weaksauce> can you share what you are actually matching against and not example?
nowhereman_ has quit [Ping timeout: 256 seconds]
Guest23176 has quit [Ping timeout: 244 seconds]
<RedNifre> Never mind, it worked with #, the next problem is that numbers aren't actually d+,dd they have dots separating the thousands...
<RedNifre> rubular is extremely helpful, thank you very much!
wild_buffalo has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has quit [Ping timeout: 260 seconds]
noidedsuper has quit [Ping timeout: 276 seconds]
jottr has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
sagax has quit [Ping timeout: 256 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
fyrekitty is now known as lunarkitty
Nicmavr has joined #ruby
Guest23176 has joined #ruby
reber has quit [Remote host closed the connection]
patr0clus has quit [Ping timeout: 276 seconds]
r29v has quit [Quit: r29v]
za1b1tsu has quit [Ping timeout: 244 seconds]
wild_buffalo has quit [Ping timeout: 260 seconds]
Guest23176 has quit [Ping timeout: 260 seconds]
Guest23176 has joined #ruby
cschneid_ has quit [Remote host closed the connection]
thejs has quit [Ping timeout: 268 seconds]
Dbugger has quit [Ping timeout: 265 seconds]
jottr has joined #ruby
alex`` has quit [Ping timeout: 272 seconds]
clemens3 has quit [Ping timeout: 272 seconds]
jottr has quit [Ping timeout: 276 seconds]
alex`` has joined #ruby
Guest23176 has quit [Ping timeout: 256 seconds]
augcesar has quit [Quit: Connection closed for inactivity]
sparch has joined #ruby
Puffball has joined #ruby
icarus has quit [Quit: leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
IanMalcolm has joined #ruby
nowhereman_ has joined #ruby
jottr has joined #ruby
IanMalcolm has quit [Client Quit]
jottr has quit [Ping timeout: 276 seconds]
gothicsouth has joined #ruby
s2013 has joined #ruby
Guest23176 has joined #ruby
alex`` has quit [Quit: WeeChat 2.2]
nikivi has quit [Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net]
thejs has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TheBloke has quit [Ping timeout: 240 seconds]
ivanskie has quit [Quit: Textual IRC Client: www.textualapp.com]
TheBloke has joined #ruby
Guest23176 has quit [Ping timeout: 272 seconds]
Blaguvest has joined #ruby
thejs has quit [Remote host closed the connection]
gothicsouth has quit [Quit: Lost terminal]
drale2k_ has joined #ruby
drale2k_ has quit [Client Quit]
knight33 has joined #ruby
LiftLeft has quit [Ping timeout: 276 seconds]
knight33 has quit [Ping timeout: 276 seconds]
knight33 has joined #ruby
nfk has joined #ruby
LiftLeft has joined #ruby
tdy has quit [Ping timeout: 268 seconds]
r29v has joined #ruby
Guest23176 has joined #ruby