« Back to channel list

#ruby - 20 August 2018

« Back 1 day Forward 1 day »
[00:00:30] jdawgaz: has joined #ruby
[00:00:46] marvin2: has left #ruby: ()
[00:05:13] Azure: has joined #ruby
[00:05:21] tdy1: has joined #ruby
[00:11:49] cadillac_: has joined #ruby
[00:14:21] dviola: has joined #ruby
[00:14:38] nadir: has joined #ruby
[00:16:38] darkhanb: has joined #ruby
[00:16:42] RedNifre_: has left #ruby: ("WeeChat 1.9.1")
[00:29:46] jdawgaz: has joined #ruby
[00:32:47] mroutis: has joined #ruby
[00:34:41] elomatreb: has joined #ruby
[00:40:16] sshock: has joined #ruby
[00:40:43] jdawgaz: has joined #ruby
[00:48:11] t0xik: has joined #ruby
[00:48:35] dbz: has joined #ruby
[00:54:24] Nicmavr: has joined #ruby
[01:04:29] faitswulff: has joined #ruby
[01:14:25] jdawgaz: has joined #ruby
[01:20:19] brent__: has joined #ruby
[01:21:33] faitswulff: has joined #ruby
[01:24:23] wild_buffalo: has joined #ruby
[01:27:49] wild_buffalo: Does anyone know what this means: if args?(args, 3) ...
[01:28:23] wild_buffalo: I understand that when there is a ?, it means it returns a boolean value, but why is there a (args, 3) after?
[01:30:30] wild_buffalo: Ah, looks like the ? is part of the function name
[01:31:48] mroutis: indeed, wild_buffalo, however, I couldn't found info about that function, is it defined elsewhere?
[01:33:28] wild_buffalo: mroutis: No, it's just part of a library I was looking at
[01:33:54] wild_buffalo: It's defined at the top, it just checks if the number of arguments were correct
[01:34:31] 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
[01:36:46] mroutis: wild_buffalo: yes, function names accept a question mark as correct syntax, so it's used for functions that returns a boolean
[01:38:46] DblLchn: has joined #ruby
[01:39:54] elomatreb: ! as well, btw
[01:42:06] 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)
[01:42:12] mroutis: wild_buffalo: ^
[01:42:49] elomatreb: Not necessarily just that, e.g. Array#pop is destructive but doesn't have a bang
[01:46:23] mroutis: ACTION scratches head
[01:46:29] mroutis: that's true, elomatreb
[01:47:08] 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"
[01:49:07] jdawgaz: has joined #ruby
[01:50:54] Puffball: has joined #ruby
[01:51:15] mroutis: ohh right, the "may raise", as in "save!" or "create!" in ruby on rails
[01:53:47] dbz: I wish there was an alias
[01:53:51] dbz: concat! for concat
[01:53:54] dbz: Because it mutates
[01:57:29] wild_buffalo: has joined #ruby
[01:57:47] wild_buffalo: mroutis: oh alright, cheers
[01:59:44] bambanx: has joined #ruby
[02:00:35] faitswulff: has joined #ruby
[02:01:56] DblLchn: has left #ruby: ("AndroIRC")
[02:06:44] arescorpio: has joined #ruby
[02:07:32] \void: has joined #ruby
[02:31:42] patr0clus: has joined #ruby
[02:40:37] mroutis: has joined #ruby
[02:49:04] wild_buffalo: has joined #ruby
[03:00:31] cadillac_: has joined #ruby
[03:05:23] sspreitz: has joined #ruby
[03:10:07] braincrash: has joined #ruby
[03:14:16] \void: has joined #ruby
[03:25:38] kapil___: has joined #ruby
[03:29:23] DTZUZO: has joined #ruby
[03:29:52] yosafbridge: has joined #ruby
[03:46:22] rivalomega: has joined #ruby
[04:03:54] jdawgaz: has joined #ruby
[04:06:52] rivalomega: has joined #ruby
[04:10:03] dbz: has joined #ruby
[04:16:54] Azure: has joined #ruby
[04:25:08] za1b1tsu: has joined #ruby
[04:25:24] ogres: has joined #ruby
[04:37:39] jdawgaz: has joined #ruby
[04:39:29] aniarya82: has joined #ruby
[04:40:40] code_zombie: has joined #ruby
[04:41:22] sleetdrop: has joined #ruby
[04:54:07] nofxx: weaksauce, thank you, nice read. Adaptive Gains seems like very intersting for my heating scenario
[05:05:02] dbz: has joined #ruby
[05:10:44] s2013: has joined #ruby
[05:11:18] dionysus69: has joined #ruby
[05:13:05] ur5us: has joined #ruby
[05:25:46] dbz: has joined #ruby
[05:27:45] kenichi: has joined #ruby
[05:30:18] apeiros: has joined #ruby
[05:41:44] cadillac_: has joined #ruby
[05:53:00] alem0lars: has joined #ruby
[05:53:22] s2013: has joined #ruby
[05:53:29] \void: has joined #ruby
[05:58:28] eckhardt_: has joined #ruby
[06:03:02] za1b1tsu: has joined #ruby
[06:06:06] Furai: has joined #ruby
[06:11:00] aupadhye: has joined #ruby
[06:15:06] Mike11: has joined #ruby
[06:31:20] KevinSjoberg: has joined #ruby
[06:35:35] Mike11: has joined #ruby
[06:44:09] xt233: has joined #ruby
[06:45:40] dbz: has joined #ruby
[06:51:56] dellavg: has joined #ruby
[06:54:20] reber: has joined #ruby
[07:01:42] dionysus69: has joined #ruby
[07:03:21] alem0lars: has joined #ruby
[07:04:03] burgestrand: has joined #ruby
[07:08:46] KevinSjoberg: has joined #ruby
[07:09:56] dbz: has joined #ruby
[07:11:36] hahuang65: has joined #ruby
[07:16:06] TomyWork: has joined #ruby
[07:17:26] sleetdrop: has joined #ruby
[07:17:59] yohji: has joined #ruby
[07:21:09] aniarya82: has joined #ruby
[07:28:56] clemens3: has joined #ruby
[07:36:06] burgestrand: has joined #ruby
[07:40:25] lytol_: has joined #ruby
[07:44:04] drale2k_: has joined #ruby
[07:46:51] j416: has joined #ruby
[07:49:35] wildermind: has joined #ruby
[07:53:58] burgestrand: has joined #ruby
[07:55:44] dbz: has joined #ruby
[07:57:30] ferhaty: has joined #ruby
[08:02:56] Dbugger: has joined #ruby
[08:10:06] moei: has joined #ruby
[08:15:46] tty: has joined #ruby
[08:17:26] lxsameer: has joined #ruby
[08:23:17] fyrekitty: has joined #ruby
[08:34:35] lipoqil: has joined #ruby
[08:42:06] drale2k_: has joined #ruby
[08:44:04] 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
[08:49:14] venmx: has joined #ruby
[08:52:32] Freshnuts: has joined #ruby
[08:56:30] drale2k_: has joined #ruby
[08:56:42] za1b1tsu: I needed to change .ruby-version file
[09:08:18] tristanp: has joined #ruby
[09:29:59] Beams: has joined #ruby
[09:30:43] drale2k_: has joined #ruby
[09:39:26] rivalomega: has joined #ruby
[09:42:14] venmx: has joined #ruby
[10:12:02] Dbugger: has joined #ruby
[10:14:22] dionysus69: has joined #ruby
[10:14:55] livcd: anyone used imba.io ? :))
[10:26:05] alex``: has joined #ruby
[10:42:33] cadillac_: has joined #ruby
[11:08:33] DTZUZO: has joined #ruby
[11:11:04] tristanp: has joined #ruby
[11:18:39] AJA4350: has joined #ruby
[11:23:01] donofrio: has joined #ruby
[11:31:43] faitswulff: has joined #ruby
[11:32:00] dionysus69: god.rb processes start and get terminated in first 1-2 seconds
[11:32:25] dionysus69: and then they stay dead, logs aren't showing anything interesting, any ideas how can I debug?
[11:33:53] apparition47: has joined #ruby
[11:34:39] Nicmavr: has joined #ruby
[11:38:42] clorisu: has joined #ruby
[11:41:14] burgestrand: has joined #ruby
[11:44:47] Zaab1t: has joined #ruby
[11:52:08] rivalomega: has joined #ruby
[12:00:24] jdawgaz: has joined #ruby
[12:01:56] Paraxial: has joined #ruby
[12:09:30] ikbenhet: has joined #ruby
[12:12:15] tristanp: has joined #ruby
[12:14:15] sina: has joined #ruby
[12:27:39] dbz: has joined #ruby
[12:32:47] dionysus69: has joined #ruby
[12:55:06] faitswulff: has joined #ruby
[12:56:33] jnor: has joined #ruby
[12:57:28] 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?
[12:58:12] Criten: jnor: you would need a redis instance running, and the redis gem
[12:58:15] Criten: gem install redis
[12:58:36] Criten: could also use a gemfile to manage dependencies (which is useful)
[12:58:40] thy0: has joined #ruby
[12:59:01] jnor: but when I already have redis installed through apt-get is this not redundant ?
[12:59:24] jnor: I have little experience with ruby
[12:59:38] burgestrand: jnor the redis you see in the script is a library/package that allows ruby to communicate with your running redis server
[13:00:08] burgestrand: jnor it is not the redis program/server itself
[13:00:14] jnor: ah so it's not == to installing redis though ruby
[13:00:22] jnor: ok I see
[13:00:26] jnor: thanks for clearing that up
[13:01:58] Criten: correct jnor :)
[13:12:58] tristanp: has joined #ruby
[13:15:07] bmurt: has joined #ruby
[13:18:30] dellavg: has joined #ruby
[13:19:52] jnor: Criten: is this the same for the gem just called "rubygems" ?
[13:20:09] jnor: a package that allow communication of sorts
[13:23:22] 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
[13:24:17] 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`
[13:24:21] drale2k_: has joined #ruby
[13:26:37] jcalla: has joined #ruby
[13:36:17] Stimpy_2000: has joined #ruby
[13:38:31] drale2k_: has joined #ruby
[13:39:41] IanMalcolm: has joined #ruby
[13:53:20] lupine: has joined #ruby
[13:55:00] blackbaba: has joined #ruby
[14:05:42] [Butch]: has joined #ruby
[14:08:36] faitswulff: has joined #ruby
[14:08:47] Inline: has joined #ruby
[14:08:52] aupadhye_: has joined #ruby
[14:09:05] za1b1tsu: has joined #ruby
[14:13:53] tristanp: has joined #ruby
[14:15:41] [Butch]: has joined #ruby
[14:16:08] croberts: has joined #ruby
[14:17:07] apeiros: has joined #ruby
[14:18:36] Rapture: has joined #ruby
[14:19:41] ruby[bot]: has joined #ruby
[14:19:41] ChanServ: +o ruby[bot]
[14:29:22] faitswulff: has joined #ruby
[14:33:11] aupadhye_: has joined #ruby
[14:36:14] rootsudo: has joined #ruby
[14:39:46] NoidedSuper: has joined #ruby
[14:39:56] cschneid_: has joined #ruby
[14:50:25] augcesar: has joined #ruby
[14:50:34] rivalomega: has joined #ruby
[14:59:09] gnufied: has joined #ruby
[15:05:51] za1b1tsu: has joined #ruby
[15:08:28] tdy1: has joined #ruby
[15:10:18] wild_buffalo: has joined #ruby
[15:10:46] eddof13: has joined #ruby
[15:13:15] polishdub: has joined #ruby
[15:25:48] yxhuvud: has joined #ruby
[15:31:01] dbz: has joined #ruby
[15:36:38] r29v: has joined #ruby
[15:39:07] jottr: has joined #ruby
[15:40:50] boxrick: Hello folks, I have the following line 'current_role = current_role.gsub!(/[^0-9A-Za-z]/, '')'
[15:41:01] boxrick: Which seems to generate all sorts of errors randomly depending on the system
[15:41:14] rippa: has joined #ruby
[15:41:56] apeiros: boxrick: you should carefully read the docs of gsub!
[15:42:07] apeiros: especially the part about its return value
[15:42:12] boxrick: Is there any reason that wouldn't work, ie edge cases. I am currently going through someone elses code.
[15:42:16] boxrick: Ok no problems will do :)
[15:43:11] doubledup: has joined #ruby
[15:45:07] ikbenhet: has joined #ruby
[15:50:46] orbyt_: has joined #ruby
[15:53:30] KidSK8: has joined #ruby
[15:55:47] boxrick: I assume that exclamation mark is not doing any good
[15:56:23] beowuff: has joined #ruby
[16:00:39] apeiros: boxrick: well, what did you find out about gsub!'s behavior?
[16:02:22] boxrick: nil return on no replace from ! is what I see
[16:02:55] apeiros: yupp. and I wouldn't be surprised if that's what's messing up things for you.
[16:03:26] 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.
[16:03:38] apeiros: if you care about the return value, use gsub without bang.
[16:03:47] apeiros: note that there's a couple more methods working like that in core.
[16:05:30] drale2k_: has joined #ruby
[16:07:04] jcarl43: has joined #ruby
[16:10:41] RedNifre: has joined #ruby
[16:12:15] cthulchu_: has joined #ruby
[16:12:26] 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?
[16:13:25] RedNifre: ...to be precise it's actually `tail -f some.log | somesedinabashscript | ruby ...`
[16:14:18] darkhanb: has joined #ruby
[16:14:28] RedNifre: so, my question is: why does it seem to hang on $stdin.each_line even though I pipe lines into it?
[16:15:23] apeiros: the $stdin.each_line should only block until a full line is in the buffer
[16:16:13] RedNifre: some people on the internet says that it buffers 20 lines for them... hm...
[16:16:43] rivalomega: has joined #ruby
[16:17:05] apeiros: are you sure the buffering happens on the ruby side?
[16:18:55] IanMalcolm: has joined #ruby
[16:19:54] RedNifre: hang on, I'll make sure...
[16:20:50] patr0clus: has joined #ruby
[16:22:28] hell0h0la: has joined #ruby
[16:26:06] RedNifre: tatsache, es haengt irgendwie am sed fest... seltsam
[16:26:10] IanMalcolm: has joined #ruby
[16:26:36] RedNifre: oops, sorry
[16:26:53] RedNifre: indeed, it somehow hangs in sed... weird
[16:29:05] ule: has joined #ruby
[16:29:13] RedNifre: guess I'll trash sed and do it all in ruby
[16:29:26] ule: Hey guys. I'm using OpenStruct to dimanically convert a hash like: ':foo => "bar"' into something like: MyOpenStruct.foo
[16:30:02] 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
[16:30:06] apeiros: ACTION hands ule a "y" and an "n" for dynamically
[16:30:24] apeiros: though, manically doing stuff might be interesting too
[16:30:28] ule: apeiros: (: thanks
[16:30:50] apeiros: you'd write a recursive method
[16:30:52] ule: I'm creating a wrapper to the SpaceX Api
[16:30:52] r29v: has joined #ruby
[16:31:52] s2013: has joined #ruby
[16:32:06] RedNifre: oh, does that api allow you to drive cars in space? or what does it do?
[16:32:15] ule: apeiros: I'm wondering if there is a kind of ruby magic oneline method that digs into all nested hash keys "Dynamically"
[16:32:22] Criten: ule: https://stackoverflow.com/questions/42519557/convert-hash-to-openstruct-recursively
[16:32:30] cadillac_: has joined #ruby
[16:32:32] ule: RedNifre: it will display launches data, it is really cool
[16:32:45] apeiros: ule: there are gems which do that if you don't want to write it yourself
[16:32:50] ule: RedNifre: https://api.spacexdata.com/v2/launches/latest
[16:33:00] apeiros: I think one is named "hashy" or "hashie" or somesuch. maybe "mashy"?
[16:33:12] Criten: neat, didnt realize spacex had an api like that
[16:33:13] Criten: super cool
[16:33:16] helloh0la: has joined #ruby
[16:33:25] ule: Ohh. I know Hashie gem. I didn't know I could do that with it
[16:33:34] ule: apeiros: thanks
[16:33:51] ule: Criten: exactly what I need. Thanks!
[16:33:57] ule: Criten: so cool eh?
[16:34:05] apeiros: ACTION prefers launching kerbals into space instead of using spacex api
[16:35:21] druonysus: has joined #ruby
[16:36:14] ule: Hi new, I'm ule
[16:40:03] Criten: hi ule i'm helloh0la
[16:40:28] ule: man this Hashie gem has a lot of cool stuff
[16:40:30] krawchyk: has joined #ruby
[16:40:39] helloh0la: Hello ule, this is first time
[16:41:00] ule: wtf is that? a chatbot?
[16:41:21] Criten: helloh0la: new to ruby? or IRC?
[16:42:07] s2013: has joined #ruby
[16:42:37] helloh0la: Criten:in the IRC
[16:42:45] Criten: helloh0la: where are you from?
[16:43:28] dbz: has joined #ruby
[16:43:37] lxsameer: has joined #ruby
[16:43:44] helloh0la: Criten: Argentina
[16:45:05] ule: Hashie::Mash.new(foo = {a: 123, b: { c: 456 } }).b.c
[16:45:16] ule: a w e s o m e
[16:45:53] apeiros: why'd you do `foo =` there?
[16:46:03] apeiros: it's confusing at best, wrong at worst.
[16:46:51] Criten: helloh0la: neat, i've never been there
[16:48:09] nowhereman_: has joined #ruby
[16:51:07] helloh0la: what IDE of ruby recommend me for a begginer ?
[16:51:55] eckhardt_: has joined #ruby
[16:53:31] lxsameer: has joined #ruby
[16:54:08] RedNifre: I'm only doing hack jobs with ruby and I use vim, but many say rubymine is a good IDE
[16:55:24] IanMalcolm: has joined #ruby
[16:56:12] helloh0la: ohh nice, now i use sublime text 3
[16:57:22] Alina-malina: has joined #ruby
[16:59:41] yxhuvud: has joined #ruby
[16:59:48] Xiti: has joined #ruby
[17:00:44] al2o3-cr: has joined #ruby
[17:00:46] apeiros: helloh0la: I'd recommend a plaintext editor over an IDE for a beginner. sublime text 3 is quite nice.
[17:01:28] dbz: I don't think it matters if you use a plaintext editor nor an IDE as long as you learn something
[17:01:55] dbz: +1 to Rubymine and +100 to vim
[17:03:47] al2o3-cr: ule: check this out.
[17:04:06] al2o3-cr: >> require 'json'; JSON.parse({a: 123, b: {c: 456}}.to_json, object_class: OpenStruct).b.c
[17:04:08] ruby[bot]: al2o3-cr: # => 456 (https://eval.in/1049242)
[17:07:05] orbyt_: has joined #ruby
[17:19:55] ivanskie: has joined #ruby
[17:24:03] hell0h0la: has joined #ruby
[17:25:00] jcarl43: Is is possible to have dash in block arguments (eg.: ... do |var-name|)? I get a syntax error with this.
[17:27:28] yxhuvud: you can have underscores though
[17:28:56] thejs: has joined #ruby
[17:29:02] ule: oh yeah my bad, I don't need to "foo ="
[17:29:32] ule: al2o3-cr: just using json lib eh, nice
[17:30:05] ule: RedNifre: I use vim as well. Love it
[17:30:17] al2o3-cr: >> (1..3).map { |var−name| var−name * 3 }
[17:30:23] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:30:33] al2o3-cr: >> (1..3).map { |var−name| var−name * 3 }
[17:30:34] ruby[bot]: al2o3-cr: # => [3, 6, 9] (https://eval.in/1049246)
[17:31:30] al2o3-cr: jcarl43: i'm cheating, i'm using "\u2122" ;)
[17:31:51] Eiam: sure to never cause confusion
[17:32:07] al2o3-cr: not advised.
[17:32:08] Eiam: look forward to losing an evening debugging that one. /s
[17:38:31] lxsameer: has joined #ruby
[17:39:17] 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.
[17:39:18] Cthulu201: has joined #ruby
[17:39:45] RedNifre: I mean, if I remove the ruby part, I see each grep output line as they happen without any delay, line by line
[17:39:51] Eiam: doesn't tail just keep sending you content...
[17:40:10] Eiam: eventually your each_line is going to be waiting on new input, no?
[17:40:17] RedNifre: tail -f sends new lines as they are added to the log. that works. The grep part also works.
[17:40:29] RedNifre: Eiam it never triggers even once, that's the problem.
[17:41:16] 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.
[17:41:42] Eiam: does $stdin have anything at all?
[17:42:42] Freshnuts: has joined #ruby
[17:43:07] 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.
[17:43:46] al2o3-cr: RedNifre: are you setting STDIN.sync = true
[17:44:20] Eiam: if you replace the tail with a cat does it start working?
[17:44:44] szulak: has joined #ruby
[17:47:05] sameerynho: has joined #ruby
[17:47:47] SeepingN: has joined #ruby
[17:48:46] jottr: has joined #ruby
[17:49:01] RedNifre: as2o3-cr no, never heard of that.
[17:49:12] RedNifre: Eiam yes, it works with cat
[17:49:21] Eiam: yeah, thought so.
[17:49:30] RedNifre: Oh, I let the rubyecho running in background and I now have output. does it do batches?
[17:49:43] RedNifre: does STDIN.sync = true turn it into line based mode?
[17:50:04] Eiam: https://stackoverflow.com/questions/29998728/what-stdout-sync-true-means
[17:50:28] al2o3-cr: RedNifre: when set to true all output in buffer is immediately flush to the OS.
[17:50:29] Eiam: removes buffering
[17:50:35] SeepingN: STDOUT.sync... not STDIN
[17:51:37] RedNifre: oh, you mean its actually reading stuff, I just don't see it? okay...
[17:51:48] RedNifre: i thought puts was always somewhat instant.
[17:51:53] RedNifre: okay, I'll try...
[17:52:14] RedNifre: wait, al2o3-cr said STDIN.sync? Or both?
[17:52:43] al2o3-cr: RedNifre: STDIN.sync = true
[17:53:09] Eiam: no, I/O is one of the most expensive modern operations on a computer
[17:53:18] Eiam: you want to avoid it as much as possible
[17:59:24] RedNifre: well, i want live updates and the log doesn't change that often
[17:59:38] RedNifre: anyway, it still doesn't work, neither with STDIN nor STDOUT
[18:00:07] drale2k_: has joined #ruby
[18:00:57] RedNifre: it works with `echo "hey" | ruby rubyecho.rb`, but I guess that's because it notices that the stream ends?
[18:02:11] RedNifre: Hang on, I think it's the grep
[18:02:49] SeepingN: STDIN.sync doesn't even makes sense does it?
[18:03:06] 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.
[18:03:23] RedNifre: yeah, I don't want individual bytes, I want lines.
[18:03:55] 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...
[18:04:13] RedNifre: I don't really understand the problem, but I guess I can solve it by going all ruby then ._.
[18:04:31] RedNifre: So you guys are doing tail -f | grep | ruby all the time without problems?
[18:05:33] SeepingN: I doubt it. maybe if you use some of those fancy TTY methods of reading data.
[18:05:41] SeepingN: but yeah, why bother at all. put it in the script
[18:09:01] RedNifre: Alright, it works. No idea what grep had to do with it. Thanks a lot!
[18:19:06] al2o3-cr: RedNifre: ah i see why grep wasn't working, you need --line-buffered
[18:20:51] al2o3-cr: RedNifre: so; `tail -f log | grep --lined-buffered "foo" | ruby script.rb
[18:23:43] RedNifre: ah, thanks al2o3-cr, that seems to explain it!
[18:24:01] RedNifre: ...but it's too late, it's all ruby now anyway ;)
[18:24:14] al2o3-cr: RedNifre: cool ;)
[18:30:14] al2o3-cr: SeepingN: i don't know what i was thinking with STDIN.sync = true there i must be honest ;?
[18:34:04] timmow: has joined #ruby
[18:35:38] patr0clus: has joined #ruby
[18:37:09] orbyt_: has joined #ruby
[18:39:29] dionysus69: has joined #ruby
[18:41:08] icarus: has joined #ruby
[18:42:08] Eiam: why don't you just have ruby do all the work
[18:42:12] Eiam: instead of piping shit into a ruby script at the end
[18:42:32] Eiam: just have ruby do the file.open etc...
[18:43:06] Eiam: http://flori.github.io/file-tail/ too =p
[18:44:10] al2o3-cr: Eiam: they are now ;)
[18:44:34] Eiam: ah, sorry
[18:44:40] Eiam: beat me to it =) got distracted with othe rwork
[18:44:49] al2o3-cr: Eiam: no worries ;)
[18:45:02] RedNifre: Eiam because I thought I should give sed and awk a chance, lost motivation, so ruby slowly ate it all away.
[18:45:28] RedNifre: oh, right, i could even move the tail -f into the ruby script...
[18:45:51] 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
[18:46:24] Eiam: not to mention every one of those has its own version that could all be updated independently
[18:46:29] r3m_: has joined #ruby
[18:46:30] RedNifre: don't worry, it's just a toy project just for myself, I won't outsource it to you...
[18:46:41] Eiam: its the philosophical "I"
[18:46:48] Eiam: its the you in 2 years, its the co-worker next month
[18:46:56] RedNifre: In this case, the philosophical "I" is just "me"
[18:47:06] RedNifre: no, I won't be using this thing in 2 years
[18:47:12] Eiam: famous last words
[18:47:57] 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 ;)
[18:53:41] lxsameer: has joined #ruby
[18:54:09] thy0: has joined #ruby
[18:58:46] yeeter: has joined #ruby
[19:01:18] nowhereman_: has joined #ruby
[19:04:42] DTZUZO: has joined #ruby
[19:06:18] dbz: has joined #ruby
[19:08:32] thejs: has joined #ruby
[19:08:37] s2013: has joined #ruby
[19:16:14] teej: has joined #ruby
[19:18:37] lxsameer: has joined #ruby
[19:18:50] weaksauce: has joined #ruby
[19:20:58] za1b1tsu: has joined #ruby
[19:30:58] impermanence: has joined #ruby
[19:31:04] dviola: has joined #ruby
[19:32:19] s2013: has joined #ruby
[19:38:45] Guest23176: has joined #ruby
[19:51:02] catsed: has joined #ruby
[19:51:37] x0F_: has joined #ruby
[19:53:34] dviola: has joined #ruby
[19:53:41] dbz_: has joined #ruby
[19:54:00] haylon_: has joined #ruby
[19:54:35] APK: has joined #ruby
[19:55:14] alnewkir1: has joined #ruby
[19:55:24] jyaworski_: has joined #ruby
[19:56:03] drbrain: has joined #ruby
[19:56:25] NightMonkey: has joined #ruby
[19:56:40] priodev: has joined #ruby
[19:57:09] irick: has joined #ruby
[19:58:05] spectra: has joined #ruby
[19:58:45] ArahaelPi: has joined #ruby
[19:59:51] dbz: has joined #ruby
[20:00:26] dionysus69: has joined #ruby
[20:01:15] d^sh: has joined #ruby
[20:05:45] yo61_: has joined #ruby
[20:09:12] AndroidKitKat: has joined #ruby
[20:09:34] nowhereman_: has joined #ruby
[20:10:46] venmx: has joined #ruby
[20:11:20] bove: has joined #ruby
[20:13:07] IanMalcolm: has joined #ruby
[20:13:44] x0F: has joined #ruby
[20:14:19] thinkpad: has joined #ruby
[20:14:43] dr3wo: has joined #ruby
[20:14:59] cats: has joined #ruby
[20:18:21] Guest23176: has joined #ruby
[20:19:25] s2013: has joined #ruby
[20:37:15] c0ncealed2: has joined #ruby
[20:38:46] arup_r: has joined #ruby
[20:39:24] dbz: has joined #ruby
[20:40:38] dminuoso: has left #ruby: ("WeeChat 2.0.1")
[20:40:49] t0xik: has joined #ruby
[20:42:01] gizmore: has joined #ruby
[20:44:38] s2013: has joined #ruby
[20:45:37] ruby[bot]: gizmore: # => 6 (https://eval.in/1049256)
[20:45:48] ruby[bot]: gizmore: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[20:47:59] clemens3: has joined #ruby
[20:48:12] akaiiro: has joined #ruby
[20:50:53] apeiros: ?experiment gizmore
[20:50:53] ruby[bot]: gizmore: Please use your local irb or pry (see ?pry) to experiment, ruby[bot]'s eval functionality is for demonstration purposes only.
[20:51:17] gizmore: just wanted to say good evening :) sorry
[20:51:21] faitswulff: has joined #ruby
[20:51:41] jottr: has joined #ruby
[20:52:20] gr33n7007h: has joined #ruby
[20:53:55] thejs: has joined #ruby
[20:54:25] postmodern: has joined #ruby
[20:54:46] bmurt: has joined #ruby
[20:57:46] cadillac_: has joined #ruby
[21:03:34] Guest23176: has joined #ruby
[21:07:44] ur5us: has joined #ruby
[21:08:45] r29v: has joined #ruby
[21:11:58] ur5us: has joined #ruby
[21:16:37] Freshnuts: has joined #ruby
[21:17:47] s2013: has joined #ruby
[21:21:16] faitswulff: has joined #ruby
[21:24:13] faitswulff: has joined #ruby
[21:26:04] ivanskie: has joined #ruby
[21:28:56] jottr: has joined #ruby
[21:30:26] 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...
[21:30:45] weaksauce: try rubular
[21:31:06] weaksauce: http://rubular.com/
[21:32:28] weaksauce: http://rubular.com/r/m1NPiK54yD
[21:33:33] weaksauce: seems like a pretty permissive match though
[21:34:58] nowhereman_: has joined #ruby
[21:35:25] DTZUZO: has joined #ruby
[21:36:48] RedNifre: yeah, hmmmm...
[21:37:06] weaksauce: what are you trying to match on?
[21:37:38] weaksauce: is there something more useful to act as boundary conditions?
[21:39:23] RedNifre: Yeah, I think like I might not understand regexes enough...
[21:40:33] RedNifre: The string looks somewhat like " 234 bla bleh blu#9e for " and my regex looks like / (\d+) ([\w# ]+) for / in the middle...
[21:41:22] RedNifre: It fails for something that looks like " 1 Bla Bleh#3y for "...
[21:43:26] Guest23176: has joined #ruby
[21:45:06] weaksauce: it should work for both of those
[21:45:17] RedNifre: Yeah... is # something special maybe?
[21:45:29] jottr: has joined #ruby
[21:45:51] weaksauce: http://rubular.com/r/Spe7AJbJmr
[21:45:56] weaksauce: not really no
[21:46:20] weaksauce: does the second example actually have whitespace around the numbers?
[21:46:38] weaksauce: your regex is expecting whitespace before and after the numbers
[21:47:15] weaksauce: can you share what you are actually matching against and not example?
[21:52:58] RedNifre: Never mind, it worked with #, the next problem is that numbers aren't actually d+,dd they have dots separating the thousands...
[21:53:13] RedNifre: rubular is extremely helpful, thank you very much!
[21:54:45] wild_buffalo: has joined #ruby
[22:03:26] jottr: has joined #ruby
[22:14:24] Nicmavr: has joined #ruby
[22:23:34] Guest23176: has joined #ruby
[22:33:25] Guest23176: has joined #ruby
[22:41:47] jottr: has joined #ruby
[22:47:11] alex``: has joined #ruby
[22:51:05] sparch: has joined #ruby
[22:55:06] Puffball: has joined #ruby
[23:03:09] eckhardt: has joined #ruby
[23:08:23] IanMalcolm: has joined #ruby
[23:09:20] nowhereman_: has joined #ruby
[23:10:00] jottr: has joined #ruby
[23:16:39] gothicsouth: has joined #ruby
[23:18:19] s2013: has joined #ruby
[23:18:31] Guest23176: has joined #ruby
[23:25:04] thejs: has joined #ruby
[23:27:22] TheBloke: has joined #ruby
[23:29:14] Blaguvest: has joined #ruby
[23:31:25] drale2k_: has joined #ruby
[23:35:50] knight33: has joined #ruby
[23:47:46] knight33: has joined #ruby
[23:48:18] nfk: has joined #ruby
[23:51:44] LiftLeft: has joined #ruby
[23:58:04] r29v: has joined #ruby
[23:58:33] Guest23176: has joined #ruby