« Back to channel list

#ruby - 21 May 2019

« Back 1 day Forward 1 day »
[00:00:36] phaul: "bar" and "baz" are strings. :bar and :baz are symbols
[00:00:42] phaul: different dta types for keys
[00:01:08] phaul: as far as accessing is concerend, the above two are the same
[00:01:51] phaul: meaning the hash doesn't care what data type it sees, it just works with it
[00:02:03] phaul: +- mri optimizations
[00:02:57] pengin: why would you use one over the other? is there a best practice there?
[00:03:18] SeepingN: I think using symbols saves space
[00:03:34] SeepingN: it doesn't actually ahve to store a string name you give it
[00:04:16] SeepingN: http://rubylearning.com/satishtalim/ruby_symbols.html
[00:04:36] SeepingN: read the gray box ;)
[00:04:55] phaul: One caveat with symbols (which fit this purpose of being hash keys 99.9% of the time) is that they are never freed. So don't do it in a long lived process that allocated keys dynamically
[00:05:00] pengin: will do, thanks for the link
[00:06:19] havenwood: phaul: but these days dynamically created symbols are freed!
[00:07:00] phaul: really, I didn't know. thank havenwood TIL
[00:07:39] havenwood: phaul: they didn't used to be, but Ruby 2.2 added Symbol GC after a nasty Rails DOS: https://bugs.ruby-lang.org/issues/9634
[00:08:04] pengin: is there a best practice around using symbols vs strings as hash keys for instance?
[00:08:09] phaul: ah. thanks for the info havenwood
[00:09:27] havenwood: pengin: Symbols make the most elegant Hash keys.
[00:11:14] skryking: has joined #ruby
[00:11:39] bikes: has joined #ruby
[00:13:14] SeepingN: yeah: use sysmbols. done. ;)
[00:13:58] SeepingN: I believe there are calls that can "convert" text into symbols in case you're bulding one of those dynamic lists based on input
[00:18:34] christiandsg: has joined #ruby
[00:23:52] djellemah: has joined #ruby
[00:32:29] bikes: has joined #ruby
[00:35:34] rafadc: has joined #ruby
[00:41:42] Swyper: has joined #ruby
[00:42:18] tf2ftw: has joined #ruby
[00:42:23] iNs: has joined #ruby
[00:46:09] Swyper: has joined #ruby
[00:50:57] orbyt_: has joined #ruby
[00:56:14] Wolland: has joined #ruby
[01:02:38] lambdapanda: has joined #ruby
[01:05:04] lambdapanda: hi! where can I learn about the current adoption status of ruby in the industry? I'm curious because I don't see a lot of job postings that require ruby knowledge
[01:06:17] Wolland: It really depends on the area/state
[01:06:27] lambdapanda: oh interesting
[01:06:33] lambdapanda: didn't know location was a factor
[01:06:46] Swyper: has joined #ruby
[01:07:19] Wolland: Absolutely
[01:07:42] Wolland: Check west coast vs Midwest job postings.
[01:08:37] Wolland: My area seem to be all .net and MS based platforms. Because of Boeing, Citi group, Etc.
[01:09:06] Wolland: Also not that many startups.
[01:09:07] lambdapanda: I haven't really been following ruby but I get the feeling it had a bigger following a few years ago. has it been dwindling down due to js frameworks?
[01:09:43] Wolland: I am not sure.
[01:10:09] Swyper: has joined #ruby
[01:10:23] Wolland: It’s an environment with a constant change, new things pop up and vanish
[01:11:11] lambdapanda: I've been drawn to Ruby due to the Destroy All Software screencasts
[01:11:13] Wolland: You can check github activity on Ruby and other projects. That should be some sort of an indication
[01:11:32] Wolland: Ruby is pleasant.
[01:11:55] lambdapanda: yeah it looks like so much fun to code with it
[01:12:12] Wolland: If that’s what does it for you 😏
[01:12:30] fphilipe: has joined #ruby
[01:13:05] lambdapanda: are there any similar screencasts to learn from?
[01:13:29] Wolland: It’s been a while. I am a bit out of the loop.
[01:13:55] Wolland: There are definitely plenty of resources, depending on your learning style.
[01:14:12] lambdapanda: I liked the Destroy All Software screencasts because they go beyond the basics
[01:14:18] lambdapanda: and they're practical
[01:14:24] lambdapanda: but yeah I'll keep looking
[01:14:32] Wolland: I used to like Railscasts but I think he stopped making them long ago?
[01:14:51] lambdapanda: sadly Destroy All Software doesnt seem to be active either
[01:15:09] lambdapanda: oh well I'll keep searching
[01:15:22] Wolland: Good luck LP
[01:21:41] spacesuitdiver: has joined #ruby
[01:26:47] Kestrel-029: has joined #ruby
[01:31:46] Swyper: has joined #ruby
[01:33:19] Swyper: has joined #ruby
[01:35:18] Renich: has joined #ruby
[01:36:56] duderonomy: has joined #ruby
[01:38:23] Swyper: has joined #ruby
[01:38:33] rafadc: has joined #ruby
[01:40:59] octos: has joined #ruby
[01:41:41] Nicmavr: has joined #ruby
[01:43:31] Swyper: has joined #ruby
[01:44:25] haxx0r: has joined #ruby
[01:46:48] Puffball_: has joined #ruby
[02:10:39] christiandsg: has joined #ruby
[02:11:26] Renich: has joined #ruby
[02:18:41] cropcircle: has joined #ruby
[02:34:12] esrse: has joined #ruby
[02:38:11] esp32_prog: has joined #ruby
[02:40:25] obzidian: has joined #ruby
[02:42:58] fphilipe: has joined #ruby
[02:54:32] tdy: has joined #ruby
[02:58:41] obzidian: has joined #ruby
[03:11:25] braincrash: has joined #ruby
[03:11:58] IGnorAND: I have a Class Room which has a certain amount of beds. I want to keep track when beds get added/removed. Do I make a Table room with column name and a Table BedTransactions with bed:references count:integer?
[03:32:36] cliluw: has joined #ruby
[03:44:13] jenrzzz: has joined #ruby
[03:47:03] graft: has joined #ruby
[03:47:03] graft: has joined #ruby
[04:04:08] zeamp: has joined #ruby
[04:13:12] fphilipe: has joined #ruby
[04:25:23] luminousnine: has joined #ruby
[04:25:23] luminousnine: has joined #ruby
[04:30:02] xfbs: has joined #ruby
[04:35:05] meinside: has joined #ruby
[04:37:42] spacesuitdiver: has joined #ruby
[04:41:47] Kestrel-029: has joined #ruby
[04:41:58] doodlebug: has joined #ruby
[04:44:53] Cyrus: has joined #ruby
[04:45:25] christiandsg: has joined #ruby
[04:48:50] sagax: has joined #ruby
[04:51:19] Puffball_: has left #ruby: ()
[05:00:56] ricekrispie: has joined #ruby
[05:03:20] christiandsg: has joined #ruby
[05:03:49] kyrylo: has joined #ruby
[05:06:10] Nebros: has joined #ruby
[05:14:05] vondruch: has joined #ruby
[05:17:14] Nebros: has joined #ruby
[05:17:30] Azure: has joined #ruby
[05:20:52] conta: has joined #ruby
[05:21:11] christiandsg: has joined #ruby
[05:21:54] christiandsg: has joined #ruby
[05:22:44] christiandsg: has joined #ruby
[05:23:11] CrazyEddy: has joined #ruby
[05:23:29] christiandsg: has joined #ruby
[05:24:15] christiandsg: has joined #ruby
[05:25:26] fphilipe: has joined #ruby
[05:32:06] dhollinger: has joined #ruby
[05:33:04] christiandsg: has joined #ruby
[05:33:50] christiandsg: has joined #ruby
[05:34:39] christiandsg: has joined #ruby
[05:35:24] christiandsg: has joined #ruby
[05:35:29] syndikate: has joined #ruby
[05:44:32] jenrzzz: has joined #ruby
[05:44:48] obzidian: has left #ruby: ()
[05:46:49] Nebros: has left #ruby: ()
[05:48:06] kapilp: has joined #ruby
[05:53:40] thunderbirdtr: has joined #ruby
[05:57:13] syndikate_: has joined #ruby
[06:03:11] sauvin: has joined #ruby
[06:07:25] DTZUZO: has joined #ruby
[06:18:44] dionysus69: has joined #ruby
[06:23:35] lypsis: has joined #ruby
[06:39:21] blackmesa1: has joined #ruby
[06:40:37] hightower2: has joined #ruby
[06:44:51] blackmesa1: has joined #ruby
[06:45:34] andikr: has joined #ruby
[06:45:53] slackmare: has joined #ruby
[06:46:35] lxsameer: has joined #ruby
[06:50:45] TomyWork: has joined #ruby
[06:52:38] xcesariox: has joined #ruby
[06:54:43] slackmare: any good tutorial to start developing in ruby?
[06:57:11] BH23: has joined #ruby
[06:58:57] balo: slackmare: https://www.ruby-lang.org/en/documentation/quickstart/ is a good place i think
[06:59:14] balo: you can mess with it here without installing anything https://ruby.github.io/TryRuby/
[06:59:39] slackmare: thanks balo !!!
[07:01:14] blackmesa1: has joined #ruby
[07:10:36] ua_: has joined #ruby
[07:11:44] leimh: has left #ruby: ("Leaving")
[07:14:08] fphilipe: has joined #ruby
[07:19:48] aupadhye: has joined #ruby
[07:26:46] Nicmavr: has joined #ruby
[07:29:09] xco: has joined #ruby
[07:29:59] christiandsg: has joined #ruby
[07:35:45] TomyWork: has joined #ruby
[07:44:45] deepredsky: has joined #ruby
[07:45:10] esp32_prog: has joined #ruby
[07:47:00] jenrzzz: has joined #ruby
[07:50:07] Paraxial: has joined #ruby
[07:58:07] blackmesa1: has joined #ruby
[07:59:32] clemens3: has joined #ruby
[08:00:40] teclator: has joined #ruby
[08:03:13] deepredsky: has joined #ruby
[08:04:50] Nebros: has joined #ruby
[08:15:10] jenrzzz: has joined #ruby
[08:20:45] marz_d`ghostman: has joined #ruby
[08:21:12] marz_d`ghostman: Is there some sort of abstract class in Ruby like the one I'm trying to implement: https://gist.github.com/marzdgzmn/b0891dbb77722e46ec99ea9b1e37a9af
[08:21:17] marz_d`ghostman: Is it a good practice though?
[08:32:31] jhass: marz_d`ghostman: in Ruby we tend to prefer modules for these kind of cases
[08:36:11] _whitelogger: has joined #ruby
[08:43:44] marz_d`ghostman: jhass: I see, so I'll have the module inheret the first class then use it as a Mixin?
[08:47:01] ur5us: has joined #ruby
[08:50:11] yqt: has joined #ruby
[08:58:25] tjj: has joined #ruby
[09:00:41] jhass: marz_d`ghostman: you cannot have a module inherit a class, only include other modules. You'd have your descendants inherit Podio::Item directly and include the module
[09:01:32] tjr_: has joined #ruby
[09:02:15] marz_d`ghostman: jhass: Hmmm. I was meaning to inherit podio::item's methods but also PodioAbstractItem's.
[09:02:59] jhass: yes that's what I understood
[09:03:32] jhass: if Podio::Item is your class, maybe it could be a module too
[09:04:43] BH23: has joined #ruby
[09:05:02] tjj: has joined #ruby
[09:07:50] deepredsky: has joined #ruby
[09:14:00] marz_d`ghostman: jhass: It'a gem my app is dependent on. Makes it tricky to test since my class depends on it
[09:14:04] ellcs: has joined #ruby
[09:14:45] ctxt: has joined #ruby
[09:15:13] marz_d`ghostman: I can't see an isolated way to test PodioAbstractItem's fetch_all_items method given it class Podio::Item's method. Hmmm, maybe mock/stub Podio and expect that it is invoked.
[09:18:37] jhass: well I suspected your example is just that, because it seems rather pointless tbh
[09:19:43] jhass: stubbing external dependencies is right, but when that ends up the test just verifying a particular implementation rather than any behavior I just skip those tests
[09:22:45] teclator: has joined #ruby
[09:25:17] banisterfiend: has joined #ruby
[09:25:31] tjj: has joined #ruby
[09:26:46] Nicmavr: has joined #ruby
[09:29:36] tjr_: has joined #ruby
[09:32:13] m_antis: has joined #ruby
[09:33:57] GodFather: has joined #ruby
[09:43:56] ur5us: has joined #ruby
[09:45:28] esp32_pr1g: has joined #ruby
[09:47:50] hightower3: has joined #ruby
[09:55:22] _axx: has joined #ruby
[09:55:28] esp32_prog: has joined #ruby
[09:59:54] NL3limin4t0r: has joined #ruby
[10:00:28] esp32_prog: has joined #ruby
[10:17:34] AJA4350: has joined #ruby
[10:21:57] BH23: has joined #ruby
[10:26:36] conta: has joined #ruby
[10:29:58] Jonopoly: has joined #ruby
[10:41:46] Nicmavr: has joined #ruby
[10:44:52] Swyper: has joined #ruby
[10:51:27] blackmesa1: has joined #ruby
[10:53:02] jenrzzz: has joined #ruby
[10:54:31] Swyper: has joined #ruby
[10:56:37] aither: has joined #ruby
[10:56:47] Kestrel-029: has joined #ruby
[11:01:24] kyrylo: has joined #ruby
[11:10:58] mozzarella: has joined #ruby
[11:13:43] livcd: has joined #ruby
[11:15:11] Tempesta: has joined #ruby
[11:15:56] yokel: has joined #ruby
[11:19:19] moei: has joined #ruby
[11:31:41] BH23: has joined #ruby
[11:42:24] blackmesa1: has joined #ruby
[11:52:14] spacesuitdiver: has joined #ruby
[12:06:54] octos: has joined #ruby
[12:07:08] Ai9zO5AP: has joined #ruby
[12:07:38] octos: has joined #ruby
[12:08:55] Ai9zO5AP: has joined #ruby
[12:11:18] lxsameer: has joined #ruby
[12:21:35] conta: has joined #ruby
[12:22:42] doodlebug: has joined #ruby
[12:24:42] cow[moo]: has joined #ruby
[12:28:21] xco: has joined #ruby
[12:28:42] xco: i’m getting this error with RVM and ruby 2.6.2 https://github.com/rvm/rvm/issues/3318
[12:28:43] doodlebug: has joined #ruby
[12:28:54] xco: any one got an idea how to fix this LDFLAGS thing?
[12:30:21] dionysus69: has joined #ruby
[12:33:49] Fischmiep: has joined #ruby
[12:39:10] apparition: has joined #ruby
[12:41:36] xco: has joined #ruby
[12:41:51] Nicmavr: has joined #ruby
[12:54:27] Jonopoly: has joined #ruby
[13:09:57] Tempesta_: has joined #ruby
[13:11:47] Kestrel-029: has joined #ruby
[13:13:12] Tempesta_: has left #ruby: ()
[13:13:24] Tempesta: has joined #ruby
[13:14:21] cd: has joined #ruby
[13:21:02] Fusl: has joined #ruby
[13:24:31] wildermind: has joined #ruby
[13:30:41] jenrzzz: has joined #ruby
[13:31:48] depesz: hi. i have a class, which contains method "print". how can I call normal, kernel, print, from within this print?
[13:31:54] depesz: i'd rather not change name of my method
[13:33:16] phaul: Kernel.print
[13:33:53] depesz: ah, thanks. obvious now :)
[13:41:44] ryouba: has joined #ruby
[13:42:30] ryouba: is there a way to access a module's submodule's method from within one of the module's methods without exposing it to a class including that module? (https://gist.github.com/sixtyfive/50b71960530bb7fa25ec984eef46e82d hopefully makes it clear what I want)
[13:46:39] phaul: dont include MyHelper in MyModule. remove privateness on the helpermethod but make it module_function or class side method. Call it by explicitly calling it on the module. : MyHelper.helpermethod
[13:48:05] phaul: this way things that explicitly qualifiy helpermethod with Myhelper. can use it. You can make MyHelper a private constant so it's not visible ooutside of MyModule
[13:48:45] ryouba: module_function is COOL!
[13:48:57] ryouba: thank you phaul :D
[13:51:07] phaul: &ri private_constant, for making MyHelper private in MyModule
[13:51:08] rubydoc: https://ruby-doc.org/core-2.6/Module.html#method-i-private_constant, for making MyHelper private in MyModule
[13:53:27] doodleb49: has joined #ruby
[13:58:52] helpa: has joined #ruby
[13:58:52] m27frogy_: has joined #ruby
[13:58:55] darkphnx4805: has joined #ruby
[13:58:55] bvdw: has joined #ruby
[13:58:59] Some-body_: has joined #ruby
[14:01:23] helpa: has joined #ruby
[14:01:29] asio_: has joined #ruby
[14:01:42] helpa: has joined #ruby
[14:01:45] Prira_: has joined #ruby
[14:01:59] r3m_: has joined #ruby
[14:02:15] mnem: has joined #ruby
[14:02:19] leftylin1: has joined #ruby
[14:02:45] canton7_: has joined #ruby
[14:04:33] Jello_Raptor_: has joined #ruby
[14:04:42] djdduty_: has joined #ruby
[14:04:55] kaleido_: has joined #ruby
[14:05:14] j416_: has joined #ruby
[14:05:27] Ekho-: has joined #ruby
[14:05:31] arthurnn_: has joined #ruby
[14:05:31] aspiers_: has joined #ruby
[14:06:26] cca: has joined #ruby
[14:06:55] xlued: has joined #ruby
[14:07:04] zululee_: has joined #ruby
[14:07:34] facest: has joined #ruby
[14:07:52] SanguineAnomaly: has joined #ruby
[14:08:04] Rapture: has joined #ruby
[14:08:18] cca: Hello, I'm new to ruby. Is there a way to display all the available methods of an object for example a test table =[1, 2] test.methods does not display anything to me
[14:09:28] cgfbee: has joined #ruby
[14:09:29] phaul: &>> table = [1, 2] ; table.methods
[14:09:33] rubydoc_: # => [:to_h, :include?, :at, :fetch, :last, :union, :difference, :push, :append, :pop, :shift, :unshift,... check link for more (https://carc.in/#/r/6yc3)
[14:10:04] irdr: has joined #ruby
[14:12:30] phaul: I'm not sure what test is in your code, probably a method?
[14:12:37] go|dfish: has joined #ruby
[14:12:39] lxsameer: has joined #ruby
[14:12:41] cadeskywalker: has joined #ruby
[14:12:42] nOwz: has joined #ruby
[14:12:55] ellcs: has joined #ruby
[14:12:58] sauvin: has joined #ruby
[14:13:01] mclee: has joined #ruby
[14:13:02] cca: @phaul I use ruby 2.5.5.5 I think that's why it doesn't work.
[14:13:04] ryouba: has joined #ruby
[14:13:20] ua_: has joined #ruby
[14:13:28] roger_rabbit: has joined #ruby
[14:13:29] depesz: has joined #ruby
[14:13:32] phaul: I don't think so. what's test in your code? and why do you have it there? why not just table =
[14:13:44] foxxx0: has joined #ruby
[14:13:48] Cyrus: has joined #ruby
[14:15:09] i1nfusion: has joined #ruby
[14:15:46] cca: #phaul Okay, it works. Thank you.
[14:16:20] jeremycw: has joined #ruby
[14:18:37] rubydoc: has joined #ruby
[14:18:40] ryouba: phaul: seems i got disconnected. did you answer that last message?
[14:19:05] phaul: ryouba: I did not see the last message :)
[14:19:25] ryouba: "phaul: i was just trying to prevent shooting-myself-in-the-foot in a few weeks, so i'm happy. but out of curiosity: https://gist.github.com/sixtyfive/50b71960530bb7fa25ec984eef46e82d"
[14:21:58] i1nfusion: has joined #ruby
[14:22:54] phaul: hm. I don't know how to fix that. private_constant only prevents you from using MyModule::Myhelper, but if MyHelper is already in sight due to the include MyModule then it's not hidden
[14:23:41] phaul: but you have to be explicit at least about including it in MyClass, so it's not that bad
[14:23:51] varesa_: has joined #ruby
[14:24:31] phaul: private_constant is a not that old invention, originally ruby wasn't designed with private modules / private classes in mind
[14:24:32] spacesuitdiver: has joined #ruby
[14:25:52] phaul: although it becomes a bit phylosophical because everything is always callable via send anyways
[14:26:02] brool: has joined #ruby
[14:26:30] ryouba: well, you either get loads of power or you get loads of protection, but you don't really get both at the same time. seems greater than just programming.
[14:26:59] ryouba: s/greater/larger/ ... sorry, not a native speaker
[14:27:16] havenwood: ryouba: privateness is usually focused on the public interface of instances, and you can get at neither the private method nor private constant directly - so that's working well
[14:27:38] havenwood: myobj.helpermethod #!> NoMethodError: private method `helpermethod'
[14:28:35] ryouba: phaul: i tried using MyModule.modmethod in the class, since you pointed that out, but to no avail. where does my thinking go wrong here?
[14:29:04] ryouba: as in, instead of "include MyModule"
[14:29:41] yasumi2136: has joined #ruby
[14:30:03] phaul: well, including and using class side methods on the module are different , they are not interchangable
[14:30:22] phaul: although module_function adds support for both
[14:31:12] tf2ftw: has joined #ruby
[14:31:13] phaul: havenwood: I was surprised that private_constants leak out to things that include the module that defined them.
[14:31:18] ryouba: ah, so you didn't mean to imply that it would be possible to use the Module method on the Class without include'ing it first
[14:31:28] havenwood: ryouba: Do you want `myobj.modmethod` to work?
[14:31:43] havenwood: phaul: yeah, isn't that a it bizarre. it's like module_function behavior.
[14:31:49] ryouba: havenwood: no, i was just playing around with the new toys that phaul suggested and was getting confused.
[14:32:14] havenwood: ryouba: module_function would make #modmethod only available inside of the including class, but not expose it as a public method
[14:32:30] doodlebug: has joined #ruby
[14:33:05] havenwood: ryouba: compare when you do or don't put a module_function in MyModule. Right now #modmethod is exposed publicly on the including class instance.
[14:34:11] havenwood: myobj.class::MyHelper #!> NameError: private constant MyModule::MyHelper referenced # phaul
[14:34:45] havenwood: phaul: i didn't know about that quirk either
[14:34:57] ryouba: havenwood: phaul: i'll keep https://gist.github.com/sixtyfive/c0ff35bb1a8b439e02fcde4778ce55ab around as this is cool stuff :)
[14:35:38] havenwood: ryouba: MyClass::MyHelper # fails (good)
[14:36:15] ryouba: havenwood: after line 18, you mean?
[14:36:38] havenwood: ryouba: I mean like 26 or 30
[14:36:47] havenwood: ryouba: the private constant isn't visible from outside the class
[14:36:58] ryouba: ah, right!
[14:38:20] ryouba: it's not like total privacy but it *is* like nice folding screens in the room
[14:46:10] ryouba: slightly inconsistent that you can't say `private_constant MySubModule` like you can say `module_function blah`. and interesting that it's module_*function* instead of module_*method*.
[14:47:22] phaul: ryouba: it's function as in "functionality". Meaning a bunch of methods defined on the instance side and on the class side of the module. Not function as in functional programming.
[14:47:45] phaul: &ri module_function
[14:47:45] rubydoc: https://ruby-doc.org/core-2.6/Module.html#method-i-module_function
[14:48:01] doodleb69: has joined #ruby
[14:48:24] phaul: although the docs there also mix the terms so idk
[14:48:50] morozovm: has joined #ruby
[14:50:26] phaul: anyways it defines multiple methods
[14:51:59] ryouba: yes, that part (that it defines multiple methods) is quite consistent
[14:52:20] phaul: except it also calls methods function
[14:55:59] m17: has joined #ruby
[14:56:54] phaul: idk. maybe it refers to the pair of defined methods as the "function" as a single entity.
[15:01:53] Nebros: i have installed opal and tryed with opal --compile pathfinder.rb > pathfinder.js to create my needed js. it was clear that i get an error no file found... where can i give the path to the file or where do i have to put in this file? :)
[15:02:55] cthulchu_: has joined #ruby
[15:03:23] Jonopoly: So i'm doing automation with ruby
[15:03:32] doodlebug: has joined #ruby
[15:03:34] Jonopoly: And need to avoid sleep as much as possible
[15:04:07] Jonopoly: I'm using Ruby and Selenium is it possible to wrap something in a try/catch
[15:04:14] Jonopoly: like Try: $wait.until { $driver.find_element(:xpath => "//span[@class='searchCode']") }
[15:04:35] Jonopoly: Wait 1 second then try again (if fails 3 times then print Failed x times"
[15:05:16] Dbugger: has joined #ruby
[15:22:54] catbusters: has joined #ruby
[15:22:57] blackmesa1: has joined #ruby
[15:25:03] orbyt_: has joined #ruby
[15:26:40] jhass: Jonopoly: you might want to take a look at capybara which provides such primitives (wait for condition with timeout)
[15:29:58] Cthulu201: has joined #ruby
[15:39:49] kapilp: has joined #ruby
[15:40:58] NL3limin4t0r: ryouba: The only reason `module_function def blah` works is because defining a method returns a symbol of that method and `module_function` accepts a symbol or string.
[15:41:11] NL3limin4t0r: &>> def foo; end
[15:41:12] rubydoc: # => :foo (https://carc.in/#/r/6ycb)
[15:41:47] Nicmavr: has joined #ruby
[15:42:08] NL3limin4t0r: While defining a module or class the last statement of the block is returned. Not a symbol of the module or class.
[15:42:15] brool: &> puts 'how do i use bot'
[15:42:16] rubydoc: parser error at position 0 around `>'
[15:42:39] NL3limin4t0r: &>> module Foo; end
[15:42:39] rubydoc: # => nil (https://carc.in/#/r/6ycc)
[15:42:46] phaul: brool: https://github.com/phaul/yarr
[15:42:50] NL3limin4t0r: &>> module Foo; def bar; end end
[15:42:51] rubydoc: # => :bar (https://carc.in/#/r/6ycd)
[15:43:36] graft: has joined #ruby
[15:43:36] graft: has joined #ruby
[15:43:36] brool: oh so it's not a ruby-in-IRC bot it's a doc lookup
[15:43:49] phaul: it's both now
[15:44:31] mikecmpbll: has joined #ruby
[15:47:35] haxx0r: has joined #ruby
[15:48:01] duderonomy: has joined #ruby
[15:50:14] xco: has joined #ruby
[15:53:18] sphenxes: has joined #ruby
[16:00:46] rippa: has joined #ruby
[16:04:22] doodleb42: has joined #ruby
[16:11:42] jgpawletko: has joined #ruby
[16:13:05] havenwood: require 'io/console'; IO.console.getpass 'What is the capital of Assyria?'
[16:15:08] jeremycw: Is there a gem that implements something like stackless coroutines?
[16:15:33] jeremycw: I'm looking for a good way to coordinate logic that spans across multiple http requests.
[16:16:10] jeremycw: I see state machines used a lot for this case but they suck and often result in spaghetti code.
[16:18:06] jeremycw: It would be much nicer to just have code that hides the state machine and actually be able to code with regular flow control.
[16:19:40] darix: jeremycw: mechanize gem?
[16:21:20] dar123: has joined #ruby
[16:21:39] octos: has joined #ruby
[16:21:50] orbyt_: has joined #ruby
[16:22:22] jeremycw: darix: I mean incoming requests on a rails server that could be load balanced to different machines.
[16:23:14] darix: jeremycw: from your initial description that was hard to guess ... and you are very optimistic
[16:23:30] darix: you would need to store the partial states of the workflow somewhere
[16:23:42] orbyt_: has joined #ruby
[16:23:54] darix: makes you wonder if it wouldnt be easier to have a javascript based workflow and only send the final state at the end
[16:25:45] NL3limin4t0r: jeremycw: Couldn't you simply add a node balencer like NGINX before the request reaches the Rails server?
[16:26:00] NL3limin4t0r: load balancer*
[16:26:01] gix: has joined #ruby
[16:27:16] darix: NL3limin4t0r: you could do session stickiness but that only solves a very minor part of the problem
[16:27:25] esp32_prog: has joined #ruby
[16:27:47] jeremycw: Like, I want continuations that can be stored and passed over the network basically.
[16:28:16] darix: jeremycw: you are dreaming too big there :)
[16:29:14] jeremycw: Haha, I've written a proof of concept but it's damn ugly and basically requires implementing a whole dsl and intepreter inside ruby...
[16:29:32] jeremycw: I was hoping someone else had already gone down this rabbit hole.
[16:30:36] jenrzzz: has joined #ruby
[16:36:27] orbyt_: has joined #ruby
[16:37:21] jeremycw: I know I can get something like this working: https://gist.github.com/jeremycw/2c65fe4dfee9b5feaccb0413491e0d5e
[16:37:38] jeremycw: but was hoping for a better way.
[16:39:14] SigizMG: has joined #ruby
[16:48:22] AJA4351: has joined #ruby
[16:49:31] tdy: has joined #ruby
[16:58:20] doodlebug: has joined #ruby
[17:03:27] Dbugger: has joined #ruby
[17:05:43] andikr: has joined #ruby
[17:06:13] blackmesa1: has joined #ruby
[17:10:22] doodleb26: has joined #ruby
[17:10:46] duderonomy: has joined #ruby
[17:16:52] ovnimancer: has joined #ruby
[17:18:59] ovnimancer: has joined #ruby
[17:19:13] ellcs: has joined #ruby
[17:22:21] doodlebug: has joined #ruby
[17:22:43] schneider: has joined #ruby
[17:23:08] blackmesa1: has joined #ruby
[17:23:55] KramerC: has joined #ruby
[17:28:22] doodlebug: has joined #ruby
[17:32:38] xco: has joined #ruby
[17:34:22] doodlebug: has joined #ruby
[17:40:22] doodlebug: has joined #ruby
[17:41:27] esp32_prog: has joined #ruby
[17:42:11] dellavg_: has joined #ruby
[17:44:43] fphilipe: has joined #ruby
[17:46:16] Exuma: has joined #ruby
[17:47:13] blackmesa1: has joined #ruby
[17:47:52] christiandsg: has joined #ruby
[17:52:11] jenrzzz: has joined #ruby
[17:52:11] xco: has joined #ruby
[17:52:21] doodlebug: has joined #ruby
[17:53:13] conta: has joined #ruby
[17:58:35] Renich: has joined #ruby
[18:04:36] Wolland: has joined #ruby
[18:08:25] fphilipe: has joined #ruby
[18:23:54] nogic: has joined #ruby
[18:28:28] ravenous_: has joined #ruby
[18:30:53] havenwood: jeremycw: Are you familiar with ioquatix's async libraries? https://github.com/ioquatix
[18:31:20] havenwood: Instead of serializing procs, you can suspend fibers and resume later.
[18:32:07] tf2ftw: has joined #ruby
[18:32:46] JasonO: has joined #ruby
[18:35:16] xco: Hi everyone!
[18:35:31] xco: I querying an endpoint with Net::HTTP.get(uri)
[18:35:51] xco: the data comes in as a string with one array of JSON inside it
[18:35:56] xco: so it looks something like
[18:36:12] xco: “[{…}]”
[18:36:19] xco: how do I parse this with JSON?
[18:36:36] xco: prolly so i can fetch the individual keys/values?
[18:37:00] Wolland: require “json”; JSON.parse(your string)
[18:37:16] Wolland: Result is a hash.
[18:37:32] xco: oh interesting!
[18:37:43] Wolland: JSON.parse(response.body)
[18:37:56] xco: i i thought the [] in the string will mess this up
[18:38:31] xco: result is actually an array
[18:38:40] xco: but that sends me a step closer, thanks :)
[18:38:46] SeepingN: has joined #ruby
[18:39:00] Wolland: You can strip it if it doesn’t work
[18:39:15] xco: how do i do that?
[18:39:39] xco: ideally i’d like it to be out of the array
[18:39:47] xco: i’m doing #first on it
[18:39:55] xco: so like so
[18:39:56] xco: JSON.parse(Net::HTTP.get(uri)).first
[18:40:14] Wolland: And that works?
[18:40:25] Wolland: So it parses it fine
[18:40:26] xco: if there’s no better way i’ll go with this
[18:40:38] xco: thought there’d be a better way
[18:40:47] xco: thanks Wolland ;)
[18:41:15] Wolland: response.body[1..-2]
[18:41:27] blackmesa1: has joined #ruby
[18:41:32] Wolland: But what you have is fine
[18:41:57] Nicmavr: has joined #ruby
[18:42:09] xco: awesome!
[18:42:57] Wolland: I like first or [0] better. I think it’s easier to read.
[18:43:14] Wolland: And it lets you know it’s an array
[18:43:37] xco: so i’m going with #first
[18:46:43] blackmesa1: has joined #ruby
[18:50:09] ytti: 21:43 < Wolland> And it lets you know it’s an array
[18:50:15] ytti: no it doeesn't
[18:50:27] ytti: it lets you know object responds to [](arg) method
[18:50:39] ytti: i would also use #first
[18:50:53] xco: prolly it lets you know it’s an Enumerable?
[18:51:16] ytti: no, it lets you know object responds to [](arg) method, nothing else
[18:51:19] xco: in the sense that on Enumerables have #first
[18:51:20] alem0lars: has joined #ruby
[18:52:21] ytti: http://p.ip.fi/6dTK
[18:52:22] xco: you don’t want ytti as your professor, you’d fail :P
[18:53:14] reber: has joined #ruby
[18:53:23] jenrzzz: has joined #ruby
[18:53:24] cropcircle: has joined #ruby
[18:54:03] Wolland: It’s a JSON, it responds to [] ... what is it 😏
[18:57:23] gix: has joined #ruby
[18:57:57] dar123: has joined #ruby
[19:02:58] thunderbirdtr: has joined #ruby
[19:04:23] tdy: has joined #ruby
[19:06:10] yqt: has joined #ruby
[19:21:18] DarthGandalf: has joined #ruby
[19:29:46] esp32_prog: has joined #ruby
[19:39:49] jenrzzz: has joined #ruby
[19:42:13] Wolland: has joined #ruby
[19:42:37] xco: has joined #ruby
[19:44:42] hiroaki: has joined #ruby
[19:46:26] doodlebug: has joined #ruby
[19:51:03] cliluw: has joined #ruby
[19:53:20] nowhereman: has joined #ruby
[19:58:12] sameerynho: has joined #ruby
[20:02:20] cjohnson: Can somebody do me a favor and install the xdg gem version 2.2.4 and see if you have an index.rb file?
[20:02:27] cjohnson: ls ~/.rbenv/versions/2.4.6/lib/ruby/gems/2.4.0/gems/xdg-2.2.4/lib/xdg/
[20:02:39] cjohnson: I don't have one, but the xdg.rb file is doing require_relative 'xdg/index'
[20:02:55] cjohnson: Seems like the github repo last change is 7 years ago so I'm rather confused why this is happening for me lol
[20:04:05] AJA4350: has joined #ruby
[20:04:51] tdy: has joined #ruby
[20:05:26] cjohnson: Well that's interesting, 2.2.4 was pushed today...
[20:05:45] mikecmpbll: has joined #ruby
[20:05:47] cjohnson: How do I see where it came from?
[20:11:47] Kestrel-029: has joined #ruby
[20:17:23] hiroaki: has joined #ruby
[20:19:18] xco: i’m working on two gems. in one gem i have an error “undefined method `downcase' for nil:NilClass” which i’m aware of. in the second them there’s no error. it works fine but any time i do “gem push” i get the warning for the first gem with the error in it. so even in the folder of the clean gem the warning shows and i can’t push it. any ideas? please?
[20:21:59] jidar: cjohnson: interesting
[20:23:17] jidar: cjohnson: ‼️ Development of this project has been transfered here: https://github.com/bkuhlmann/xdg. This will be the last version supported within the 2.2.x series. Be aware major breaking changes will be introduced in the upcoming 3.0.0 release (2019-06-01).
[20:23:36] jidar: so there ya go
[20:24:33] cjohnson: Yeah that's 3.0.0 though, the broken version is 2.2.4
[20:24:41] cjohnson: I made an issue on his new github, I suspect it was a mistake
[20:25:03] cjohnson: From what I can see, the master branch of hte original repository listed 2.2.4 in the HISTORY.md, but no 2.2.4 was ever pushed up to rubygems
[20:25:28] jidar: > xdg (2.2.4)
[20:25:34] cjohnson: I suspect he took control, saw a mismatch, pushed up without testing that it actually worked and then intended to move forward with his 3.x refactor
[20:25:54] cjohnson: Probably the 2.2.4 version just needs to be yanked, or fixed
[20:26:21] cjohnson: I meant that no 2.2.4 had ever been pushed up until today
[20:26:46] Nicmavr: has joined #ruby
[20:27:37] graft: has joined #ruby
[20:27:37] graft: has joined #ruby
[20:29:48] wildermind: has joined #ruby
[20:32:03] mikecmpbll: has joined #ruby
[20:32:54] ur5us: has joined #ruby
[20:42:06] troulouliou_div2: has joined #ruby
[20:46:34] tdy: has joined #ruby
[20:48:54] Xeago: has joined #ruby
[21:05:46] graft: has joined #ruby
[21:05:47] graft: has joined #ruby
[21:07:45] brool: has joined #ruby
[21:17:37] fphilipe: has joined #ruby
[21:18:21] esp32_prog: has joined #ruby
[21:23:08] cd: has joined #ruby
[21:25:21] Fusl: has joined #ruby
[21:26:46] Nicmavr: has joined #ruby
[21:26:55] Wolland: has joined #ruby
[21:32:32] doodleb64: has joined #ruby
[21:33:26] jenrzzz: has joined #ruby
[21:33:49] miskatonic: has joined #ruby
[21:35:14] troulouliou_div2: has joined #ruby
[21:36:29] nogic: has joined #ruby
[21:38:41] troulouliou_div2: has joined #ruby
[21:43:10] xco: has joined #ruby
[22:03:19] skryking: has joined #ruby
[22:03:59] xco: has joined #ruby
[22:06:09] fphilipe: has joined #ruby
[22:11:46] Nicmavr: has joined #ruby
[22:12:20] fphilipe: has joined #ruby
[22:18:32] fphilipe: has joined #ruby
[22:18:36] wolfgangzim: has joined #ruby
[22:22:22] jenrzzz: has joined #ruby
[22:29:34] fphilipe: has joined #ruby
[22:33:30] dar123: has joined #ruby
[22:41:56] cd: has joined #ruby
[22:48:40] Swyper: has joined #ruby
[22:53:12] xco: has joined #ruby
[22:54:10] weird_error: has joined #ruby
[22:56:29] tf2ftw: has joined #ruby
[22:59:43] houhoulis: has joined #ruby
[23:00:32] Kestrel-029: has joined #ruby
[23:06:42] esp32_prog: has joined #ruby
[23:09:23] xco: has joined #ruby
[23:09:45] spacesuitdiver: has joined #ruby
[23:12:06] Swyper: has joined #ruby
[23:18:18] Swyper: has joined #ruby
[23:21:33] nowhereman: has joined #ruby
[23:48:21] Swyper: has joined #ruby
[23:50:43] Ai9zO5AP: has joined #ruby
[23:51:47] jenrzzz_: has joined #ruby
[23:52:11] Swyper: has joined #ruby
[23:57:14] brool: has joined #ruby