« Back to channel list

#ruby - 08 November 2017

« Back 1 day Forward 1 day »
[00:01:04] jphase: has joined #ruby
[00:02:15] jrabe: has joined #ruby
[00:04:00] jenrzzz: has joined #ruby
[00:04:00] jenrzzz: has joined #ruby
[00:07:20] waveprop: has joined #ruby
[00:08:18] banisterfiend: has joined #ruby
[00:12:53] Azure: has joined #ruby
[00:20:07] sumobob: has joined #ruby
[00:20:12] sucks: has joined #ruby
[00:25:59] Technodrome: has joined #ruby
[00:26:47] xco: has joined #ruby
[00:27:33] xco: has joined #ruby
[00:40:25] waveprop: has joined #ruby
[00:40:44] waveprop: instance_eval(&config) within call did it
[00:40:50] waveprop: sorry for the noice
[00:40:54] banisterfiend: has joined #ruby
[00:42:28] karapetyan: has joined #ruby
[00:43:18] sumobob_: has joined #ruby
[00:45:55] kus_ubuntui686: has joined #ruby
[00:46:35] alveric1: has joined #ruby
[00:47:20] chouhoulis: has joined #ruby
[00:49:22] sumobob: has joined #ruby
[00:55:11] friday: has joined #ruby
[00:56:55] tekk: has joined #ruby
[01:00:46] sumobob_: has joined #ruby
[01:01:31] hndk: has joined #ruby
[01:04:51] charliesome: has joined #ruby
[01:06:16] enterprisey: has joined #ruby
[01:08:18] Ayey_: has joined #ruby
[01:12:54] knight33: has joined #ruby
[01:13:26] cschneid_: has joined #ruby
[01:14:28] |ifei5good: has joined #ruby
[01:19:19] cdg: has joined #ruby
[01:29:30] Exagone313: has joined #ruby
[01:29:55] giraffe: has joined #ruby
[01:30:29] cschneid_: has joined #ruby
[01:30:42] tpendragon: has joined #ruby
[01:31:22] guardianx: has joined #ruby
[01:33:48] jesuitx: has joined #ruby
[01:35:21] govg: has joined #ruby
[01:36:55] mson: has joined #ruby
[01:44:23] Ayey_: has joined #ruby
[01:46:23] sumobob: has joined #ruby
[01:47:31] bob_f: has joined #ruby
[01:51:46] cdg: has joined #ruby
[01:53:15] iooner: has joined #ruby
[01:54:13] Orbixx[m]: has left #ruby: ("User left")
[01:54:15] haraoka: has joined #ruby
[01:55:50] cschneid_: has joined #ruby
[01:56:17] hinbody: has joined #ruby
[01:56:17] eb0t: has joined #ruby
[01:56:23] eb0t_: has joined #ruby
[01:56:44] chouhoulis: has joined #ruby
[02:03:21] the_f0ster: has joined #ruby
[02:03:54] jphase: has joined #ruby
[02:04:50] the_f0ster: if I split my tests to only use spec_helper and rails_helper when necessary, would that speed things up? isnt the cost just one rails initialization ?
[02:06:07] David_H_Smith: has joined #ruby
[02:06:47] baweaver: Use Guard and Spork
[02:06:48] baweaver: Then that's not really much of an issue
[02:06:59] baweaver: Guard is a test runner that watches for changes and runs the correct test afterwards
[02:07:44] baweaver: like you save person.rb it runs person_spec.rb
[02:07:56] baweaver: Spork keeps Rails loaded in the background
[02:09:11] elomatreb: Isn't that spring (and isn't it enabled by default now)?
[02:09:22] baweaver: ...yes, that
[02:09:37] baweaver: ACTION wonders where he got spork from
[02:10:05] sucks: has joined #ruby
[02:10:11] elomatreb: You need to run the test command from the bin/ directory, those have the proper code for spring preloading inserted
[02:10:44] elomatreb: Doesn't speed up the individual tests, but the boot time before the tests start is almost completely eliminated on all but the first test run
[02:15:45] cschneid_: has joined #ruby
[02:20:38] Ayey_: has joined #ruby
[02:21:43] kculpis: has joined #ruby
[02:21:55] orbyt_: has joined #ruby
[02:23:03] tcopeland: has joined #ruby
[02:24:06] ramfjord: has joined #ruby
[02:25:43] Toggi3: has joined #ruby
[02:28:26] hopsoft: has joined #ruby
[02:29:46] ramfjord: has joined #ruby
[02:31:27] jphase: has joined #ruby
[02:39:56] xall: has joined #ruby
[02:40:40] mjolnird: has joined #ruby
[02:43:56] jrafanie: has joined #ruby
[02:45:05] jrafanie_: has joined #ruby
[02:49:49] |ifei5g00d: has joined #ruby
[02:49:55] Devalo: has joined #ruby
[02:52:57] gizmore: has joined #ruby
[02:53:27] nofxx: has joined #ruby
[02:56:36] Ayey_: has joined #ruby
[02:57:48] charliesome: has joined #ruby
[02:59:53] enterprisey: has joined #ruby
[03:02:06] d^sh: has joined #ruby
[03:10:36] hackeron_: has joined #ruby
[03:15:31] hackeron: has joined #ruby
[03:19:50] nofxx: has joined #ruby
[03:20:16] haylon: has joined #ruby
[03:22:10] ResidentBiscuit: has joined #ruby
[03:26:57] sucks: has joined #ruby
[03:29:01] Ayey_: has joined #ruby
[03:29:12] uZiel: has joined #ruby
[03:32:46] sagax: has joined #ruby
[03:34:15] the_f0ster: has joined #ruby
[03:36:15] cschneid_: has joined #ruby
[03:39:29] electrostat: has joined #ruby
[03:44:34] PaulCape_: has joined #ruby
[03:46:31] electrostat_: has joined #ruby
[03:46:51] nofxx: has joined #ruby
[03:53:02] ResidentBiscuit: has joined #ruby
[03:57:00] cschneid_: has joined #ruby
[04:01:23] howdoi: has joined #ruby
[04:07:47] jphase: has joined #ruby
[04:08:18] Toggi3: has joined #ruby
[04:12:20] lucz: has joined #ruby
[04:15:28] nofxx: has joined #ruby
[04:16:58] jphase: has joined #ruby
[04:17:20] cschneid_: has joined #ruby
[04:21:08] veeti: has joined #ruby
[04:22:45] ramfjord: has joined #ruby
[04:25:29] sucks: has joined #ruby
[04:39:04] gix: has joined #ruby
[04:40:23] uneeb: has joined #ruby
[04:42:33] Uptime: has left #ruby: ()
[04:43:36] xall: has joined #ruby
[04:46:08] kies: has joined #ruby
[04:48:05] the_f0ster: has joined #ruby
[04:48:11] nofxx: has joined #ruby
[04:57:47] JsilverT: has joined #ruby
[04:59:06] Dimik: has joined #ruby
[04:59:20] ramfjord: has joined #ruby
[05:01:01] Rodya_: has joined #ruby
[05:05:00] csmrfx: Do you add Gemfile.lock in your repo? Or .gitignore it?
[05:09:00] jenrzzz: has joined #ruby
[05:09:01] jenrzzz: has joined #ruby
[05:10:48] Radar: csmrfx: depends. What kind of repo is it?
[05:11:05] ozcanesen: has joined #ruby
[05:11:12] Radar: In a gem you wouldn't commit it but in other codebases you'd normally commit it. That is because you want to make sure that everyone is using the same dependenie.s
[05:11:15] Radar: dependencies*
[05:12:19] veeti: has joined #ruby
[05:12:49] csmrfx: Radar so its just a game engine project that I'm going to open source and put up on github
[05:13:02] csmrfx: I guess the problem is I don't understand what Gemfile.lock is
[05:13:11] fullstack: has joined #ruby
[05:14:23] Radar: csmrfx: When you run `bundle install` it resolves all your gems' dependencies (and their dependencies) and LOCKS them down to just those exact versions. Next time you run `bundle install` it will install those exact versions.
[05:14:54] Radar: csmrfx: You _don't_ want this in a gem because in a gem you'll have a `gemspec` which tells RubyGems which versions to install... and the gems installed by the gemspec's dependencies _might_ be different from what's in your `Gemfile.lock`
[05:16:02] michael1: has joined #ruby
[05:23:34] mim1k: has joined #ruby
[05:26:14] iamarun: has joined #ruby
[05:27:52] sumobob: has joined #ruby
[05:28:18] cschneid_: has joined #ruby
[05:29:03] AnoHito: has joined #ruby
[05:35:48] ramfjord: has joined #ruby
[05:37:37] k3rn31: has joined #ruby
[05:39:31] jphase: has joined #ruby
[05:42:41] cschneid_: has joined #ruby
[05:43:41] anisha: has joined #ruby
[05:49:40] the_f0ster: has joined #ruby
[05:50:25] rabajaj: has joined #ruby
[05:53:17] jphase: has joined #ruby
[05:55:07] dminuoso: apeiros: Mmm. I gave this some good thought, and Im starting to agree with you.
[05:55:26] dminuoso: It's just too weird to have floating point represent monetary values.
[05:56:33] RickHull: what's a good example?
[05:56:43] RickHull: >> 0.1 + 0.2
[05:56:45] ruby[bot]: RickHull: # => 0.30000000000000004 (https://eval.in/895099)
[05:56:55] dminuoso: And is that a good way to represent how much money you have?
[05:57:13] RickHull: no, that's a simple example of floating point imprecision relative to decimal intuition
[05:57:15] dminuoso: Either you have 30 seconds, or you have 0.3000000000000204010273582489 cents.
[05:57:29] dminuoso: nevermind then
[05:57:37] xall: has joined #ruby
[05:58:39] RickHull: i'm just saying, 0.1 + 0.2 is a good example of one float pitfall. it doesn't quite explain the pitfall of using floats for currency
[05:58:56] RickHull: if there were a similar simple example, that would be a good thing
[05:59:32] RickHull: but I'll take a complex one -- I am convinced it is a pitfall
[06:00:36] cschneid_: has joined #ruby
[06:01:23] RickHull: your sense that double precision should be plenty for money -- this is compelling
[06:01:37] RickHull: so what's a good example to refute?
[06:02:31] jphase: has joined #ruby
[06:06:06] Jameser: has joined #ruby
[06:09:59] jenrzzz: has joined #ruby
[06:10:40] Technodrome: has joined #ruby
[06:11:04] cdg: has joined #ruby
[06:12:01] ramfjord: has joined #ruby
[06:20:49] jphase: has joined #ruby
[06:22:08] dinoangelov: has joined #ruby
[06:25:09] uZiel: has joined #ruby
[06:25:21] shoogz: has joined #ruby
[06:27:00] wewlad: has joined #ruby
[06:27:00] shoogz: has joined #ruby
[06:27:58] dionysus69: has joined #ruby
[06:28:24] shoogz: has joined #ruby
[06:28:54] wewlad: I'm having a brainfart. I'm working my way down for a code golf challenge, and I need to move the contents of my method inside of a loop. Any advice? https://pastebin.com/sAQFqTWy
[06:28:55] ruby[bot]: wewlad: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/a5b2bc022554d03a719da0c23de126b8
[06:28:55] ruby[bot]: wewlad: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[06:29:12] wewlad: Thanks, robit
[06:29:45] shoogz: has joined #ruby
[06:30:26] wewlad: Anyway, I want to take the contents of `romanize` and use that directly in the lower loop. How can I do that?
[06:31:20] shoogz: has joined #ruby
[06:31:51] RickHull: the contents of romanize?
[06:32:01] cdg: has joined #ruby
[06:32:04] RickHull: you are calling romanize already in the lower loop
[06:32:11] RickHull: what more do you want?
[06:32:49] RickHull: do you want an array of romanized args?
[06:32:53] shoogz: has joined #ruby
[06:33:01] RickHull: ARGV.map { |a| romanize a }
[06:33:32] wewlad: I want the contents of romanize in the lower loop. The objective is to print a list of romanized numbers on new lines
[06:33:51] RickHull: romanize is a method / function
[06:33:59] RickHull: it has no inherent contents except the definition
[06:34:13] RickHull: do you want the result of calling romanize on a particular arg?
[06:34:49] RickHull: probably you want `puts ARGV.map { |a| romanize(a) }`
[06:35:14] RickHull: but this is roughly equivalent to what you have
[06:35:28] wewlad: I don't understand. I'm saying that I want to lower the overall character count by adding the functionality of `romanize` to the ARGV loop.
[06:35:39] wewlad: It's for a code golf thing. Let me prep a pseudocode example
[06:37:14] wewlad: Something roughly equivilent to this: https://gist.github.com/anonymous/d5505ee79d0e99ef956219b7c31774aa
[06:37:38] RickHull: ARGV.map { |a| D.map { |ltr, val| ltr.to_s * num.to_i.divmod(val).first } }
[06:37:53] RickHull: oh, .join in there
[06:38:12] RickHull: ARGV.map { |a| D.map { |ltr, val| ltr.to_s * num.to_i.divmod(val).first }.join }
[06:38:36] biberu: has joined #ruby
[06:38:36] fishcooker: has joined #ruby
[06:39:20] RickHull: ARGV.map { |a| D.map { |ltr, val| ltr.to_s * a.to_i.divmod(val).first }.join }
[06:40:12] wewlad: That doesn't appear to work
[06:40:18] RickHull: it depends on what D has
[06:40:57] mozzarella: has joined #ruby
[06:41:00] wewlad: Oh, it looks like I didn't copy that in the first gist
[06:41:22] wewlad: https://gist.github.com/anonymous/937ff38971a4eab13b33a40c251b09d0
[06:41:42] wewlad: That will turn given args into roman numerals
[06:41:43] RickHull: same answer
[06:41:49] RickHull: just make sure D is defined
[06:41:51] wewlad: But it doesn't work
[06:42:06] Sparky: has joined #ruby
[06:42:14] RickHull: ok, I haven't tested it
[06:42:17] Sparky: Hello everyone
[06:42:21] RickHull: but you should be able to figure it out
[06:42:29] wewlad: I'm just asking how to extract the roman function into the lower loop
[06:42:37] RickHull: that's what I showed
[06:42:39] wewlad: I am unable to figure it out, that's why I'm asking
[06:42:47] wewlad: But your example didn't work
[06:43:00] RickHull: it's very close, if you are correct that it doesn't work
[06:43:07] RickHull: in what way is it not working?
[06:43:21] Sparky: I am learning ruby right now and I was wondering... How can I spot a string inside of a string? Is it when I see "" inside of "" ?
[06:43:31] wewlad: It prints a vastly wrong answer with (seemingly) no connection to the correct answer
[06:43:35] RickHull: Sparky: check String#substr
[06:43:43] sent-hil: has joined #ruby
[06:43:51] RickHull: wewlad: try it with ARGV = ["1"]
[06:43:59] RickHull: and give actual vs expected results
[06:44:07] Sparky: RickHull: What's that?
[06:44:20] RickHull: substr = substring
[06:44:26] RickHull: aka a string inside a string
[06:45:07] wewlad: 1 outputs "I", which is correct. However, 10 outputs "XIXVVIVIVIIIIIIIIII"
[06:45:40] cschneid_: has joined #ruby
[06:45:59] RickHull: oh, I see, I simplified out some part of that
[06:46:10] RickHull: anyways, you should be able to see the general technique
[06:46:15] RickHull: don't oversimplify like I did
[06:46:48] RickHull: the multiple assignment is doing reduction over the map
[06:46:52] alfiemax: has joined #ruby
[06:46:55] RickHull: I missed that
[06:48:27] RickHull: see where I use .first? I am skipping the multiple assignment there; I oversimplified
[06:48:48] RickHull: you will need two statements / expressions inside the D.map block
[06:48:57] RickHull: as in the romanize method
[06:49:22] wewlad: I think I see what you mean. Thank you!
[06:50:34] aufi: has joined #ruby
[06:50:41] eckhardt: has joined #ruby
[06:50:45] the_f0ster: has joined #ruby
[06:50:47] jarnalyrkar: has joined #ruby
[06:51:11] Sparky: I think I'm starting to get this ruby thing, at least basic strings and variables- neat!
[06:52:15] jarnalyrkar: has joined #ruby
[06:52:55] jphase: has joined #ruby
[06:53:03] RickHull: alright! generally a string is just a flat list of chars/bytes/codepoints
[06:53:24] Sparky: The things that I put in the quotations, right?
[06:53:27] RickHull: while embedded quotes can be annoying, you don't generally see this problem in source code very much
[06:53:59] RickHull: >> ["a string", 'a string "with double quotes"']
[06:54:01] ruby[bot]: RickHull: # => ["a string", "a string \"with double quotes\""] (https://eval.in/895131)
[06:54:55] RickHull: >> %q{you can use "double quotes" and 'single quotes' inside percent-q}
[06:54:56] ruby[bot]: RickHull: # => "you can use \"double quotes\" and 'single quotes' inside percent-q" (https://eval.in/895132)
[06:55:48] RickHull: >> "a string 'with single quotes'"
[06:55:49] ruby[bot]: RickHull: # => "a string 'with single quotes'" (https://eval.in/895133)
[06:56:14] Sparky: I have no idea what's going on, did I mention that I've only been studying for a day?
[06:57:06] RickHull: >> sparky = 'new'; "here is a #{sparky} example of string interpolation"
[06:57:07] ruby[bot]: RickHull: # => "here is a new example of string interpolation" (https://eval.in/895135)
[06:57:50] Sparky: A new example of a string interpolation?
[06:57:58] alfiemax: has joined #ruby
[06:58:02] Sparky: hah, right you set a variable
[06:58:10] Sparky: I get that
[06:59:41] RickHull: the first example, I show a simple string delimited with double quotes, and then a similar string delimited similarly, but with double quotes embedded
[06:59:46] reber: has joined #ruby
[07:00:17] RickHull: if you use 'single quotes' to delimit the string, you are allowed to use naked "double quotes" within
[07:00:32] RickHull: likewise if you use "double quotes" to delimit the string, you can use naked 'single quotes' within
[07:00:38] Rodya_: has joined #ruby
[07:00:59] RickHull: if you need both "double quotes" and 'single quotes' then you can use %q{} to delimit the string
[07:01:13] RickHull: or you can just escape them "like \"this\""
[07:01:13] Sparky: This is what I'm working on, I believe maybe what you are explaining is slightly over my head at this point https://learnrubythehardway.org/book/ex6.html
[07:01:28] alfiemax: has joined #ruby
[07:01:39] RickHull: it's all good, I have to leave soon, you are on the path!
[07:02:04] jphase: has joined #ruby
[07:02:43] ahrs: has joined #ruby
[07:02:53] Sparky: I'm picking up and understanding most of what is going on int he code that I have been using, I've even been able to modify it to do other things. Really simple things, but I think I have a basic understanding of what is being taught
[07:03:08] RickHull: make sure you are using irb or pry
[07:03:16] RickHull: are you familiar with irb?
[07:03:33] ramfjord: has joined #ruby
[07:03:37] Sparky: So when I go into my linux terminal, I can type "irb"
[07:03:44] Sparky: and then I get a.. ruby shell
[07:03:47] zapata: has joined #ruby
[07:03:48] Sparky: I think its a shell, right?
[07:03:51] RickHull: yes, a REPL
[07:03:57] RickHull: Read Eval Print Loop
[07:04:05] c-c: Ideas on how to create a print-method that prints the name of the particular instace that calls it?
[07:04:09] RickHull: it accepts an expression, prints the result
[07:04:19] Sparky: So basically I can do irb, and do real time- uhh coding?
[07:04:22] RickHull: c-c: see #caller
[07:04:33] RickHull: Sparky: yup
[07:05:17] RickHull: >> like_what = 'this'; "rather like #{like_what}"
[07:05:18] ruby[bot]: RickHull: # => "rather like this" (https://eval.in/895142)
[07:06:27] RickHull: >> %w{here is an expression that is represented as an array}
[07:06:28] ruby[bot]: RickHull: # => ["here", "is", "an", "expression", "that", "is", "represented", "as", "an", "array"] (https://eval.in/895143)
[07:06:56] RickHull: try the same thing in irb :)
[07:07:11] c-c: Yes, I tried #caller
[07:07:15] c-c: >> def prt s; p "#{caller}: " + s.to_s; end; prt "foo"
[07:07:16] ruby[bot]: c-c: # => "[\"/tmp/execpad-118043d7f45e/source-118043d7f45e:2:in `<main>'\"]: foo" ...check link for more (https://eval.in/895144)
[07:07:22] Sparky: >> %w{here is also an expression represented as an array}
[07:07:26] c-c: its strange
[07:07:53] RickHull: c-c: it looks ok -- i think it has an array representation
[07:08:11] RickHull: Sparky: try it irb :)
[07:09:25] RickHull: also c-c : things like caller and such can behave differently in a REPL like irb
[07:09:35] quobo: has joined #ruby
[07:10:01] RickHull: gotta run, g'night
[07:10:10] c-c: I want to know what the instance is. ID and class. Kernel#caller returns a call stack, with ruby filenames.
[07:11:40] c-c: I can get the ID and class of the instance that calls the printing method, by passing it in as argument: prt mstr, self
[07:12:11] c-c: but wouldn't mind if the prt -method could just deduce that
[07:19:11] ramfjord: has joined #ruby
[07:19:17] dminuoso: c-c: look into binding-of-caller
[07:19:44] dminuoso: Arguably the most useful native extension in existence, making me wonder why this has not went into Ruby.
[07:21:47] uZiel: has joined #ruby
[07:24:03] mim1k: has joined #ruby
[07:24:14] Ayey_: has joined #ruby
[07:26:33] cschneid_: has joined #ruby
[07:27:39] waveprop: hm. in Rack, when i set @request['some_var'] = {'some' => 'data'} then @request['some_var'] is nil when i try to read it further down the middleware stack
[07:38:11] conta: has joined #ruby
[07:39:44] ramfjord: has joined #ruby
[07:40:13] Sparky: Can someone eli5 what is going on in this? I got the code to work, but I really don't understand what is happening.
[07:40:20] Sparky: https://learnrubythehardway.org/book/ex8.html
[07:48:26] scatterp: has joined #ruby
[07:48:54] kristofferR: has joined #ruby
[07:49:45] baweaver: you put name tags in the string, and % knows just the thing for 'em: A hash!
[07:50:01] baweaver: So we shove those values right on in there and voila! String!
[07:52:00] baweaver: It's a throwback to ol' man C and sprintf before we had nice things like interpolation
[07:52:30] BTRE: has joined #ruby
[07:52:33] baweaver: That said, it does definitely have its uses for fixed width columns and formatted rows
[07:52:46] baweaver: Though I've used that maybe all of 5 times in some 7-8 years of Ruby so your mileage may vary.
[07:52:55] baweaver: unless you could code golf
[07:53:13] baweaver: then I've abused the heck out of that poor thing
[07:57:09] jphase: has joined #ruby
[07:59:54] ta: has joined #ruby
[07:59:58] jenrzzz: has joined #ruby
[07:59:58] jenrzzz: has joined #ruby
[08:01:30] Rodya_: has joined #ruby
[08:06:01] fullstack: has joined #ruby
[08:06:31] r3QuiEm_cL: has joined #ruby
[08:09:25] funghi: has joined #ruby
[08:09:51] funghi: hello i want to ask a question, but this is also include rails activerecord
[08:10:21] tobiasvl: funghi: ask away, but might be better suited for #rubyonrails
[08:10:44] funghi: has left #ruby: ()
[08:12:42] kryptoz: has joined #ruby
[08:12:43] claudiuinberlin: has joined #ruby
[08:14:15] r3QuiEm_cL: has joined #ruby
[08:17:32] alex``: has joined #ruby
[08:18:54] paranoicsan: has joined #ruby
[08:19:10] r3QuiEm_cL: has joined #ruby
[08:24:40] jphase: has joined #ruby
[08:30:54] nicesignal: has joined #ruby
[08:33:50] jphase: has joined #ruby
[08:40:58] andikr: has joined #ruby
[08:46:59] InfinityFye: has joined #ruby
[08:47:12] hinbody: has joined #ruby
[08:52:10] jphase: has joined #ruby
[08:55:57] gix: has joined #ruby
[09:00:33] r3QuiEm_cL: has joined #ruby
[09:00:37] gix: has joined #ruby
[09:00:40] Silthias: has joined #ruby
[09:01:04] marr: has joined #ruby
[09:01:21] jphase: has joined #ruby
[09:02:09] VladGh_: has joined #ruby
[09:02:20] mark_66: has joined #ruby
[09:02:24] uZiel: has joined #ruby
[09:02:41] Silthias2: has joined #ruby
[09:07:19] r3QuiEm_cL: has joined #ruby
[09:07:23] hurricanehrndz: has joined #ruby
[09:08:23] vondruch: has joined #ruby
[09:11:11] vondruch: has joined #ruby
[09:11:28] Nitza: has joined #ruby
[09:16:01] burgestrand: has joined #ruby
[09:16:23] alex``: has joined #ruby
[09:19:51] mim1k: has joined #ruby
[09:23:38] Stan: has joined #ruby
[09:24:08] Ayey_: has left #ruby: ()
[09:24:18] jphase: has joined #ruby
[09:25:30] cschneid_: has joined #ruby
[09:33:29] jphase: has joined #ruby
[09:33:45] alfiemax: has joined #ruby
[09:34:50] zautomata: has joined #ruby
[09:35:01] anisha: has joined #ruby
[09:36:09] xco: has joined #ruby
[09:40:26] darkness: has joined #ruby
[09:41:23] raatiniemi: has joined #ruby
[09:42:27] Beams: has joined #ruby
[09:44:17] A124: has joined #ruby
[09:45:11] jhill: has joined #ruby
[09:45:34] Meow-J: has joined #ruby
[09:46:07] Nitza: has joined #ruby
[09:46:12] dminuoso: has joined #ruby
[09:48:08] dinfuehr: has joined #ruby
[09:48:12] bokayio: has joined #ruby
[09:49:04] emerson: has joined #ruby
[09:49:04] alex``: has joined #ruby
[09:49:04] r3QuiEm_cL: has joined #ruby
[09:49:04] quobo: has joined #ruby
[09:49:04] GodFather: has joined #ruby
[09:49:04] SegFaultAX: has joined #ruby
[09:49:04] pfg: has joined #ruby
[09:49:04] ephemera_: has joined #ruby
[09:49:04] jxf: has joined #ruby
[09:49:04] craysiii: has joined #ruby
[09:49:04] avdi: has joined #ruby
[09:49:04] vayan: has joined #ruby
[09:49:04] colstrom: has joined #ruby
[09:49:04] doublyx: has joined #ruby
[09:49:04] creat: has joined #ruby
[09:49:04] jidar: has joined #ruby
[09:49:04] aspiers: has joined #ruby
[09:49:04] clamstar: has joined #ruby
[09:49:04] z3uS: has joined #ruby
[09:49:05] charles81_: has joined #ruby
[09:49:05] Yonk: has joined #ruby
[09:49:05] schaary: has joined #ruby
[09:49:05] Guest67616: has joined #ruby
[09:49:05] skmp: has joined #ruby
[09:49:05] ReinH: has joined #ruby
[09:49:05] jmhmccr: has joined #ruby
[09:49:05] seanh: has joined #ruby
[09:49:05] oblak: has joined #ruby
[09:49:05] pilne: has joined #ruby
[09:49:05] ozzloy: has joined #ruby
[09:49:05] j416: has joined #ruby
[09:49:05] Nicmavr: has joined #ruby
[09:49:05] ShekharReddy: has joined #ruby
[09:49:05] sonOfRa: has joined #ruby
[09:49:05] biox: has joined #ruby
[09:49:05] [reed]: has joined #ruby
[09:49:05] esObe: has joined #ruby
[09:49:05] bogdanteleaga: has joined #ruby
[09:49:05] havenwood: has joined #ruby
[09:49:06] sunrunner20: has joined #ruby
[09:49:06] NikolausK: has joined #ruby
[09:49:06] twe4ked: has joined #ruby
[09:49:06] mikeiniowa: has joined #ruby
[09:49:06] ectos: has joined #ruby
[09:49:06] cyberRodent: has joined #ruby
[09:49:06] cschneid: has joined #ruby
[09:49:06] Flabbergazta: has joined #ruby
[09:49:06] JoshL: has joined #ruby
[09:49:06] DanielI: has joined #ruby
[09:49:06] fyrril: has joined #ruby
[09:49:06] ircmaxell: has joined #ruby
[09:49:06] Fenhl: has joined #ruby
[09:49:06] andersh: has joined #ruby
[09:49:06] daemonwrangler: has joined #ruby
[09:49:06] jokke: has joined #ruby
[09:49:06] Radar: has joined #ruby
[09:49:06] ghormoon: has joined #ruby
[09:49:06] Ober: has joined #ruby
[09:49:07] jhass: has joined #ruby
[09:49:07] adambeynon: has joined #ruby
[09:49:07] yo61: has joined #ruby
[09:49:07] machty: has joined #ruby
[09:49:07] aarongodin: has joined #ruby
[09:49:07] solidsnack: has joined #ruby
[09:49:07] bcavileer: has joined #ruby
[09:49:07] hayden___: has joined #ruby
[09:49:07] knowtheory: has joined #ruby
[09:49:07] dmnd: has joined #ruby
[09:49:07] cardoni: has joined #ruby
[09:49:07] Diabolik: has joined #ruby
[09:49:07] mroth: has joined #ruby
[09:49:07] danzilio: has joined #ruby
[09:49:07] jimeh: has joined #ruby
[09:49:07] pwillard: has joined #ruby
[09:49:07] swgillespie: has joined #ruby
[09:49:43] sonne: has joined #ruby
[09:50:22] ghormoon: has joined #ruby
[09:50:24] DanielI: has joined #ruby
[09:50:25] DanielI: has joined #ruby
[09:50:36] quobo: has joined #ruby
[09:50:47] jxf: has joined #ruby
[09:50:54] swgillespie: has joined #ruby
[09:51:04] Diabolik: has joined #ruby
[09:51:12] pwillard: has joined #ruby
[09:51:18] ShekharReddy: has joined #ruby
[09:51:19] yo61: has joined #ruby
[09:51:32] machty: has joined #ruby
[09:51:52] naquad: has joined #ruby
[09:52:39] creat: has joined #ruby
[09:53:32] clamstar: has joined #ruby
[09:53:35] Pisuke: has joined #ruby
[09:53:35] sunrunner20: has joined #ruby
[09:54:21] rhyselsmore: has joined #ruby
[09:54:24] ahrs: has joined #ruby
[09:55:36] ramfjord: has joined #ruby
[09:58:12] Serpent7776: has joined #ruby
[10:00:19] Tagami[m]: has joined #ruby
[10:01:35] hackeron_: has joined #ruby
[10:01:57] scatterp: has joined #ruby
[10:02:19] mjolnird: has joined #ruby
[10:03:24] stamina: has joined #ruby
[10:04:29] Rodya_: has joined #ruby
[10:05:12] ferr: has joined #ruby
[10:06:12] ferr: has left #ruby: ()
[10:08:15] mikecmpbll: has joined #ruby
[10:11:08] mim1k: has joined #ruby
[10:11:49] FahmeF: has joined #ruby
[10:14:08] GodFather: has joined #ruby
[10:18:36] govg: has joined #ruby
[10:19:24] adlerdias: has joined #ruby
[10:19:28] GodFather: has joined #ruby
[10:20:19] apeiros: has joined #ruby
[10:22:35] davic: has joined #ruby
[10:23:29] aviraldg: has joined #ruby
[10:23:29] jonjits[m]: has joined #ruby
[10:23:29] lasenna[m]: has joined #ruby
[10:23:29] M107262[m]: has joined #ruby
[10:23:29] dtcristo: has joined #ruby
[10:23:29] yana[m]: has joined #ruby
[10:23:29] Hanma[m]: has joined #ruby
[10:23:29] torarne: has joined #ruby
[10:23:29] astronavt[m]: has joined #ruby
[10:23:30] watzon: has joined #ruby
[10:23:30] haylon: has joined #ruby
[10:23:30] Giphy[m]: has joined #ruby
[10:23:30] turt2live: has joined #ruby
[10:23:30] velu_aon[m]: has joined #ruby
[10:23:30] dman[m]: has joined #ruby
[10:23:31] KevinMGranger: has joined #ruby
[10:23:36] kua[m]: has joined #ruby
[10:23:37] aagdbl[m]: has joined #ruby
[10:23:37] Matt[m]2: has joined #ruby
[10:23:37] itmerc[m]: has joined #ruby
[10:23:38] gokul_mr[m]: has joined #ruby
[10:23:38] zalipuha[m]: has joined #ruby
[10:23:43] jashmatthews: has joined #ruby
[10:24:24] cgfbee: has joined #ruby
[10:24:48] faces: has joined #ruby
[10:24:52] jashmatthews: has joined #ruby
[10:26:25] adlerdias: has left #ruby: ()
[10:26:43] ldnunes: has joined #ruby
[10:28:30] jphase: has joined #ruby
[10:30:38] Jameser: has joined #ruby
[10:31:57] FahmeF_: has joined #ruby
[10:34:10] rahul_bajaj: has joined #ruby
[10:37:44] conta: has joined #ruby
[10:38:39] tvw: has joined #ruby
[10:40:03] jashmatthews: has joined #ruby
[10:42:15] jphase: has joined #ruby
[10:47:43] cdg: has joined #ruby
[10:48:41] rahul_bajaj: has joined #ruby
[10:49:50] banisterfiend: has joined #ruby
[10:50:06] cschneid_: has joined #ruby
[10:50:24] dminuoso: has joined #ruby
[10:50:36] konsolebox: has joined #ruby
[10:51:11] workmad3: has joined #ruby
[10:51:16] ramfjord: has joined #ruby
[10:55:37] cschneid_: has joined #ruby
[10:56:07] jaruga: has joined #ruby
[11:00:47] zanoni: has joined #ruby
[11:03:24] banisterfiend: has joined #ruby
[11:05:09] charliesome: has joined #ruby
[11:06:25] oetjenj: has joined #ruby
[11:07:12] oetjenj: has joined #ruby
[11:07:58] oetjenj: has joined #ruby
[11:08:44] oetjenj: has joined #ruby
[11:09:30] oetjenj: has joined #ruby
[11:10:06] Toggi3: has joined #ruby
[11:10:17] rgr: has joined #ruby
[11:10:19] oetjenj: has joined #ruby
[11:10:53] jashmatthews: has joined #ruby
[11:13:12] banisterfiend: has joined #ruby
[11:15:12] Hexafox[I]: has joined #ruby
[11:20:06] rkoller: has joined #ruby
[11:20:48] cschneid_: has joined #ruby
[11:25:10] banisterfiend: has joined #ruby
[11:25:19] jashmatthews: has joined #ruby
[11:26:27] oetjenj: has joined #ruby
[11:26:27] rahul_bajaj: has joined #ruby
[11:30:32] Hexafox[I]: Is using Capistrano to copy a single ruby file to a server and start it overkill?
[11:35:28] oded: has joined #ruby
[11:39:12] paranoicsan: has joined #ruby
[11:42:41] milardovich: has joined #ruby
[11:45:09] hfp_work: has joined #ruby
[11:46:56] Jameser: has joined #ruby
[11:48:10] dangerousdave: has joined #ruby
[11:48:52] alfiemax: has joined #ruby
[11:49:05] deathwisdave: has joined #ruby
[11:55:15] the_f0ster: has joined #ruby
[11:55:59] vondruch_: has joined #ruby
[11:56:13] jrafanie: has joined #ruby
[11:57:21] znz_jp: has joined #ruby
[11:58:48] r3QuiEm_cL: has joined #ruby
[12:00:32] xco: has joined #ruby
[12:00:39] guacamole: has joined #ruby
[12:02:19] c0mrad3: has joined #ruby
[12:06:23] GodFather: has joined #ruby
[12:09:11] vondruch: has joined #ruby
[12:11:25] banisterfiend: has joined #ruby
[12:13:30] Toggi3: has joined #ruby
[12:15:43] r3QuiEm_cL: has joined #ruby
[12:19:45] alfiemax: has joined #ruby
[12:21:19] anisha: has joined #ruby
[12:24:45] ldnunes: has joined #ruby
[12:27:28] truenito: has joined #ruby
[12:27:48] milardov_: has joined #ruby
[12:28:07] alfiemax_: has joined #ruby
[12:30:33] fishcooker: has joined #ruby
[12:31:20] jashmatthews: has joined #ruby
[12:34:43] banisterfiend: has joined #ruby
[12:34:51] Rodya_: has joined #ruby
[12:35:37] rgr: has joined #ruby
[12:37:26] vondruch_: has joined #ruby
[12:37:29] hopsoft: has joined #ruby
[12:40:24] alfiemax: has joined #ruby
[12:40:43] roamingdog: has joined #ruby
[12:41:41] mostlybadfly: has joined #ruby
[12:41:45] hopsoft: has joined #ruby
[12:44:00] vondruch: has joined #ruby
[12:44:49] hopsoft: has joined #ruby
[12:53:11] xco: has joined #ruby
[12:53:54] anisha: has joined #ruby
[12:55:47] Jameser: has joined #ruby
[12:59:01] shinnya: has joined #ruby
[13:00:47] ur5us: has joined #ruby
[13:00:53] dn`: has joined #ruby
[13:05:57] guille-moe: has joined #ruby
[13:06:02] ur5us: has joined #ruby
[13:06:28] Mia: has joined #ruby
[13:06:28] Mia: has joined #ruby
[13:06:56] ramfjord: has joined #ruby
[13:08:17] hightower2: has joined #ruby
[13:09:19] mjolnird: has joined #ruby
[13:09:52] conta: has joined #ruby
[13:10:01] Jameser: has joined #ruby
[13:11:42] [[thufir]]: has joined #ruby
[13:16:24] Toggi3: has joined #ruby
[13:16:45] jashmatthews: has joined #ruby
[13:17:01] banisterfiend: has joined #ruby
[13:17:46] Jameser: has joined #ruby
[13:19:12] JsilverT: has joined #ruby
[13:19:31] anisha: has joined #ruby
[13:21:42] cschneid_: has joined #ruby
[13:23:55] Psybur: has joined #ruby
[13:24:38] charliesome: has joined #ruby
[13:24:46] GodFather_: has joined #ruby
[13:27:30] cschneid_: has joined #ruby
[13:33:21] banisterfiend: has joined #ruby
[13:35:43] Rodya_: has joined #ruby
[13:41:10] papanik: has joined #ruby
[13:42:43] charliesome: has joined #ruby
[13:43:15] bmurt: has joined #ruby
[13:52:08] johno84: has joined #ruby
[13:57:09] the_f0ster: has joined #ruby
[14:00:40] darkmorph: has joined #ruby
[14:01:54] cdg: has joined #ruby
[14:04:24] jphase: has joined #ruby
[14:04:51] jphase: has joined #ruby
[14:06:19] kryptoz: has joined #ruby
[14:07:23] Bish: has joined #ruby
[14:07:51] Bish: LyndsySimon: hows live with sequel
[14:13:12] LyndsySimon: Bish: I've not touched it, other than to read the docs. I don't write Ruby outside of work, as a rule.
[14:13:49] LyndsySimon: I did make some significant progress on my CSV gem, thouhg.
[14:15:45] alnewkirk: has joined #ruby
[14:17:58] guille-moe: has joined #ruby
[14:19:12] sepp2k: has joined #ruby
[14:19:46] Toggi3: has joined #ruby
[14:24:23] alan_w: has joined #ruby
[14:25:44] uZiel: has joined #ruby
[14:26:02] vondruch: has joined #ruby
[14:26:23] swills: has joined #ruby
[14:29:57] jrafanie: has joined #ruby
[14:31:51] DLSteve: has joined #ruby
[14:32:17] kryptoz: has joined #ruby
[14:34:59] naprimer: has joined #ruby
[14:36:17] Rodya_: has joined #ruby
[14:37:16] fishcooker: has joined #ruby
[14:37:16] bauruine: has joined #ruby
[14:38:28] _whitelogger: has joined #ruby
[14:43:07] mson: has joined #ruby
[14:44:27] Toledo: has joined #ruby
[14:46:04] Vaanir: has joined #ruby
[14:54:28] milardovich: has joined #ruby
[14:56:09] Toggi3: has joined #ruby
[14:57:04] tcopeland: has joined #ruby
[14:57:47] alfiemax: has joined #ruby
[14:58:59] the_f0ster: has joined #ruby
[15:00:01] oleo: has joined #ruby
[15:01:34] milardovich: has joined #ruby
[15:01:47] rippa: has joined #ruby
[15:05:23] kryptoz: has joined #ruby
[15:08:00] Bish: LyndsySimon: why as a rule?
[15:10:59] the_f0ster: has joined #ruby
[15:12:51] synthroid: has joined #ruby
[15:14:26] Rodya_: has joined #ruby
[15:15:50] Guest17098: has joined #ruby
[15:16:29] Rapture: has joined #ruby
[15:17:57] FahmeF: has joined #ruby
[15:19:10] LyndsySimon: Bish: because I'm honestly not a huge fan of Ruby, like I said. I am a fan of writing stuff I like, though, and this CSV gem is one of those things. Hence, I'm writing Ruby in my personal time even though it's not my preferred language and not something I would normally work in without a financial reason.
[15:19:29] FrostCandy: has joined #ruby
[15:20:26] cr3: has joined #ruby
[15:21:13] alfiemax: has joined #ruby
[15:21:47] orbyt_: has joined #ruby
[15:23:17] banisterfiend: has joined #ruby
[15:24:17] polishdub: has joined #ruby
[15:24:29] alfiemax_: has joined #ruby
[15:24:51] hopsoft: has joined #ruby
[15:27:40] kryptoz: has joined #ruby
[15:27:44] dviola: has joined #ruby
[15:28:50] eclm: has joined #ruby
[15:29:41] kryptoz: has joined #ruby
[15:29:49] lucz: has joined #ruby
[15:33:48] clemens3: has joined #ruby
[15:34:09] _aeris_: has joined #ruby
[15:40:10] nowhereman: has joined #ruby
[15:40:24] alex``: has joined #ruby
[15:40:43] Bish: LyndsySimon: whats wrong with ruby
[15:40:55] dionysus69: has joined #ruby
[15:40:57] LyndsySimon: Bish: Nothing is *wrong* with Ruby
[15:40:57] Bish: it's just boxes sending messages to each other, with block-proc syntax
[15:41:00] LyndsySimon: At least, not that I know of.
[15:41:17] LyndsySimon: It just doesn't fit the way I think about problems as well as many other languages. Personal preference is all.
[15:41:20] Bish: it's fukin slow, other than that, i cannot think of something bad
[15:42:06] LyndsySimon: If I had to wrap my complaints into a single statement, I'd say: Ruby encourages developers to create things that behave in unexpected and difficult-to-debug ways.
[15:42:27] havenwood: Ruby, you'll shoot your eye out!
[15:43:13] LyndsySimon: Metaprogramming, for instance. It's a pain in the ass in Python, and as a result while it's available it's something that isn't done much unless it's really the best solution. It's super-easy in Clojure, and as a result at least when you run in to it, it's more obvious what's happening and easier to debug.
[15:44:02] Bish: weird, i had the feeling that happens less to me in ruby
[15:44:13] LyndsySimon: Ruby takes a more middle path. It's approachable for less-experienced developers, but it has a much steeper learning curve and it's not always obvious when you're dealing with something you don't fully understand.
[15:44:13] Bish: ven with metaprogramming
[15:44:24] Bish: i choose the oddest programming style for my current project
[15:44:28] havenwood: http://poignant.guide/images/about.the.poignant.guide-2.jpg
[15:44:36] Bish: and it works
[15:45:03] Bish: i dont get that strip
[15:45:11] Bish: why is that kid screaming class << self
[15:45:34] havenwood: the infant has learned Ruby
[15:45:42] apeiros_: has joined #ruby
[15:45:49] LyndsySimon: ... because it doesn't conform to the class syntax used elsewhere, and because classes in Ruby don't have metaclasses in the same way that other languages do ...
[15:46:17] Bish: well, yeah ruby does it correctly
[15:46:18] Bish: what a bummer
[15:46:21] havenwood: LyndsySimon: Smalltalk had some good ideas.
[15:49:12] cschneid_: has joined #ruby
[15:51:21] milardovich: has joined #ruby
[15:53:41] LyndsySimon: havenwood: I don't think it's a bad idea, and I don't think Ruby is a bad language. I just prefer a different way of dealing with it :)
[15:53:50] LyndsySimon: Bish: "Correct", in this case, is subjective.
[15:54:27] nicesignal: has joined #ruby
[15:54:29] LyndsySimon: Bish: It's more flexible without question. I just see the point of this sort of language to be to reduce the depth at which I have to think about things when I'm writing code. For me, Python does that much more effectively than Ruby
[15:54:48] LyndsySimon: I really miss Python decorators when I'm working in Ruby, much more than I miss blocks in Python.
[15:55:49] alfiemax: has joined #ruby
[15:58:42] havenwood: LyndsySimon: http://yehudakatz.com/2009/07/11/python-decorators-in-ruby/
[15:59:10] havenwood: TL;DR: "Python decorators do in fact provide a certain amount of additional power and elegance over the Python before decorators. However, this power is simply a subset of the available Ruby functionality."
[15:59:18] Senecea: has joined #ruby
[15:59:24] uZiel: has joined #ruby
[16:00:09] LyndsySimon: havenwood: Right - that's exactly my complaint with Ruby. It's not that it's lacking features, it's that it has too many features.
[16:00:10] havenwood: I can see reaching for the pattern, but there's nothing missing in Ruby on that front.
[16:00:42] LyndsySimon: Python decided on a pattern, made is easy to use, and eschewed others.
[16:00:44] havenwood: LyndsySimon: Yeah, TIMTOWTDI is something that some folk love and some folk hate.
[16:00:49] LyndsySimon: AFK - going into a meeting.
[16:03:42] cschneid_: has joined #ruby
[16:04:18] Bish: regarding the fact that abstraction itself might be a human-made construct.. everything is subjective when it comes to programming
[16:04:50] Bish: but if you mean with "metaclasses like ruby" that classes itself are objects, i think that is very correct
[16:05:22] Bish: and not like in javascript/c++ where you kinda like lose the information what something was at compiletime, or more information that is
[16:08:55] ta: has joined #ruby
[16:10:02] deathwisdave: has joined #ruby
[16:10:05] [Butch]: has joined #ruby
[16:11:51] iamarun: has joined #ruby
[16:11:58] anisha: has joined #ruby
[16:12:22] jrafanie: has joined #ruby
[16:12:26] alfiemax: has joined #ruby
[16:16:28] apparition: has joined #ruby
[16:19:00] synthroid: has joined #ruby
[16:19:13] troys: has joined #ruby
[16:20:22] Technodrome: has joined #ruby
[16:21:21] eclm: has joined #ruby
[16:22:21] milardovich: has joined #ruby
[16:26:04] kculpis: has joined #ruby
[16:29:09] dinfuehr: has joined #ruby
[16:33:17] milardov_: has joined #ruby
[16:36:36] bkxd: has joined #ruby
[16:39:30] raatiniemi: has joined #ruby
[16:43:16] connor_goodwolf: has joined #ruby
[16:44:27] apeiros_: has joined #ruby
[16:45:19] eroux: has joined #ruby
[16:45:50] guille-moe: has joined #ruby
[16:46:11] the_f0ster: has joined #ruby
[16:47:53] havenwood: deathwisdave: hi
[16:48:53] anisha: has joined #ruby
[16:52:20] mochiyoda_: has joined #ruby
[16:52:38] lucz: has joined #ruby
[16:53:11] FahmeF_: has joined #ruby
[16:54:42] lucz: has joined #ruby
[16:56:01] mtkd: has joined #ruby
[16:56:47] cvander: has joined #ruby
[17:01:38] jrafanie: has joined #ruby
[17:01:42] Technodrome: has joined #ruby
[17:02:33] guille-moe: has joined #ruby
[17:04:46] gix: has joined #ruby
[17:07:36] anisha: has joined #ruby
[17:07:37] michael1: has joined #ruby
[17:10:17] alfiemax_: has joined #ruby
[17:10:33] Guest88823: has joined #ruby
[17:12:03] the_f0ster: has joined #ruby
[17:12:30] JsilverT: has joined #ruby
[17:13:16] cr3: if I have class Bar < Foo; ALIASES = [1,2,3]; end and a class method in the Foo base class, how should I be accessing ALIASES from the subclass?
[17:16:03] guacamole: has joined #ruby
[17:17:37] nowhereman: has joined #ruby
[17:18:03] havenwood: cr3: What have you tried?
[17:18:26] cr3: havenwood: the problems turns out I need @@ALIASES
[17:18:27] havenwood: cr3: If you gist your attempt it might help reveal your intention.
[17:19:32] havenwood: cr3: I don't turn to class variables like `@@aliases` very often.
[17:19:54] cr3: havenwood: nor do I, that's why I forgot that syntax :)
[17:20:17] EXCHGR: has joined #ruby
[17:28:53] alfiemax: has joined #ruby
[17:30:51] orbyt_: has joined #ruby
[17:32:42] marxarelli: has joined #ruby
[17:34:13] guacamole: has joined #ruby
[17:37:57] nowhereman: has joined #ruby
[17:38:40] SeepingN: has joined #ruby
[17:43:32] lucz: has joined #ruby
[17:46:40] guacamole: has joined #ruby
[17:52:16] Silthias: has joined #ruby
[17:52:33] micalexander: Is there a way to list gems created and pushed to rubygems.org?
[17:52:38] micalexander: from the command line
[17:57:48] havenwood: micalexander: gem list --remote
[17:58:43] micalexander: havenwood: I am only looking for the gems that I created, not everything
[18:03:08] havenwood: micalexander: You could use the RubyGems API or write a little fetcher in Ruby.
[18:04:00] havenwood: micalexander: Gem::SpecFetcher, or whatever it is.
[18:07:01] claudiuinberlin: has joined #ruby
[18:12:35] teej: has joined #ruby
[18:13:07] CrazyEddy: has joined #ruby
[18:14:27] fishcooker: has joined #ruby
[18:22:19] apeiros_: has joined #ruby
[18:24:34] jrafanie: has joined #ruby
[18:25:24] lucz: has joined #ruby
[18:29:07] eckhardt: has joined #ruby
[18:29:26] ta: has joined #ruby
[18:30:17] michael1: has joined #ruby
[18:33:46] pwnd_nsfw: has joined #ruby
[18:36:13] uZiel: has joined #ruby
[18:36:49] kculpis: has joined #ruby
[18:39:28] lucz: has joined #ruby
[18:39:47] nolakat: has joined #ruby
[18:42:13] raatiniemi: has joined #ruby
[18:42:17] raynold: has joined #ruby
[18:44:49] jamesaxl: has joined #ruby
[18:49:23] nolakat: has joined #ruby
[18:51:07] lamduh: has joined #ruby
[18:54:01] ta: has joined #ruby
[18:54:20] lamduh: is there a way to skip part of a range/sequence when creating the sequence?
[18:54:30] lamduh: I want to (0...50).map { ('A'..'Z').to_a[rand(26)] }.join
[18:54:39] lamduh: to look something like (0...50).map { ('A'..'Z', 'a'..'z').to_a[rand(26)] }.join
[18:56:09] gix: has joined #ruby
[18:56:42] ramfjord: has joined #ruby
[18:58:20] alfiemax: has joined #ruby
[18:59:14] kobina: has joined #ruby
[18:59:26] Dimik: has joined #ruby
[18:59:34] apeiros_: has joined #ruby
[19:00:17] RickHull: has joined #ruby
[19:00:21] ogres: has joined #ruby
[19:00:56] gigetoo: has joined #ruby
[19:04:24] eckhardt: has joined #ruby
[19:04:25] ta: has joined #ruby
[19:11:03] Archrover: has joined #ruby
[19:13:52] conta2: has joined #ruby
[19:14:41] milardovich: has joined #ruby
[19:14:46] mozzarella: lamduh: not sure I understand
[19:15:26] nowhereman: has joined #ruby
[19:16:37] lamduh: I just need to get random characters 'a'-'z' and 'A-'Z' but there are random characters between Z and a that are messing things up..i want a hole in my range
[19:17:50] baweaver: >> [*'A'..'Z', *'a'..'z'].sample(50)
[19:17:51] ruby[bot]: baweaver: # => ["W", "y", "m", "A", "j", "l", "K", "F", "P", "R", "f", "t", "M", "b", "G", "N", "d", "x", "o", "r", ...check link for more (https://eval.in/895761)
[19:18:02] baweaver: Though I think that can only get each char once
[19:18:12] baweaver: anyways, you can map it for similar effect
[19:18:49] baweaver: >> set = [*'A'..'Z', *'a'..'z']; 10.times.map { set.sample }.join(', ')
[19:18:50] ruby[bot]: baweaver: # => "p, d, q, R, N, o, Z, V, u, U" (https://eval.in/895763)
[19:19:23] ur5us: has joined #ruby
[19:19:56] RickHull: baweaver: pls no splat ;)
[19:20:12] baweaver: shorthand is fair game in ze REPL
[19:20:12] jhass: Array.new(10) { set.sample } ;P
[19:20:26] jhass: splat assigned to a constant is fine IMO
[19:20:27] baweaver: jhass: good call
[19:20:27] orbyt_: has joined #ruby
[19:20:31] baweaver: also welcome back
[19:24:18] lucz: has joined #ruby
[19:26:02] mochiyoda_: splat is bad now?
[19:26:45] pork13: has joined #ruby
[19:27:17] ta: has joined #ruby
[19:27:28] jhass: to create another array it's kinda inefficient compared to say a.to_a.concat(b), so don't do it in a loop
[19:27:40] RickHull: mochiyoda_: nah, just a joke -- we were benching various array and hash creation / mutation
[19:27:41] jhass: but as part of program setup it should be fine
[19:28:00] RickHull: and when constructing an array or set from multiple ranges, i think splat is maybe more natural
[19:28:02] RickHull: than range.to_a
[19:28:05] lamduh: ruby so fancy
[19:28:35] mochiyoda_: ahh got you. cheers.
[19:29:20] pork13: Hello all... I'm having a little trouble with the jdbc/mysql gem, trying to execute a prepared_statement. I have a ? in my where clause, but whether I quote it or not I get a SQL syntax error.
[19:29:27] mochiyoda_: RickHull: I'd splat that myself out of habit
[19:30:00] lamduh: Well your examples gave me a good wayt to do it (0...50).map { [*'A'..'Z', *'a'..'z'].to_a[rand(52)] }.join
[19:30:08] lamduh: Really quick though...what does the * before the range mean?
[19:30:22] RickHull: it means, put them like ['A', 'B' .. ]
[19:30:35] pork13: %q{SELECT id, blahblah from `table` WHERE id = ?}
[19:30:41] RickHull: like *args where args is an array. foo(arg1, arg2, arg3)
[19:30:44] lamduh: That is what I would have expected as the default...what is the actual default
[19:30:45] jhass: does mysql have server side bind params yet or is it still all client side? well with jdbc it probably is client side anyway
[19:31:16] Freshnuts: has joined #ruby
[19:31:30] jhass: lamduh: the default is to just put it there as is, so in this case an array of two range objects
[19:31:52] pork13: then I run execute_query(myVar) I get: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myValue' at line 1
[19:31:57] Archrover: has joined #ruby
[19:32:20] babykosh: has joined #ruby
[19:32:23] jhass: pork13: what's the real thing behind myValue?
[19:32:30] kculpis: has joined #ruby
[19:32:45] pork13: It's a String
[19:32:48] jhass: I promise as long as it's not a password copy pasting it to us will tell us nothing :P
[19:33:18] pork13: Fair enough... I'm just trying to keep it short, but I'll keep it real.. one sec!
[19:33:21] chmurifree: has joined #ruby
[19:33:27] RickHull: keep it real, short
[19:34:01] RickHull: the error in your SQL syntax is within myVar almost certainly
[19:34:25] pork13: https://www.irccloud.com/pastebin/lPYpyAde/
[19:34:27] ruby[bot]: pork13: we in #ruby do not like irccloud.com, I reposted your paste to gist for you: https://gist.github.com/862c424899b0053ee8278a707a370d06
[19:34:27] ruby[bot]: pork13: irccloud.com has no syntax highlighting, distracting formatting and loads slowly for most.
[19:34:33] lamduh: cool thanks
[19:34:51] pork13: I like this robot.:D
[19:35:19] truenito: has joined #ruby
[19:35:27] Sparky: has joined #ruby
[19:36:21] RickHull: pork13: i'm guessing it's the ? -- don't you need to do the param substituion or whatever?
[19:36:30] jhass: so this is more of an JDBC question than a ruby one I guess :D And I'm sure the answer is because jdbc sucks :P
[19:37:12] jhass: https://stackoverflow.com/a/12745238/2199687 try this?
[19:37:24] pork13: Yeah.. I'm here because when I do this with JDBC in java, it works :( Was hoping you might have some light to shed on the jdbc/mysql gem's particular implementation...
[19:37:54] pork13: Hm, good call @jhass I'll try it
[19:39:27] Sparky: Do I have to gets.chomp.to_i for numbers? I can't just gets.chomp?
[19:39:28] pork13: Actually... The syntax error getting reported has the substituted value in it, so I think that stmtSelect.execute_query(hostname) is indeed handling the subbing.
[19:39:48] RickHull: that would do the substitution
[19:39:53] jhass: but maybe in the wrong way
[19:40:00] jhass: maybe it needs to know it's a string
[19:40:14] RickHull: where is the error happening?
[19:40:14] jhass: or "string value"
[19:40:25] RickHull: is a line of your paste causing the error?
[19:40:53] raatiniemi: has joined #ruby
[19:41:08] milardovich: has joined #ruby
[19:41:52] pork13: error comes on line 11
[19:41:55] pork13: rSlocid = stmtSelect.execute_query(hostname)
[19:42:16] RickHull: confirm the value of hostname -- maybe it's nil?
[19:42:25] pork13: If I pass 0 args to that call, that's a different problem
[19:42:40] RickHull: passing nil would be a single arg
[19:42:50] pork13: hostname isn't nil; error is:
[19:42:58] ta: has joined #ruby
[19:43:03] pork13: ...check the manual that corresponds to your MySQL server version for the right syntax to use near 'angelica' at line 1...
[19:43:06] havenwood: Sparky: In Ruby 2.4+ you can provide a keyword argument to #gets so it chomps without another method call.
[19:43:30] havenwood: Sparky: gets(chomp: true)
[19:43:52] pork13: You guys are right, this feels like a jdbc problem... and it's a subtle one I'm sure :P
[19:44:04] havenwood: Sparky: If you don't #to_i, you'll have a String.
[19:44:22] RickHull: pork13: i think you can prepare the statement first, and then examine it
[19:44:26] RickHull: before executing it
[19:44:34] jhass: let's stare at the query a bit, mysql tends to complain about the stuff after the problem more often than not :D
[19:44:50] RickHull: i.e. stmt.prepare(hostname) #=> String
[19:45:04] Sparky: havenwood: Cool! Thanks, I'll play with it and see what different things do, I guess that's the process of learning afterall
[19:45:06] jhass: can you try without the ` in the query?
[19:45:07] havenwood: Sparky: You don't need to chomp to #to_i though.
[19:47:04] pork13: You've gotta be kidding me. That worked @jhass. Backticks are my new enemy.
[19:47:25] jhass: maybe they were the wrong kind, you're on OSX? :D
[19:47:31] pork13: I sure am!
[19:47:32] Sparky: havenwood: Can you Show me an example? Any time I hit # it blocks out the rest of the line for comment
[19:47:40] jhass: then that'll be it
[19:47:41] pork13: There's more than one kind? OMG.
[19:47:52] jhass: sure, Unicode got you covered!
[19:48:02] havenwood: Sparky: #method_name is just a notation to say the thing after the # is a method
[19:48:10] pork13: I had no idea. #TIL
[19:48:17] pork13: Thanks for the save
[19:48:20] havenwood: Sparky: In irb or pry try: gets.to_i
[19:48:25] havenwood: Sparky: Compare with: gets
[19:49:34] lamduh: Why can you use map on a range e.g. (1..50).map {}. I dont see map as a memeber function onth e Range class? http://ruby-doc.org/core-2.2.0/Range.html
[19:50:17] havenwood: lamduh: Range mixes in Enumerable, which provides #map based on the Range#each implementation.
[19:51:11] Sparky: havenwood: So gets gives the get/n and gets.to_i gives just the get without /n
[19:51:15] lamduh: Ah I see the included modules thing. Ive never used ruby before but my QA is trying to learn it so she can write your selenium tests and I am trying to explain to her why the method we came up above works
[19:51:28] havenwood: Sparky: There's another difference
[19:51:37] RickHull: Sparky: it's that to_i ignores the newline
[19:51:44] havenwood: Sparky: (Look for quotes on both return values.)
[19:51:55] Sparky: OH! gets puts it in a string?
[19:52:04] RickHull: get-s -- s for string
[19:52:23] RickHull: gets puts it in a string and puts gets it in a string ;)
[19:52:53] Technodrome: has joined #ruby
[19:53:26] RickHull: >> "123\n\n\n".to_i
[19:53:27] ruby[bot]: RickHull: # => 123 (https://eval.in/895777)
[19:55:27] ta: has joined #ruby
[19:55:35] RickHull: >> ["123\n\n\n".chomp, "123\n\n\n".strip, "123\n\n\n".to_i]
[19:55:36] ruby[bot]: RickHull: # => ["123\n\n", "123", 123] (https://eval.in/895784)
[19:56:24] AndBobsYourUncle: has joined #ruby
[19:57:30] apeiros_: gets = get string, puts = put string
[19:58:56] lagweezle: has joined #ruby
[20:01:44] milardov_: has joined #ruby
[20:03:24] zanoni: Maybe I can get some help, been trying to print out some directories and files, specifically in the format that I need. This is the best code I have, and almost would work if I could filter Dir.entries https://gist.github.com/stuartambient/89a4fecee1a1873fb233cadc5e3472cc
[20:03:33] michael1: has joined #ruby
[20:04:05] Archrover: has joined #ruby
[20:04:09] RickHull: zanoni: fix your indentation, and it looks like you're missing an `end`
[20:04:35] Papierkorb: Changing the filename in the gist to end in `.cr` will also enable highlighting
[20:04:42] RickHull: oh, maybe not
[20:04:59] RickHull: the poor indentation makes it hard to read
[20:05:32] RickHull: the `end` corresponding to `if` should be at the same level, and the body of the conditional should be indented further
[20:05:38] zanoni: i changed it but, I could do better on idents and styles
[20:05:38] RickHull: two spaces per indent level is the convention
[20:05:58] Papierkorb: zanoni: You misunderstood #reject. You just put a condition in there, like what you have *after* the if. Then you #each over what the #reject returns, which now doesn't contain anymore what you just threw out
[20:06:08] apeiros_: RickHull: cr like crystal? :D
[20:06:19] zanoni: i know about the 2 spaces, but always get confused about when it doesn't apply in a block
[20:06:24] Papierkorb: apeiros_: Dang, wrong channel lawl
[20:06:33] minimalism: has joined #ruby
[20:06:35] Papierkorb: Well, the highlighting rules aren't that different...
[20:06:36] apeiros_: oh, right, sorry RickHull - that was @ Papierkorb
[20:06:42] RickHull: i'm offended
[20:06:47] apeiros: rightly so!
[20:06:54] apeiros: want to duel?
[20:07:19] RickHull: 1v1 corewars?
[20:07:32] apeiros: 1v1 starcraft2
[20:07:34] jrafanie_: has joined #ruby
[20:07:43] zanoni: Papierkorb: you saying drop the reject?
[20:08:16] zanoni: or add an each
[20:08:18] apeiros: I should add stone paper scissors to rubybot
[20:08:22] Papierkorb: zanoni: Not at all. The whole thing should end up looking like this: `Dir.entries(dir).reject{|x| x =~ /your regex/}.each{|x| p x}`
[20:08:25] apeiros: inline duel for the channel :)
[20:08:57] apeiros: and/or battleships (is that the english name?)
[20:09:12] Sparky: I could totally almost program rock paper scissors in ruby right now
[20:09:36] apeiros: Sparky: go for it :)
[20:10:07] ta: has joined #ruby
[20:10:46] dminuoso: And then we'll have a golf course.
[20:11:07] zanoni: Papierkorb, nope that leaves me back with the dots
[20:11:41] Sparky: apeiros: I don't know how to give if/then arguments yet
[20:11:42] zanoni: No, the reject and regex is working, but i need a condition on the entries for reject entries that are not acutally files
[20:12:28] apeiros: Sparky: if/then doesn't take arguments. it only contains an expression
[20:12:36] Papierkorb: zanoni: Oh those you wanna get rid of, now I understand. Two solutions: Either use a `Dir["#{path}/*"]`, or: `Dir.entries(path).reject{|x| [ ".", ".." ].include? x}`
[20:12:39] apeiros: if some_expression then …code… end
[20:12:43] ap4y: has joined #ruby
[20:13:17] Papierkorb: zanoni: If you want to get rid of *all* leading-dot entries, just do `.reject{|x| x.start_with? '.'}`
[20:13:17] apeiros: e.g. if your_choice == "scissors" and their_choice == "rock" then puts "you lost!" end
[20:13:19] Sparky: I'm sure the book I'm following will get me to that point eventually :P
[20:13:40] Sparky: Why == and not = ?
[20:13:46] apeiros: It'd be a terrible book if not ;-)
[20:13:49] apeiros: = is assignment
[20:13:51] apeiros: == is comparison
[20:14:10] Sparky: So I can do 3 + 5 == 10 and get a false?
[20:14:13] apeiros: and === is very different kind of comparison (used in case/when)
[20:14:17] zanoni: no , i 've gotten rid of dot files, but still get entries that are not files
[20:14:17] apeiros: >> 3 + 5 == 10
[20:14:19] ruby[bot]: apeiros: # => false (https://eval.in/895790)
[20:14:27] apeiros: Sparky: ^ it would almost seem so ;-)
[20:15:10] apeiros: Papierkorb: grep_v(/\A\./) ^^
[20:15:37] apeiros: less typing, yay!
[20:16:07] banisterfiend: has joined #ruby
[20:17:09] claudiuinberlin: has joined #ruby
[20:17:12] zanoni: i do like the start_with? , cleaner then regex
[20:19:42] ta: has joined #ruby
[20:21:34] RickHull: first stab: https://gist.github.com/rickhull/e1eadca86fc72ea40e1f818578b92abf
[20:22:53] tomphp: has joined #ruby
[20:24:37] RickHull: next, def spaceship ?
[20:24:57] jhass: lizard, spock
[20:25:09] zanoni: Papierkorb, it is !x.start_with?'.' Which is all good, but still in the same place , not being able to drop the entries that are devoid of file. Like /app/assets/views/views.rb I only want to see views since that actually contains the file
[20:26:01] nofxx: has joined #ruby
[20:26:02] Papierkorb: `Dir["app/assets/views/**/*.{erb,haml,slim,md}"]` ?
[20:26:24] michael1: has joined #ruby
[20:26:50] AndBobsYourUncle: has joined #ruby
[20:27:02] safetypin: has joined #ruby
[20:27:27] ur5us: has joined #ruby
[20:28:06] sagax: has joined #ruby
[20:29:40] KeyJoo: has joined #ruby
[20:30:10] Coldblackice: has joined #ruby
[20:33:11] Sparky: Uh-oh hey, if I want to put a #{} inside of a q%{} how do I do that?
[20:33:24] RickHull: i think %Q{}
[20:33:38] RickHull: note that %[] and %() are valid as well
[20:33:42] Papierkorb: Sparky: You can also escape the #
[20:33:53] Papierkorb: >> "Foo: \#{bar}"
[20:33:54] truenito: has joined #ruby
[20:33:57] Sparky: escape with \ ?
[20:34:15] Papierkorb: >> "Foo: \#{bar}"
[20:34:16] ruby[bot]: Papierkorb: # => "Foo: \#{bar}" (https://eval.in/895796)
[20:35:13] RickHull: >> format(%q{here is an integer %i}, 5)
[20:35:14] ruby[bot]: RickHull: # => "here is an integer 5" (https://eval.in/895799)
[20:35:21] baweaver: >> "#\{}" # < watch the birdie
[20:35:22] ruby[bot]: baweaver: # => "\#{}" (https://eval.in/895800)
[20:36:04] RickHull: >> %q(here is a string %s) % 'foo'
[20:36:05] ruby[bot]: RickHull: # => "here is a string foo" (https://eval.in/895801)
[20:36:22] lucz: has joined #ruby
[20:37:55] eam: >> % #{% % } #{ % %} %
[20:37:56] ruby[bot]: eam: # => "%" (https://eval.in/895802)
[20:38:07] RickHull: >> format %q[here is the bill: $%0.2f], 9000
[20:38:08] ruby[bot]: RickHull: # => "here is the bill: $9000.00" (https://eval.in/895804)
[20:40:05] RickHull: >> format "the #{'pie'} cost $0.2f", Math::PI
[20:40:06] ruby[bot]: RickHull: # => "the pie cost $0.2f" (https://eval.in/895806)
[20:40:13] RickHull: doh, anyways
[20:40:31] Sparky: Can someone look at my code and give me a push in the right direction?
[20:41:05] Sparky: https://pastebin.com/WJ9GtkGP
[20:41:06] ruby[bot]: Sparky: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/f0d92022b4395a318d7c556c92b75ca2
[20:41:08] ruby[bot]: Sparky: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[20:41:17] Sparky: Thanks rubybot
[20:41:26] adaedra: What kind of push do you want?
[20:41:38] Sparky: A small nudge, give me a topic to google
[20:41:48] llua: does someone know why this .irbrc doesn't print the ansi escape sequences correctly in my prompt on freebsd but does on linux? http://sprunge.us/QVeN
[20:41:54] eam: well the giraffe is ridiculously underpriced, for one
[20:41:57] adaedra: Do you have a problem with it Sparky ?
[20:42:04] Psybur: has joined #ruby
[20:42:45] Sparky: I need a way to associate the price of the thing with the name... I think that's what I need?
[20:42:57] RickHull: also, 1.23 is an IEEE float and it does not represent monetary amounts very well
[20:43:12] RickHull: it's better to represent monetary amounts as integers of the indivisible unit -- e.g. pennies
[20:43:58] eam: Sparky: associating names with values is generally done with a Hash
[20:44:18] RickHull: you can format them as money where needed, e.g. def dollars(pennies); "$0.2f" % pennies / 100r; end
[20:44:23] eam: mapping any object to another object
[20:44:50] RickHull: ah crap, messed up the format string again
[20:45:17] Sparky: Is this what I'm looking for then? https://docs.ruby-lang.org/en/2.0.0/Hash.html
[20:45:39] adaedra: woah, calm down with the time machine
[20:45:39] ta: has joined #ruby
[20:45:45] adaedra: we're at 2.4.2 now
[20:46:04] Sparky: Then this? https://ruby-doc.org/core-2.4.2/Hash.html
[20:46:05] eam: Sparky: likely, yes
[20:46:38] RickHull: >> def dollars(pennies); format "$%0.2f", pennies / 100r; end; dollars(2399)
[20:46:39] ruby[bot]: RickHull: # => "$23.99" (https://eval.in/895810)
[20:47:40] ta: has joined #ruby
[20:49:12] RickHull: there are Money and Decimal classes IIRC that work as well or better
[20:50:29] the_f0ster: has joined #ruby
[20:51:16] eam: sprintf formatting with %0.2f will represent as a float at some point though
[20:51:36] RickHull: yeah -- you would not use the string representation for further computation
[20:51:42] RickHull: just for presentation
[20:52:10] eam: but what if there's a display error? :)
[20:52:54] cdg: has joined #ruby
[20:53:01] Senecea: has joined #ruby
[20:53:17] conta: has joined #ruby
[20:53:25] Hanmac: has joined #ruby
[20:55:55] alfiemax: has joined #ruby
[20:56:00] jenrzzz: has joined #ruby
[20:56:00] jenrzzz: has joined #ruby
[20:58:53] orbyt_: has joined #ruby
[21:01:14] Sparky: Sooo.. like this? price = { "beach ball" => 12.99, "tennis ball" => 4.99, "giraffe" => 93.86 }
[21:01:39] RickHull: yep, it's a good start
[21:02:24] RickHull: you can also consider symbols for keys: { beach_ball: 12.99, ... }
[21:02:38] RickHull: :beach_ball vs "beach ball"
[21:03:03] RickHull: symbols are better for internal identifiers, and strings are better for representing outside info like user input
[21:03:04] marr: has joined #ruby
[21:03:10] Sparky: Would beach_ball get called for the get.chomp for beach ball?
[21:03:11] RickHull: very generally speaking
[21:03:32] RickHull: if "beach ball" comes from #gets -- then it is outside info / user input
[21:03:36] RickHull: and a string is appropriate
[21:03:58] c-c: So I have this class that represents game interface -process. I have currently solved the refresh at intervals in the following way. Can you suggest how to improve/comments on this? https://gist.github.com/csmr/87eae0fa218efba43f9fc661b270ceb4
[21:05:22] RickHull: it seems reasonable. it shouldn't be necessary to call #to_f on Time.now
[21:05:34] RickHull: and what's up with drawing_bool vs _drawing_bool ?
[21:06:14] RickHull: oh, just kidding, you do need .to_f
[21:07:20] c-c: RickHull: yes
[21:08:16] c-c: Otherwise it somehow ends up being time as milliseconds on even fraction (12.0, 12.0, ..etc for the remaining frames for this sec.., 13.0, 13.0, ... 14.0, 14.0...)
[21:08:46] gizmore: has joined #ruby
[21:08:47] c-c: not sure if 'on even fraction' is proper english though :)
[21:10:27] elomatreb: This seems like a bad idea for UI refreshing, normally you'll want to use proper threads and sleep for as much time as possible. What you seem to be doing here is busy-waiting
[21:10:53] c-c: threads are not ruby, nor are they linux
[21:11:08] c-c: elomatreb: one needs to use processes for concurrency
[21:11:14] Sparky: Oh poop, I tried doing the hash thing and got- ery good, you have chosen beach ball, that will be {"beach ball"=>12.99}
[21:11:18] RickHull: both ruby and linux have threads
[21:11:44] RickHull: ruby also has fibers, which are like cooperative rather than preemptive threads
[21:11:54] c-c: Have you guys done a lot of concurrent multi-core programming with threads?
[21:12:09] RickHull: ruby threads are green threads, so single core
[21:12:24] RickHull: unless using jruby (or rbx?)
[21:12:39] c-c: also, for linux, the concurrency model is processes
[21:12:45] elomatreb: Not "a lot", but it's not a complicated thing you're trying to do. If you want your UI to refresh every N ms you just sleep N ms
[21:13:05] elomatreb: Absolutely false. Open htop, press "H", see all the threads your applications are using
[21:13:14] nofxx: has joined #ruby
[21:13:30] c-c: elomatreb: tell me, on the left in htop, whats the colum "PID" signify? :)
[21:13:33] headius: RickHull: MRI has native threads but they're locked to only allow one running Ruby code at once
[21:13:41] headius: green threads are different
[21:13:49] c-c: elomatreb: is it the thread id, or the process id? (rhetoric)
[21:13:53] eam: c-c: you should be tracking the time since your last refresh, then add your refresh_time, subtract now() and sleep for that long
[21:13:57] RickHull: ah, thanks -- when did that happen?
[21:14:07] eam: ideally, if this is a game, you can poll the vsync
[21:14:07] elomatreb: c-c: Every linux process can have any amount of threads
[21:14:11] RickHull: or was "green threads" just a misnomer for a long time?
[21:14:25] veeti: has joined #ruby
[21:14:26] c-c: elomatreb: well, process based concurrency just makes sense
[21:14:50] c-c: in my humble opinion, threads make things complicated and difficult to partition
[21:15:12] RickHull: c-c: the point is, there is a choice. you were implying there is no choice
[21:15:31] selim: has joined #ruby
[21:15:36] c-c: also, I like the option of having the ui, the server and the logic/engine on different machines altogether - process based concurrency gives me this easily
[21:16:01] c-c: RickHull: well, afaics, threads are not an attractive option
[21:16:01] eam: right now you don't have concurrency at all
[21:16:07] StarSeed0000: has joined #ruby
[21:16:10] Technodrome: has joined #ruby
[21:16:14] c-c: eam I have 3 process concurrency
[21:16:25] RickHull: c-c: nothing wrong with multiprocess, go for it :)
[21:16:25] eam: I mean, in the code you're sharing
[21:16:36] c-c: but will have to clean this up before I wont shame myself for putting it up on github :*)
[21:16:44] sepp2k: has joined #ruby
[21:16:46] RickHull: what is your plan for IPC?
[21:16:56] c-c: RickHull: I implemented named pipes already
[21:17:06] RickHull: oh, i remember that, i think :)
[21:17:16] eam: you don't need threads for a simple game btw
[21:17:36] rhyselsmore: has joined #ruby
[21:17:38] c-c: its also clean, can be replaced with sockets if multiplayer-server-solution, and uses kernel for super fast throughput
[21:18:04] eam: I'm not sure what that means
[21:18:25] c-c: it means 3 different scenarios, so vague
[21:18:31] RickHull: when you go to multi-machine, will sockets have the same semantics as named pipes? authentication?
[21:18:50] c-c: lets just say named pipes keep IPC as fast as possible without sharing memory directly
[21:19:52] c-c: RickHull: not exactly. Named pipes are bit simpler. But afaics the outcome is it won't be painful for example to use tcp sockets for multiplayer server <-> client.
[21:20:36] c-c: anyway I want to simulate the weather and state of a planet, so it might need all the cores possible
[21:21:03] RickHull: if you are concerned about squeezing every drop of performance, ruby might not be the best choice
[21:21:04] c-c: - this is the dream, anyway, probably 2 man years worth of work left, minimum.
[21:21:13] RickHull: have you looked at e.g. Crystal ?
[21:21:18] c-c: RickHull: ok I thought about that too
[21:21:26] RickHull: jruby / truffle might be worth a look
[21:21:49] c-c: RickHull: thats *another* reason I use process based conc, and named pipes. The plan is - use crystal or rust for the state server eventually, once a POC exists.
[21:21:53] headius: RickHull: Ruby 1.9 switched to native threads with a lock
[21:22:01] headius: like 2007 or 8
[21:22:15] c-c: - If need be. I have used things like nmatrix gem for computation intensive with ruby, and its pretty nice.
[21:22:24] RickHull: part of me is still stuck in the 1.8 mindset :)
[21:22:33] raatiniemi: has joined #ruby
[21:22:44] headius: also jruby and truffle are separate projects now btw
[21:22:49] c-c: I started this on jruby
[21:22:56] c-c: but threads give me headache
[21:23:53] c-c: hehe pesterd headius years ago about it like half dozen times
[21:24:48] Sparky: I feel like I am missing something very simple, preventing this to work the way I want it to https://gist.github.com/anonymous/54fc9582c10b69496058d4b29e9937d2
[21:25:19] RickHull: Sparky: purchase is not used
[21:25:42] RickHull: price is a data structure, not a scalar
[21:26:06] RickHull: it rarely makes sense to stick a data structure inside a string
[21:26:09] c-c: price[:giraffe] ?
[21:26:23] jrafanie: has joined #ruby
[21:26:31] nofxx: Hash#default ... jez, you'll never know everything =P
[21:26:49] nofxx: before rdoc I was "is this guy thinking this is JS?"
[21:27:05] Sparky: RickHull: I was going to use purchase later after I get this sorted
[21:27:36] RickHull: to get a single price (i.e. a scalar) out of the data structure, you should address it with a key
[21:27:50] RickHull: price[some_key] returns some value
[21:28:17] c-c: elomatreb: btw, was going to add that the reason there is the test for refreshtime and not just sleep is grabbing the input. I'm not sure how its going to be exactly, but the refresh rate for view is going to be 24-48 fps, but I want the input be grabbed minimum 50 times a sec, ideally at least 100
[21:28:20] RickHull: in your case, the value would be 0 if some_key does not exist
[21:29:11] c-c: Most people can tell if theres ~20 ms or more of delay. Less than 10 ms is hard to tell even for many musicians.
[21:29:41] eam: c-c: why not just poll on input, with a timeout of the delta until the next display cycle?
[21:30:31] RickHull: i like the idea of sleep_time = interval - computation_time
[21:30:50] c-c: eam: so how it works now is 100 times a second it ui_gran_input (should be grab_input). It also calls ui_refresh, which tests if its time to start view refresh.
[21:31:00] eam: yeah, but why have that interval?
[21:31:10] eam: you can poll on input and respond to it immediately
[21:31:45] c-c: Hm, I probably don't understand how "poll on input" might work. It now tests with 0 ms timeout select if theres input or not.
[21:31:54] eam: you're writing a single threaded state machine, so you want to gather up all the things that can trigger an event (network, keyboard, etc) and sleep for up to the refresh cycle waiting for them to perform i/o
[21:32:07] c-c: so currently its ie. non-locking
[21:32:25] eam: instead of a non-blocking select, you block select for up to the refresh interval delta
[21:32:58] eam: and then if select returns an event, you re-calculate the delta and sleep waiting for events for that new delta
[21:33:13] c-c: interesting
[21:33:52] eam: this means you respond to any input instantly and you never loop unless you either 1) have an input event or 2) the refresh interval is reached and you need a repaint
[21:34:58] Rangerst: has joined #ruby
[21:35:12] c-c: yes, I thought this way as attempting to "do as much nothing/sleep as possible most of the time" so times of heavy load would (theoretically) not be a problem
[21:36:12] eam: the main thing is now you have 0.01s added latency
[21:36:34] RickHull: sleeping instead of working while there is work to be done doesn't seem to have a benefit
[21:36:39] eam: and the lower you shrink that interval, the higher the idle cost becomes
[21:37:11] eam: there's also the added twist that on a system with a low Hz, this might not even sleep at all
[21:37:18] c-c: yeah. In reality I have no idea where the bottleneck is going to be, in terms of the UI/view/input
[21:37:27] eam: because timers aren't perfectly granular
[21:37:46] vifino: has joined #ruby
[21:37:56] eam: granted, it's been a while since 100Hz was common, now we have tickless linux
[21:38:58] RickHull: also, regarding Time.now -- see this alternative: https://github.com/seattlerb/minitest/blob/master/lib/minitest.rb#L846
[21:39:21] RickHull: Time.now can go backwards
[21:40:17] c-c: ok at least the output of Process.clock_gettime looks desirable
[21:40:23] charliesome: has joined #ruby
[21:40:43] eam: yeah, you wnat monotonic time sources
[21:40:54] eam: but then you can't support OSX
[21:41:24] eam: since in their infinite wisdom, OSX neglected to implement clock_gettime
[21:41:39] RickHull: there must be some alternative, no?
[21:41:44] eam: it's gross
[21:42:05] c-c: ok, thats not totally bad, but it would be great to have as much cross plat as posso
[21:42:10] alnewkirk: has joined #ruby
[21:42:30] c-c: - although f.ex. windows 10 support for named pipes is probably 0
[21:42:46] adaedra: iirc, there's an equivalent
[21:43:12] lucz: has joined #ruby
[21:43:19] c-c: adaedra: for gettime?
[21:43:22] eam: https://stackoverflow.com/questions/11680461/monotonic-clock-on-osx
[21:43:29] eam: it's some mach specific junk
[21:43:34] adaedra: for named pipes
[21:44:34] RickHull: it looks like clock_get_time can be used with reasonable confidence
[21:44:43] RickHull: but I have no idea what that means practically from ruby
[21:45:02] c-c: adaedra: yes, I was looking at a gem that might provide named pipes for windows
[21:45:49] adaedra: I mean, a system-provided equivalent. https://msdn.microsoft.com/fr-fr/library/windows/desktop/aa365590(v=vs.85).aspx
[21:45:58] c-c: not sure if its 2.3 proof, but I'd really like to have as much core/plain ruby and osx on board as posso
[21:46:10] adaedra: s/fr-fr/en-us/
[21:46:19] mson: has joined #ruby
[21:46:42] c-c: adaedra: yes, windows 7 does have, but I haven't had a chance to look at win10 support for named pipes (that I remember)
[21:46:58] adaedra: why would they have removed them?
[21:47:02] RickHull: MS is fanatical about backwards compat, so I would expect they remain
[21:47:37] c-c: adaedra: win10 is in many ways different from win7
[21:47:39] adaedra: They seem to exist since 2k, so I'd expect them to be well anchored now
[21:48:13] adaedra: The underlying calls that worked before are expected to still work tho
[21:48:59] alfiemax: has joined #ruby
[21:50:29] lucz: has joined #ruby
[21:52:28] nolakat: has joined #ruby
[21:53:43] galtgendo: has joined #ruby
[21:54:12] c-c: Yes, named pipes should be available. Not sure if they work as fast, as the implementation might not be via kernel (dma, whatever/however).
[21:54:49] RickHull: if you will be using sockets at some point, I would stop worrying about hypothetical performance issues
[21:55:16] c-c: Except, looks like there might be extra work for Win10 https://stackoverflow.com/questions/46497926/named-pipes-no-longer-a-thing-in-windows-10-version-1709
[21:55:31] adaedra: I'd say if you're using Ruby, you're not at this performance difference
[21:55:43] RickHull: perhaps you want the "standard" IPC for windows rather than chasing "named pipes"
[21:55:57] c-c: the latency is the key here, as the messages should remain rather small
[21:55:59] adaedra: That's for UWP, c-c
[21:56:13] adaedra: I guess this doesn't apply to you
[21:56:36] galtgendo: first thing: I know very little of ruby; given that: how should I go about adding a generic :encode_with method to a list of classes to prevent yaml dump going recursively out of stack ?
[21:56:37] c-c: I wish I knew whats a UWP on windows
[21:56:57] RickHull: galtgendo: please paste an example of the problem you're having
[21:57:09] RickHull: e.g. show the code, the input, the execution, and the error
[21:57:14] jenrzzz: has joined #ruby
[21:57:14] jenrzzz: has joined #ruby
[21:57:18] adaedra: c-c: If only search engines were a thing. :)
[21:57:19] c-c: but windows is priority 4 after linux, osx and - android
[21:57:48] RickHull: galtgendo: I haven't had this problem with yaml before
[21:58:00] c-c: Thanks for all the input channel, I appreciate it 8)
[21:58:20] charliesome: has joined #ruby
[21:59:14] c-c: hehe is there even an android ruby, probably no more
[21:59:39] Toggi3: has joined #ruby
[21:59:43] RickHull: c-c: i would make sure you have a prototype, a spike, that shows a working project on linux, with the proper refresh and perf characteristics
[22:00:01] RickHull: it's good to keep multiplatform in mind, but extremely ambitious
[22:00:18] c-c: yes, I keep it in mind while barely making progress on linux
[22:02:12] brucebag: has joined #ruby
[22:02:12] brucebag: has joined #ruby
[22:03:06] jenrzzz_: has joined #ruby
[22:04:02] lucz: has joined #ruby
[22:04:27] galtgendo: RickHull: it's somewhat hard to paste, it's a little (not mine) project, that loads a marshal dump file (with some of the classes having their own definitions, other just turned into classes via const_set(name, Class.new)), then dumps it into yaml, then can go back after yaml is edited; the problem is that sometimes accept goes into target.respond_to?(:encode_with) == false branch which ends up with dump_ivars getting called recursively
[22:04:27] galtgendo: orry, typing speed low)
[22:04:56] RickHull: can you link to some code?
[22:06:25] adaedra: try to produce a minimal example. it can even help you pin down your problem.
[22:08:06] galtgendo: Ricwell, it's pretty much https://github.com/Solistra/rvpacker
[22:08:17] RickHull: which file / method ?
[22:09:00] RickHull: looks like https://github.com/Solistra/rvpacker/blob/master/lib/RGSS/serialize.rb
[22:09:41] galtgendo: RickHull: somewhat; hang on, it will be a bit long winded
[22:09:51] RickHull: https://github.com/Solistra/rvpacker/search?utf8=%E2%9C%93&q=encode_with&type=
[22:11:10] galtgendo: there's a block in RGSS.rb calling process(Object, *x) on a long list, where process is that thing that ends up with const_set(name, Class.new)
[22:11:21] zautomata: has joined #ruby
[22:12:24] RickHull: at the risk of being uncharitable, this is low quality code that appears to be doing a lot of unnecessary stuff
[22:12:48] baweaver: Oh man! RGSS!
[22:12:48] RickHull: i wouldn't want to debug it, especially lacking strong ruby skills
[22:13:00] baweaver: RPG Maker XP / MV eh?
[22:13:28] baweaver: It's basically an odd offshoot of 1.9.2
[22:13:44] baweaver: Nostalgia abounds
[22:13:53] galtgendo: well, mostly used for VX Ace, but XP/VX too, not MV - that's js
[22:13:57] baweaver: ACTION reads back up on the problem
[22:13:58] RickHull: galtgendo: to try to answer your original question, it is pretty easy to add a specific method signature to many classes
[22:14:48] RickHull: klasses.each { |k| def k.encode_with; nil; end } # something like that
[22:14:57] RickHull: assuming it's a class method
[22:15:06] alfiemax: has joined #ruby
[22:15:21] RickHull: and all you need is k.respond_to? :encode_with
[22:15:53] baweaver: Typically the RM forums are the best source for specific questions on that. Few years back Solistra was fairly active and would answer questions
[22:18:07] RickHull: >> [String.respond_to?(:encode_with), eval('def String.encode_with; nil; end'), String.respond_to?(:encode_with)]
[22:18:08] ruby[bot]: RickHull: # => [false, :encode_with, true] (https://eval.in/895821)
[22:18:57] c-c: is RM == Role Master?
[22:20:13] RickHull: galtgendo: you can set up klasses = [String, Array, Foo, Bar, Baz]
[22:20:17] c-c: ah, its Rpg Maker again
[22:21:24] Rapture: has joined #ruby
[22:21:27] galtgendo: RickHull: it goes like this: call to visit_Object, call to dump_ivars, call to accept, from target.respond_to?(:encode_with) == false branch call to send (which is effectively a call to visit_Object for the file in question) (again, low typing speed - now I need to read your comments)
[22:21:52] raatiniemi: has joined #ruby
[22:23:04] Toggi3: has joined #ruby
[22:23:32] galtgendo: RickHull: but won't a nil method prevent a proper dump (that is one where a round trip is possible) ?
[22:23:39] RickHull: if you need instance methods, it's trickier. and I wouldn't be surprised if the workaround for this stack/recursion bug causes more problems down the line
[22:23:58] RickHull: galtgendo: uh, probably? my suggestion is TOTAL_HAX
[22:24:26] dgsntro: has joined #ruby
[22:24:29] RickHull: and frankly I would like to retract it and back slowly away from the tarpit ;)
[22:24:47] jenrzzz: has joined #ruby
[22:24:47] jenrzzz: has joined #ruby
[22:25:51] galtgendo: RickHull: do you have any idea how a trivial *working* encode_with method would look like ?
[22:26:32] RickHull: just curious, I looked for tests for this project...
[22:26:42] galtgendo: ..please, don't
[22:27:20] RickHull: heh -- I would suggest not wasting your time on this particular project
[22:27:21] baweaver: It's basically impossible to "test" without a crap-ton of assumptions and unit test stubs
[22:27:25] galtgendo: anyway, in such case do you know a place with some simple psych usage samples ?
[22:27:46] baweaver: That said this is some of the better RM code I've seen
[22:27:58] RickHull: i would just use 'yaml' i forget why psych and syck and all the other yaml impls exist
[22:28:09] baweaver: yes RickHull, better, fancy that XD
[22:28:10] galtgendo: or rather some complex usage, but well commented ones
[22:28:29] baweaver: I can take a look into this more later tonight or this weekend maybe.
[22:29:02] milardovich: has joined #ruby
[22:29:26] baweaver: Ah, it wants Ruby 1.9.3
[22:29:31] baweaver: see the README at the bottom
[22:29:45] veeti: has joined #ruby
[22:30:23] galtgendo: baweaver: not quite: VX Ace is ruby 1.9.3, but that thing still seems to work with 2.2
[22:30:48] baweaver: Mmm. I've been out of the game of toying with this for a while
[22:30:54] baweaver: Really since RMXP years ago.
[22:31:13] galtgendo: not sure about 2.4, as I've recently read that there where some marshal format changes
[22:34:43] GodFather: has joined #ruby
[22:35:59] galtgendo: RickHull: btw., what did you mean by "just use 'yaml'" ? some gem ? is there any other way of dumping to yaml file besides psych ?
[22:36:15] RickHull: you are probably tied by the project -- and it doesn't really matter
[22:36:30] RickHull: i think in ruby 2.0 the name of the lib is just yaml
[22:37:30] RickHull: it may still be the psych code under the hood -- i'm just not sure if there psych-specific quirks to be aware of
[22:37:38] dminuoso: I blame baweaver.
[22:37:49] dminuoso: Because baweaver also starts with "b". like blaming.
[22:38:09] baweaver: what is who blaming when why?
[22:38:31] RickHull: >> require 'yaml'; 'baweaver'.to_yaml
[22:38:32] ruby[bot]: RickHull: # => "--- baweaver\n...\n" (https://eval.in/895827)
[22:39:14] RickHull: >> require 'yaml'; YAML.to_yaml
[22:39:15] ruby[bot]: RickHull: # => "--- !ruby/module 'Psych'\n" (https://eval.in/895828)
[22:39:36] baweaver: >> require 'json'; JSON.to_json
[22:39:37] ruby[bot]: baweaver: # => "\"JSON\"" (https://eval.in/895829)
[22:41:10] RickHull: as far as testing goes -- it should be pretty easy to come up with a structure to dump and load via Marshal and Psych
[22:41:25] RickHull: or start with some binary structure from RPG Maker
[22:41:57] galtgendo: ...to_yaml is for psych (if I understand the docs correctly) and it's an obsolete method on top of that
[22:42:00] RickHull: so the "no tests" thing is not really excusable
[22:42:24] baweaver: They don't really believe in tests in that area, I had that argument years ago
[22:42:49] RickHull: color me surprised when they are blowing the stack with a recursive loop
[22:43:43] RickHull: anyway, if you are determined to use this project, then debugging this issue will be a good dive into the deep end
[22:44:25] RickHull: can you come with a small example that will trigger the error?
[22:44:40] RickHull: you might want to file an issue if you can't fix it yourself or work around it
[22:44:58] baweaver: Aha, it was git, but same idea - https://forums.rpgmakerweb.com/index.php?threads/aversion-to-git.34472/
[22:45:06] baweaver: Took a while to get them off pastebin on things
[22:45:15] dminuoso: baweaver: Does one need a reason to blame others?
[22:45:16] RickHull: and if it's no longer actively developed, then subtract more points from "should i use this project?"
[22:45:22] hopsoft: has joined #ruby
[22:45:28] dminuoso: Mundane people seem to do it without one on the streets all the time.
[22:45:30] dminuoso: Why cant I?
[22:46:03] galtgendo: also 'require 'yaml'' is an alias for 'require 'psych''
[22:46:09] baweaver: There's a significant chance this is the only project which does this
[22:46:11] baweaver: Considering Solistra was one of the better OSS types around
[22:46:34] fishcooker: has joined #ruby
[22:47:27] galtgendo: RickHull: well, technically, VXAce is no longer developed, as MV is js
[22:47:51] RickHull: what I mean is: if you can come with a small example that blows the stack, and you file an issue, will it get fixed?
[22:48:05] RickHull: if not, then you're on your own and you will git gud at ruby
[22:48:07] AndBobsYourUncle: has joined #ruby
[22:51:40] RickHull: your best bet is to come up with that small example that triggers the bug
[22:51:45] RickHull: file the issue
[22:52:22] RickHull: and if the project can't fix it, then maybe you or someone else can. having the example is a huge 1st step
[22:53:27] the_f0ster: has joined #ruby
[22:53:27] GodFather: has joined #ruby
[22:56:18] jenrzzz: has joined #ruby
[22:56:19] jenrzzz: has joined #ruby
[22:56:24] galtgendo: RickHull: ...TBH, I'm close to certain, that this 'project' *is* dead
[22:57:23] RickHull: so the main question is, how much time do you want to spend debugging it?
[22:57:23] Technodrome: has joined #ruby
[22:57:43] RickHull: definitely see if you can get baweaver to assist :)
[22:58:03] RickHull: and in the meantime, try to come up with a minimal example / test case
[22:58:13] RickHull: like some dump file in yaml or marshal format
[22:58:35] tvw: has joined #ruby
[22:59:13] RickHull: it's possible you were on the right track -- of needing to define the encode_with method (properly?) for classes / objects that are missing it
[22:59:44] nolakat: has joined #ruby
[22:59:47] RickHull: but... the whole enterprise smells of self-created problems in a very complicated approach to what seems outwardly simple
[23:00:13] Gadgetoid: has joined #ruby
[23:00:33] ruby[bot]: has joined #ruby
[23:00:33] ChanServ: +o ruby[bot]
[23:01:11] jenrzzz_: has joined #ruby
[23:03:37] orbyt_: has joined #ruby
[23:04:51] jphase: has joined #ruby
[23:05:09] eb0t: has joined #ruby
[23:05:25] thinkpad: has joined #ruby
[23:05:32] eb0t_: has joined #ruby
[23:08:16] nymous: has joined #ruby
[23:08:39] stephh: has joined #ruby
[23:08:41] nymous: hey folks, i need an advice
[23:08:59] elomatreb: One advice, coming right up
[23:09:08] banisterfiend: has joined #ruby
[23:09:15] nymous: what is the best way to run user code with mine dsl?
[23:09:28] nymous: i mean something like Rakefile
[23:10:24] milardov_: has joined #ruby
[23:10:31] RickHull: I don't quite follow...
[23:10:38] elomatreb: A common way is having the user require a module/class of your code in the user file, and having them write the DSL in a block
[23:10:44] jphase: has joined #ruby
[23:10:53] mim1k: has joined #ruby
[23:11:10] nymous: i'm writing a small gem for collecting system/app metrics (externel, non-ruby)
[23:11:35] nymous: it's a dsl with some execution code
[23:12:19] RickHull: can you give an example (use a paste site) of how it works currently, and/or how you would like it to work?
[23:12:34] nymous: https://github.com/divanikus/salus
[23:12:53] jenrzzz: has joined #ruby
[23:13:26] nymous: this is an example script https://gist.github.com/divanikus/5b511aee8d5700e8d7bf76d3060f2f28
[23:14:04] nymous: it fully works, but currently is included into module Salus with just load
[23:14:29] RickHull: for a standalone script, you would want something like require 'salus' at the top
[23:14:30] nymous: sorry, didn't wrote any docs yet
[23:15:00] nymous: i want a user to write something like that and just run it with my cli util
[23:15:05] elomatreb: RickHull: I think they want something like Rakefiles, where you don't have to do require "rake" either
[23:15:12] nymous: or write his own code requiring gem etc
[23:15:19] RickHull: you don't need to make it a gem
[23:15:47] elomatreb: I would look at how Rake does it, the naive way would just be to eval the file in an appropriate context but that seems fragile
[23:16:16] RickHull: ok, so salus is itself a gem. it can include a bin/salus that is like `rake`
[23:16:17] nymous: i'm already looking at rake's code, but it's way too complex for my project
[23:16:41] nymous: yeah, i'm currently writing that bin/salus
[23:17:22] nymous: btw, do you like the name? "health" is too stupid imo, other words doesn't come up for this task
[23:17:38] RickHull: easier than that is to just have: require 'salus' at the top, and execute with `ruby path/to/script.rb` is that really so awful?
[23:18:06] duderonomy: has joined #ruby
[23:18:14] RickHull: otherwise, I would guess elomatreb is right and you would have to eval the script contents
[23:19:09] nymous: i think it can be used both ways
[23:19:10] dinfuehr: has joined #ruby
[23:19:28] nymous: or you just include it in your script, or you use cli and tell it to run yours
[23:20:04] RickHull: i'm not a fan of .rb files which don't require what they use at the top
[23:20:38] Coldbla9: has joined #ruby
[23:20:40] RickHull: and I prefer ruby as the executable to bespoke runners
[23:20:52] RickHull: but I'm kind of grumpy like that ;)
[23:21:33] nymous: oh, if you mean gist, extension is just to say to github it's a ruby code
[23:21:40] jphase: has joined #ruby
[23:21:47] RickHull: it sure looks like ruby code ;)
[23:21:58] raynold: ahh it's a wonderful day
[23:22:15] RickHull: i think it's a negative win to put ruby code into a non-.rb file and omit the require statements and rely on a bespoke runner
[23:22:26] nymous: the motivation behind this gem is that i'm tired to rewrite code like this for every new check I need: https://github.com/vv-sm/Zabbix-Bind9-Statistics-Collection/blob/master/bind-stats.py
[23:22:29] RickHull: versus just putting the proper require statement and using `ruby` as the runner
[23:22:42] elomatreb: Skimming through the Rake sourcecode it seems it uses Kernel#load in a context where the DSL methods are defined
[23:22:49] nymous: notice the caching, args parsing etc
[23:22:58] raynold: llua is crap
[23:23:12] elomatreb: Mh, those nested ifs are a delight
[23:23:16] RickHull: raynold: who's asking?
[23:24:13] raynold: Lua the language is awesome
[23:24:49] _aeris_: hello #ruby
[23:25:07] elomatreb: nymous: https://github.com/ruby/rake/blob/32dcaa61cb63d9855d568779fe7e9c2f1c4d1cab/lib/rake/rake_module.rb#L29
[23:25:14] RickHull: nymous: I still suggest that your DSL will work fine with `require 'salus'` and using ruby as the runner
[23:25:17] baweaver: Someone's over the moon for Lua eh?
[23:25:27] _aeris_: small question : why with debian ruby, gem are search on 2.3.0/extensions/x86_64-linux/2.3.0, but rbenv looks for 2.3.0/extensions/x86_64-linux/2.3.0*-static* ?
[23:25:28] RickHull: is that a problem? you can make your own runner later if you really want to
[23:25:35] nymous: so, stupid way is just to load?
[23:25:47] elomatreb: In a context where the DSL methods are available, yes
[23:25:48] raynold: Llua the chatter is a troll
[23:26:13] elomatreb: nymous: From your code: `name, user, nice, csystem, idle, iowait, irq, softirq = l.split(/\s+/)` -- Oo
[23:26:30] nymous: RickHull: i just want to make some more magic for a user, like maintaining state files
[23:26:38] baweaver: raynold the chatter is a troll too, or do they have something Ruby to say?
[23:26:44] nymous: if his asking to though
[23:27:09] RickHull: nymous: i don't quite follow -- what format for your state files?
[23:27:17] raynold: Stop trolling baweaver
[23:27:17] nymous: elomatreb: it's just a quick example
[23:28:59] llua: raynold: if you disable that auto-message, i'll unban you.
[23:29:00] nymous: RickHull: well, you know, some metrics are just gauges, but others, like cpu jiffies in unix are counters. so if you have to calculate load % of a cpu, you have to know a value from previous run, and know how far in time it was. i my example that info is saved to a yaml
[23:29:45] raynold: What auto message?
[23:29:50] RickHull: my only point is that you don't need a custom runner to execute a DSL script, if you just put the require statement at the top
[23:30:03] llua: 'ahh it's a wonderful day'
[23:30:40] RickHull: i think it's a negative win to omit require statements
[23:31:02] nymous: you see, in that case this little bits of code would mandatory for a user
[23:31:27] nymous: *would be
[23:31:27] elomatreb: RickHull: I have to agree with nymous here, it sounds like a runner could be nice
[23:32:09] elomatreb: You could still have a shebang and the require in the files if you want to, since requiring an already required file does nothing
[23:32:10] RickHull: I don't disagree -- but I'm not sure what justifies the effort
[23:32:47] nymous: gem also supports running in a daemon mode, without any state files
[23:33:06] RickHull: is it so you can say `salus do_the_thing` like a rake task?
[23:33:16] RickHull: versus `ruby do.rb the_thing` ?
[23:33:16] baweaver: raynold: well you're more than welcome to talk about Ruby, but let's leave the attacks out of it
[23:33:19] shinnya: has joined #ruby
[23:33:24] RickHull: or `./do.rb the_thing`
[23:34:10] raynold: llua: that's not an auto message
[23:34:23] nymous: well, idk, i think i can implement several approaches, unfortunately i don't have time to try them all
[23:34:47] raynold: baweaver: you should follow your own advice and leave me out of it
[23:34:52] jphase: has joined #ruby
[23:35:06] RickHull: raynold: everything you have talked about so far is off topic
[23:35:15] nymous: if you can suggest a better way of implementing the thing, i don't mind to implement your approach
[23:36:17] raynold: RickHull: youre being selective. Im responding to baweaverv who's offtopic.
[23:36:23] RickHull: my approach is simply the standard default. write your script as an .rb file
[23:36:29] nymous: i have to separate 4 stages i have: loading previous state, collecting things, rendering (sending) things, saving current state
[23:36:30] RickHull: put the require 'salus' at the top
[23:36:41] RickHull: and execute it
[23:36:50] orbyt_: has joined #ruby
[23:37:01] ledestin: has joined #ruby
[23:37:13] nymous: i don't think that implementing first and last each time is a fun thing to do
[23:37:15] RickHull: your script itself can parse args if need be
[23:37:15] elomatreb: It's only a matter of interface, you decide which one you find more aesthetically pleasing. For perspective, the approach with the runner and no require is fairly common, I can think of e.g. Rakefiles, Gemfiles, Guardfile...
[23:37:57] RickHull: elomatreb: i think omitting the require does not justify the runner in these cases
[23:38:07] RickHull: e.g. `bundle` does tons of stuff
[23:38:10] nymous: yeah, i was thinking of a dir with bunch of *.salus or whatever
[23:38:30] DTZUZO: has joined #ruby
[23:38:40] elomatreb: RickHull: From the sound of it this project here does quite a bit as well
[23:39:32] RickHull: yep -- if that's the case, where the runner is already necessary, and it feels like a big win to omit a require statement, then sure, eval/load it :)
[23:39:34] nymous: one thing that also bothers me is that renderers code should be pretty reusable
[23:39:54] nymous: so writing it in each script would be annoying
[23:40:11] RickHull: i would put the common functionality in a lib -- so it's just a call from a script
[23:40:40] nymous: i can't write renderers for every system, it should be up to a user
[23:40:46] baweaver: raynold: So what have you done in Ruby lately?
[23:40:57] nymous: graphite, zabbix, collectd, whatever
[23:41:12] elomatreb: Another benefit of a runner binary is that you can probably package it for OS distribution more easily
[23:41:19] elomatreb: I.e. associate man pages and the like
[23:42:25] nymous: yeah, i really like things like fpm
[23:42:29] Technodrome: has joined #ruby
[23:42:52] jphase: has joined #ruby
[23:44:09] nymous: damn, i'm a little bit confused
[23:45:25] nolakat: has joined #ruby
[23:45:54] nymous: my first idea was a runner which is doing something like salus collect -f md_array
[23:46:25] nymous: optionally with trying something like Salusfile in the current directory
[23:46:43] jphase_: has joined #ruby
[23:47:19] nymous: you can put it in your crontab and you have a simple collector right away
[23:47:40] RickHull: eh, where does crontab find the current dir? that can get hairy
[23:48:10] nymous: but i'm actually confused where to put renderers code, as they should be pretty reusable between checks
[23:53:01] cdg: has joined #ruby
[23:55:15] minimalism: has joined #ruby
[23:55:50] jphase: has joined #ruby
[23:57:58] stephh: has joined #ruby
[23:59:12] KeyJoo: nymous: Andrey, do you have access to telegramm-chats? You are welcome to https://t.me/rubyschool (Russian community)
[23:59:54] nymous: yeah, i have telegram