« Back to channel list

#ruby - 19 November 2017

« Back 1 day Forward 1 day »
[00:00:29] minim: https://gist.github.com/anonymous/e2dc1803a99b5294d52fc459b17808bd
[00:01:36] RickHull: mini_: L17 should it be @movies?
[00:02:24] nawi_is: RickHull: the error from before again https://gist.github.com/anonymous/73dabf826ab79d3610891cc876bd608a the Makefile se before
[00:02:38] shazbotmcnasty: has joined #ruby
[00:02:42] gone_haywire: has joined #ruby
[00:03:48] minim: RichHull i think it should be global variable
[00:03:58] guardianx: has joined #ruby
[00:04:08] nawi_is: RickHull: are theese gists editable if someone knows a solution - I ask because I have a unstable internet connection at the moment
[00:04:36] RickHull: they can be forked, and the forker can edit the fork
[00:05:14] nawi_is: good to know, thanks
[00:05:38] RickHull: you should be able to edit your own anonymous gists, but not sure
[00:05:46] RickHull: in which case, you can combine your two into a single gist
[00:05:59] RickHull: there is an `Add File` button at the bottom
[00:06:46] nawi_is: for now it is just to know because of my connection
[00:09:34] minim: Rickhull issue is that L:53 is not working
[00:09:41] alveric4: has joined #ruby
[00:11:10] RickHull: mini_: why would @movies be nil?
[00:14:12] minimalism: has joined #ruby
[00:16:30] minim: RickHull wait.. so if title =! input maaybe ?
[00:17:30] RickHull: which lines assign a value to @movies ?
[00:20:15] RickHull: nope -- you can just search for @movies
[00:20:19] RickHull: e.g. ctrl-f
[00:20:35] RickHull: notice, I identified L17 earlier
[00:20:46] RickHull: shouldn't it be `@movies` not `movies` ?
[00:21:52] Technodrome: has joined #ruby
[00:21:57] minim: well i changed it
[00:22:17] RickHull: you should update the paste so we can follow along :)
[00:25:49] mini89: has joined #ruby
[00:26:46] mini89: RickHull https://gist.github.com/anonymous/bbb5edf022cf1ddc80e3c65c802e0ffb
[00:27:35] RickHull: @movies won't be nil, because you initialized it with an empty array, right?
[00:28:09] RickHull: and then you add items to the @movies array on L15
[00:28:20] RickHull: you could test `if @movies.empty?`
[00:28:36] RickHull: but that's probably not what you want
[00:28:57] RickHull: probably you want `if @movies.include?(input)`
[00:29:45] orbyt_: has joined #ruby
[00:29:47] mini89: i thought about that
[00:33:08] mini89: but i got an error undefined method include for Array
[00:36:47] RickHull: the `?` is part of the method name
[00:37:36] RickHull: mini__: have you tried the irb program? it's for playing with ruby interactively
[00:37:54] RickHull: >> ary = [1,2,3]; ary.include?(4)
[00:37:55] ruby[bot]: RickHull: # => false (https://eval.in/902892)
[00:41:55] bkxd: has joined #ruby
[00:42:39] shazbotmcnasty: has joined #ruby
[00:45:17] hutch34: has joined #ruby
[00:49:50] enterprisey: has joined #ruby
[00:52:13] jeanlinux: has joined #ruby
[00:53:11] mim1k: has joined #ruby
[00:54:24] hutch34: has joined #ruby
[00:55:38] PixeLInc: has joined #ruby
[00:56:39] al2o3-cr: has joined #ruby
[01:02:00] AxelAlex: has joined #ruby
[01:02:38] shazbotmcnasty: has joined #ruby
[01:04:58] AxelAlex: has joined #ruby
[01:14:40] |ifei5good: has joined #ruby
[01:15:42] |ifei5good: has joined #ruby
[01:22:38] shazbotmcnasty: has joined #ruby
[01:34:19] nicesignal: has joined #ruby
[01:40:37] hutch34: has joined #ruby
[01:42:39] shazbotmcnasty: has joined #ruby
[01:43:28] charliesome: has joined #ruby
[01:44:05] jottr: has joined #ruby
[01:55:08] xlegoman: has joined #ruby
[01:58:43] bkxd: has joined #ruby
[02:02:39] workmad3: has joined #ruby
[02:02:40] shazbotmcnasty: has joined #ruby
[02:08:30] BTRE: has joined #ruby
[02:16:31] rouge: has joined #ruby
[02:22:39] shazbotmcnasty: has joined #ruby
[02:24:57] Jameser: has joined #ruby
[02:38:30] d^sh: has joined #ruby
[02:41:52] weathermaker: has joined #ruby
[02:42:39] shazbotmcnasty: has joined #ruby
[02:44:03] bkxd: has joined #ruby
[02:45:07] hutch34: has joined #ruby
[02:45:52] Technodrome: has joined #ruby
[02:49:07] cdg: has joined #ruby
[02:49:50] charliesome: has joined #ruby
[02:50:29] bkxd: has joined #ruby
[02:53:38] mim1k: has joined #ruby
[03:02:40] shazbotmcnasty: has joined #ruby
[03:03:01] shinnya: has joined #ruby
[03:05:18] bkxd: has joined #ruby
[03:12:55] jottr: has joined #ruby
[03:20:48] noobineer: has joined #ruby
[03:21:44] enterprisey: has joined #ruby
[03:22:20] sucks: has joined #ruby
[03:22:40] shazbotmcnasty: has joined #ruby
[03:24:15] al2o3-cr: has joined #ruby
[03:26:52] jottr: has joined #ruby
[03:27:28] noobineer: has joined #ruby
[03:28:52] weathermaker: has joined #ruby
[03:33:13] Jameser: has joined #ruby
[03:36:00] noobineer: has joined #ruby
[03:36:53] weathermaker: has joined #ruby
[03:42:38] shazbotmcnasty: has joined #ruby
[03:45:44] |ifei5g00d: has joined #ruby
[03:47:26] houhoulis: has joined #ruby
[03:50:28] mrconfused: has joined #ruby
[03:51:56] houhoulis: has joined #ruby
[03:58:32] enterprisey: has joined #ruby
[04:02:39] shazbotmcnasty: has joined #ruby
[04:02:50] workmad3: has joined #ruby
[04:04:12] AxelAlex: has joined #ruby
[04:10:34] |ifei5good: has joined #ruby
[04:11:59] hndk: has joined #ruby
[04:13:34] PixeLInc: has joined #ruby
[04:13:44] Antiarc: has joined #ruby
[04:16:31] Technodrome: has joined #ruby
[04:26:12] noobineer: has joined #ruby
[04:32:43] nhhc: has joined #ruby
[04:34:10] hays: has joined #ruby
[04:34:47] hays: I have objects that open files and I want those files to be closed when I'm done with the objects. is there a way to do this where ruby manages it?
[04:35:35] matthewd: hays: Use blocks
[04:37:02] hays: not sure how to, if the object has a file open persistently
[04:37:47] gix-: has joined #ruby
[04:38:14] SeepingN: has joined #ruby
[04:39:08] matthewd: hays: See File
[04:39:23] hays: the class is a basic logging class, it opens a file and you write logs to it. then it has a :close method. but I am finding this a bit cumbersome
[04:40:39] matthewd: If the object goes away, its file will eventually get closed by the garbage collector anyway.. but it's better practice not to rely on that (partly just because it could be some time later)
[04:41:35] allcentury: has joined #ruby
[04:42:39] shazbotmcnasty: has joined #ruby
[04:44:11] jamesaxl: has joined #ruby
[04:44:15] hays: i let a non-programmer maintain and add features to this program that is multithreaded, and now I am in hell
[04:44:27] hays: so much copying and pasting
[04:44:56] hays: can't figure out the path through the code where he's closing files twice
[04:45:07] hays: or i should say closing and then writing
[04:45:50] hays: is there a way to access the stack from a method call? e.g. print out what called a given method?
[04:45:53] matthewd: Override the log's close to log caller to the log before it closes the log?
[04:46:00] matthewd: Yeah, `caller`
[04:50:11] hays: something like this: puts "#{self.class}: (#{self.object_id}) Called from #{caller[0]}"
[04:50:38] mim1k: has joined #ruby
[04:51:17] matthewd: Sounds plausible -- though if things are convoluted, you might want more of the call stack
[04:52:13] hays: on friday i reduced 100 lines of code to 10
[04:52:40] hays: i cant say how many copies of the same or almost-same logic there was
[04:53:09] hays: doing that somehow fixed a bug i still can't explain
[04:53:25] hays: sigh. lessons
[04:54:47] matthewd: https://github.com/seattlerb/flay#flay might help in finding some of that
[04:56:56] hays: hmm is this some kind of magic? heh yeah i should try that and see what happens
[05:00:59] hays: score of 290
[05:02:40] shazbotmcnasty: has joined #ruby
[05:04:04] hays: shazbotmcnasty: you come in and out a lot
[05:04:50] al2o3-cr: has joined #ruby
[05:04:50] apparition: has joined #ruby
[05:06:33] Dreamer3: has joined #ruby
[05:07:49] bkxd: has joined #ruby
[05:09:16] RickHull: hays: here's how I set up my Rakefile for flay: https://gist.github.com/rickhull/43b8dae92f2fe3a4da456282b42d5799
[05:09:47] RickHull: I like flog and roodi too: https://github.com/rickhull/compsci/blob/master/Rakefile
[05:09:59] hays: man I have another coworker who writes crap rails code. I want to use Heckle to straighten him out
[05:12:51] jottr: has joined #ruby
[05:18:39] mson: has joined #ruby
[05:18:44] jamesaxl: has joined #ruby
[05:19:57] Zamyatin: has joined #ruby
[05:20:52] Zamyatin: has joined #ruby
[05:22:40] shazbotmcnasty: has joined #ruby
[05:27:59] bkxd: has joined #ruby
[05:33:43] kapil___: has joined #ruby
[05:40:18] jrm: has joined #ruby
[05:42:39] shazbotmcnasty: has joined #ruby
[05:47:23] ruby[bot]: has joined #ruby
[05:47:23] ChanServ: +o ruby[bot]
[05:48:04] oetjenj: has joined #ruby
[05:49:21] cdg: has joined #ruby
[05:50:27] noobineer: has joined #ruby
[05:54:33] oetjenj: has joined #ruby
[05:55:20] oetjenj: has joined #ruby
[06:02:08] bkxd: has joined #ruby
[06:02:40] shazbotmcnasty: has joined #ruby
[06:09:39] cschneid_: has joined #ruby
[06:12:17] ledestin: has joined #ruby
[06:18:15] mjolnird: has joined #ruby
[06:22:41] shazbotmcnasty: has joined #ruby
[06:34:13] jackjackdripper: has joined #ruby
[06:36:41] jottr: has joined #ruby
[06:42:40] shazbotmcnasty: has joined #ruby
[06:42:58] bkxd: has joined #ruby
[06:45:01] jottr: has joined #ruby
[06:57:37] allcentury: has joined #ruby
[07:02:39] shazbotmcnasty: has joined #ruby
[07:10:07] uZiel: has joined #ruby
[07:13:15] jenrzzz: has joined #ruby
[07:13:16] jenrzzz: has joined #ruby
[07:13:18] erlend: has joined #ruby
[07:15:17] Technodrome: has joined #ruby
[07:15:57] rippa: has joined #ruby
[07:21:56] bkxd_: has joined #ruby
[07:27:10] jottr: has joined #ruby
[07:34:59] Jameser: has joined #ruby
[07:36:16] quobo: has joined #ruby
[07:36:47] lxsameer: has joined #ruby
[07:42:40] shazbotmcnasty: has joined #ruby
[07:42:49] bkxd: has joined #ruby
[07:48:44] al2o3-cr: has joined #ruby
[07:50:37] Exhiled: has joined #ruby
[08:02:41] shazbotmcnasty: has joined #ruby
[08:03:21] workmad3: has joined #ruby
[08:03:22] mtkd: has joined #ruby
[08:09:46] jottr: has joined #ruby
[08:09:55] Palando: has joined #ruby
[08:13:11] bkxd: has joined #ruby
[08:14:42] cschneid_: has joined #ruby
[08:15:17] mtkd: has joined #ruby
[08:25:16] marr: has joined #ruby
[08:25:47] biberu: has joined #ruby
[08:31:09] mson: has joined #ruby
[08:33:29] luminor: has joined #ruby
[08:37:57] lupine: has joined #ruby
[08:42:41] shazbotmcnasty: has joined #ruby
[08:46:17] claudiuinberlin: has joined #ruby
[08:54:36] luminor_: has joined #ruby
[08:58:11] allcentury: has joined #ruby
[08:58:39] Cork: has joined #ruby
[09:01:48] VladGh_: has joined #ruby
[09:11:13] JsilverT: has joined #ruby
[09:11:53] hotpancakes: has joined #ruby
[09:12:00] jottr: has joined #ruby
[09:16:04] Aces1up: has joined #ruby
[09:16:37] Aces1up: what is the best way to build json reply as per this spec
[09:16:38] Aces1up: http://docs.chatfuel.com/plugins/plugin-documentation/json-api
[09:16:54] Aces1up: looking for the correct ruby pattern to build up json structures
[09:18:01] jottr: has joined #ruby
[09:18:47] dminuoso: aces1up: I actually use jsonapi-rb in my rails application, but you can use this outside rails just as easily
[09:22:15] Aces1up: dminuoso cool so it will allow you to build up custom json structures likes this?
[09:22:40] dminuoso: Not "custom". But JSON:API conform output
[09:22:42] shazbotmcnasty: has joined #ruby
[09:24:23] cdg: has joined #ruby
[09:25:56] cdg_: has joined #ruby
[09:27:47] enterprisey: has joined #ruby
[09:28:34] dviola: has joined #ruby
[09:29:23] yxhuvud: has joined #ruby
[09:32:57] konsolebox: has joined #ruby
[09:36:53] allcentury: has joined #ruby
[09:42:41] shazbotmcnasty: has joined #ruby
[09:44:29] cdg: has joined #ruby
[09:45:22] yabbes: has joined #ruby
[09:46:44] luminor: has joined #ruby
[09:48:41] uZiel: has joined #ruby
[09:49:50] Freshnuts: has joined #ruby
[10:01:54] ledestin: has joined #ruby
[10:02:40] shazbotmcnasty: has joined #ruby
[10:07:50] rabajaj: has joined #ruby
[10:08:23] _sfiguser: has joined #ruby
[10:13:20] hays: has joined #ruby
[10:13:20] hays: has joined #ruby
[10:17:15] mikecmpbll: has joined #ruby
[10:18:46] jottr: has joined #ruby
[10:24:20] nhhc: has joined #ruby
[10:25:04] jottr: has joined #ruby
[10:25:25] Aces1up: has joined #ruby
[10:25:39] Aces1up: how can i have a meothod on my class using equal sign?
[10:25:54] Aces1up: just def =(var) end ??
[10:27:07] lexruee: has joined #ruby
[10:27:11] apeiros: = is not eligible as a method name
[10:27:12] ahrs: has joined #ruby
[10:28:31] apeiros: I mean, to be precise, you can, but you can't ever use it without send:
[10:28:33] apeiros: >> class Foo; define_method(:"=") { puts "wow" }; end; Foo.new.send("=")
[10:28:35] ruby[bot]: apeiros: # => wow ...check link for more (https://eval.in/902979)
[10:31:35] dminuoso: asm>> a = b
[10:31:36] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/902984
[10:32:07] lele: has joined #ruby
[10:32:18] luminor: has joined #ruby
[10:37:58] shoogz: has joined #ruby
[10:38:11] p0s1x: has joined #ruby
[10:39:49] shoogz: has joined #ruby
[10:41:18] shoogz: has joined #ruby
[10:42:41] shazbotmcnasty: has joined #ruby
[10:42:45] shoogz: has joined #ruby
[10:44:14] shoogz: has joined #ruby
[10:52:03] tomphp: has joined #ruby
[10:52:53] pskosinski: has joined #ruby
[10:59:58] PaulCapestany: has joined #ruby
[11:00:08] d^sh: has joined #ruby
[11:00:36] dinfuehr: has joined #ruby
[11:02:41] shazbotmcnasty: has joined #ruby
[11:03:56] yabbes: has joined #ruby
[11:04:00] devchild: has joined #ruby
[11:04:32] devchild: anyone experience with native extentions?
[11:04:40] ruby[bot]: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[11:07:16] pskosinski_: has joined #ruby
[11:07:27] devchild: I'm looking for a way to expose libgit2 recieve-pack upload-pack methods, how do I send input output streams to native extensions?
[11:07:46] jenrzzz: has joined #ruby
[11:07:47] jenrzzz: has joined #ruby
[11:08:45] apeiros: devchild: rugged doesn't provide access to those? (the official libgit2 ruby binding)
[11:10:07] dminuoso: apeiros: They were so overwhelmed.
[11:10:25] apeiros: I am that way
[11:13:16] devchild: has joined #ruby
[11:13:54] pskosinski: has joined #ruby
[11:13:54] pskosinski: has joined #ruby
[11:14:26] evie_hammond: has joined #ruby
[11:15:05] apeiros: any more elegant way to write this (subtract all cells of table b from the corresponding cell in table a, returning a new table with the difference)?
[11:15:07] apeiros: table_a.zip(table_b).map { |row_a, row_b| row_a.zip(row_b).map { |cell_a, cell_b| cell_a - cell_b }}
[11:15:32] apeiros: >> table_a = [[10,20,30],[50,60,70]]; table_b = [[1,2,3],[5,6,7]]; table_a.zip(table_b).map { |row_a, row_b| row_a.zip(row_b).map { |cell_a, cell_b| cell_a - cell_b }}
[11:15:33] ruby[bot]: apeiros: # => [[9, 18, 27], [45, 54, 63]] (https://eval.in/903008)
[11:18:17] dminuoso: apeiros: Yes but you wont like the answer
[11:19:09] apeiros: dminuoso: does the answer introduce a dependency? like some library you wrote? :-)
[11:19:10] kapil___: has joined #ruby
[11:20:35] dminuoso: apeiros: It will be `zipWith (zipWith sub), table_a, table_b` with it :P
[11:21:17] apeiros: yeah, ok. no :D
[11:21:36] apeiros: but hey, you've been right. I don't like the answer ;-p
[11:21:56] dminuoso: apeiros: Find comfort in that you've already done it in functional programming style.
[11:22:00] dminuoso: Mine just allows you to do it point-free.
[11:22:10] dminuoso: But it's essentially the same code.
[11:22:42] shazbotmcnasty: has joined #ruby
[11:23:27] cschneid_: has joined #ruby
[11:25:09] faces: has joined #ruby
[11:26:27] plexigras: has joined #ruby
[11:28:25] luminor: has joined #ruby
[11:28:42] mim1k: has joined #ruby
[11:31:10] michael3: has joined #ruby
[11:37:03] Jameser: has joined #ruby
[11:40:48] tomphp: has joined #ruby
[11:42:42] shazbotmcnasty: has joined #ruby
[11:45:20] Jameser: has joined #ruby
[11:45:24] dminuoso: Okay.. how do I find out whether lambda_a is a decurried lambda_b or not?
[11:45:49] tomphp: has joined #ruby
[11:46:30] tomphp: has joined #ruby
[11:46:33] dminuoso: By decurried I mean partially applied
[11:47:25] apeiros: btw. dminuoso: (Matrix[*table_a] - Matrix[*table_b]).to_a ;-)
[11:47:32] apeiros: (not using that, though)
[11:48:09] snickers: has joined #ruby
[11:48:18] dminuoso: apeiros: Yeah it crossed my mind but didnt bother to mention for the same reasons that you rejected (probably)
[11:48:49] tomphp: has joined #ruby
[11:51:21] oetjenj: has joined #ruby
[11:52:01] PaulCapestany: has joined #ruby
[11:54:10] p0s1x: has joined #ruby
[11:58:29] JsilverT: has joined #ruby
[11:59:30] b100s: has joined #ruby
[12:00:54] b100s: hi2all; i have file task and task 'foo'; i want task foo to always recreate that file using file task but it not creates file in case file already exists : ( is there way to re-create file always?
[12:01:14] Jameser: has joined #ruby
[12:02:43] shazbotmcnasty: has joined #ruby
[12:03:05] iamarun: has joined #ruby
[12:04:03] workmad3: has joined #ruby
[12:04:55] eb0t: has joined #ruby
[12:05:05] zanoni: has joined #ruby
[12:07:00] arup_r: has joined #ruby
[12:09:44] arup_r: I am using regexp in my test for string matching with html. But it sometimes fails because the string "O'Hara" in html source is being printed as 'O'Hara' How can I fix this? see expected string https://gist.github.com/aruprakshit/ad1c3eb05d293a2ccc80019aab5f362e#file-error-txt-L7 and https://gist.github.com/aruprakshit/ad1c3eb05d293a2ccc80019aab5f362e#file-error-txt-L42 .. Is there any flag that I can pass to regex to solve this problem?
[12:10:17] arup_r: this line fails https://gist.github.com/aruprakshit/ad1c3eb05d293a2ccc80019aab5f362e#file-view_spec-rb-L20 for this test
[12:12:46] tomphp: has joined #ruby
[12:13:38] tAn: has joined #ruby
[12:13:40] arup_r: added another scenario when it fails which is fax number. Not sure though why the 2 string doesn't match.
[12:14:04] tAn: has joined #ruby
[12:14:15] luminor: has joined #ruby
[12:15:01] dminuoso: apeiros: Great idea! https://gist.github.com/dminuoso/d5743e27c83a8d7a59be5fa67dda05a9
[12:15:24] apeiros: I'm amazed :D
[12:15:50] apeiros: though I'm currently more concerned about how the hell I get apache to run different rubies in different vhosts with passenger
[12:16:37] apeiros: I think I found it :)
[12:16:54] dminuoso: I just use puma and not think about how to cater passenger
[12:18:35] hutch34: has joined #ruby
[12:19:52] apeiros: well, I still have most experience with apache2, so I use it for my private stuff. it's relatively simple and quite powerful.
[12:21:42] dminuoso: I dont doubt it. Puma is still easier because passenger still requires that third party extension on your webserver.
[12:21:52] dminuoso: But I suppose thats minimal
[12:22:10] devchild: how do i debug native extentions?
[12:22:29] dminuoso: devchild: Debugger Ahoi.
[12:22:42] tAn: has joined #ruby
[12:22:44] shazbotmcnasty: has joined #ruby
[12:22:46] dminuoso: devchild: gdb/lldb are your friends.
[12:24:27] apeiros: dminuoso: puma alone won't do it, so you still need some kind of webserver which does the reverse-proxy. no? or can puma now do vhosts?
[12:36:15] arup_r: has joined #ruby
[12:37:11] dminuoso: apeiros: oh we just have nginx running in front for tls-termination
[12:37:28] dminuoso: but we can deploy this trivially from any alpine container
[12:37:42] tAn: has joined #ruby
[12:37:43] apeiros: see, so it's 2 layers there too :)
[12:37:44] shazbotmcnasty: has joined #ruby
[12:37:52] dminuoso: apeiros: yeah except we dont have to meddle with building passenger :)
[12:38:01] apeiros: my 2 layers are apache + passenger. apache does static file serving & tls termination
[12:38:14] apeiros: well, that's trivial :D
[12:38:47] conta: has joined #ruby
[12:38:48] apeiros: gem install & mod install & 4 lines of config. to change ruby version it's a single config line to change. no need to recompile passenger.
[12:39:17] apeiros: though ideally it'd just read the .ruby-version file and select on its own.
[12:40:00] chmurifree: has joined #ruby
[12:40:14] arup_r: What I need to fix this code, so that it matches. Right now it doesn't. s = 'foo bar (672) 941-7736 x626 some string'; regex = '(672) 941-7736 x626'; s.match(/#{regex}/) # nil
[12:40:54] apeiros: arup_r: () are special chars in a regex.
[12:41:14] arup_r: yeah.. but how will I control it when regex is dynamic
[12:41:26] apeiros: &ri Regexp.escape
[12:41:27] `derpy: http://ruby-doc.org/core-2.4.1/Regexp.html#method-c-escape
[12:41:31] GodFather: has joined #ruby
[12:41:47] apeiros: depends on your scenario.
[12:43:10] arup_r: my scenario is this https://gist.github.com/aruprakshit/ad1c3eb05d293a2ccc80019aab5f362e :) but that will solve one error. Now I need to find out how to fix the html unicode character.
[12:43:50] arup_r: >> s = 'foo bar (672) 941-7736 x626 some string'; regex = '(672) 941-7736 x626'; puts s.match(Regexp.escape(regex)) # works now.
[12:43:51] ruby[bot]: arup_r: # => (672) 941-7736 x626 ...check link for more (https://eval.in/903016)
[12:45:19] apeiros: I think you knew that using regex on html is a bad idea. didn't you?
[12:46:00] arup_r: yes rspec exposed only .match() method for view test. so I think I am forced. But I need to google now to see what alternatives I have
[12:46:04] tomphp: has joined #ruby
[12:47:15] apeiros: I don't know rspec well enough. but seems you're just looking whether a piece of text is in the html. with nokogiri it'd be something akin Nokogiri.HTML(your_document).text =~ /needle/
[12:47:35] dminuoso: Ruby specialists...
[12:47:37] dminuoso: https://eval.in/903019
[12:47:45] dminuoso: Where is the infinite recursion that I cant see?
[12:48:46] yeticry_: has joined #ruby
[12:49:48] cdg: has joined #ruby
[12:52:53] Nitrogen: has joined #ruby
[12:53:10] Nitrogen: Greetings. I am trying to download all images of a Wikimedia Commons Category using wimgs: https://github.com/abartov/wimgs
[12:53:24] Nitrogen: But when I run the command, the following error shows up: https://paste.debian.net/996507/
[12:53:36] Nitrogen: How can I fix that?
[12:54:51] apeiros: dminuoso: not sure :-S
[12:55:13] apeiros: Nitrogen: the author forgot to tell you that you need to install a gem, presumably called mediawiki_api
[12:55:29] apeiros: also sqlite3, since that's not part of ruby either.
[12:55:58] Nitrogen: I installed ruby-sqlite3 earlier. WHere do I find the mediawiki_api?
[12:55:59] apeiros: alternatively the author forgot to make this script into a proper gem with proper gemspec with proper dependency declaration.
[12:56:12] apeiros: no idea. tried `gem install mediawiki_api`?
[12:58:34] Nitrogen: apeiros: https://paste.debian.net/996511/
[12:59:07] apeiros: `apt-get install ruby-dev` or somesuch
[12:59:38] dminuoso: apeiros: I *think* the hack Im doing to convert blocks to lambdas is unhealthy.
[13:02:17] p0s1x: has joined #ruby
[13:02:43] shazbotmcnasty: has joined #ruby
[13:03:38] apeiros_: has joined #ruby
[13:03:39] roshanavand: has joined #ruby
[13:04:55] dminuoso: apeiros_: https://eval.in/903023
[13:05:33] apeiros: *sob*. about 1 random crash every 3 days now. really can't recommend apple anymore.
[13:05:40] Nitrogen: apeiros: https://paste.debian.net/996514/
[13:05:53] dminuoso: apeiros: I do think they made a mistake during reassembly.
[13:06:03] dminuoso: Never heard anyone else having those kinds of problems.
[13:06:12] apeiros: dminuoso: yeah, pondering on getting another appointment
[13:06:55] shinnya: has joined #ruby
[13:06:57] yeticry: has joined #ruby
[13:07:48] dminuoso: Seriously what the heck is going on here.
[13:08:02] dminuoso: https://eval.in/903025
[13:08:07] apeiros: Nitrogen: make: g++: Kommando nicht gefunden
[13:08:12] dminuoso: Works, but removing those comments blows up?
[13:08:54] apeiros: dminuoso: I suppose Method#curry and prepended [] with super is buggy?
[13:11:20] Nitrogen: apeiros: That did it! Thanks a bundle!
[13:13:10] dminuoso: apeiros: The buggy thing is when it looks up the super for []
[13:13:18] dminuoso: or.. wait..
[13:17:14] dminuoso: apeiros: It seems to also be related to this instance_method usage
[13:18:53] dminuoso: Do you agree that this looks like a real bug?
[13:18:58] sleepee: has joined #ruby
[13:20:56] tomphp: has joined #ruby
[13:21:38] apeiros: from the bit of what I looked at it, certainly seems so
[13:22:43] shazbotmcnasty: has joined #ruby
[13:23:57] tomphp: has joined #ruby
[13:26:21] mtkd: has joined #ruby
[13:28:35] tomphp: has joined #ruby
[13:28:49] PixeLInc: has joined #ruby
[13:29:50] Devalo: has joined #ruby
[13:31:45] dminuoso: apeiros: It just hit me. Its not a bug.
[13:31:47] dminuoso: This is to be expected.
[13:32:02] dminuoso: instance_method just does not grab the method I think it does.
[13:32:23] dminuoso: Which explains exactly what Im seeing.
[13:34:16] dminuoso: https://eval.in/903036
[13:36:58] charliesome: has joined #ruby
[13:39:44] p0s1x: has joined #ruby
[13:41:46] xt233: has joined #ruby
[13:42:41] shazbotmcnasty: has joined #ruby
[13:43:25] xt233: has left #ruby: ()
[13:44:14] Nitrogen: has left #ruby: ()
[13:46:54] yeticry: has joined #ruby
[13:48:50] selim: has joined #ruby
[13:51:13] banisterfiend: has joined #ruby
[13:53:55] badeball: has joined #ruby
[13:55:00] mtkd: has joined #ruby
[13:57:45] linocisco: has joined #ruby
[14:00:08] devchild: how do I start rails with lldb
[14:00:40] kitsunenokenja: has joined #ruby
[14:02:43] shazbotmcnasty: has joined #ruby
[14:03:53] foxxx0: has joined #ruby
[14:04:14] workmad3: has joined #ruby
[14:05:51] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[14:06:54] hutch34: has joined #ruby
[14:07:35] jenrzzz: has joined #ruby
[14:12:21] jeanlinux: has joined #ruby
[14:15:56] hutch34: has joined #ruby
[14:22:42] shazbotmcnasty: has joined #ruby
[14:24:16] gizmore: has joined #ruby
[14:25:43] sepp2k: has joined #ruby
[14:29:44] kculpis: has joined #ruby
[14:32:10] devchild: has joined #ruby
[14:36:43] yeticry: has joined #ruby
[14:39:53] JsilverT: has joined #ruby
[14:42:06] Arney: has joined #ruby
[14:42:23] Arney: after an update of my whole stack ruby gives me Time.now without a timezone
[14:42:32] Arney: even though the timezone of my pc is correct
[14:42:33] Arney: what can i do?
[14:42:40] Arney: (im in +0100)
[14:42:43] shazbotmcnasty: has joined #ruby
[14:42:48] Arney: and Time.now says +0000
[14:44:00] millz: has joined #ruby
[14:45:58] tomphp: has joined #ruby
[14:46:30] Arney: well okay, ruby thinks it's in utc, but why?
[14:46:49] mistnim: has joined #ruby
[14:48:08] mistnim: how do I debug an unexpected end of input, excpetcted keyboard end (with line number the end of a long file?) indenting with my editor doesn't show any problem
[14:48:53] apeiros: keyboard end? :D
[14:49:12] apeiros: now *that* is an interesting syntax error ;-p
[14:49:30] Arney: that face when you cant write end because u reached the end of the keyboard
[14:49:34] apeiros: expected keyword end litterally means that you're missing an 'end'
[14:49:45] mistnim: apeiros, yes, but where it is?
[14:49:59] Arney: apeiros: you better get your glass sphere
[14:49:59] mistnim: the auto-indentation is fine
[14:50:11] apeiros: mistnim: well, read through your source, find all places where you open a scope which needs an ending 'end', indent it properly and see
[14:50:32] Arney: have any changes been made to ruby's detection of timezones?
[14:50:35] mistnim: it's 1000 lines of code
[14:50:36] apeiros: and yeah, if your editor supports autoformat, try that
[14:50:48] apeiros: mistnim: tough life.
[14:50:52] theillusioneer: has joined #ruby
[14:50:59] apeiros: cut sections you consider correct
[14:51:15] banisterfiend: has joined #ruby
[14:51:25] apeiros: binary search style - cut half, see whether it works. if not, it's in the remaining half. if it does, it's in the cut half.
[14:51:36] apeiros: rinsse & repeat.
[14:51:52] DLSteve: has joined #ruby
[14:52:53] nowhere_man: has joined #ruby
[14:56:16] wolfshappen: has joined #ruby
[14:58:03] oetjenj: has joined #ruby
[14:58:48] oetjenj: has joined #ruby
[14:58:49] mistnim: guys, it's not else if, it's elsif.
[14:59:14] FahmeF: has joined #ruby
[15:00:25] apeiros: would it surprise you if I told you that we know that already? :)
[15:00:46] devchild: has joined #ruby
[15:02:09] banisterfiend: has joined #ruby
[15:02:45] mistnim: also, run your thing frequently while you code
[15:03:30] apeiros: nah, I usually run stuff every ~10KB ;-D
[15:03:53] apeiros: (not really, only if a single feature really requires that much code - else after a feature is done)
[15:08:23] adaedra: rerun rspec
[15:08:26] adaedra: hop, done.
[15:08:46] dminuoso: And then wait 20 minutes
[15:09:05] dminuoso: https://xkcd.com/303/
[15:09:09] dminuoso: Why is there no equivalent for testing?
[15:09:50] adaedra: Because we have fast test suites 😎
[15:10:57] shazbotmcnasty: has joined #ruby
[15:13:12] dminuoso: Fast usually means empty. ;p
[15:17:41] gone_haywire: has joined #ruby
[15:18:42] nickjj: SSDs and only running tests against the code we're actively developing
[15:20:08] ^mtkd: has joined #ruby
[15:20:45] Psybur: has joined #ruby
[15:21:13] apeiros: nickjj: pffft, I have a testsuite with >1mio assertions which runs <2s.
[15:21:13] mtkd: has joined #ruby
[15:24:34] nickjj: apeiros, assert_equal 1, 1 -- x a million?
[15:25:05] dminuoso: Im guessing some of those are automatically generated.
[15:25:18] dminuoso: Id rather be interested in how many separate tests (with setup and teardown in between) are being run.
[15:25:48] banisterfiend: has joined #ruby
[15:26:18] mtkd: has joined #ruby
[15:27:26] dinfuehr: has joined #ruby
[15:28:30] apeiros: nickjj: no, a datetime library testing a cycle of 402 years (since 400 years is a complete leap year cycle in gregorian calendar system)
[15:28:42] apeiros: + some other tests, but the cycle is where most assertions happen
[15:30:48] devchild: has joined #ruby
[15:30:58] shazbotmcnasty: has joined #ruby
[15:33:17] webguynow: has joined #ruby
[15:33:22] nickjj: i tend to run a smaller amount of end to end tests, but they also run fast enough if i stick to testing what i'm actively working on (then i run full tests when i'm ready to push a new build)
[15:33:39] nickjj: but that is in the context of developing web applications
[15:35:50] Senecea: has joined #ruby
[15:40:33] nunchuck: has joined #ruby
[15:42:53] hutch34: has joined #ruby
[15:44:44] Technodrome: has joined #ruby
[15:45:58] snickers: has joined #ruby
[15:47:07] uZiel: has joined #ruby
[15:50:58] shazbotmcnasty: has joined #ruby
[15:53:23] mrconfused: has joined #ruby
[15:53:31] wolfshappen: has joined #ruby
[15:59:55] dminuoso: apeiros: this is amazing
[15:59:57] dminuoso: &ri Coverage
[15:59:57] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/coverage/rdoc/Coverage.html
[16:00:23] dminuoso: Seen some presentation from tenderlove regarding reducing testing time with this
[16:00:27] apeiros: dminuoso: isn't that the basis for simplecov?
[16:01:18] uZiel: has joined #ruby
[16:01:23] dminuoso: I thought simplecov was the old ancient tool for before?
[16:02:05] apeiros: that was rcov iirc
[16:02:25] dminuoso: ¯\_(ツ)_/¯
[16:02:31] apeiros: simplecov started to exist with the advent of this api. or maybe a predecessor of it. but I'm pretty sure simplecov started when ruby had native support of sorts
[16:03:11] dminuoso: apeiros: considering Coverage is rather new, idk
[16:04:13] apeiros: http://ruby-doc.org/stdlib-2.0.0/libdoc/coverage/rdoc/Coverage.html
[16:04:24] valeth2: has joined #ruby
[16:04:50] apeiros: 5th version it's in already.
[16:04:56] apeiros: so not *that* new :)
[16:05:48] apeiros: "SimpleCov is a code coverage analysis tool for Ruby. It uses Ruby's built-in Coverage library to gather code coverage data"
[16:05:54] apeiros: I'd say that settles it ;-p
[16:06:32] dminuoso: Ill buy you a beer.
[16:06:46] apeiros: you do remember that I don't drink beer?
[16:07:05] dminuoso: Yes, which is why.
[16:07:17] apeiros: oh, actually even http://ruby-doc.org/stdlib-1.9.3/libdoc/coverage/rdoc/Coverage.html
[16:07:21] apeiros: I only tested 1.9.0
[16:07:30] dminuoso: That way Ill have a "gutes Gewissen", but get to drink your beer for you as well.
[16:07:57] apeiros: we got different ideas about the meaning of "win"
[16:08:12] dminuoso: Fine, pick your poison
[16:08:29] apeiros: and now excuse me, I've got to figure out why my glyphicons no longer load since updating bootstrap-sass
[16:08:41] apeiros: and read https://waitbutwhy.com/2014/05/fermi-paradox.html - just because
[16:08:42] dminuoso: are you using webpacker?
[16:11:03] shazbotmcnasty: has joined #ruby
[16:12:59] apeiros: hm, seems no glyphicons there anymore, but FA is there. I guess I'll just turn all icons to FA icons instead. glyph is dead anyway iirc.
[16:15:08] cschneid_: has joined #ruby
[16:15:23] dminuoso: Yes. bootstrap 4 has glyphicons removed
[16:16:04] dminuoso: apeiros: Its just sad that people are still using font icons. :(
[16:16:16] dminuoso: Wish FA had svg icons available, like glyphicons do
[16:16:54] apeiros: ye, but this project is still on bootstrap3, so I thought glyph would still be there. but it's not important.
[16:17:03] apeiros: you know fontanello?
[16:17:10] dminuoso: Never heard of it
[16:17:19] apeiros: wait… must misremember the name…
[16:17:34] apeiros: ah, fontello
[16:17:35] apeiros: http://fontello.com
[16:17:45] xlegoman: has joined #ruby
[16:17:56] apeiros: instead of having a huge font file, you can create your own small font-file with the couple of icons you actually use
[16:18:26] banisterfiend: has joined #ruby
[16:18:27] dminuoso: Like I said, I wish people stopped using font icons.
[16:19:37] nickjj: damn, that article is epic
[16:19:48] apeiros: dminuoso: why's that?
[16:19:52] Psybur: has joined #ruby
[16:19:56] apeiros: I mean why svg > font?
[16:21:28] dminuoso: apeiros: Semantic correctness (abusing span/i for icons is gross), anti-aliasing of fonts can blur icons, properly colored icons, and styling. css with font icons can drive you mad.
[16:22:08] dminuoso: Also it's trivial do just change an icon
[16:22:23] dminuoso: Since you can just edit them with inkscape if need be.
[16:22:35] adaedra: Yeah, icon fonts were a neat trick, but SVG is really the good tool for this
[16:23:20] p0s1x: has joined #ruby
[16:25:03] apeiros: dminuoso: and how are the svg's referenced? <img src=>?
[16:25:22] apeiros: or in css with background-image: url(…)?
[16:25:28] apeiros: or some other means?
[16:25:37] dminuoso: apeiros: turns out you got <svg> :-)
[16:25:58] apeiros: ok. that means everytime you show an icon you embed the full code? o0
[16:26:31] dminuoso: apeiros: You can but you dont have to. You can use internal/external references
[16:27:18] dminuoso: apeiros: Essentially svg in HTML acts as foreign elements. And svg defines <use> elements that can reference other files
[16:27:39] apeiros: ok, let me boil this down:
[16:27:43] dminuoso: So you end up with something like <svg><use xlink:href='...' /></svg>
[16:27:52] apeiros: is it possible to load a single file with all icons and reference those from the html?
[16:28:21] apeiros: ok. that was my main concern. because otherwise we're back at old problems :)
[16:28:43] adaedra: we're kinda deriving from ruby here :p
[16:28:54] apeiros: point taken. -> ot
[16:29:03] adaedra: good thing ops didn't see you.
[16:29:15] apeiros: yeah. they're lazy AF anyway.
[16:29:37] apeiros: and the founders? haven't seen 'em in ages… shame, shame…
[16:31:00] shazbotmcnasty: has joined #ruby
[16:31:55] astronavt: has joined #ruby
[16:33:15] michael3: has joined #ruby
[16:33:51] dstrunk: has joined #ruby
[16:33:58] astronavt: has joined #ruby
[16:34:20] tAn: has joined #ruby
[16:35:36] devchild: has joined #ruby
[16:37:29] aroaminggeek: has joined #ruby
[16:40:30] nadir: has joined #ruby
[16:40:52] craysiii: hey all, attempting to write my first API wrapper. wondering if I can get some constructive criticism on what i'm doing wrong/what can be done better https://gist.github.com/craysiii/b7886f8ff1b9f15834fc8f09e51bf1bf
[16:42:45] dminuoso: craysiii: Two things: Dont put everything into one class. You're missing the point of ruby's object oriented design.
[16:42:55] dminuoso: craysiii: And the other is youf `req.params['asset'] = asset unless asset.nil?` idiom
[16:42:59] dminuoso: &ri Hash#merger
[16:42:59] `derpy: No results
[16:43:01] dminuoso: &ri Hash#merge
[16:43:01] `derpy: http://ruby-doc.org/core-2.4.1/Hash.html#method-i-merge
[16:45:10] joker5bb: has joined #ruby
[16:45:22] craysiii: thanks derpy, will check out merge. and will work on the OOP as well
[16:47:05] Exhiled: has joined #ruby
[16:48:44] astronavt: has joined #ruby
[16:50:00] devchild: has joined #ruby
[16:50:03] astronavt: has joined #ruby
[16:50:25] dminuoso: apeiros: Didn't realize because I was being silly:
[16:50:42] dminuoso: (Q.zipWith * Q.zipWith).(Q.sum, a, b)
[16:50:45] dminuoso: Look at this beauty!
[16:50:59] shazbotmcnasty: has joined #ruby
[16:51:07] apeiros: indeed it is
[16:53:22] dminuoso: It's not as clean as `(zipWith . zipWith) (-) a b` but its fairly close
[16:53:47] dminuoso: Im so tempted to rig method_missing to allow . for function composition.
[16:54:53] apeiros: just go ahead and implement your own language already :D
[16:55:23] dminuoso: Been there done that. With what Im learning now, it's way beyond my skills to implement a language with the things I like.
[16:55:56] apeiros: eh, you're a clever cookie. I'm pretty sure you can acquire those skills.
[16:57:06] nofxx1: has joined #ruby
[16:57:44] mim1k: has joined #ruby
[16:57:50] tAn: has joined #ruby
[16:59:42] Mia: has joined #ruby
[16:59:42] Mia: has joined #ruby
[17:01:54] p0s1x: has joined #ruby
[17:03:25] dminuoso: apeiros: https://gist.github.com/dminuoso/5c9cb9837966fd12b1be8b3112b939bf
[17:03:46] dminuoso: Never have tables been so much fun before, with functional ruby!
[17:04:51] p0s1x: has joined #ruby
[17:07:09] RougeR: has joined #ruby
[17:08:07] nopolitica: has joined #ruby
[17:08:35] astronavt: has joined #ruby
[17:11:03] tAn: has joined #ruby
[17:11:05] shazbotmcnasty: has joined #ruby
[17:11:18] mtkd: has joined #ruby
[17:16:29] tomphp: has joined #ruby
[17:19:15] Hanmac: has joined #ruby
[17:19:51] Psybur: has joined #ruby
[17:21:37] FahmeF: has joined #ruby
[17:21:49] hutch34: has joined #ruby
[17:23:52] drowze: has joined #ruby
[17:28:45] Seich: has joined #ruby
[17:29:38] eroux: has joined #ruby
[17:31:00] shazbotmcnasty: has joined #ruby
[17:31:22] mson: has joined #ruby
[17:31:40] tomphp: has joined #ruby
[17:38:37] orbyt_: has joined #ruby
[17:41:00] jackjackdripper: has joined #ruby
[17:41:43] darkmorph: has joined #ruby
[17:43:33] kitsunenokenja: has joined #ruby
[17:45:25] tAn: has joined #ruby
[17:47:44] mikeiniowa: has joined #ruby
[17:50:21] noobineer: has joined #ruby
[17:51:00] shazbotmcnasty: has joined #ruby
[17:56:50] drowze: has joined #ruby
[17:58:20] craysiii: wow i thanked the bot, thanks dminuoso lol.
[17:58:35] hndk: has joined #ruby
[18:00:08] Sambsquanch: has joined #ruby
[18:00:53] noobineer: has joined #ruby
[18:03:19] astronavt: has joined #ruby
[18:04:53] workmad3: has joined #ruby
[18:05:08] kitsunenokenja: has joined #ruby
[18:06:23] ruby[bot]: nomnomnomnom
[18:08:43] digitalowl: has joined #ruby
[18:09:55] digitalowl: Hello. Can I generate event for EventMachine? I want generate periodic inotify events for scan path.
[18:10:15] digitalowl: Only touch file in watched directory?
[18:10:59] shazbotmcnasty: has joined #ruby
[18:11:19] RickHull: that sounds reasonable. inotify can fire on lots of stuff IIRC
[18:11:27] RickHull: not sure how EM hooks into inotify
[18:13:35] Dimik: has joined #ruby
[18:13:44] dtzuzu: has joined #ruby
[18:14:08] digitalowl: I want process big count of files in 10-15 threads and files will be added. When threadpool for file processing will be filled - new inotify events will be just dropped. I want additional periodic generate additional intofy for continue process.
[18:14:38] tAn: has joined #ruby
[18:15:55] digitalowl: s/additional intofy/inotify/
[18:15:55] RickHull: like a ping so you know it's still alive?
[18:16:22] RickHull: oh, nvm, I misunderstood
[18:16:52] RickHull: you should be able to queue up inotify events, even if all threads are busy
[18:16:55] RickHull: all *worker* threads
[18:17:07] RickHull: you can have a supervisor thread that maintains a queue of events, maybe
[18:17:33] RickHull: i wouldn't expect the events to just get dropped in a basic setup though -- but haven't played with this in a while
[18:17:39] digitalowl: I think about native threads with supervisor, yes...
[18:18:24] RickHull: anyway, I'm just guessing. maybe someone else has more relevant experience :)
[18:19:39] RickHull: while there are scaling limits -- you might consider just spinning up a thread per event, rather than a pool
[18:19:54] Psybur: has joined #ruby
[18:20:06] RickHull: short-lived threads -- perhaps with an internal timer that suicides the thread
[18:21:10] astronavt: has joined #ruby
[18:21:47] digitalowl: Hm... Okay, try again - I have a temporary folder with files - my task - pack all files so fast as i can
[18:22:06] digitalowl: And move packed files to destination directory.
[18:22:51] digitalowl: I want read listen inotify events for new files coming and create separated packing thread for every file in directory
[18:23:14] RickHull: pack, like tar.gz ?
[18:23:59] RickHull: i would start with a thread per event and see how it performs
[18:24:06] RickHull: it should be 100% correct and no events dropped
[18:24:22] RickHull: it's possible too many threads are created, and you would maybe consider a thread pool for that scenario
[18:24:39] digitalowl: Yeah, while count of running threads less than threads limit
[18:25:30] RickHull: with all worker threads busy -- in the thread pool case -- you should still have a thread that can consume and queue events -- assuming inotify doesn't queue for you
[18:25:34] digitalowl: I want limit count of threads because packing is heavy task
[18:26:28] RickHull: i dunno -- you can probably rely on the OS to do your scheduling rather than the crude scheduling of a thread pool full of busy workers
[18:26:52] RickHull: but maybe there are IO bottlenecks or the machine grinds to a halt
[18:27:55] digitalowl: I want use 10-15 threads for process thousands files - ofc all threads will be busy
[18:28:22] RickHull: how long does a work take?
[18:28:32] RickHull: and at what rate do new files show up?
[18:28:44] RickHull: you are going to get backed up at some point, presumably
[18:28:47] digitalowl: from 1 to 5-10 seconds
[18:29:09] digitalowl: I think rate for new files is low
[18:29:19] RickHull: then why would there be thousands of files?
[18:29:34] digitalowl: First fill of database
[18:29:46] RickHull: solve that separately from the ongoing operations problem
[18:29:59] RickHull: they are two distinct problems
[18:30:39] RickHull: you don't need inotify for initial startup where there are thousands of files
[18:30:59] shazbotmcnasty: has joined #ruby
[18:31:36] digitalowl: But sometimes I can get new pack of files (ofc with less count of files)
[18:33:07] devchild: has joined #ruby
[18:33:17] digitalowl: In ideal case I want create simple backend with CRUD api - I put file to server, he save to file to temporary directory and after one of threads is free - he process new file.
[18:33:31] digitalowl: s/to file to/to/
[18:34:07] RickHull: just to back up: 1 current problem is that when all workers are busy, inotify events get dropped?
[18:34:12] digitalowl: In additional case I think about use message broker
[18:34:13] RickHull: is that the only issue right now?
[18:34:38] Zamyatin: has joined #ruby
[18:35:10] jeanlinux: has joined #ruby
[18:35:16] digitalowl: Inotify will be generated - but I may only drop it or save for future process.
[18:35:42] RickHull: if inotify is your source of truth -- if you won't know of a file's existence without it -- then you must queue the event for later processing
[18:35:55] RickHull: i would think inotify has a built in mechanism for this
[18:36:00] RickHull: but not sure
[18:37:01] digitalowl: For my case inotify is not a right choise, because I want listen inotify on remporary directory, but that
[18:37:24] digitalowl: event will be generated on each modification of folder - create file, delete file, move file, etc
[18:37:34] Technodrome: has joined #ruby
[18:37:46] kitsunenokenja: has joined #ruby
[18:38:18] digitalowl: What do you think about message broker or memcached?
[18:38:32] houhoulis: has joined #ruby
[18:38:37] RickHull: i think you're venturing into astronaut architecture :)
[18:39:04] digitalowl: Server got file< save his to temporary directory, push metadata to message broker, queue turn, read new messagess and process new files
[18:39:12] RickHull: just listen for file creation event, queue it, and process it with workers
[18:39:30] digitalowl: Rocket science is all of my live :D
[18:40:09] RickHull: I don't know if I can help much more without researching inotify, which isn't going to happen today :)
[18:40:26] RickHull: but hopefully this gives some things to think about, some alternatives :)
[18:40:40] digitalowl: I can't listen inotify events for non existent files. I can listen inotify for temporary folder, but without additional information - only - folder changed.
[18:40:45] tAn: has joined #ruby
[18:41:03] RickHull: you should be able to filter the events easily
[18:41:16] digitalowl: About alternatives - yes, that's true.
[18:43:34] JsilverT: has joined #ruby
[18:48:08] digitalowl: RickHull, thx, I get message broker. INotify is not applicapable for my case.
[18:48:33] lexruee: has joined #ruby
[18:49:22] RickHull: good luck. I don't see how it helps, because inotify is listening for filesystem events. a message broker doesn't (typically) solve that problem
[18:50:33] Immune: has joined #ruby
[18:50:57] digitalowl: Em... Server put message to broker, queue run per minute for example, get new messages for free threads and drop his from message queue.
[18:50:59] shazbotmcnasty: has joined #ruby
[18:51:43] RickHull: so the message is something like: "there should be a file named xyz.txt in /tmp/dir" ?
[18:51:56] digitalowl: something like that, yes
[18:52:13] digitalowl: But in this case I can get race condition :D
[18:52:23] RickHull: i would be more tempted to query the filesystem for the existence of files
[18:53:09] RickHull: you could just use `ls` and have /tmp/dump /tmp/processing /tmp/packed
[18:53:27] RickHull: move from dump to processing when a thread grabs a file
[18:53:35] RickHull: that way it won't be processed twice
[18:53:49] digitalowl: replace ls to File.exists?, but yes, you right, I think about that
[18:53:50] aroaminggeek: has joined #ruby
[18:54:48] RickHull: you will have to be careful about concurrency, atomicity, etc -- what else is new? ;)
[18:54:56] digitalowl: lol, I know how write queue on bash in 5-10 lines, but that's not interesting
[18:55:08] RickHull: but the advantage is that when something goes wrong -- and it will -- the state is all there on the filesystem
[18:55:11] Radanisk: has joined #ruby
[18:55:31] chmurifree: has joined #ruby
[18:56:11] swills: has joined #ruby
[18:56:12] swills: has joined #ruby
[18:56:33] digitalowl: I create this project for myself because I want understand what multiprocessing problems I get, resolve it and get more expirience.
[18:56:57] digitalowl: And I want have a normal library for my ebooks collection.
[18:57:23] dstrunk: has joined #ruby
[18:57:26] Prutheus: has joined #ruby
[18:58:11] Prutheus: Hello! Is it possible to write this statement in a more easy way: https://bpaste.net/show/4022520eccdf I used a lot of multiplications, divisions and sums. Maybe I could shorten this a bit? at least removing the -1 somehow?
[18:58:16] mim1k: has joined #ruby
[18:59:00] dminuoso: prutheus: On a highlevel, what does the code do?
[18:59:31] Prutheus: i have a number, e.g. 300
[18:59:32] RickHull: may $deity help the maintenance programmer who has to debug this
[18:59:45] Prutheus: then i have an array with elements, every 10 it gets one element
[18:59:55] Prutheus: now, when we got 30 elemets we reached 300
[19:00:04] Prutheus: then the code under the unless statement should get executed
[19:00:22] dminuoso: Dont explain to me what the code does step by step. I want you to just tell me what this does on an abstract level.
[19:00:35] dminuoso: Trying to see your intend.
[19:00:35] Prutheus: yeah thats it what i did
[19:01:10] dminuoso: prutheus: Oh sorry you misunderstood. I just want to know the gist of that expression.
[19:01:21] tAn: has joined #ruby
[19:01:28] RickHull: what is the purpose? what problem is being solved?
[19:01:47] Prutheus: checking if we received 30 elements already
[19:02:12] Prutheus: ahahahahaha
[19:02:15] Prutheus: oh man i am so stupid
[19:02:17] dviola: has joined #ruby
[19:02:19] digitalowl: prutheus, 30 elements per minute?
[19:02:33] Prutheus: i just can rewrite it to unless .length * 10 == 300
[19:02:37] dminuoso: prutheus: :-)
[19:02:49] dminuoso: prutheus: this is why I asked you to get a high level description of your intent. :-)
[19:02:58] Prutheus: yeah right, thanks a lot for that
[19:03:04] Prutheus: oh man this is su funny
[19:03:15] RickHull: it could be that 30 is not an invariant of your problem
[19:03:23] RickHull: 30 may be the result of some choice in the problem space
[19:03:58] RickHull: you may want to organize all of these variables into a class with ivars and methods that yield sensible scalars
[19:04:02] Prutheus: yeah but its all "static", man I don't know why I was using something like modulo, no sense on taht point haha
[19:05:30] ogres: has joined #ruby
[19:05:56] dminuoso: prutheus: I've been there, refactoring entire 200 LoC modules to nothing, realizing it could be replaced by a single method call to Enumerable before.
[19:06:11] RickHull: I love those moments!
[19:07:22] RickHull: http://i0.kym-cdn.com/photos/images/original/000/263/418/5e7.jpg
[19:08:24] idiocrash: has joined #ruby
[19:08:56] Prutheus: what is LoC ?
[19:09:04] craysiii: lines of code
[19:10:59] shazbotmcnasty: has joined #ruby
[19:14:02] armyriad: has joined #ruby
[19:15:08] dminuoso: RickHull: Im on a rick roll.
[19:15:12] dminuoso: This code is writing itself.
[19:15:56] RickHull: sometimes the universe speaks and you're just a vessel
[19:16:42] dminuoso: https://gist.github.com/dminuoso/ee067743fcfe4b1dfa47d9615961f313
[19:16:48] dminuoso: My latest most readable lens implementation
[19:17:40] dminuoso: That defc pattern should be a thing.
[19:17:53] digitalowl: RickHull, hm... I found another solution with inotify :D
[19:18:07] craysiii: RickHull sounds like something terry would say
[19:18:17] digitalowl: RickHull: https://github.com/mockko/em-dir-watcher
[19:18:55] RickHull: digitalowl: yeah, I meant to say earlier, this is a common problem that has been solved many times before
[19:19:11] dminuoso: I think.. I need to write tests now.
[19:19:12] RickHull: some solutions better than others -- the devil is in the details
[19:19:19] dminuoso: adaedra: rspec or minitest?
[19:19:20] michael3: has joined #ruby
[19:19:52] Psybur: has joined #ruby
[19:21:00] RickHull: I haven't found anything that rspec solves better than minitest for my gems -- I think rspec is maybe a win for web projects
[19:21:32] RickHull: i haven't looked very hard either, so grain of salt and all that
[19:21:32] dminuoso: adaedra: It was an honest question. ;o
[19:21:47] adaedra: dminuoso: I lack the context for this question
[19:21:52] dminuoso: Ive only ever used rspec because... well a few years ago I flipped a coin because I couldnt decide.
[19:22:00] dminuoso: adaedra: So Im writing a library right now.
[19:22:13] dminuoso: And I want to start writing tests. Wondering whether there are sane arguments for minitest.
[19:22:43] plexigras: has joined #ruby
[19:22:57] adaedra: RickHull: I really like rspec because of the describe/context/it syntaxes which I find better for organizing (and minitest/spec is not reimplementing correctly) and rspec has some good additions (like re-launching previously failed tests) out of the box
[19:23:44] adaedra: dminuoso: arguments for minitest are usually that it's simpler and ruby-like.
[19:24:16] dminuoso: Seeing as I seem to be incapable of writing ruby-like ruby code..
[19:24:17] RickHull: adaedra: yeah, i think there are some wins there -- but the cost of the DSL dampens
[19:24:29] ur5us: has joined #ruby
[19:24:39] adaedra: it's a matter of habit
[19:25:00] RickHull: i have hit some limits with minitest where I want to apply tests defined in one place to another context / class / ojb
[19:25:04] RickHull: and i think rspec can do that
[19:26:01] elomatreb: shared examples, yeah. Pretty useful
[19:26:40] RickHull: at some point though, rspec and test grooming can feel like a fetish ;)
[19:27:27] safetypin: has joined #ruby
[19:28:33] RickHull: minitest tends toward quick, flat, simple
[19:28:51] RickHull: rspec suites are like their own program, with bugs included
[19:29:06] RickHull: sometimes hard to know what is being tested, or surprising behavior
[19:29:16] adaedra: You can have that with minitest too
[19:30:43] cryocaustik: has joined #ruby
[19:30:52] RickHull: any examples of such here? https://github.com/rickhull/compsci/tree/master/test
[19:30:58] noobineer: has joined #ruby
[19:30:59] shazbotmcnasty: has joined #ruby
[19:31:13] Xiti: has joined #ruby
[19:33:33] cryocaustik: Hi - I am very new to ruby and am trying to learn; my goal is to setup a web forum that would also have a subsite with charts/tables to consume some data from another database.
[19:33:33] cryocaustik: I was wondering it if would be possible to run https://github.com/discourse/discourse and also add a subsite for my data application into the discourse infrastructure?
[19:35:16] RickHull: cryocaustik: have you heard of rails?
[19:35:45] RickHull: probably setting up discourse is a bad way to learn ruby
[19:36:06] RickHull: rails is a good compromise for making it easy to set up a site and talk to a database
[19:36:16] cryocaustik: I have read about it; an infrastructure to help people new to ruby get setup and running
[19:36:44] AX31_A13X: has joined #ruby
[19:36:58] RickHull: do you want to learn ruby specifically? do you want to learn web stuff? or do you want to learn just enough to run a website?
[19:37:27] aroaminggeek: has joined #ruby
[19:37:43] cryocaustik: I am interested in learning ruby overall; but what drove me to the language is wanting to build a forum/subsite
[19:38:39] RickHull: I would suggest a 2-pronged effort: 1. pick a free ruby tutorial like "pine learn to program" or "learn ruby the hard way" and 2. pick a rails tutorial and set up your first rails site
[19:39:09] RickHull: budget one week to one month for this
[19:39:18] RickHull: and then decide on proceeding with discourse or whatever
[19:39:40] cryocaustik: that is a good point; I am about 20% into the codecademy tutorial; I will give rails a try and see if I can setup a site using that
[19:39:49] RickHull: if you can't budget more than a week or a month, then you may need to reconsider your goals :)
[19:39:59] cryocaustik: nah, that is a great timeline
[19:40:05] cryocaustik: esp. considering I am new to ruby :D
[19:40:06] xlegoman: has joined #ruby
[19:40:21] zanoni: or try Jumpstart Sinatra, short book and you get started with web , ruby and database, quick project to fall along with
[19:40:43] cryocaustik: nice - I will look it up
[19:40:52] cryocaustik: thanks again for the advice
[19:40:52] RickHull: ^ I prefer Sinatra to rails for simple things -- but i'm not sure what it's like for a newbie
[19:41:30] mtkd: has joined #ruby
[19:44:15] zanoni: I took the path of Sinatra to get better acquainted with how a web framework works
[19:51:00] shazbotmcnasty: has joined #ruby
[19:52:59] michael1: has joined #ruby
[19:58:00] Radanisk: has joined #ruby
[20:01:36] Zamyatin: has joined #ruby
[20:05:01] workmad3: has joined #ruby
[20:05:04] woodruffw: has joined #ruby
[20:05:05] woodruffw: has joined #ruby
[20:11:04] shazbotmcnasty: has joined #ruby
[20:15:18] devchild: has joined #ruby
[20:19:52] Psybur: has joined #ruby
[20:20:48] devchild: has joined #ruby
[20:25:27] p0s1x: has joined #ruby
[20:31:07] shazbotmcnasty: has joined #ruby
[20:42:56] Technodrome: has joined #ruby
[20:46:18] Emmanuel_Chanel: has joined #ruby
[20:51:00] shazbotmcnasty: has joined #ruby
[20:58:47] mim1k: has joined #ruby
[21:06:56] Pierreb|home: has joined #ruby
[21:11:06] shazbotmcnasty: has joined #ruby
[21:15:06] luminor: has joined #ruby
[21:17:49] shazbotmcnasty: has joined #ruby
[21:19:53] Psybur: has joined #ruby
[21:21:38] FahmeF: has joined #ruby
[21:21:41] Azure: has joined #ruby
[21:22:18] sepp2k1: has joined #ruby
[21:25:13] luminor: has joined #ruby
[21:25:37] cagomez: has joined #ruby
[21:25:38] drowze: has joined #ruby
[21:26:23] luminor: has joined #ruby
[21:27:04] luminor: has joined #ruby
[21:27:51] luminor: has joined #ruby
[21:30:51] brokesys: has joined #ruby
[21:31:07] shazbotmcnasty: has joined #ruby
[21:33:57] mattp__: has joined #ruby
[21:39:08] devchild: has joined #ruby
[21:42:35] cschneid_: has joined #ruby
[21:43:12] marr: has joined #ruby
[21:43:42] cdg: has joined #ruby
[21:44:06] cagomez: has joined #ruby
[21:44:33] Technodrome: has joined #ruby
[21:45:15] p0s1x: has joined #ruby
[21:45:52] cschneid_: has joined #ruby
[21:51:01] shazbotmcnasty: has joined #ruby
[21:51:17] raynold: has joined #ruby
[21:54:04] eckhardt: has joined #ruby
[21:56:53] yokel: has joined #ruby
[21:58:48] Freshnuts: has joined #ruby
[22:00:38] mtkd: has joined #ruby
[22:03:49] ap4y: has joined #ruby
[22:03:58] hutch34: has joined #ruby
[22:04:39] mattp_: has joined #ruby
[22:05:17] workmad3: has joined #ruby
[22:08:13] cdg: has joined #ruby
[22:11:01] shazbotmcnasty: has joined #ruby
[22:11:44] Mutter: has joined #ruby
[22:11:55] dstrunk: has joined #ruby
[22:18:38] cagomez: has joined #ruby
[22:19:54] Psybur: has joined #ruby
[22:26:15] tomphp_: has joined #ruby
[22:31:00] shazbotmcnasty: has joined #ruby
[22:31:36] michael3: has joined #ruby
[22:32:17] astronavt: has joined #ruby
[22:32:21] yabbes: has joined #ruby
[22:33:07] Azure: has joined #ruby
[22:34:18] Sightes: has joined #ruby
[22:34:33] devchild: has joined #ruby
[22:34:40] Azure: has joined #ruby
[22:36:40] astronavt: has joined #ruby
[22:43:29] Zamyatin: has joined #ruby
[22:44:55] MagicGuitarist: has joined #ruby
[22:50:08] m4rCsi: has joined #ruby
[22:51:06] shazbotmcnasty: has joined #ruby
[22:58:14] hutch34: has joined #ruby
[22:59:22] mim1k: has joined #ruby
[23:01:21] lexruee: has joined #ruby
[23:06:01] thinkpad: has joined #ruby
[23:08:27] leitz: has joined #ruby
[23:08:41] leitz: Do you have to have Ruby on a machine to build ruby?
[23:09:43] Ropeney: has joined #ruby
[23:10:33] leitz: Trying to understand "configure:3077: error: cannot run /bin/sh tool/config.sub"
[23:10:55] Radar: No you don't have to have Ruby to install Ruby.
[23:11:01] shazbotmcnasty: has joined #ruby
[23:11:01] Radar: How would Ruby get built in the first place?
[23:11:25] leitz: OS package.
[23:13:10] leitz: Hrmph. autoconf uses config.sub and tells you not to use it.
[23:15:37] jeanlinux: has joined #ruby
[23:19:00] goyox86_: has joined #ruby
[23:19:02] cdg_: has joined #ruby
[23:19:38] leitz: Seems to be an issue new to 2.5.0-preview-1. So far the 2.4.2 configure is running.
[23:19:55] Psybur: has joined #ruby
[23:21:39] goyox86__: has joined #ruby
[23:22:10] mostlybadfly: has joined #ruby
[23:22:25] eckhardt: has joined #ruby
[23:25:19] goyox86: has joined #ruby
[23:26:21] xlegoman: has joined #ruby
[23:26:46] RickHull: i was able to ruby-install 2.5.0-preview1
[23:27:59] RickHull: on debian FWIW
[23:31:01] shazbotmcnasty: has joined #ruby
[23:35:07] leitz: RickHull, I had to copy in tool/config.sub from 2.4.2. Did your install tree have it already?
[23:35:26] leitz: I'm on CentOS 6.
[23:35:40] RickHull: I don't think ruby-install does anything like that
[23:35:45] RickHull: let me poke around
[23:36:01] leitz: check ruby/tool/config.sub, see if it's there.
[23:36:19] leitz: I pulled it from git, which may be another issue.
[23:36:22] RickHull: it's there. July 11 2013
[23:36:46] dstrunk: has joined #ruby
[23:37:03] RickHull: i expect you'll find it in the 2.5.0-preview1 .tar.gz
[23:37:37] RickHull: unless it's generated by autoconf or something -- never messed with these bits
[23:37:55] RickHull: (with that timestamp, it can't be generated)
[23:38:18] leitz: Yup, it's in the tar file from ruby-lang.org, not in the git repo.
[23:41:04] leitz: Opened a ticket, not sure if there's a reason not to have config.sub in the git repo.
[23:41:29] RickHull: you could do some spelunking and see, if it's there for 2.4.2, when and why it was removed
[23:42:42] leitz: Hmm...not in the 2.4 repo either.
[23:46:33] leitz: It went away between 2_0_0 and 2_1. Commit c51615963af25a50e52cf933298d6405eb611d7a from 7 Jul 2013 says "Ignore config.guess and config.sub"
[23:47:30] leitz: Nobu removed them 14 Jun 13.
[23:49:29] RickHull: obviously something is looking for it still, in the repo
[23:49:37] RickHull: `git grep config.sub` ?
[23:49:53] enterprisey: has joined #ruby
[23:49:56] leitz: or "git log" and then look for it.
[23:50:04] RickHull: again, I have basically no idea how this stuff works
[23:50:08] RickHull: autoconf etc
[23:50:09] banisterfiend: has joined #ruby
[23:50:26] RickHull: no, i mean `git grep` on the 2.5.0 branch
[23:50:36] leitz: Ah, your git grep works. Reading.
[23:50:50] RickHull: would a reference to config.sub be in the Makefile? some other autoconf thingie?
[23:51:02] shazbotmcnasty: has joined #ruby
[23:51:38] banisterfiend: anyone here has experience with osx development?
[23:51:43] RickHull: i assume you've googled this as well. if this happens on `git clone; make` on centos, you can't be the first
[23:51:53] RickHull: ?anyone banisterfiend
[23:51:53] ruby[bot]: banisterfiend: Just ask your question, if anyone has, is or can, they will respond.
[23:51:59] RickHull: get effed nerd
[23:52:20] RickHull: <3 how's it been?
[23:52:37] JsilverT: has joined #ruby
[23:52:47] banisterfiend: well i'm building an osx app but i'm trying to "code sign" it and when i do i get a stupid fucking error: "the sealed resource directory is invalid"
[23:52:51] banisterfiend: anyone know how to debug this?
[23:53:01] banisterfiend: no further information
[23:53:12] leitz: There's a line "tool/config.guess, tool/config.sub: remove and download from the upstream"
[23:53:51] RickHull: leitz: this seems sensible -- there must be an intermediate step to grab this stuff when building from git repo
[23:54:31] RickHull: also, related -- I've noticed some repos have like symlinks to other repos -- on github anyway
[23:54:33] banisterfiend: leitz did you try: `autoconf -i` ?
[23:54:37] RickHull: anyone know what this is called and how to set it up?
[23:54:53] banisterfiend: leitz "autoreconf -i" i mean
[23:55:12] charliesome: has joined #ruby
[23:55:23] leitz: banisterfiend; Not that skilled. So far the fix has been to copy in a config.sub file. :)
[23:55:37] RickHull: leitz: there are probably instructions that cover this
[23:55:57] RickHull: that said, shouldn't `make` do it for you?
[23:56:17] leitz: RickHull, not on the github main page under "How to compile and Install"
[23:56:27] banisterfiend: autoreconf -i. installs all the stuff necessary for a 'make'
[23:56:31] RickHull: does it start with `git clone` or `tar.gz` ?
[23:56:47] leitz: You have to run ./configure before make, and configure fails.
[23:56:56] RickHull: oh right xD
[23:57:21] banisterfiend: sorry i mean 'autoreconf -i' installs the stuff for configure
[23:57:33] leitz: Trying banisterfiend's autoreconf idea.
[23:57:46] RickHull: if it works, update your ticket to maybe suggest that addition to the install instructions
[23:57:47] banisterfiend: i had to do that to get ruby source compiling on linux
[23:58:01] mim1k: has joined #ruby
[23:58:38] leitz: autoreconf -i didn't set up config.sub
[23:59:08] leitz: Ticket 14117, if you think it needs more info.
[23:59:11] banisterfiend: leitz did you install ruby
[23:59:21] banisterfiend: what are oyu trying to compile again?
[23:59:37] banisterfiend: cosy ou need a ruby installed to compile ruby. (assuming you'er messing wtih compiling ruby)
[23:59:42] leitz: banisterfiend, trying to compile ruby-2.5.0-preview1 from git source
[23:59:49] banisterfiend: yeah do you hav ea system ruby installed?
[23:59:58] leitz: Nope, just removed it.