#ruby - 13 May 2019
« Back 1 day Forward 1 day »
[00:00:50] phaul: one is for lexical nesting of modules diregarding any relation of objects the other is all about relating objects disregarding layout of code.
[00:02:51] phaul: module A ; module B; end ; end. means A and B has no relation to each other whasoever apart from B is lexically layed out in the code of A
[00:12:11] al2o3-cr: &>> module A module B module C Module.nesting end end end # xco your probably looking for this
[09:13:49] NL3limin4t0r: Is there an easy way to get the source location of the (first) definition of a class at runtime? For methods there is `method(:some_method).source_location`. I'm looking for the same thing but for the class itself.
[09:44:54] mhlei: hello everyone, my i ask the ref in `self.formats = request.formats.map(&:ref).compact ` is a user-defined method?
[09:46:09] mhlei: the value of the request.formats is [#<Mime::Type:0x0000000004e3a090 @hash=-4433183059252532333, @string="text/html", @symbol=:html, @synonyms=["application/xhtml+xml"]>]
[09:55:41] rubydoc: stderr: -e:2:in `<main>': uninitialized constant Mine (NameError) (https://carc.in/#/r/6wtv)
[10:03:24] mhlei: i know it now. the ref is the instance method of the `request.formats`, not in current namespace, so I can not found the require statement in current namespaces.
[13:48:54] syndikate: Is there any equivalent way of doing this in ruby? Elixir snippet: Enum.reduce(a_map, &process(&1, &2)), essentially I want to be able to pass a method into enum_with_index.map(&:process_all) where it would automatically pass the two arguments into process_all
[13:54:48] syndikate: I believe it is not possible to get that syntax in ruby, but I just wanted to be sure.
[13:57:14] phaul: " where it would automatically pass the two arguments " - map doesn't want to pass 2 arguments, it wants to pass 1. Do you mean inject/reduce ?
[13:57:14] ellcs: sorry, i want to be able to deploy on debian(old) and debian(new), to keep it simple. i am bound to system-libs and those differ on old and new.
[14:27:28] NL3limin4t0r: ellcs: I normaly use RVM. When using system-libs I'd check the newest versions avaible on debian(old), lock the gems on that version and on debian(new) install that specific version of the lib.
[14:30:04] NL3limin4t0r: If I'm not mistaken you can specify a version in apt using `apt install your-lib -v 1.2.3`
[14:33:32] NL3limin4t0r: syndikate: Alternatively if you want to reduce using an operator with two inputs you can provide a symbol.
[15:25:00] havenwood: ellcs: The Gemfile is just a Ruby file, so you can use normal Ruby logic with case or if statements.
[17:32:34] syndikate: NL3limin4t0r, phaul Thanks! I was using (&:custom_method) which was causing error, instead I had to use (&custom_method)
[18:47:20] rubydoc: stderr: -e:2:in `<main>': undefined local variable or method `lol' for main:Object (NameError) (https://carc.in/#/r/6wwa)
[19:18:40] IGnorAND: I'm trying to cut a gem and created another class. I however now get a message uninitialized constant Gemname::Gemname::ClassICreated
[19:19:52] IGnorAND: much better keywords than ruby gem cutting class which gives me lectures on how to cut stones