« Back to channel list

#ruby - 04 June 2017

« Back 1 day Forward 1 day »
[00:03:07] GinoMan1423: has joined #ruby
[00:04:03] mochiyoda: has joined #ruby
[00:06:26] wnd: has joined #ruby
[00:06:45] forgot: has joined #ruby
[00:08:52] Rich_Morin: has joined #ruby
[00:15:49] nadir: has joined #ruby
[00:36:57] bkxd_: has joined #ruby
[00:49:51] jolamb: has joined #ruby
[00:57:10] _whitelogger: has joined #ruby
[01:02:04] N0ATN: has joined #ruby
[01:02:18] charliesome: has joined #ruby
[01:12:51] cjhowe7: has joined #ruby
[01:12:53] Bhootrk_: has joined #ruby
[01:21:30] moei: has joined #ruby
[01:28:09] belmoussaoui_: has joined #ruby
[01:30:12] bruce_lee: has joined #ruby
[01:36:56] d^sh: has joined #ruby
[01:38:34] kies: has joined #ruby
[01:39:21] JoshS: has joined #ruby
[01:39:42] N0ATN: has joined #ruby
[01:42:45] micahjam97: has joined #ruby
[01:45:07] Definity2: has joined #ruby
[01:45:54] micahjam97: hey so I was wondering. I was playing around with .methods, 2.methods for example returns an array of symbols of the names of methods you can use on 2. It got me thinking. Lets say you had an array of symbols with method names. is there a clear way of calling that method on that object using only variables to contain the name? The only way I can come up with is eval "object.#{method}"
[01:46:15] lupine: micahjam97: see `send`
[01:46:31] lupine: object.send(method)
[01:47:49] micahjam97: sweet. exactly what I was looking for. ruby has built in methods for everything
[01:49:11] N0ATN: has joined #ruby
[01:50:55] `tim`: has joined #ruby
[01:52:59] gizmore|2: has joined #ruby
[01:55:09] N0ATN: has joined #ruby
[02:00:34] N0ATN: has joined #ruby
[02:05:08] N0ATN-: has joined #ruby
[02:09:32] mathys: has joined #ruby
[02:14:56] Jameser: has joined #ruby
[02:15:42] Jameser: has joined #ruby
[02:20:24] genpaku: has joined #ruby
[02:26:05] N0ATN: has joined #ruby
[02:28:09] shinnya: has joined #ruby
[02:28:46] ignarps: has joined #ruby
[02:31:09] bmurt: has joined #ruby
[02:33:56] jackjackdripper: has joined #ruby
[02:38:32] N0ATN: has joined #ruby
[02:40:01] ecuanaso: has joined #ruby
[02:41:09] N0ATN-: has joined #ruby
[02:47:13] bkxd: has joined #ruby
[02:47:57] dasher00: has joined #ruby
[02:47:57] PatrikasZvaigzde: has joined #ruby
[02:48:25] enterprisey: has joined #ruby
[02:49:58] tristanp: has joined #ruby
[02:53:07] cb: has left #ruby: ()
[03:00:51] Alina-malina: has joined #ruby
[03:00:52] tristanp: has joined #ruby
[03:09:33] mathys: has joined #ruby
[03:10:55] skixlix: has joined #ruby
[03:13:29] roamingdog: has joined #ruby
[03:14:38] skixlix: is this channel for the programming language
[03:15:19] skixlix: nvm it is, but what is purpose of this channel? Can learners ask questions
[03:16:28] mesamoo: has joined #ruby
[03:18:01] charliesome: has joined #ruby
[03:18:31] armyriad: has joined #ruby
[03:19:51] skixlix: nvm again I read the rules I have my answer :)
[03:30:41] gix: has joined #ruby
[03:31:37] tristanp: has joined #ruby
[03:31:44] bkxd: has joined #ruby
[03:37:12] segmond: has joined #ruby
[03:40:14] quazimodo: has joined #ruby
[03:49:44] Bhootrk_: has joined #ruby
[03:56:17] chalkmonster: has joined #ruby
[04:04:47] haylon: has joined #ruby
[04:05:02] cjhowe7: has joined #ruby
[04:05:29] mesamoo: has joined #ruby
[04:11:31] mathys: has joined #ruby
[04:12:44] __Yiota: has joined #ruby
[04:14:00] bkxd: has joined #ruby
[04:21:43] charliesome: has joined #ruby
[04:25:26] rohitpaulk: has joined #ruby
[04:33:32] mtkd: has joined #ruby
[04:41:30] Antiarc: has joined #ruby
[04:44:06] iomotoko: has joined #ruby
[04:46:15] iomotoko: has joined #ruby
[04:47:23] skixlix: has joined #ruby
[04:49:19] Antiarc: has joined #ruby
[04:59:46] mtkd: has joined #ruby
[05:00:29] kristofferR: has joined #ruby
[05:10:57] symm-: has joined #ruby
[05:11:16] Jameser: has joined #ruby
[05:11:36] rohitpaulk: has joined #ruby
[05:18:41] Jameser: has joined #ruby
[05:20:28] mtkd: has joined #ruby
[05:23:33] mathys: has joined #ruby
[05:25:16] \tau: has joined #ruby
[05:26:56] david: has joined #ruby
[05:26:59] Jameser: has joined #ruby
[05:27:35] mathys: has joined #ruby
[05:33:07] Jameser: has joined #ruby
[05:33:54] herbmillerjr: has joined #ruby
[05:41:33] AnoHito: has joined #ruby
[05:47:47] ahrs: has joined #ruby
[05:51:10] _whitelogger: has joined #ruby
[05:52:20] belmoussaoui: has joined #ruby
[05:55:41] mtkd: has joined #ruby
[05:56:07] govg: has joined #ruby
[05:57:40] Derperperd: has joined #ruby
[06:06:43] AnoHito_: has joined #ruby
[06:08:38] `tim`: has joined #ruby
[06:10:37] armyriad: has joined #ruby
[06:12:16] AnoHito: has joined #ruby
[06:15:59] mtkd: has joined #ruby
[06:20:58] Alina-malina: has joined #ruby
[06:24:16] jgnagy: has joined #ruby
[06:31:55] taurgal: has joined #ruby
[06:33:57] cfec0b8d: has joined #ruby
[06:39:23] jusa: has joined #ruby
[06:39:44] mtkd: has joined #ruby
[06:44:53] Mia: has joined #ruby
[06:44:53] Mia: has joined #ruby
[06:51:05] quazimodo: has joined #ruby
[06:54:56] belmoussaoui__: has joined #ruby
[07:08:11] zipace: has joined #ruby
[07:18:05] ecuanaso: has joined #ruby
[07:18:11] _whitelogger: has joined #ruby
[07:23:20] rippa: has joined #ruby
[07:36:17] antgel: has joined #ruby
[07:47:51] CacoS: has joined #ruby
[07:50:13] morfin: has joined #ruby
[07:51:59] morfin: seems like OptionParser is capable to handle something ling --foo "bar" --foo="baz" etc?
[07:52:43] morfin: --foo "bar" --foo "barN" etc
[07:55:46] dkam: has joined #ruby
[07:56:28] Phanes: has joined #ruby
[07:56:37] Phanes: what is `yarn check` actually doing?
[07:57:57] havenwood: Phanes: JavaScript things. (This is #ruby :-P.)
[08:01:11] Bock: has joined #ruby
[08:01:23] _main_: has joined #ruby
[08:02:28] _main_: has joined #ruby
[08:03:40] Phanes: oh. good to know.
[08:04:03] KeyJoo: has joined #ruby
[08:04:08] govg: has joined #ruby
[08:04:26] _main_: has joined #ruby
[08:04:46] Bock: has joined #ruby
[08:06:05] havenwood: morfin: Yeah, you can do as many as you like. It's up to you do decide what to do with the values.
[08:06:09] nofxxxx: has joined #ruby
[08:06:40] havenwood: morfin: Try something like: foos = []; opt_parser = OptionParser.new { |opts| opts.on('-f', '--foo [FOO]') { |foo| foos << foo } }; opt_parser.parse(ARGV); p foos
[08:18:58] marr: has joined #ruby
[08:20:20] doublemalt__: has joined #ruby
[08:30:27] taurgal: has joined #ruby
[08:33:41] Farioko: has joined #ruby
[08:36:20] roshanavand: has joined #ruby
[08:37:47] laekur: has joined #ruby
[08:46:22] taurgal: has joined #ruby
[08:54:01] bkxd_: has joined #ruby
[08:54:44] Farioko: I'm trying to build a small rest API using sinatra and activerecord. The API is storing papers and they may contain several tags. How do I set up the relations?
[08:55:25] quazimodo: has joined #ruby
[09:02:42] bkxd: has joined #ruby
[09:02:45] lele: has joined #ruby
[09:08:51] quobo: has joined #ruby
[09:09:54] lxsameer: has joined #ruby
[09:14:09] rohitpaulk: has joined #ruby
[09:24:45] konsolebox_: has joined #ruby
[09:31:14] Psy-Q: has joined #ruby
[09:33:09] dkam: has joined #ruby
[09:33:24] fxa90id: has joined #ruby
[09:37:55] rohitpaulk: has joined #ruby
[09:39:56] fxa90id: has joined #ruby
[09:40:36] mikecmpbll: has joined #ruby
[09:46:05] MichaelBurge: has joined #ruby
[09:52:59] konsolebox: has joined #ruby
[09:55:58] ur5us: has joined #ruby
[10:03:19] rohitpaulk: has joined #ruby
[10:13:16] jane_booty_doe: has joined #ruby
[10:16:12] Sembei: has joined #ruby
[10:17:22] ddffg: has joined #ruby
[10:19:02] rohitpaulk: has joined #ruby
[10:21:43] bkxd: has joined #ruby
[10:23:09] tomphp: has joined #ruby
[10:23:19] govg: has joined #ruby
[10:26:43] bkxd: has joined #ruby
[10:27:43] jusa: has joined #ruby
[10:37:38] ShekharReddy: has joined #ruby
[10:42:13] morfin: Paper should has_an_belongs_to_many :tag?
[10:42:41] morfin: has_and_belongs_to_many :tag
[10:43:13] morfin: so one tag can have many papers and one paper can has many tags
[10:44:51] arquebus: has joined #ruby
[10:50:01] zenspider: havenwood/morfin iirc there's also a way to tell it that it is explicitly an array arg
[10:50:49] morfin: ah he left
[10:51:31] zenspider: morfin: that's fine. they'll be back.
[10:51:49] zenspider: morfin: ah... stating it is an array means you can do --foo 1,2,3
[10:52:18] zenspider: eg: parser.on("--list x,y,z", Array, "Example 'list' of arguments") do |list|
[10:52:28] zenspider: ri OptionParser and look for Array
[10:52:36] zenspider: ok... bed for me
[10:52:56] morfin: is parser capable to parse syntax with = and without = for short/long syntax?
[10:53:19] morfin: -u 1,33,5 or --users=1,33,5
[10:53:44] morfin: that's how args usually handled in many programs
[10:54:11] bast: has joined #ruby
[10:54:11] bast: has joined #ruby
[10:55:49] zenspider: morfin: please look at the doco. Try `ri OptionParser`
[11:05:57] pankaj: has joined #ruby
[11:07:54] cjhowe7: has joined #ruby
[11:08:02] meshsmith: has joined #ruby
[11:23:51] mitt3ns: has joined #ruby
[11:25:29] ecuanaso: has joined #ruby
[11:27:32] agent_white: has joined #ruby
[11:29:45] belmoussaoui__: has joined #ruby
[11:36:37] Jameser: has joined #ruby
[11:40:23] Jameser: has joined #ruby
[11:42:02] art-solopov: has joined #ruby
[11:46:27] cfec0b8d: has joined #ruby
[11:55:44] laekur: has joined #ruby
[11:57:46] jane_booty_doe: has joined #ruby
[12:00:26] jdawgaz: has joined #ruby
[12:07:35] im0nde: has joined #ruby
[12:07:40] quazimodo: has joined #ruby
[12:10:58] cadillac__: has joined #ruby
[12:11:52] ecuanaso: has joined #ruby
[12:12:54] leitz: has joined #ruby
[12:12:55] antgel: has joined #ruby
[12:15:20] laekur: has joined #ruby
[12:19:57] rohitpaulk: has joined #ruby
[12:20:09] Mon_Ouie: has joined #ruby
[12:22:46] MichaelBurge: has joined #ruby
[12:23:36] chalkmonster: has joined #ruby
[12:24:47] doublemalt_: has joined #ruby
[12:27:55] im0nde: has joined #ruby
[12:30:15] A124: has joined #ruby
[12:31:12] nanoz: has joined #ruby
[12:31:18] Fernando-Basso: has joined #ruby
[12:35:37] mikecmpbll: has joined #ruby
[12:41:37] mahlon: has joined #ruby
[12:41:52] devyn: has joined #ruby
[12:50:53] guardianx: has joined #ruby
[12:54:00] ikoma: has joined #ruby
[12:56:02] guardianxx: has joined #ruby
[12:58:23] bkxd: has joined #ruby
[12:58:47] konsolebox: has joined #ruby
[12:59:39] omab: has joined #ruby
[13:03:04] taurgal: has joined #ruby
[13:03:48] bkxd: has joined #ruby
[13:04:25] Robtop__: has joined #ruby
[13:05:01] guardianxx: has left #ruby: ()
[13:08:01] Alina-malina: has joined #ruby
[13:09:58] Alina-malina: has joined #ruby
[13:10:25] cdg: has joined #ruby
[13:12:15] amosbird: has joined #ruby
[13:12:36] amosbird: hello, how can I fix this bash script using ruby? echo '{"args":["$@"], "target_arg":"", "protocol_version":1}' | socat - UNIX-CONNECT:"${socket[0]}"
[13:12:48] amosbird: konsolebox: hi
[13:15:08] konsolebox: amosbird: this is my quick answer: ruby -e 'printf "{\"args\":[%s], \"target_arg\":\"\", \"protocol_version\":1}", ARGV.map{ |e| e.inspect }.join(", ")' -- "$@" | socat ...
[13:15:25] konsolebox: amosbird: but it can be done less hackily with JSON class
[13:15:46] amosbird: konsolebox: ok, do you mean it's better using jq?
[13:15:58] konsolebox: amosbird: no, JSON class of Ruby
[13:16:18] amosbird: konsolebox: well, this doesn't work
[13:17:40] konsolebox: amosbird: what's wrong with it?
[13:22:01] DoubleMalt: has joined #ruby
[13:23:17] DoubleMalt: has joined #ruby
[13:24:39] amosbird: konsolebox: well i'm not sure. The output seems fine
[13:25:11] amosbird: something went wrong when piping it to the socet
[13:25:14] konsolebox: amosbird: wait i'll give a JSON solution
[13:25:38] amosbird: i see what's wrong
[13:25:56] amosbird: there is a trilling return char
[13:28:31] konsolebox: amosbird: printf is not supposed to do that. it doesn't even to have a newline. i didn't add "\n", neither "\r"
[13:28:59] konsolebox: amosbird: this is the other less hacky solution: ruby -r json -e 'printf "{\"args\":%s, \"target_arg\":\"\", \"protocol_version\":1}", JSON.generate(ARGV)' -- "$@" | ...
[13:29:21] amosbird: https://la.wentropy.com/Vm0R.png
[13:29:47] konsolebox: # ruby -r json -e 'printf "{\"args\":%s, \"target_arg\":\"\", \"protocol_version\":1}", JSON.generate(ARGV)' -- "a b" c d
[13:30:09] konsolebox: ok nothing happens
[13:30:22] amosbird: well, this still generates the trailing char
[13:30:44] amosbird: this bash solution works fine :) https://la.wentropy.com/hXcK
[13:31:11] konsolebox: amosbird: what do you get with: `ruby -r json -e 'printf "{\"args\":%s, \"target_arg\":\"\", \"protocol_version\":1}", JSON.generate(ARGV)' -- "a b" c d | hexdump -C`?
[13:32:18] ncthom91: has joined #ruby
[13:32:40] konsolebox: amosbird: well maybe it's good enough
[13:33:13] konsolebox: amosbird: just don't use quotes or other characters that need backslash quoting
[13:34:37] chalkmonster: has joined #ruby
[13:35:51] im0nde: has joined #ruby
[13:36:30] amosbird: konsolebox: .....
[13:36:50] amosbird: the shell indicates that it misses a return at the end
[13:37:14] amosbird: this works : ruby -r json -e 'printf "{\"args\":%s, \"target_arg\":\"\", \"protocol_version\":1}\n", JSON.generate(ARGV)' -- "a b" c d
[13:37:29] konsolebox: good if it does. np
[13:37:55] amosbird: ok, so the ruby solution is better than bash one
[13:38:23] konsolebox: the ruby solution quotes characters properly
[13:40:03] guardianx: has joined #ruby
[13:40:04] acalycine: has joined #ruby
[13:40:26] acalycine: Is this the correct way to rescue this error? Error and code in this gist: https://gist.github.com/fd3b707353eb28f715625ec47bc47f1e
[13:44:11] guardianx: has joined #ruby
[13:47:22] gigetoo: has joined #ruby
[13:48:21] guardianx: has left #ruby: ()
[13:48:37] konsolebox: acalycine: if you're not confident about the class mentioned by the message, you can temporarily add another rescue after that rescue block (`Exception => e`) and have something like: puts "Thrown error's class was: #{e.class}, message was #{e.message}". optionally raise the exception back if you like. at least that's what i'd do.
[13:49:01] acalycine: But, surely the class is "OpenURI::HTTPError"?
[13:49:13] acalycine: It just doesn't seem to rescue when I try it
[13:50:09] vuoto: has joined #ruby
[13:50:25] acalycine: What do you mean raise back?
[13:51:33] konsolebox: acalycine: rescue Exception => ex; puts "Message here..."; raise ex; end
[13:51:56] konsolebox: acalycine: i'd prefer to raise back critical errors.
[13:52:00] konsolebox: or fatal ones
[13:52:01] elomatreb: Don't rescue Exception, it will block signals
[13:52:14] psychicist__: has joined #ruby
[13:52:29] acalycine: https://gist.github.com/57525322b04edc9e6c6aaccd39ad443a
[13:52:32] acalycine: That's what I have now.
[13:52:39] konsolebox: ^ and that's the reason why i'd rescue it back
[13:52:45] konsolebox: *one of the reasons
[13:52:54] elomatreb: Remove the end in line 5 for your second rescue to work
[13:53:00] amosbird: has left #ruby: ("WeeChat 1.8")
[13:53:11] acalycine: Why don't I need to end the begin block?
[13:53:34] elomatreb: You do, after all the rescues are done
[13:53:54] konsolebox: i thought that was just part of another block
[13:54:10] acalycine: I removed it, and still get the error.
[13:54:20] elomatreb: It *might* still work since Ruby has an implicit begin around most scopes, but still
[13:54:27] acalycine: I've ended both rescue blocks.
[13:55:37] konsolebox: acalycine: there's only one 'end' needed: begin ...; rescue E1 => ex; ...; rescue => E2 => ex2; ...; end
[13:55:51] nowhere_man: has joined #ruby
[13:56:24] bkutil: has joined #ruby
[13:57:22] acalycine: Somehow I don't get the error anymore. I was inducing the error by placing too many requests to this API thing, but now I don't get it at all, and the code runs normally!
[13:57:50] acalycine: I wouldn't have thought rescue would have been a work-around for rate-limiting, if it's working like that
[13:58:02] elomatreb: Still, your rescue seems to me like it should have worked
[13:58:10] acalycine: Hmm, I thought so.
[13:58:16] acalycine: Okay, I have another question.
[13:58:32] acalycine: I'm currently using "ruby -W0", but I want to put that in the script.
[13:58:41] acalycine: But using the $VERBOSE global variable doesn't seem to work.
[13:59:16] acalycine: `$VERBOSE = nil` should be the same as `-W0`, but it doesn't seem to work.
[14:01:08] elomatreb: Settings that only affects code after it, are your warnings being printed before you set it?
[14:01:54] acalycine: I'd say so. They're just weird warnings about EventManager that I don't want on the console.
[14:02:13] acalycine: But even setting the global variable *before* all my requirements doesn't work.
[14:02:29] elomatreb: I'm not sure how verbosity behaves wrt threading, and EventManager sounds like it may involve them
[14:02:55] acalycine: http://ruby-doc.org/core-2.4.0/doc/globals_rdoc.html
[14:02:59] acalycine: ` Setting this to nil disables warnings, including from Kernel#warn.`
[14:07:41] minimalism: has joined #ruby
[14:08:44] sepp2k: has joined #ruby
[14:11:10] acalycine: It should surpress it, elomatreb. `$VERBOSE = nil` is the same as `-W0`, so it should work.
[14:12:50] im0nde: has joined #ruby
[14:14:26] gil_: has joined #ruby
[14:14:26] gil_: has joined #ruby
[14:19:28] govg: has joined #ruby
[14:22:23] konsolebox: acalycine: consider creating a script that could reproduce the issue (i.e., something that still produces a warning or any unexpected message even when $VERBOSE is set to nil), and then submit it to github.com/ruby/ruby, or maybe in ruby's mailing list. don't forget to tell the version of ruby you're using.
[14:25:42] acalycine: perhaps i could just resolve the issue through fixing the errors given through the EventManager
[14:26:10] acalycine: Even though it's not the actual EventManager gem. I'm doing `require 'em/pure_ruby'`
[14:27:07] acalycine: And have just realised that I'm still getting the error.
[14:27:19] elomatreb: But -W0 works?
[14:27:37] acalycine: For the verbose issue, yes.
[14:27:42] acalycine: https://gist.github.com/c126d00ccfc7fe9910cdce2e9c802d8f
[14:27:46] acalycine: That's my full code.
[14:27:57] DLSteve: has joined #ruby
[14:29:37] ZacNoMore: has joined #ruby
[14:36:30] belmoussaoui__: has joined #ruby
[14:43:11] charliesome: has joined #ruby
[14:44:41] vuoto: has joined #ruby
[14:46:09] im0nde: has joined #ruby
[15:00:22] jgnagy: has joined #ruby
[15:01:43] cdg_: has joined #ruby
[15:02:28] SenpaiSilver: has joined #ruby
[15:17:59] djbkd: has joined #ruby
[15:19:32] immensus: has joined #ruby
[15:19:48] vuoto: has joined #ruby
[15:20:57] meshsmith: has joined #ruby
[15:21:16] immensus: has left #ruby: ()
[15:23:30] vuoto: has joined #ruby
[15:26:24] charliesome: has joined #ruby
[15:28:21] mathys: what is the best application server per ruby?
[15:28:36] codelurker: has joined #ruby
[15:31:44] im0nde: has joined #ruby
[15:31:54] rohitpaulk: has joined #ruby
[15:38:10] charliesome: has joined #ruby
[15:39:44] morfin: i have no idea why hash can has strings and symbols but it always confusing me :(
[15:40:11] oleo: has joined #ruby
[15:43:48] ecuanaso: has joined #ruby
[15:46:53] konsolebox: mathys: declaring one would be subjective. but take a look at rails or sinatra.
[15:46:56] GodFather: has joined #ruby
[15:47:27] mathys: passenger could be a good application server?
[15:48:29] GodFather: has joined #ruby
[15:49:56] spastorino: has joined #ruby
[15:51:32] konsolebox: i haven't heard of that yet
[15:56:44] jgnagy: has joined #ruby
[16:02:25] cjhowe7: has joined #ruby
[16:04:54] brent__: has joined #ruby
[16:06:53] im0nde: has joined #ruby
[16:09:33] qsx: has left #ruby: ("WeeChat 1.7.1")
[16:13:55] belmoussaoui__: has joined #ruby
[16:20:36] im0nde: has joined #ruby
[16:21:28] stormbytes: has joined #ruby
[16:21:51] kobain: has joined #ruby
[16:28:21] LastWhisper____: has joined #ruby
[16:28:42] quobo: has joined #ruby
[16:31:02] bkutil: mathys: 'best' => 'it depends' :) You can try passenger, unicorn or puma - all of them are fine. Nate Berkopec discusses the servers in https://www.speedshop.co/2015/07/29/scaling-ruby-apps-to-1000-rpm.html (Connecting to your server section), from performance/robustness perspective, but he also describes the architecture nicely.
[16:32:17] mathys: I'm getting 500 error when load the url but the static content work fine, what could be the issue?
[16:33:17] ecuanaso: has joined #ruby
[16:34:25] ddffg: has joined #ruby
[16:47:06] tomphp: has joined #ruby
[16:48:49] dviola: has joined #ruby
[16:50:47] Mia: has joined #ruby
[16:50:48] Mia: has joined #ruby
[16:54:16] havenwood: mathys: Puma is the default. Use that until you have a reason to move off the default.
[16:58:03] LightStalker: has joined #ruby
[17:00:50] dar123: has joined #ruby
[17:00:53] t-recx: has joined #ruby
[17:02:25] tomphp_: has joined #ruby
[17:05:30] ledestin: has joined #ruby
[17:14:37] marr: has joined #ruby
[17:20:02] crazycoolzac: has joined #ruby
[17:21:08] morfin: puma use Event Machine and ActionCable use that
[17:21:26] morfin: since whole server is event-drive
[17:22:10] morfin: woops that's only about Rails, but i guess it's possible to implement similar thing with Sinatra/whatever
[17:22:52] dionysus69: has joined #ruby
[17:23:44] morfin: always keep doing same mistake
[17:23:54] morfin: :items and "items" :\
[17:24:48] morfin: i guess i need use HashWithIndifferentAccess
[17:25:01] brent__: has joined #ruby
[17:25:36] raumzeit: has joined #ruby
[17:25:55] cczac1: has joined #ruby
[17:27:20] rt: has joined #ruby
[17:31:35] havenwood: morfin: Puma doesn't use EventMachine. Are you thinking of Thin?
[17:33:00] havenwood: morfin: ActionCable doesn't use EventMachine either. It did in an early prototype.
[17:33:24] A124: has joined #ruby
[17:34:25] havenwood: morfin: ActionCable uses nio4r: https://github.com/rails/rails/blob/master/actioncable/actioncable.gemspec#L23
[17:36:19] havenwood: morfin: Puma has its own reactor: https://github.com/puma/puma/blob/master/lib/puma/reactor.rb
[17:39:35] enterprisey: has joined #ruby
[17:41:05] morfin: sorry Thin use it
[17:41:17] morfin: but Puma is still event-driven
[17:41:53] havenwood: morfin: Puma uses forking for workers, threads for threads and its own evented reactor.
[17:41:59] morfin: that's some attempt to create thing similar to JAVA nio?
[17:42:26] havenwood: morfin: kgio is more that. nio4r is rather simple but has good bindings to kqueue and epoll from what i recall.
[17:43:01] havenwood: https://github.com/socketry/nio4r
[17:43:52] havenwood: ah, right, and then java nio wrapper as well.
[17:44:03] havenwood: and a pure ruby fallback.
[17:44:11] morfin: i guess with JRuby you can use native NIO
[17:44:13] pazzaz: has joined #ruby
[17:44:38] havenwood: jruby is a first-class citizen with nio4r
[17:46:36] pazzaz: Does anyone here know why ruby-doc is down?
[17:47:01] havenwood: pazzaz: nope
[17:48:43] havenwood: pazzaz: you might want to ping james@neurogami.com
[17:48:56] morfin: and JRuby use SnakeYAML for yaml?
[17:49:10] havenwood: pazzaz: he's in this channel sometimes, i don't know the nick
[17:49:35] havenwood: pazzaz: or #haskell
[17:49:42] morfin: which is capable to handle aliases when even C++ implementations aren't even when they're 1.2 :(
[17:49:58] DLSteve: has joined #ruby
[17:54:12] meshsmith: has joined #ruby
[17:55:14] haylon: has joined #ruby
[17:55:41] Cohedrin: has joined #ruby
[17:57:22] opencw: has joined #ruby
[17:58:28] nadir: has joined #ruby
[18:11:14] sagax: has joined #ruby
[18:14:54] chalkmonster: has joined #ruby
[18:15:28] mtkd: has joined #ruby
[18:16:38] diego1: has joined #ruby
[18:18:14] cyphase: has joined #ruby
[18:18:29] workmad3: has joined #ruby
[18:18:40] BSaboia: has joined #ruby
[18:19:59] ecuanaso: has joined #ruby
[18:22:17] KeyJoo: has joined #ruby
[18:28:54] synstack: ruby is nice
[18:30:14] _sfiguser: has joined #ruby
[18:34:40] dviola: has joined #ruby
[18:34:58] yeticry: has joined #ruby
[18:45:00] CacoS: has joined #ruby
[18:48:00] jgnagy: has joined #ruby
[18:49:56] morfin: well, i like Ruby much more than PHP :)
[18:51:11] cerulean: i like ruby and php both, but i usually dont mess with php anymore
[18:52:36] nofxxxx: cerulean, I like my $ with numbers after, thank you
[18:54:09] cerulean: not saying to use php, i only go back for when people need like drupal or something
[18:54:24] cerulean: and then i only install and dont edit
[18:54:37] cerulean: php variable syntax is retarded
[18:59:14] patarr: has joined #ruby
[19:01:22] taurgal: has joined #ruby
[19:08:52] morfin: sometimes i dream about no not cheese :) just about being able to avoid some PHP projects i have to support
[19:09:04] morfin: *not about cheese
[19:09:11] KatyJones: has joined #ruby
[19:09:39] morfin: but i still forget about hashes keys differences :(
[19:24:06] sagax: [04.06.17 21:28:54] <synstack> ruby is nice
[19:24:18] jgt2: has joined #ruby
[19:25:16] KatyJones: Can anyone advise how I can DRY this code up? https://pastebin.com/vxCXdxR1
[19:25:18] ruby[bot]: KatyJones: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/b591c64dcfc7c52f0a9fb473f5dda506
[19:25:18] ruby[bot]: KatyJones: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[19:26:36] morfin: pastebin is garbage
[19:26:37] ljarvis: KatyJones: move the constants to a shared level
[19:28:44] morfin: sleep 1.second hangs up my Ruby
[19:29:42] morfin: why that can happen? If i ctrl+c it says that execution has been interrupted in sleep
[19:30:13] sepp2k: has joined #ruby
[19:31:29] Jayson_Virissimo: has joined #ruby
[19:32:58] KatyJones: ljarvis: Do you mean like this? https://gist.github.com/anonymous/7d5c6be9b1e5569bbf5ce1d6cc615038
[19:33:30] ljarvis: KatyJones: sure, that works
[19:34:28] ljarvis: I would probably have a top class Request and have subclasses that override options myself, though
[19:34:50] tomphp: has joined #ruby
[19:35:23] morfin: i think i should trottle my speed only when API reports that i send requests too quickly
[19:35:49] KatyJones: Hmm that's an interesting idea
[19:36:21] havenwood: morfin: 1.second is a Rails ActiveSupport::Duration. It should work with Kernel#sleep.
[19:36:37] morfin: i use activesupport )
[19:36:55] morfin: but sometimes i get hangup in sleep which is weird
[19:37:16] havenwood: morfin: If for some reason it's not working you might try explicitly turning it into an Integer, like: sleep 1.minute.to_i
[19:37:28] tomphp_: has joined #ruby
[19:37:32] havenwood: morfin: 1.minute.to_i #=> 60
[19:37:59] havenwood: morfin: or create your own throttling that respects the API limits
[19:38:13] morfin: i think i should throttle
[19:38:34] morfin: because e.code == 6 => too many requests => need sleep a bit and repeat
[19:39:01] havenwood: morfin: or, don't request too many
[19:39:13] havenwood: morfin: throttle yourself to respect the API limits rather than backing off when they 420 error you
[19:39:30] havenwood: assuming the API rate limits are known
[19:39:34] havenwood: they usually publish them
[19:40:20] shinnya: has joined #ruby
[19:40:41] KatyJones: Does it make sense for a base class to call methods that only belong in the subclass? https://gist.github.com/anonymous/e3b6b97b42818abcd585b74f14224962
[19:41:44] jusa: has joined #ruby
[19:41:50] ljarvis: KatyJones: yes, you could also define options on the base class with some defaults, and do `super.merge(timeout: 15)` or something
[19:41:53] ljarvis: there's many ways
[19:42:31] morfin: worst part that sleep 1 hangs up too
[19:42:50] ljarvis: morfin: is sleep being overridden?
[19:43:37] KatyJones: Thanks ljarvis
[19:44:24] czerasz: has joined #ruby
[19:45:37] DarrinStephens: has joined #ruby
[19:46:23] morfin: hmm idk i use ruby-vk which use Faraday
[19:46:47] phenix: has joined #ruby
[19:47:35] konsolebox: has joined #ruby
[19:47:36] texasmynsted: has joined #ruby
[19:47:56] texasmynsted: Where is the ruby online docs?
[19:48:01] tomphp: has joined #ruby
[19:48:03] texasmynsted: I thought is was here —-> http://ruby-doc.org/
[19:48:11] texasmynsted: but that site is down or does not exist
[19:48:25] ljarvis: texasmynsted: it is there, it's just down right now
[19:48:40] texasmynsted: It there a way to install those docs locally?
[19:48:57] morfin: DarrinStephens
[19:51:15] blackwind_123: has joined #ruby
[19:53:26] fxa: has joined #ruby
[19:54:27] havenwood: texasmynsted: Yes. How'd you install Ruby?
[19:55:13] havenwood: texasmynsted: You can find stdlib docs here: https://docs.ruby-lang.org/en/2.4.0/
[19:55:38] havenwood: texasmynsted: https://www.jstorimer.com/blogs/workingwithcode/7766081-5-reasons-you-should-use-ri-to-read-ruby-documentation
[19:55:53] morfin: seems like my issue not with sleeping
[19:56:11] morfin: except maybe i sleep not much =)
[19:56:24] havenwood: texasmynsted: gem install rdoc-data && rdoc-data --install
[19:56:33] morfin: it seems to be an issue with implementation of API
[19:57:01] havenwood: texasmynsted: Or say if you're using RVM: rvm docs generate
[19:57:20] havenwood: texasmynsted: Check if you already have ri setup: ri Array
[19:59:01] havenwood: texasmynsted: Or there are ruby-docs packages. Anyhow, you probably already have the docs installed or it's not hard to install them.
[19:59:02] havenwood: It depends on how you installed Ruby whether you already have them or need to add them.
[19:59:40] morfin: eventually i will install Ruby in Msys2 )
[19:59:55] pen: has joined #ruby
[20:09:21] User458764: has joined #ruby
[20:20:36] matthewd: has joined #ruby
[20:21:12] czerasz2: has joined #ruby
[20:24:24] dcunit3d: has joined #ruby
[20:28:37] bpmedley: has joined #ruby
[20:29:37] _sfiguser: has joined #ruby
[20:31:28] pen: has joined #ruby
[20:35:54] Asher: has joined #ruby
[20:35:59] herbmillerjr: has joined #ruby
[20:38:38] matthewd: has joined #ruby
[20:39:09] morfin60: has joined #ruby
[20:40:04] pelegreno_____: has joined #ruby
[20:40:28] Antiarc1: has joined #ruby
[20:40:30] nyuszika7h_: has joined #ruby
[20:40:39] rikai_: has joined #ruby
[20:41:28] abort_: has joined #ruby
[20:43:13] diegok: has joined #ruby
[20:44:57] ij-: has joined #ruby
[20:44:57] synstack_: has joined #ruby
[20:44:58] synstack_: has joined #ruby
[20:45:00] Kilobyte22: has joined #ruby
[20:45:06] nchamber-: has joined #ruby
[20:45:08] benjen-: has joined #ruby
[20:45:16] nfsnobody: has joined #ruby
[20:45:18] RealMarc: has joined #ruby
[20:45:35] `derpy: has joined #ruby
[20:47:12] spiette: has joined #ruby
[20:47:23] sspreitz: has joined #ruby
[20:47:33] rrichardsr3: has joined #ruby
[20:47:37] rann: has joined #ruby
[20:47:37] dgs: has joined #ruby
[20:47:37] mnem: has joined #ruby
[20:47:37] ledestin: has joined #ruby
[20:47:37] iomotoko: has joined #ruby
[20:47:37] cstrahan: has joined #ruby
[20:47:37] lipoqil: has joined #ruby
[20:47:37] Tony-St4rk: has joined #ruby
[20:47:37] bcavileer: has joined #ruby
[20:47:37] mrsolo: has joined #ruby
[20:47:37] gmcintire: has joined #ruby
[20:47:38] seanh: has joined #ruby
[20:47:38] Majost: has joined #ruby
[20:47:38] dman[m]: has joined #ruby
[20:47:38] intermo[m]: has joined #ruby
[20:47:38] johnson[m]: has joined #ruby
[20:47:38] M107262[m]: has joined #ruby
[20:47:38] bascht: has joined #ruby
[20:47:38] Guest37310: has joined #ruby
[20:47:38] dunk: has joined #ruby
[20:47:38] andersh: has joined #ruby
[20:47:38] jimeh: has joined #ruby
[20:47:38] ewilliam__: has joined #ruby
[20:47:38] mattwc: has joined #ruby
[20:47:38] avdi: has joined #ruby
[20:47:38] Heero__: has joined #ruby
[20:47:38] pmarreck: has joined #ruby
[20:47:38] troter__________: has joined #ruby
[20:47:51] cerulean: has left #ruby: ()
[20:48:11] petems: has joined #ruby
[20:48:14] Qommand0r: has joined #ruby
[20:48:41] NightMonkey: has joined #ruby
[20:49:09] hsiktas: has joined #ruby
[20:49:13] nebben: has joined #ruby
[20:49:39] deimos: has joined #ruby
[20:49:57] pizzaops: has joined #ruby
[20:49:59] Meow-J: has joined #ruby
[20:50:08] rfv: has joined #ruby
[20:50:23] bauruine: has joined #ruby
[20:50:44] tpendragon: has joined #ruby
[20:50:47] zeroDivisible: has joined #ruby
[20:50:56] tekk: has joined #ruby
[20:51:11] mkaito: has joined #ruby
[20:51:13] Vircung: has joined #ruby
[20:51:16] ytti: has joined #ruby
[20:51:20] jinie: has joined #ruby
[20:51:22] Psy-Q: has joined #ruby
[20:53:27] xikuukawaii: has joined #ruby
[20:53:39] ij: has joined #ruby
[20:53:45] ij: has left #ruby: ("WeeChat 1.7.1")
[20:53:45] xikuukawaii: How do I iterate a loop once every x minutes?
[20:53:58] spectra: has joined #ruby
[20:55:27] xikuukawaii: Nvm just found sleep
[20:55:49] stormbytes: has joined #ruby
[20:56:20] pen: has joined #ruby
[20:57:11] dasher00: has joined #ruby
[20:59:02] herbmillerjr: has joined #ruby
[21:05:40] Tagami[m]: has joined #ruby
[21:14:18] nicolai86: has joined #ruby
[21:15:39] matthewd: has joined #ruby
[21:17:51] herbmillerjr: has joined #ruby
[21:22:02] kp666[m]: has joined #ruby
[21:22:03] johnson[m]: has joined #ruby
[21:22:03] jonjits[m]: has joined #ruby
[21:22:03] bascht: has joined #ruby
[21:22:03] M107262[m]: has joined #ruby
[21:22:03] daveyboi[m]: has joined #ruby
[21:22:03] intermo[m]: has joined #ruby
[21:22:03] thulsa_legume[m]: has joined #ruby
[21:22:03] heftig: has joined #ruby
[21:22:04] torarne: has joined #ruby
[21:22:04] jakebriggs[m]: has joined #ruby
[21:22:04] dman[m]: has joined #ruby
[21:22:04] turt2live: has joined #ruby
[21:22:04] Giphy[m]: has joined #ruby
[21:22:04] aviraldg: has joined #ruby
[21:22:04] voltai[m]: has joined #ruby
[21:22:04] ecuanaso: has joined #ruby
[21:22:05] KevinMGranger: has joined #ruby
[21:22:10] velu_aon[m]: has joined #ruby
[21:22:10] testnick[m]: has joined #ruby
[21:22:12] el_ocho[m]: has joined #ruby
[21:27:48] nicolai86: has joined #ruby
[21:31:40] nicolai86: has joined #ruby
[21:33:31] nowhere_man: has joined #ruby
[21:36:25] cfec0b8d: has joined #ruby
[21:36:38] nicolai86: has joined #ruby
[21:45:08] saltsa: has joined #ruby
[21:47:09] yorickpeterse: konsolebox: regarding #append being silly, I think it's silly because basically every language out there already uses "push", and "push" itself should be clear enough
[21:49:33] im0nde: has joined #ruby
[21:51:52] GodFather: has joined #ruby
[21:52:14] apeiros: ACTION doesn't like the alias-itis ruby has
[21:52:21] apeiros: it makes code actually less readable
[21:53:03] apeiros: why? because it means unless you have a perfect memory of all aliases, you have to look up whether there's subtle differences…
[21:54:03] nicolai86: has joined #ruby
[21:55:56] brent__: has joined #ruby
[21:56:20] meshsmith: has joined #ruby
[21:57:03] nicolai86: has joined #ruby
[21:58:36] nertzy: has joined #ruby
[22:00:31] ruby[bot]: has joined #ruby
[22:00:31] ChanServ: +o ruby[bot]
[22:01:30] jusa: has joined #ruby
[22:06:44] nicolai86: has joined #ruby
[22:08:07] nertzy: has joined #ruby
[22:15:00] im0nde: has joined #ruby
[22:15:31] jpterry_: has joined #ruby
[22:22:14] Bock: has joined #ruby
[22:23:30] chouhoul_: has joined #ruby
[22:27:16] djbkd: has joined #ruby
[22:29:24] myk267: has joined #ruby
[22:34:04] myk267: has joined #ruby
[22:35:10] nofxxxx: the coolest thing in 2.5 is reversed backtrace error... that's something that really saves time
[22:35:15] nofxxxx: not to mention mental sanity
[22:35:57] nofxxxx: 'reversed' in relation to old way... it's actually the correct way imho (only thing that was done correctly in python and not in ruby btw)
[22:36:02] PaulCapestany: has joined #ruby
[22:37:01] ahrs: has joined #ruby
[22:37:22] nofxxxx: apeiros, the fun with aliases is that some will be the 'prefered' lint thing way hehe... so goes like "yeah, you could write that way, but please don't"
[22:39:16] herbmillerjr: has joined #ruby
[22:39:26] PaulCape_: has joined #ruby
[22:40:07] ecuanaso: has joined #ruby
[22:49:41] jgnagy: has joined #ruby
[22:51:57] alveric1: has joined #ruby
[22:55:06] jgt2: has joined #ruby
[22:55:42] herbmillerjr: has joined #ruby
[22:56:21] elcontrastador: has joined #ruby
[22:58:02] PaulCapestany: has joined #ruby
[23:00:31] jpterry: has joined #ruby
[23:04:10] PaulCape_: has joined #ruby
[23:09:30] PatrikasZvaigzde: has joined #ruby
[23:16:12] PaulCapestany: has joined #ruby
[23:30:30] |ifei5g00d: has joined #ruby
[23:38:03] quazimodo: has joined #ruby
[23:41:11] MichaelBurge: has joined #ruby
[23:44:29] ecuanaso: has joined #ruby
[23:45:44] ineb: has joined #ruby
[23:46:25] zenspider: need help understanding this oddity: https://gist.github.com/801d9cef0f71a257e7266b8570d93f58
[23:47:04] zenspider: basically, if I try to make this purely declarative (extend is INSIDE), then it doesn't work
[23:47:13] zenspider: I can't see why tho
[23:48:04] zenspider: SHIT. derp. precedence of do/end vs {}...
[23:48:48] apeiros: oh, nice spotting
[23:49:11] apeiros: so `extend Module.new do` is the culprit
[23:49:35] apeiros: ACTION still thinks methods should raise when not taking a block
[23:51:02] im0nde: has joined #ruby
[23:51:19] manveru: is there any release of 2.5 yet?
[23:51:19] manveru: i thought it's christmas
[23:51:47] manveru: i guess https://bugs.ruby-lang.org/versions/34 is the status
[23:52:26] DLSteve: has joined #ruby
[23:53:25] ledestin: has joined #ruby
[23:55:19] lupine: has joined #ruby
[23:55:26] alveric1: has joined #ruby
[23:56:03] darix: manveru: if they keep the cycle then christmas yes
[23:56:31] havenwood: manveru: It's not Christmas yet. But you can use the nightly 'till then.
[23:56:53] havenwood: manveru: https://cache.ruby-lang.org/pub/ruby/snapshot.tar.gz
[23:56:58] apeiros: but when will it be ruby 3? the "3 times faster ruby"?
[23:58:17] nesoi: has joined #ruby
[23:59:18] stee_3_: has joined #ruby
[23:59:26] ytti_: has joined #ruby
[23:59:28] nesoi: I am trying to get a ruby program which was running on Windows with ruby version 1.9.2 working on os x. What's the minimal way to do that? My ruby version comes up as: ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]. The current activerecord won't install, saying it needs 2.2 or greater