#ruby - 12 July 2018
« Back 1 day Forward 1 day »
[00:31:53] hays_: any major differences in MRI implementation for Linux vs. Mac/Windows that might underlie an issue I am having where a script using celluloid would only crash in Linux?
[00:32:54] hays_: kind of a vague question i know, but im a bit at a loss why i only seem to experience problems on linux
[00:33:39] hays_: script running on powerful, underutilized server--crash and burn. Run it on a Windows laptop, no problems
[00:35:08] g-: you have a stack trace? did you notice the 9 celluloid issues on github that contain 'crash'?
[00:39:07] hays_: g-: I do, and I am working that angle also--probably some unhandled exception. but I still find it puzzling that this only happens on linux machine
[00:49:15] hays_: one day i will have the time to actually track down this bug and fix it, but I was just hoping there might be some major differences in platform that could give me a hint
[01:04:30] troplex: Hello everyone, I have a question regarding attributes and instance variables. Anyone can help?
[01:35:56] zugzug: Hey folks, I'm trying to figure out why Open.capture2e('ruby', <some-file>, stdin_data: ...) behaves differently from Open.capture2e(<some-file>, stdin_data: ...). Would appreciate if someone could look at the gist here: https://gist.github.com/zug-zug/2f2e81f4963333542a90ced87595f5bc
[02:05:57] g-: hays_: is it open source? i can try it on a local Debian tomorrow if you're still stuck.
[02:17:20] hays_: g- unfortunately not really--plus it would not be fair to ask you to do my work for me, but I appreciate the offer
[02:35:40] zugzug: g-: FYI I confirmed that the gist is accessible *without* logging into github: https://gist.github.com/zug-zug/2f2e81f4963333542a90ced87595f5bc
[02:38:52] evdubs_: hi - is there a common way in ruby to make sure that debug log lines are effectively a no-op when logging is at a more severe level (like error)? i think the java way to do this would be to make the log level a static final variable and the JIT can see that and optimize log level checks out along with the debug log lines themselves
[02:42:46] zugzug: g-: interesting ... what output do you get? (and what version of Ruby? I'm on 2.3.6p384)
[02:43:50] elomatreb: evdubs_: You can write a log method that runs a block, and based on the log level decides not to run the block
[02:43:54] g-: evdubs_: https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html seems to say your logger level controls this, 2nd paragraph
[02:44:33] g-: zugzug: "> foo\n> bar\n> ! foo\n! bar\n", ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-linux]
[02:44:45] elomatreb: That just controls printing though, if you do `Log.debug expensive_method_call` it will still run the method even if it won't print the output
[02:46:08] elomatreb: Oh, logger actually supports the technique I mentioned: https://ruby-doc.org/stdlib-2.4.0/libdoc/logger/rdoc/Logger.html#class-Logger-label-How+to+log+a+message
[02:46:50] elomatreb: It won't do as much optimization as in Java, but it'll still save you the method call
[02:52:00] zugzug: g-: thanks for the sanity check; I'm on macosx and just checked on Linux - I get the same results you do on Linux
[04:15:59] memo1: hi, i have a git repository with a ruby script. I need to replicate this scripts to many machines, but the varibles inside the scripts depends on every machine. How i integrate environments varibles with ruby and git?
[04:29:06] elomatreb: memo1: You can access the environment variables with the ENV global (e.g. `ENV["HOME"]`)
[04:47:54] havenwood: memo1: There are gems like dotenv, or you can just create a shim that exports vars before running Ruby, etc.
[06:17:00] havenwood: memo1: Rails has gone to encrypted credentials with a single master key to decrypt them.
[06:26:30] havenwood: memo1: Here's my take on it: https://gist.github.com/havenwood/396aadc6f222f52f2f2c7d8d8cbe82c2
[11:14:52] SunnyLumens: looks like it assigns lefthand to msg but im not sure and i want to know how to properly name this feature
[11:25:17] konsolebox: SunnyLumens: a block is basically treated like a method. the "yielder" internally calls the block. in your example, `each` is the "yielder", and it calls the block method in a loop, with the "msg" passed as an argument to it.
[11:28:25] SunnyLumens: my example construction confuses me as im new to erb style and dont get where are block boundaries
[11:55:39] konsolebox: i don't get to really like languages that are compulsive at using spaces over explicit symbols
[12:38:37] chainz: according to google, Senior Ruby Developer Salary. A Senior Ruby Developer earns an average salary of $101,736 per year.
[12:44:34] chainz: but either there aren't many ruby devs around here or no one wants to work for this company :)
[13:00:49] za1b1tsu: anybody using vim with ruby? when using K on a keyword it outputs weird stuff. Anybody messed with K, keywordprg do get some proper documentation?
[13:19:39] za1b1tsu: Anyway I can get documentation using pry, but not inside the interactive shell?
[13:21:54] za1b1tsu: when using ri inside a rails project, for example ri String, it looks for classes inside the project. Anyway I could force it to show Ruby documentation in general?
[16:29:53] loincloth: graphql-client... graphql-ruby-client... graphlient... or something else idk??? anybody feel passionate about graphql clients :P
[16:30:41] baweaver: In the Bay Area a Senior Ruby dev could probably pull 150-180 base plus options.
[16:33:36] baweaver: Also if you're using any JS, this is a nasty issue: https://github.com/eslint/eslint-scope/issues/39
[16:56:45] gizmore: havenwood: https://github.com/gizmore/GDO-Register/blob/master/lib/GDO/Register/GDO_SignupIP.rb (comments welcome, also from others)
[21:24:10] leitz: Trying to find a way to put an ever growing list into "executables" without listing every one.
[21:27:42] leitz: So there's no module method. So far Dir.glob("*") tries to get everything in the base gem dir, and adding "bin/*" doesn't work either.
[21:29:45] leitz: Not using "bin/" means it tries to get everything from the gem base directory, like this: "bin/lib"
[21:30:35] leitz: Supper calls, back in a bit. I appreciate the help, my first gem that I'm trying to push up to rubygems.
[21:34:18] leitz: This is what I'm working on: https://github.com/makhidkarun/ftl_tools/blob/master/ftl_tools.gemspec#L8
[22:42:08] leitz: Oh, that's funny. Can't push a gem as I'm using a too far ahead version of Rubygems...
[23:39:54] Alec: elomatreb: I've been talking to (if I may namedrop this, hopefully he wont mind) BanisterFeind, I read the ruby book he recommended - it had almost nothing on blocks and like most programming language books covered like loops, ifs ect, in C++ there's this great site, cppreference.org that gives you *references*
[23:41:06] Alec: Does Ruby have a thing like that? Like I don't want examples (I've fucking love "theory of computation" - which covers grammars and the like, it's borderline a fetish, it's weird and a little bit creepy) - I really want a reference not an example that leads one way later followed by "now check this out"
[23:41:43] Alec: Like return and non-local returns, at first I was like "okay cool" and then came non-local returns and the model I'd build up of it was destroyed.
[23:41:55] elomatreb: Not sure, sorry. There are some other books linked in the topic, but I don't know if they check that box
[23:42:31] Alec: How about eBNF (or "RailRoad diagrams" ect) of Ruby's grammar and how it is evaluated? (I'll check the source yeah yeah, but maybe someone already has!)
[23:43:30] Alec: If this stuff interests you I'd love to talk about it, but as no one has asked me a question and I'm easily on my third paragraph I wont :P
[23:44:39] Alec: In C++ we have geordi, you can PM geordi or join #geordi to fuck about and get an example right without cluttering main chat. ...
[23:59:16] Alec: mikecmpb_: is it possible to make ruby[bot] accept PMs with >> and run them? Or if not, can I make my own RubyBot for "personal use" - I've been told about the website, but I'm a command line guy with screen...