#ruby - 20 May 2019
« Back 1 day Forward 1 day »
[01:05:00] marz_d`ghostman: In rails, instead of defining a global variable under initializers/, is there a different mechanism perhaps a constant that I can do so I can initialize once and use it anywhere?
[03:43:15] johnp: i used to like it more than iptables until i started trying to do split tunneling wtih it, now i hate it
[09:19:24] fub: Hi. I need to update some jekyll project of a friend. After installing everything with "bundle install", a "buzndle exec jekyll serve" fails because "Could not find commonmarker-0.17.13 in any of the sources".
[09:19:50] fub: However, I can see in the bundle install output that "Installing commonmarker 0.17.13 with native extensions" is executed.
[09:34:53] ytti: all methods are idempotent which do only has local state and receive arguments which they do not modify and return value
[09:35:14] ytti: it's not a language feature, in that no language forbids idempotent functions and methods
[09:40:27] ytti: that is broad question, broader than i have time to answer in meaningful way other than you need to have sufficient competency as developer
[09:40:43] ShalokShalom: since I figured out that functions in Elm look exactly like Methods in Ruby, just without def and end
[09:41:05] ytti: the original answer sets the constrains you have to test cognitively if it meets those constrains
[09:41:24] ytti: perhaps you could write static analyser which enforces and checks, unsure if that is possible
[09:42:06] ytti: people who put value in this type of things usually choose pure functional langauges
[09:43:40] ytti: aya, if you are comfortable with ocaml probably everything else will feel inelegant
[16:03:04] Net: Is there a stdlib method that will get a value from a hash by key, or, if not value exists, will set the value using a block then return it?
[16:14:16] phaul: although it's different from ||= I think on falsey values. but I think fetch is correct and ||= is a bug.
[16:16:38] phaul: unless this is what you want, Net . note the key :a was in the hash and we still updated it with ||=
[17:26:46] dretnx: Which is best async library for ruby and how performs in comparision with node.js?
[17:33:39] havenwood: dretnx: Node.js was based in part on EventMachine, a Ruby library, iir. The author of Node was a Rubyist.
[17:34:34] havenwood: dretnx: These days, check out the Socketry libraries: https://github.com/socketry
[17:35:57] havenwood: dretnx: See Falcon for an example of putting these primitives together into a web server: https://github.com/socketry/falcon
[17:36:17] havenwood: dretnx: We could probably give you better answers if you say more about the perspective you're looking from. Are you doing IO? Computation?
[17:37:07] dretnx: havenwood: I'm considering switching from node.js to async ruby, because i'm bored with node
[17:39:33] havenwood: dretnx: Here's a recent talk about the state of async in Rubyland: https://youtu.be/qKQcUDEo-ZI
[20:18:05] happyhans: What's that one website that categorizes ruby gems and also displays their health (last maintained, usage, bug count, etc...)?
[20:20:01] ytti: picking up kotlin (no java experience) and really most work seems to be figuring out what are the 'de facto' libraries i should be using
[20:20:31] ytti: but java has so many competing libraries, no obvious winner and most of them not touched in years
[20:28:52] havenwood: happyhans: Steep is already open source, if you want to look at an alternative: https://github.com/soutaro/steep
[20:29:32] havenwood: happyhans: Ruby 3 should have a standard .rbi format so you can use either of these tools, or others.