« Back to channel list

#ruby - 04 October 2017

« Back 1 day Forward 1 day »
[00:00:10] ahrs: has joined #ruby
[00:05:25] cadillac_: has joined #ruby
[00:07:16] marcux: has joined #ruby
[00:08:30] imode: has joined #ruby
[00:09:45] Zimsky: has joined #ruby
[00:09:53] bruno-: has joined #ruby
[00:10:19] jinie_: has joined #ruby
[00:11:56] cdg: has joined #ruby
[00:14:15] shinnya: has joined #ruby
[00:17:57] webnanners: has joined #ruby
[00:21:12] mim1k: has joined #ruby
[00:24:51] ycyclist: Any flexmock people out there?
[00:28:06] Alina-malina: has joined #ruby
[00:31:13] jphase: has joined #ruby
[00:34:09] Cohedrin_: has joined #ruby
[00:36:14] milardovich: has joined #ruby
[00:37:38] Cohedrin_: has joined #ruby
[00:42:20] RickHull: ycyclist: just curious, are you wedded to flexmock? it looks unmaintained (RIP Jim)
[00:47:17] ycyclist: Yes, I know. I am somewhat wedded, but the problem is known at large. Thank you.
[00:47:34] ycyclist: Interestingly, I got the case to work, but what I am stuck on now is a more general problem.
[00:47:48] RickHull: what's the problem?
[00:48:57] ycyclist: I need to re-initialize the require step that is presently happening at the top of the file, inside each of several flexmock blocks where I am stubbing Socket.gethostname I can set a different value.
[00:49:10] ycyclist: By the way, just a second and I'll post the code I got to work:
[00:50:00] ycyclist: Sorry for the dump, but:
[00:50:01] ycyclist: flexmock(Socket,:strict,Socket => :gethostname, :gethostname => "myhostname") do hostname = Socket.gethostname assert_equal("myhostname", hostname, "Could not get the hostname")
[00:50:13] RickHull: hm, right off the bat, it is a smell that require would have "significant" side effects
[00:50:14] ycyclist: Then do your other stuff of course.
[00:50:20] RickHull: require should just load code
[00:50:35] ycyclist: But as you can see, what I really need is to require the stuff all over again so that the stub gets used.
[00:50:51] ycyclist: I think a second require sees the first and says "naa"
[00:51:26] RickHull: yes, require returns true the first time
[00:51:39] RickHull: and returns false the second, very quickly
[00:52:02] ycyclist: There must be a way, especially for things like testing, to force a re-require.
[00:52:17] RickHull: there is, but I am pretty sure you are barking up the wrong tree
[00:52:38] RickHull: can you please paste using http://gist.github.com/
[00:52:53] RickHull: e.g. the first N lines of your test script
[00:53:20] ycyclist: I can paste critical lines. Just a minute:
[00:53:25] RickHull: omit or mask any sensitive info of course
[00:53:56] Cohedrin_: has joined #ruby
[00:58:36] ycyclist: Sorry, I'm slow: https://gist.github.com/v-xecamp/2d5cf385975155137763f0a0052d3df5
[00:58:59] RickHull: ok, it looks like you have an antipattern
[00:59:11] RickHull: whereby you are doing side-effect-laden stuff at requiretime
[00:59:33] RickHull: can you paste some of the contents of `icanttellyouthat.rb` ?
[01:00:04] ycyclist: No. Not allowed.
[01:00:21] RickHull: fair enough. can you explain the effects of that require statement?
[01:00:32] conta: has joined #ruby
[01:00:33] ycyclist: It's got a module and a class, no constants except the module and class names
[01:01:14] RickHull: anything else besides method definitions?
[01:01:26] ycyclist: We require the class to the test script and then go through all the methods and test them. We often can get away with testin things without mocks, but this one would be really helpful.
[01:01:39] ycyclist: It's a Singleton.
[01:01:47] ycyclist: Which makes it a little wierder.
[01:02:02] RickHull: singletons are antipatterns, generally
[01:02:05] ycyclist: We do Thingy.method1
[01:02:30] ycyclist: Yes, well I cannot redesign the system. I can only help make it less bad.
[01:02:37] RickHull: understood :)
[01:02:38] ycyclist: But I agree.
[01:02:58] RickHull: so, are there any effects at requiretime besides loading classes/modules and their contained methods?
[01:03:08] RickHull: are any methods called or other code executed?
[01:03:13] ycyclist: This is a fairly simple test. Is Ruby seriously averse to reloading inside a block and ignoring what was there before?
[01:03:20] ycyclist: I have done a lot of ruby, but not that.
[01:03:49] nankyokusei: has joined #ruby
[01:03:50] RickHull: ycyclist: I strongly recommend looking up what `load` does
[01:03:55] RickHull: er, not looking up
[01:04:09] ycyclist: There are internal methods, but these are all Class methods, no instance available except to the extent that a Class is an object anyway.
[01:04:15] RickHull: even with a singleton, there is a good way and a bad way to proceed
[01:04:35] RickHull: ycyclist: where does Thingy.method1 happen?
[01:04:37] ycyclist: Well, I am after constructive criticism, and appreciate any you have.
[01:05:12] RickHull: i personally guarantee any criticism from me will be 100% constructive :)
[01:05:17] ycyclist: Thingy.method1 calls Socket.gethostname. It is defined inside MOD::Thingy. Pretty simple class really.
[01:05:34] RickHull: who calls Thingy.method1 ?
[01:05:56] ycyclist: Oh, it's a general utility, called all over the framework.
[01:06:19] RickHull: for example, I could define Thingy and method1, and then after the module/class definition, I could call it
[01:06:21] RickHull: in the same file
[01:06:34] RickHull: i.e. executable code at the toplevel
[01:06:48] RickHull: it will be executed at requiretime. or a constant assignment can call methods
[01:06:56] RickHull: that will be executed at requiretime
[01:07:15] RickHull: I am interested, what happens at requiretime?
[01:07:24] RickHull: why would you be tempted to require a 2nd time?
[01:08:09] ycyclist: Yes, I want to require many times, in many different tests. Many is probably 2, but it is at least 2.
[01:08:20] RickHull: why? for what effect?
[01:08:42] ycyclist: Sometimes we get ip addresses back from Socket.gethostname. We want to handle that well.
[01:08:52] Cohedrin_: has joined #ruby
[01:09:08] RickHull: argh, I am not making myself clear
[01:09:30] RickHull: if you do require 'blahblah', what state is changing in your program?
[01:09:43] RickHull: if I do require 'yaml', then I expect the YAML module to be available
[01:09:58] RickHull: I expect code declarations to be made, but no imperative code will be executed for "setup"
[01:10:15] ycyclist: The state that changes is I want the stubbed Socket.gethostname to be in effect when I re-load so that Thingy.method1, which uses it, will use the stub instead of the original.
[01:10:39] RickHull: ah, this is somewhat clearer
[01:10:59] ycyclist: Right now, we stub Socket.gethostname, but because the stubbing happens after the definition of Thingy.method1, method1 just uses the original defintion of Socket.gethostname.
[01:11:18] tcopeland: has joined #ruby
[01:11:41] ycyclist: Seems like this is a typical case for stubbing, except for the stinker of the fact that it's a Singleton and a class, not an instance object.
[01:12:10] ycyclist: But I got that part kindof fixed, except, I cannot pass an instance to the thing, I need to have it defined when the module definition occurs.
[01:13:06] ycyclist: All sorts of externalities could be moralized on here, but we're all human, and I like humans, so I'm working with it.
[01:13:35] RickHull: you can play with Kernel.load but it's a huge terrible smell
[01:14:04] ycyclist: Ok. That will be my starting point tomorrow. I fear right now my wife wants me to go home.
[01:14:11] ycyclist: BTW, thank you, this is very helpful.
[01:14:14] RickHull: it's like require except it happily reloads and requires the actual filename
[01:14:31] RickHull: it will throw a bunch of warnings for constant redefinitions
[01:14:41] ycyclist: yes, and I may find there are immutables buried in there. We'll see.
[01:14:56] RickHull: calling Socket stuff directly inside a singleton is a recipe for a testing headache
[01:14:58] bronson: has joined #ruby
[01:14:58] ycyclist: I will try to get back to you tomorrow about my results.
[01:15:22] RickHull: I have written tons of tests but nothing successfully with mocks or stubs; testability informs my program design
[01:15:28] ycyclist: Yes, but they're humans. Nice, decent-minded humans as near as I can tell.
[01:15:38] enterprisey: has joined #ruby
[01:16:16] ycyclist: Yes. I have always tried to avoid them if possible, but sometimes stubbing and mocking are good answers.
[01:17:05] RickHull: for sure, I wish I had better guidance here but I've avoided these problems somehow; I love your attitude though :)
[01:17:13] ycyclist: I'm already breaking down Thingy's insides to check on its pieces, so I have it pretty well covered, but we want this too, and we will probably use it for future exigencies.
[01:17:32] ycyclist: I suspect it's a good idea. I am really looking forward to migrating to minitest though. It is so much nicer.
[01:17:41] RickHull: <3 minitest
[01:17:58] RickHull: here is my best guess for your situation:
[01:18:02] ycyclist: He, gotta go man. I will post results as soon as I squeeze'm out.
[01:18:07] RickHull: 1. i think to mock successfully, you have to mock before require
[01:18:25] RickHull: 2. therefore, you may need to split out stuff that needs to be mocked (calls to Socket, etc)
[01:18:31] ycyclist: Still here.
[01:19:05] ycyclist: Yes, that is parallel to my guesses too.
[01:19:17] RickHull: i.e. stop requiring at the top
[01:19:27] RickHull: you may not need to split out your lib/source stuff
[01:19:39] RickHull: but in the test script, just do your mocks first, then your requires
[01:19:52] RickHull: however, there are some situations where you need to require some stuff before the mocks
[01:20:03] RickHull: and thats where you may need to consider splitting out the lib/source functionality
[01:20:04] amirite: has joined #ruby
[01:20:28] RickHull: i.e. split canttellyou.rb to canttellyou-core.rb and canttellyou-mocks.rb
[01:20:46] RickHull: and your test script requires canttellyou-core
[01:20:58] RickHull: and canttellyou-mocks after the mocks
[01:21:33] d^sh: has joined #ruby
[01:22:47] paradisaeidae_: has joined #ruby
[01:22:48] paradisaeidae: has joined #ruby
[01:23:16] RickHull: all that said, I am just making an educated guess. I don't know mocks and stubs very well
[01:27:11] ledestin: has joined #ruby
[01:29:05] tamouse__: has joined #ruby
[01:32:05] paradisaeidae: has joined #ruby
[01:32:12] paradisaeidae_: has joined #ruby
[01:36:39] cdg: has joined #ruby
[01:39:05] cagomez: has joined #ruby
[01:39:26] ineb: has joined #ruby
[01:44:28] theunraveler: has joined #ruby
[01:45:09] greenbagels: has joined #ruby
[01:46:04] tcopeland: has joined #ruby
[01:49:05] oetjenj: has joined #ruby
[01:53:31] enterprisey: has joined #ruby
[01:54:08] pr0ton: has joined #ruby
[01:55:18] milardovich: has joined #ruby
[01:55:38] oetjenj: has joined #ruby
[01:57:24] gizmore|2: has joined #ruby
[01:57:41] alnet: has joined #ruby
[02:01:04] enterprisey: has joined #ruby
[02:01:11] Alina-malina: has joined #ruby
[02:01:22] smelnicki: has joined #ruby
[02:06:38] orbyt_: has joined #ruby
[02:06:39] enterprisey: has joined #ruby
[02:09:02] MrBismuth: has joined #ruby
[02:12:52] imode: has joined #ruby
[02:15:18] enterprisey: has joined #ruby
[02:20:33] enterprisey: has joined #ruby
[02:21:41] mim1k: has joined #ruby
[02:23:01] tamouse__: has joined #ruby
[02:24:14] DTZUZO: has joined #ruby
[02:26:33] hinbody: has joined #ruby
[02:27:09] uneeb: has joined #ruby
[02:27:22] adlerdias: has joined #ruby
[02:29:15] Ropeney: has joined #ruby
[02:33:13] jphase: has joined #ruby
[02:35:41] coderphive: has joined #ruby
[02:39:28] jenrzzz: has joined #ruby
[02:39:28] jenrzzz: has joined #ruby
[02:39:40] jrafanie: has joined #ruby
[02:41:36] Emmanuel_Chanel: has joined #ruby
[02:42:15] imode: has joined #ruby
[02:47:34] webnanners: has joined #ruby
[02:47:36] milardovich: has joined #ruby
[02:48:09] Alina-malina: has joined #ruby
[02:50:34] bmurt: has joined #ruby
[02:51:19] ramfjord: has joined #ruby
[02:52:40] NightMonkey: has joined #ruby
[02:52:45] s3nd1v0g1us: has joined #ruby
[02:55:48] Iambchop: has joined #ruby
[03:00:08] cadillac_: has joined #ruby
[03:02:37] Alina-malina: has joined #ruby
[03:03:07] DTZUZO: has joined #ruby
[03:03:34] webnanners: has joined #ruby
[03:12:22] webnanners: has joined #ruby
[03:13:36] xuanrui: has joined #ruby
[03:15:54] lxleuser: has joined #ruby
[03:15:58] bronson: has joined #ruby
[03:17:33] freddy_flintston: Who can recommend resources for machine learning in Ruby?
[03:17:38] milardovich: has joined #ruby
[03:22:41] webnanners: has joined #ruby
[03:27:10] gix: has joined #ruby
[03:28:42] Alina-malina: has joined #ruby
[03:29:50] webnanners: has joined #ruby
[03:31:55] pr0ton: has joined #ruby
[03:34:25] hahuang65: has joined #ruby
[03:35:02] greenbagels: has joined #ruby
[03:36:00] enterprisey: has joined #ruby
[03:36:46] orbyt_: has joined #ruby
[03:37:16] maxmanders: has joined #ruby
[03:38:41] jenrzzz: has joined #ruby
[03:38:41] jenrzzz: has joined #ruby
[03:42:33] RickHull: found this https://github.com/arbox/machine-learning-with-ruby
[03:44:12] nowhereman: has joined #ruby
[03:46:23] Map: has joined #ruby
[03:47:51] clamstar: has joined #ruby
[03:50:47] nicesignal: has joined #ruby
[03:59:10] hyperreal: has left #ruby: ("WeeChat 1.9.1")
[03:59:47] hahuang65: has joined #ruby
[04:01:59] rfoust: has joined #ruby
[04:02:37] tamouse__: has joined #ruby
[04:03:07] hahuang65: has joined #ruby
[04:08:50] Pisuke: has joined #ruby
[04:13:19] cdg: has joined #ruby
[04:13:41] ta: has joined #ruby
[04:13:44] hs366: has joined #ruby
[04:17:38] Psy-Q: has joined #ruby
[04:21:53] GGMethos: has joined #ruby
[04:21:58] yokel: has joined #ruby
[04:22:15] mim1k: has joined #ruby
[04:24:08] SpComb: has joined #ruby
[04:24:26] akkad: has joined #ruby
[04:27:25] alnet: has joined #ruby
[04:32:16] jenrzzz: has joined #ruby
[04:32:40] ramfjord: has joined #ruby
[04:42:16] mim1k: has joined #ruby
[04:44:53] jphase: has joined #ruby
[04:52:04] xuanrui: has joined #ruby
[04:53:13] ramfjord: has joined #ruby
[05:05:25] alex``: has joined #ruby
[05:06:47] jphase: has joined #ruby
[05:07:18] Alina-malina: has joined #ruby
[05:09:53] jamesaxl: has joined #ruby
[05:13:34] conta: has joined #ruby
[05:13:48] ramfjord: has joined #ruby
[05:16:15] pr0ton: has joined #ruby
[05:16:36] yosafbridge: has joined #ruby
[05:17:12] bronson: has joined #ruby
[05:19:53] jenrzzz: has joined #ruby
[05:22:42] xuanrui: has joined #ruby
[05:24:02] sspreitz: has joined #ruby
[05:24:36] nicolai86: has joined #ruby
[05:29:23] akkad: has joined #ruby
[05:36:21] ta: has joined #ruby
[05:38:03] voiceftp: has joined #ruby
[05:39:20] ramfjord: has joined #ruby
[05:39:20] aufi: has joined #ruby
[05:41:00] emulator3: has joined #ruby
[05:44:48] aupadhye: has joined #ruby
[05:47:08] kriskropd: has joined #ruby
[05:47:48] Alina-malina: has joined #ruby
[05:54:09] Ropeney: has joined #ruby
[05:54:29] dminuoso_: has joined #ruby
[05:54:54] Bock: has joined #ruby
[05:56:06] Bock: has joined #ruby
[05:57:24] Bock: has joined #ruby
[05:59:28] nfsnobody: has joined #ruby
[05:59:31] Bock: has joined #ruby
[06:01:00] nocaberi: has joined #ruby
[06:03:02] nfsnobody: has joined #ruby
[06:08:41] paranoicsan: has joined #ruby
[06:11:24] ndrst: has joined #ruby
[06:12:04] milardovich: has joined #ruby
[06:12:10] AnoHito: has joined #ruby
[06:17:50] Cohedrin_: has joined #ruby
[06:20:49] anisha: has joined #ruby
[06:28:48] andikr: has joined #ruby
[06:29:28] blackmesa: has joined #ruby
[06:33:55] guardianx: has joined #ruby
[06:34:37] anas: has joined #ruby
[06:38:45] jphase: has joined #ruby
[06:40:07] mjolnird: has joined #ruby
[06:42:41] rabajaj: has joined #ruby
[06:56:44] quobo: has joined #ruby
[06:56:57] mtkd: has joined #ruby
[06:57:53] ta: has joined #ruby
[06:58:33] dminuoso_: has joined #ruby
[06:58:58] Vap0r1ze: has joined #ruby
[06:59:03] roshanavand: has joined #ruby
[06:59:19] r7c: has joined #ruby
[07:00:56] milardovich: has joined #ruby
[07:01:16] Vap0r1ze: How do I define class methods, where the name of the method is based on a variable string
[07:02:10] uneeb: has joined #ruby
[07:04:18] RickHull: define_method() I think
[07:04:29] Ropeney: `define_method 'string' do`
[07:05:13] gr33n7007h: define_singleton_method for class methods.
[07:11:10] mark_66: has joined #ruby
[07:14:58] biberu: has joined #ruby
[07:14:59] alex``: has joined #ruby
[07:16:41] dminuoso_: has joined #ruby
[07:16:58] phaul: has joined #ruby
[07:18:05] bronson: has joined #ruby
[07:18:51] blackmesa: has joined #ruby
[07:20:20] Vap0r1ze: thanks guys it worke
[07:22:18] claudiuinberlin: has joined #ruby
[07:23:47] gr33n7007h: cool beans :)
[07:24:12] mathys: has joined #ruby
[07:30:32] amirite: has joined #ruby
[07:30:34] dminuoso_: has joined #ruby
[07:32:52] fyrril2: has joined #ruby
[07:34:24] jaruga: has joined #ruby
[07:34:46] charliesome: has joined #ruby
[07:36:23] PaulePanter: has joined #ruby
[07:39:54] ramfjord: has joined #ruby
[07:40:58] bastilian_: has joined #ruby
[07:41:49] oded: has joined #ruby
[07:44:45] Defenestrate: has joined #ruby
[07:47:35] claudiuinberlin: has joined #ruby
[07:49:48] charliesome: has joined #ruby
[07:50:04] shime: has joined #ruby
[07:50:52] burgestrand: has joined #ruby
[07:51:31] ts_: has joined #ruby
[08:00:29] ramfjord: has joined #ruby
[08:02:59] Mortomes|Work: has joined #ruby
[08:04:00] Bock: has joined #ruby
[08:04:49] lel: has joined #ruby
[08:04:51] sysvalve: has joined #ruby
[08:04:57] phaul: has joined #ruby
[08:06:04] Silthias: has joined #ruby
[08:10:43] nowhereman: has joined #ruby
[08:10:56] jinie: has joined #ruby
[08:11:10] charliesome: has joined #ruby
[08:13:11] bruno-: has joined #ruby
[08:14:14] cdg: has joined #ruby
[08:14:16] mikecmpbll: has joined #ruby
[08:15:17] milardovich: has joined #ruby
[08:19:46] conta: has joined #ruby
[08:20:01] foxxx0: has joined #ruby
[08:27:28] cadillac_: has joined #ruby
[08:28:21] dionysus69: has joined #ruby
[08:30:46] Jameser: has joined #ruby
[08:32:38] burgestrand: has joined #ruby
[08:35:06] mim1k: has joined #ruby
[08:36:29] ramfjord: has joined #ruby
[08:41:05] ur5us: has joined #ruby
[08:43:57] marr: has joined #ruby
[08:46:23] Beams: has joined #ruby
[08:49:36] ur5us: has joined #ruby
[08:50:39] milardovich: has joined #ruby
[08:51:06] claudiuinberlin: has joined #ruby
[08:51:07] burgestrand: has joined #ruby
[08:57:05] infernix: has joined #ruby
[08:58:39] claudiuinberlin: has joined #ruby
[09:04:47] lxsameer: has joined #ruby
[09:09:28] charliesome: has joined #ruby
[09:12:30] ramfjord: has joined #ruby
[09:18:54] bronson: has joined #ruby
[09:27:58] elsevero: has joined #ruby
[09:28:42] dminuoso_: has joined #ruby
[09:29:17] claudiuinberlin: has joined #ruby
[09:30:43] burgestrand: has joined #ruby
[09:33:02] elsevero_: has joined #ruby
[09:33:18] pavan: has joined #ruby
[09:33:47] pavan: <XMLRPC::FaultException: XMLRPC::FaultException> getting Error
[09:34:06] workmad3: has joined #ruby
[09:34:26] bruno-: has joined #ruby
[09:34:44] Defenestrate: has joined #ruby
[09:34:51] TheBrayn: pavan: You'll need to provide more information than that
[09:35:28] mtkd: has joined #ruby
[09:39:23] bruno-_: has joined #ruby
[09:39:45] uZiel: has joined #ruby
[09:40:32] jphase: has joined #ruby
[09:42:12] bauruine: has joined #ruby
[09:42:54] roshanavand: has joined #ruby
[09:43:39] Serpent7776: has joined #ruby
[09:48:28] ramfjord: has joined #ruby
[09:52:09] infernix: has joined #ruby
[09:54:38] GodFather: has joined #ruby
[09:55:40] mniip: has joined #ruby
[09:55:53] acalycine: has joined #ruby
[10:00:40] kapil___: has joined #ruby
[10:00:52] emulator4: has joined #ruby
[10:01:50] nicolai86: has joined #ruby
[10:02:20] acalycine: has joined #ruby
[10:02:47] jenrzzz: has joined #ruby
[10:03:22] snickers: has joined #ruby
[10:04:05] ramfjord: has joined #ruby
[10:04:11] ur5us: has joined #ruby
[10:05:33] nankyoku_: has joined #ruby
[10:07:41] nankyoku_: has joined #ruby
[10:07:47] GodFather: has joined #ruby
[10:08:40] gregf_: has joined #ruby
[10:13:35] blackmesa: has joined #ruby
[10:17:19] claudiuinberlin: has joined #ruby
[10:18:51] Defenestrate: has joined #ruby
[10:23:47] elsevero_: has joined #ruby
[10:24:30] ramfjord: has joined #ruby
[10:24:32] rikkipitt: has joined #ruby
[10:35:16] claudiuinberlin: has joined #ruby
[10:37:53] Siyfion: has joined #ruby
[10:40:28] dminuoso_: has joined #ruby
[10:42:35] adlerdias: has joined #ruby
[10:43:24] burgestrand: has joined #ruby
[10:44:02] SURAJIT: has joined #ruby
[10:44:56] rgr: has joined #ruby
[10:55:21] mathys: has joined #ruby
[10:56:28] huyderman: has joined #ruby
[10:56:55] mathys_: has joined #ruby
[11:00:30] ramfjord: has joined #ruby
[11:00:38] Nahra: has joined #ruby
[11:08:44] cagomez: has joined #ruby
[11:10:57] apparition: has joined #ruby
[11:13:43] cdg: has joined #ruby
[11:15:13] mr_foto: has joined #ruby
[11:20:12] bronson: has joined #ruby
[11:20:15] guille-moe: has joined #ruby
[11:22:53] sepp2k: has joined #ruby
[11:24:38] cagomez: has joined #ruby
[11:32:52] ramfjord: has joined #ruby
[11:37:29] charliesome: has joined #ruby
[11:46:30] fmcgeough: has joined #ruby
[11:46:44] ldnunes: has joined #ruby
[11:51:57] zautomata: has joined #ruby
[11:52:44] tvw: has joined #ruby
[11:54:29] dminuoso_: has joined #ruby
[11:55:34] shinnya: has joined #ruby
[11:56:27] bruno-: has joined #ruby
[11:57:46] jphase: has joined #ruby
[11:59:58] fmcgeough: has joined #ruby
[12:04:24] halt: has joined #ruby
[12:06:18] Heph_: has joined #ruby
[12:06:37] ldnunes: has joined #ruby
[12:07:15] gnufied: has joined #ruby
[12:08:17] ramfjord: has joined #ruby
[12:11:02] dminuoso_: has joined #ruby
[12:11:43] alnet: has joined #ruby
[12:13:37] mr_foto: has joined #ruby
[12:14:05] rgr_: has joined #ruby
[12:18:30] burgestrand: has joined #ruby
[12:24:15] mathys: has joined #ruby
[12:24:52] ts_: has joined #ruby
[12:29:13] huyderman: has joined #ruby
[12:31:36] pavan: has left #ruby: ()
[12:33:51] tcopeland: has joined #ruby
[12:33:57] tsglove: has joined #ruby
[12:34:47] coderphive: has joined #ruby
[12:35:39] aclark: has joined #ruby
[12:36:10] truenito: has joined #ruby
[12:36:39] nankyokusei: has joined #ruby
[12:39:03] bmurt: has joined #ruby
[12:44:37] ShalokShalom_: has joined #ruby
[12:44:39] Map: has joined #ruby
[12:45:47] vasilakisFiL: has joined #ruby
[12:46:58] burgestrand: has joined #ruby
[12:48:19] vasilakisFiL: hey folks! I am wondering, doesn anyone know why self.private_method= doesn't raise an error bug self.private_method does? (snippet: https://gist.github.com/vasilakisfil/7eb19688f3861d9e1b54437c47c60f07 )
[12:49:07] matthewd: vasilakisfil: It's a special case, because private_method= without the self. wouldn't do the right thing
[12:51:16] vasilakisFiL: interesting thanks!
[12:52:41] vasilakisFiL: but that's inconsistend a bit. In any case, I would really like it if ruby could extend this special case to the self.foobar as well, so that we can access private accessor from inside our class seamlessly (in case we use a local variable of the same name)
[12:52:51] GodFather: has joined #ruby
[12:53:30] johno84: has joined #ruby
[12:53:33] coderphive: has joined #ruby
[12:53:43] matthewd: Matz recommends `foobar()` for that
[12:53:43] ts_: has joined #ruby
[12:54:17] matthewd: But yeah, I agree it'd be more consistent to special-case self. entirely
[12:54:38] gnufied: has joined #ruby
[13:01:12] chouhoulis: has joined #ruby
[13:01:52] ts_: has joined #ruby
[13:04:25] anisha: has joined #ruby
[13:05:06] ts_: has joined #ruby
[13:07:15] InfinityFye: has joined #ruby
[13:09:41] mson: has joined #ruby
[13:12:32] __Yiota: has joined #ruby
[13:12:41] workmad3: has joined #ruby
[13:15:36] __Yiota: has joined #ruby
[13:18:52] dminuoso_: has joined #ruby
[13:19:19] swills: has joined #ruby
[13:19:19] swills: has joined #ruby
[13:19:26] claudiuinberlin: has joined #ruby
[13:21:11] bronson: has joined #ruby
[13:21:22] cagmz: has joined #ruby
[13:23:01] cagmez__: has joined #ruby
[13:28:05] claudiuinberlin: has joined #ruby
[13:28:30] ramfjord: has joined #ruby
[13:35:15] jphase: has joined #ruby
[13:35:21] rfoust: has joined #ruby
[13:41:30] alnet: has joined #ruby
[13:41:55] headius: has joined #ruby
[13:41:56] DLSteve: has joined #ruby
[13:43:43] bmurt: has joined #ruby
[13:43:44] jottr: has joined #ruby
[13:43:55] ramfjord: has joined #ruby
[13:48:40] mr_foto: has joined #ruby
[13:49:25] mim1k: has joined #ruby
[13:52:43] __Yiota: has joined #ruby
[13:53:10] jrafanie: has joined #ruby
[13:56:35] yeticry: has joined #ruby
[13:56:46] jottr: has joined #ruby
[13:57:30] simmaniac: has joined #ruby
[13:59:34] bmurt: has joined #ruby
[13:59:41] ShalokShalom: has joined #ruby
[14:03:26] soahccc: has joined #ruby
[14:04:09] __Yiota: has joined #ruby
[14:06:11] neuraload: has joined #ruby
[14:11:10] kassav_: has joined #ruby
[14:11:18] ResidentBiscuit: has joined #ruby
[14:11:46] ResidentBiscuit: has joined #ruby
[14:13:25] bmurt: has joined #ruby
[14:14:27] jrafanie: has joined #ruby
[14:15:05] cdg: has joined #ruby
[14:15:46] ana__: has joined #ruby
[14:17:17] tcopeland: has joined #ruby
[14:18:47] ramfjord: has joined #ruby
[14:20:58] poofjavelin: has joined #ruby
[14:23:34] mim1k: has joined #ruby
[14:24:24] dionysus69: has joined #ruby
[14:26:07] kus_ubuntui686: has joined #ruby
[14:26:32] minimalism: has joined #ruby
[14:28:06] charliesome: has joined #ruby
[14:28:38] jrafanie: has joined #ruby
[14:28:49] jhg: has joined #ruby
[14:28:52] jhg: has left #ruby: ()
[14:28:59] Rapture: has joined #ruby
[14:29:20] claudiuinberlin: has joined #ruby
[14:30:19] dionysus69: has joined #ruby
[14:31:25] jrafanie: has joined #ruby
[14:31:33] __Yiota: has joined #ruby
[14:31:59] jottr_: has joined #ruby
[14:33:59] bmurt: has joined #ruby
[14:35:45] Alina-malina: has joined #ruby
[14:35:49] dionysus69: has joined #ruby
[14:37:20] motstgo: has joined #ruby
[14:37:46] jrafanie: has joined #ruby
[14:41:13] maxmanders: has joined #ruby
[14:41:14] uZiel: has joined #ruby
[14:45:02] blackmesa: has joined #ruby
[14:45:30] dminuoso_: has joined #ruby
[14:46:32] anisha: has joined #ruby
[14:46:34] wattt: has joined #ruby
[14:48:35] jottr_: has joined #ruby
[14:48:44] clamstar: has joined #ruby
[14:49:35] kitallis: has joined #ruby
[14:52:57] orbyt_: has joined #ruby
[14:53:47] Genya: has joined #ruby
[14:56:04] Silthias1: has joined #ruby
[14:57:31] bmurt: has joined #ruby
[14:58:06] audy: has joined #ruby
[15:01:18] BlkDynmt: has joined #ruby
[15:03:41] TheMoonMaster: has joined #ruby
[15:04:19] maxmanders: has joined #ruby
[15:04:39] jrafanie: has joined #ruby
[15:04:52] nankyoku_: has joined #ruby
[15:05:39] __Yiota: has joined #ruby
[15:06:31] rippa: has joined #ruby
[15:06:39] gr33n7007h: has joined #ruby
[15:06:54] nankyoku_: has joined #ruby
[15:07:14] Sirecote: has joined #ruby
[15:07:44] anisha: has joined #ruby
[15:08:14] bmurt: has joined #ruby
[15:12:44] polishdub: has joined #ruby
[15:15:28] jphase: has joined #ruby
[15:18:28] mim1k: has joined #ruby
[15:19:39] rabajaj: has joined #ruby
[15:19:39] chouhoulis: has joined #ruby
[15:20:18] SuperLag: has joined #ruby
[15:22:07] [Butch]: has joined #ruby
[15:22:10] bronson: has joined #ruby
[15:22:54] rabajaj: has joined #ruby
[15:24:34] charliesome: has joined #ruby
[15:25:32] alfiemax: has joined #ruby
[15:30:44] cagomez: has joined #ruby
[15:30:54] alex``: has joined #ruby
[15:33:22] someuser: has joined #ruby
[15:35:42] mim1k: has joined #ruby
[15:37:43] alnet: has joined #ruby
[15:45:15] claudiuinberlin: has joined #ruby
[15:45:29] cdg: has joined #ruby
[15:48:54] claudiuinberlin: has joined #ruby
[15:49:50] snickers: has joined #ruby
[15:50:43] dminuoso_: has joined #ruby
[15:51:18] dionysus70: has joined #ruby
[15:55:37] oetjenj: has joined #ruby
[15:56:22] mim1k: has joined #ruby
[15:56:48] ldnunes: has joined #ruby
[15:57:11] eroux: has joined #ruby
[15:58:40] marr: has joined #ruby
[15:59:21] anisha: has joined #ruby
[16:02:03] orbyt_: has joined #ruby
[16:02:34] kassav_: has joined #ruby
[16:02:55] claudiuinberlin: has joined #ruby
[16:04:39] centrx: has joined #ruby
[16:04:41] centrx: has joined #ruby
[16:07:37] pr0ton: has joined #ruby
[16:13:16] naftilos76: has joined #ruby
[16:15:03] cdg: has joined #ruby
[16:15:12] oetjenj: has joined #ruby
[16:15:45] naftilos76: hi i am trying to extract a substring from a big string with "some_string".scan(//) . Assuming that there are two words in the big string "one" and "two" and i want to extract the substring between these two words what would be your approach?
[16:16:05] oetjenj: has joined #ruby
[16:18:02] Papierkorb: naftilos76: Only one occurence of a one/two pair in one big string, or possibly multiple occurences?
[16:19:10] naftilos76: Papierkorb, correct question! one occurence only
[16:19:20] wnd: >> "fooonebartwozzap"[/one(.*)two/, 1]
[16:19:21] ruby[bot]: wnd: # => "bar" (https://eval.in/873657)
[16:19:21] marcux: has joined #ruby
[16:19:28] Papierkorb: naftilos76: `big_string[/one(.*)two/, 1]`
[16:21:35] naftilos76: Papierkorb, thanks, that would be mine but somehow it does not work
[16:21:47] naftilos76: let me try a few things
[16:23:50] ruby_: has joined #ruby
[16:24:05] ruby_: I cannot require kernel. What's with that?????
[16:24:29] naftilos76: Papierkorb, i have an instance that contains a big string and i do this: @file_data[/^(.*)$/, 1] and i get an empty string. Is that what it should do?
[16:24:50] Papierkorb: naftilos76: empty string or nil?
[16:25:03] naftilos76: "" is what i get
[16:25:09] Papierkorb: naftilos76: That regex matches an empty line
[16:25:24] naftilos76: i try this while using byebug
[16:25:37] ruby_: This should be simple. I cannot require kernel: require 'kernel' fails???
[16:25:53] Papierkorb: ruby_: Why do you want to require that?
[16:26:04] andikr: has joined #ruby
[16:27:20] alfiemax: has joined #ruby
[16:29:04] AndBobsYourUncle: has joined #ruby
[16:30:46] ldnunes: has joined #ruby
[16:31:06] ycyclist: has joined #ruby
[16:32:56] gusrub: has joined #ruby
[16:36:46] cadillac_: has joined #ruby
[16:42:08] raynold: has joined #ruby
[16:43:51] ElDoggo: has joined #ruby
[16:45:32] alfiemax: has joined #ruby
[16:46:53] postmodern: has joined #ruby
[16:47:18] ElDoggo: has joined #ruby
[16:48:57] mtkd: has joined #ruby
[16:49:52] claudiuinberlin: has joined #ruby
[16:52:37] havenwood: >> $LOAD_PATH.any? { |path| File.exist? File.join path, 'kernel.rb' }
[16:52:43] ruby[bot]: havenwood: # => false (https://eval.in/873667)
[16:54:52] blackmesa: has joined #ruby
[16:55:31] jottr_: has joined #ruby
[16:58:09] sysvalve: has joined #ruby
[16:59:57] conta2: has joined #ruby
[17:01:12] eckhardt: has joined #ruby
[17:03:33] techn1cs_: has joined #ruby
[17:09:06] orbyt_: has joined #ruby
[17:09:14] nankyokusei: has joined #ruby
[17:10:11] jottr_: has joined #ruby
[17:10:34] bruno-: has joined #ruby
[17:16:57] amirite: has joined #ruby
[17:18:10] claudiuinberlin: has joined #ruby
[17:18:19] kies: has joined #ruby
[17:19:39] graft: has joined #ruby
[17:19:41] graft: has joined #ruby
[17:19:59] Dimik: has joined #ruby
[17:20:16] alfiemax: has joined #ruby
[17:23:24] bronson: has joined #ruby
[17:24:07] jphase: has joined #ruby
[17:25:25] jenrzzz: has joined #ruby
[17:29:58] chouhoul_: has joined #ruby
[17:33:17] wattt: has joined #ruby
[17:33:27] amirite: has joined #ruby
[17:34:40] chouhoulis: has joined #ruby
[17:35:13] mim1k: has joined #ruby
[17:36:43] _aeris_: has joined #ruby
[17:37:56] spt0: has joined #ruby
[17:38:41] sspreitz: has joined #ruby
[17:39:06] charliesome: has joined #ruby
[17:42:08] uZiel: has joined #ruby
[17:42:12] seggy: has joined #ruby
[17:45:21] mikecmpbll: has joined #ruby
[17:46:13] claudiuinberlin: has joined #ruby
[17:47:55] rgr: has joined #ruby
[17:49:48] alfiemax: has joined #ruby
[17:58:23] orbyt_: has joined #ruby
[17:58:51] jottr_: has joined #ruby
[18:01:03] jrafanie: has joined #ruby
[18:01:37] wattt: has joined #ruby
[18:04:06] jrafanie_: has joined #ruby
[18:04:57] ramfjord: has joined #ruby
[18:06:26] imode: has joined #ruby
[18:08:11] mtkd: has joined #ruby
[18:09:17] harfangk: has joined #ruby
[18:09:36] iamdevnul: has joined #ruby
[18:10:27] SeepingN: has joined #ruby
[18:12:54] Cohedrin_: has joined #ruby
[18:13:22] cagomez_: has joined #ruby
[18:15:08] elsevero: has joined #ruby
[18:15:30] enterprisey: has joined #ruby
[18:20:20] dcluna: has joined #ruby
[18:27:26] harmaahylje: has joined #ruby
[18:29:17] pilne: has joined #ruby
[18:35:08] uZiel: has joined #ruby
[18:37:36] jenrzzz: has joined #ruby
[18:45:35] claudiuinberlin: has joined #ruby
[18:48:17] bwiseman: has joined #ruby
[18:48:17] kaled: has joined #ruby
[18:51:16] simmaniac: has joined #ruby
[18:51:39] sonOfRa: has joined #ruby
[18:54:17] alnet: has joined #ruby
[18:58:21] yokel: has joined #ruby
[18:58:22] mkali: has joined #ruby
[19:00:18] Jamdaman: has joined #ruby
[19:01:24] AndBobsYourUncle: has joined #ruby
[19:02:38] blackmesa: has joined #ruby
[19:04:29] jenrzzz: has joined #ruby
[19:04:41] jenrzzz: has joined #ruby
[19:09:03] BTRE: has joined #ruby
[19:12:39] Bhootrk_: has joined #ruby
[19:14:14] jinie: has joined #ruby
[19:15:21] phaul: has joined #ruby
[19:19:04] unreal: has joined #ruby
[19:20:48] Dimik: has joined #ruby
[19:21:09] conta2: has joined #ruby
[19:23:57] ycyclist: has joined #ruby
[19:24:09] Azure: has joined #ruby
[19:24:20] bronson: has joined #ruby
[19:24:42] motstgo: has joined #ruby
[19:24:44] ycyclist: If my friend from last night is out there, the kernel load option worked fine.
[19:25:00] ycyclist: However, many is definitely larger than 2 in this case.
[19:25:58] irick: has joined #ruby
[19:28:30] alfiemax: has joined #ruby
[19:32:07] ramfjord: has joined #ruby
[19:33:18] chouhoulis: has joined #ruby
[19:33:32] claudiuinberlin: has joined #ruby
[19:37:04] Azure: has joined #ruby
[19:38:02] ramfjord: has joined #ruby
[19:39:40] cagmz: has joined #ruby
[19:40:20] johno84: has joined #ruby
[19:41:13] Guest97372: has joined #ruby
[19:44:07] enterprisey: has joined #ruby
[19:45:00] eckhardt: has joined #ruby
[19:45:04] naitian: has joined #ruby
[19:45:24] blackmesa1: has joined #ruby
[19:50:42] gizmore: has joined #ruby
[19:51:15] ur5us: has joined #ruby
[19:52:07] elsevero: has joined #ruby
[19:52:13] AndBobsYourUncle: has joined #ruby
[19:54:22] wald0: has joined #ruby
[19:54:51] troulouliou_dev: has joined #ruby
[19:56:20] Petru: has joined #ruby
[19:57:47] troulouliou_dev: hi what is the check_empty in this case : def valid?(value, check_empty: true)
[19:58:12] troulouliou_dev: alternative syntax for default parameter value ?
[19:58:41] orbyt_: has joined #ruby
[19:58:46] mim1k: has joined #ruby
[19:59:45] Papierkorb: troulouliou_dev: That's a key-word argument with a default value of `true`. To pass a different value to it, you have to explicitly pass the keyword name: `valid?(foo, check_empty: false)`. You can't omit the name, this won't work: `valid?(foo, false)`
[20:00:16] troulouliou_dev: Papierkorb, ok thanks
[20:00:20] perniciouscaffei: has joined #ruby
[20:00:28] aclark: has joined #ruby
[20:00:54] troulouliou_dev: Papierkorb, they are position independant i guess if i use several then
[20:01:08] Papierkorb: You're correct, they are :)
[20:01:32] troulouliou_dev: Papierkorb, awesome thanks
[20:03:31] ta: has joined #ruby
[20:03:43] linetrace: has joined #ruby
[20:04:28] Rapture: has joined #ruby
[20:04:30] elitetnade: has joined #ruby
[20:06:04] dviola: has joined #ruby
[20:06:42] shinnya: has joined #ruby
[20:09:00] jrafanie: has joined #ruby
[20:09:57] claudiuinberlin: has joined #ruby
[20:17:54] zachk: has joined #ruby
[20:23:49] dinfuehr: has joined #ruby
[20:27:09] claudiuinberlin: has joined #ruby
[20:29:39] troulouliou_dev: has joined #ruby
[20:29:42] amirite: has joined #ruby
[20:29:42] cadillac_: has joined #ruby
[20:30:48] gusrub: has joined #ruby
[20:31:53] linetrace: has left #ruby: ()
[20:32:34] eckhardt: has joined #ruby
[20:33:35] ta: has joined #ruby
[20:34:52] enterprisey: has joined #ruby
[20:38:24] mtkd: has joined #ruby
[20:39:30] kt: has joined #ruby
[20:40:39] eckhardt: has joined #ruby
[20:40:52] Rythen: has joined #ruby
[20:41:46] lexruee: has joined #ruby
[20:44:28] amirite: has joined #ruby
[20:46:11] spt0: has joined #ruby
[20:46:12] zeitchef: has joined #ruby
[20:50:26] eckhardt: has joined #ruby
[20:53:58] Archrover: has joined #ruby
[20:56:05] ta: has joined #ruby
[21:06:14] elitedhort: has joined #ruby
[21:07:24] knight33: has joined #ruby
[21:08:52] jenrzzz: has joined #ruby
[21:10:02] amirite: has joined #ruby
[21:12:01] rwb: has joined #ruby
[21:14:11] milardovich: has joined #ruby
[21:14:37] Alina-malina: has joined #ruby
[21:16:08] Rythen: Hi I'm new to Ruby. I was wondering if it's considered better form to use symbols or strings as keys in Ruby. Is one considered more right or is it just preference that varies from developer to developer?
[21:16:22] Rythen: as keys to hashes I mean
[21:17:51] Puffball: has joined #ruby
[21:25:15] matthewd: Rythen: It really depends where the keys are coming from
[21:25:31] bronson: has joined #ruby
[21:26:29] matthewd: Rythen: If it's all in straight code, symbols are handy. If you're using externally-input data, strings are more common.
[21:29:35] Alina-malina: has joined #ruby
[21:29:36] ramfjord: has joined #ruby
[21:31:04] Rythen: matthewd: So if you were for example parsing strings and ptuting them into a hash it'd be better to keep the keys as strings since that's what they originally are?
[21:37:34] ta: has joined #ruby
[21:37:46] gusrub: has joined #ruby
[21:38:09] Alina-malina: has joined #ruby
[21:38:42] rfoust: has joined #ruby
[21:44:14] imode: has joined #ruby
[21:48:36] Alina-malina: has joined #ruby
[21:50:17] jphase: has joined #ruby
[21:56:08] Alina-malina: has joined #ruby
[21:57:25] Rapture: has joined #ruby
[22:00:30] ruby[bot]: has joined #ruby
[22:00:30] ChanServ: +o ruby[bot]
[22:00:51] enterprisey: has joined #ruby
[22:03:42] orbyt_: has joined #ruby
[22:06:50] selim: has joined #ruby
[22:07:58] AndBobsYourUncle: has joined #ruby
[22:13:37] Alina-malina: has joined #ruby
[22:15:01] mson: has joined #ruby
[22:17:28] alfiemax: has joined #ruby
[22:20:04] def_jam: has joined #ruby
[22:20:32] eb0t_: has joined #ruby
[22:20:47] orbyt_: has joined #ruby
[22:23:35] Alina-malina: has joined #ruby
[22:23:56] vondruch: has joined #ruby
[22:28:27] vondruch: has joined #ruby
[22:30:13] chouhoul_: has joined #ruby
[22:31:58] zautomata: has joined #ruby
[22:33:27] adamisntdead: has joined #ruby
[22:47:27] ta: has joined #ruby
[22:49:47] elsevero_: has joined #ruby
[22:57:25] jphase: has joined #ruby
[22:57:47] Kanibal: >> File.join('foo/', './bar/blub.txt')
[22:57:48] ruby[bot]: Kanibal: # => "foo/./bar/blub.txt" (https://eval.in/873822)
[22:58:07] Kanibal: Is there a quick solution to further "improve" this? (omit the dot?)
[23:02:02] cdg_: has joined #ruby
[23:02:04] jenrzzz: has joined #ruby
[23:02:04] jenrzzz: has joined #ruby
[23:05:46] kanobt61: has joined #ruby
[23:10:04] thinkpad: has joined #ruby
[23:14:12] Alina-malina: has joined #ruby
[23:15:08] enterprisey_: has joined #ruby
[23:15:16] __Yiota: has joined #ruby
[23:23:43] Alina-malina: has joined #ruby
[23:24:51] tfitts: has joined #ruby
[23:26:33] ta: has joined #ruby
[23:27:03] Heph_: has joined #ruby
[23:38:30] nchambers: has joined #ruby
[23:39:07] nchambers: has joined #ruby
[23:46:17] Alina-malina: has joined #ruby
[23:48:13] cagomez_: whats the preferred object creation pattern when you want to pass in a variable and immediately get a return value back? like a throwaway object that doesn't really need to hold any state, just generate a string (for example) based on the params
[23:49:44] teatime: sounds like a function?
[23:49:47] bruno-: has joined #ruby
[23:50:55] cagomez_: teatime: let's say i want to make it into a class/object
[23:52:17] cagomez_: one example i saw is SomeObject.call() where SomeObject had def self.call; new.call(); end; def cell; doStuff; end; end;
[23:54:18] jphase: has joined #ruby
[23:57:21] rwb: has joined #ruby
[23:58:33] ta: has joined #ruby
[23:58:40] bastilian_: has joined #ruby
[23:58:50] elomatreb: Is it necessary to create an instance internally like that?
[23:59:23] elomatreb: I.e. can't you just put the logic (doStuff) in the self.call method?