« Back to channel list

#ruby - 02 October 2017

« Back 1 day Forward 1 day »
[00:01:23] cdg: has joined #ruby
[00:06:25] hahuang65: has joined #ruby
[00:07:44] teatime: with .reduce the memo object can't be arbitrary objects?
[00:08:19] teatime: (I found .each_with_object, but still curious)
[00:09:34] jinie_: has joined #ruby
[00:09:36] milardovich: has joined #ruby
[00:14:08] orbyt_: has joined #ruby
[00:19:16] BubonicPestilenc: has joined #ruby
[00:19:48] BubonicPestilenc: https://ruby-doc.org/stdlib-2.4.0/libdoc/find/rdoc/Find.html
[00:19:55] BubonicPestilenc: using something new to me: == ?.
[00:20:13] BubonicPestilenc: i tested `p ?.` #=> "."
[00:20:33] BubonicPestilenc: can somebody tell me what is this called to find description ?
[00:20:41] BubonicPestilenc: i definitely missed this "string" syntax
[00:21:47] matthewd: BubonicPestilenc: It's a character literal
[00:22:10] BubonicPestilenc: why they used it in example?
[00:22:17] BubonicPestilenc: why not compare to == "."
[00:22:33] BubonicPestilenc: Are they preventing utf-8 issues?
[00:22:53] matthewd: As you've already seen, they're the same
[00:23:08] matthewd: ?. is another way of spelling ".", just like '.'
[00:23:16] mjolnird: has joined #ruby
[00:23:51] mjolnird: has joined #ruby
[00:25:24] halt: has joined #ruby
[00:25:57] teatime: BubonicPestilenc: it stopped working like ord---nevermind.
[00:28:20] tamouse__: has joined #ruby
[00:28:35] mjolnird: has joined #ruby
[00:30:15] adampants: has joined #ruby
[00:36:19] statelesscode: has joined #ruby
[00:39:24] vivekananda: has joined #ruby
[00:41:59] adampants: has left #ruby: ()
[00:47:29] orbyt_: has joined #ruby
[00:57:29] al2o3-cr: has joined #ruby
[01:00:21] enterprisey: has joined #ruby
[01:01:59] gizmore|2: has joined #ruby
[01:05:53] nankyoku_: has joined #ruby
[01:11:35] nankyokusei: has joined #ruby
[01:12:38] milardovich: has joined #ruby
[01:19:58] swills: has joined #ruby
[01:19:59] swills: has joined #ruby
[01:20:09] MarkBilk: has joined #ruby
[01:23:26] bronson: has joined #ruby
[01:23:38] d^sh: has joined #ruby
[01:29:54] tamouse__: has joined #ruby
[01:30:48] bmurt: has joined #ruby
[01:40:38] Stan: has joined #ruby
[01:42:02] xcortexinx: has joined #ruby
[01:42:34] giraffe: has joined #ruby
[01:43:34] tpendragon: has joined #ruby
[01:46:08] tamouse__: has joined #ruby
[01:56:03] milardovich: has joined #ruby
[01:56:16] milardovich: has joined #ruby
[01:59:45] gizmore: has joined #ruby
[02:06:31] cdg: has joined #ruby
[02:06:33] milardovich: has joined #ruby
[02:06:33] nowhereman: has joined #ruby
[02:07:17] hahuang65: has joined #ruby
[02:09:30] bkulbida: has joined #ruby
[02:09:46] harai: has joined #ruby
[02:11:29] cdg: has joined #ruby
[02:15:39] tamouse__: has joined #ruby
[02:15:51] bmurt: has joined #ruby
[02:18:38] consti: has joined #ruby
[02:23:49] MarkBilk: has joined #ruby
[02:24:25] Azure: has joined #ruby
[02:28:18] bmurt: has joined #ruby
[02:29:53] Phage: has joined #ruby
[02:29:53] Phage: has joined #ruby
[02:32:31] jphase: has joined #ruby
[02:32:53] jinie_: has joined #ruby
[02:36:06] Morrolan: has joined #ruby
[02:36:23] Stan: has joined #ruby
[02:43:41] AOSGm: has joined #ruby
[02:44:21] jinie_: has joined #ruby
[02:48:02] AOSGm: Hi guys anyone up for a newb qn? I'm tryin setup`http://opensourcebilling.org on my Debian8x64. By all accounts it looks fine and running but when i loaded the site on the browser it says not found. Firewall set to accept all over port but it cannot be loaded. Any ideas why?
[02:52:15] teatime: AOSGm: are you running "rails server" or did you setup a nginx/apache/etc. ?
[02:53:16] AOSGm: teatime: Im runnin rails server
[02:53:41] teatime: it only listens on localhost (127.0.0.1 and ::1)
[02:53:53] alfiemax: has joined #ruby
[02:54:54] AOSGm: it listens to port 3000
[02:55:14] teatime: on localhost.
[02:55:52] teatime: You can't access localhost remotely.
[02:56:38] teatime: You can tell `rails server` to not just listen on localhost, but `rails server` is not meant for production or public access.
[02:56:43] AOSGm: i can access domain.com just not domain.com:3000
[02:57:16] AOSGm: It is meant for tinkering
[02:57:35] teatime: it's listening on 127.0.0.1:3000 not on the public IP addr, you can't access it remotely that way.
[02:58:37] AOSGm: So i'll just specify the public IP in -h?
[02:59:03] cdg: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:01:02] teatime: something you can do, which is super helpful to know about, is use SSH port forwarding. if you 'ssh -L 2000:127.0.0.1:3000 username@webserver.example.com' (from your local machine) you can then go to http://127.0.0.1:2000/ (on your local machine) and the traffic will be tunneled through the SSH connection to the remote machine (where it will go to 127.0.0.1:3000.) note that these two localhosts are
[03:01:08] teatime: different.
[03:02:07] teatime: AOSGm: it's -b, but be aware 1) that will make it available to everyone on the internet, and 2) your traffic to it, including passwords and such, will be sent in plaintext and not encrypted.
[03:02:16] teatime: it is not recommended.
[03:04:28] mokiwis: has joined #ruby
[03:08:10] jinie: has joined #ruby
[03:10:12] hahuang65: has joined #ruby
[03:13:08] AOSGm: teatime: I should run it on ssl?
[03:24:20] bronson: has joined #ruby
[03:27:34] yitsushi: has joined #ruby
[03:28:56] gix: has joined #ruby
[03:33:36] Zimsky: has joined #ruby
[03:40:16] tamouse__: has joined #ruby
[03:42:59] Cyrus: has joined #ruby
[03:51:37] LastWhisper____: has joined #ruby
[03:52:29] Cohedrin_: has joined #ruby
[03:52:59] Dimik: has joined #ruby
[04:00:26] cdg: has joined #ruby
[04:00:28] Stan: has joined #ruby
[04:18:36] jphase: has joined #ruby
[04:19:08] Stan: has joined #ruby
[04:27:10] _whitelogger: has joined #ruby
[04:33:45] xco: has joined #ruby
[04:41:53] Stan: has joined #ruby
[04:42:53] Stan: has joined #ruby
[04:45:26] bastilian: has joined #ruby
[04:47:03] Stan: has joined #ruby
[04:56:41] xco: has joined #ruby
[05:01:17] cdg: has joined #ruby
[05:04:12] cgfbee: has joined #ruby
[05:11:17] hahuang65: has joined #ruby
[05:16:26] dionysus69: has joined #ruby
[05:24:16] xco: hi on line 6 here: https://gist.github.com/xcobar/1aee27b48599e0add7a40df35cbc5d38 i have an error comparison of String with String failed. this can be reproduced when #<=> is overwritten like here https://eval.in/870733. problem is, i haven’t overwritten that anywhere in my code.
[05:24:19] xco: any tips?
[05:25:41] bronson: has joined #ruby
[05:26:23] Stan: has joined #ruby
[05:27:51] Radar: xco: what is words? what is str?
[05:28:02] Radar: show us the values for those and we can probably tell you what's going wrong
[05:33:12] Cohedrin_: has joined #ruby
[05:33:13] xco: ok few mins
[05:33:49] haxx0r: has left #ruby: ()
[05:40:38] aupadhye: has joined #ruby
[05:46:35] pr0ton: has joined #ruby
[05:50:31] uZiel: has joined #ruby
[05:51:43] aufi: has joined #ruby
[05:52:22] xco: Radar: the values of words = ["nike", "sho", "nike sho"] and str = "nike sho"
[05:53:21] Radar: xco: and what is word_indexes
[05:53:52] xco: locations = {"nike"=>0, "sho"=>5, "nike sho"=>0}
[05:54:47] xco: word_indexes = https://gist.github.com/xcobar/1aee27b48599e0add7a40df35cbc5d38#file-word_indexes-rb
[05:56:14] alfiemax: has joined #ruby
[05:57:01] Stan: has joined #ruby
[05:57:25] mjolnird: has joined #ruby
[05:59:51] Stan: has joined #ruby
[06:00:31] aupadhye: has joined #ruby
[06:02:23] cdg: has joined #ruby
[06:04:04] al2o3-cr: xco: that code works.
[06:05:39] xco: yeah just found out. Sentry is catching it :/
[06:06:18] harai: has joined #ruby
[06:17:20] Stan: has joined #ruby
[06:20:31] gusrub: has joined #ruby
[06:23:13] cdg: has joined #ruby
[06:28:20] djbkd: has joined #ruby
[06:30:49] oetjenj: has joined #ruby
[06:35:28] tonini: has joined #ruby
[06:44:17] DoubleMalt: has joined #ruby
[06:46:25] zautomata: has joined #ruby
[06:47:49] claudiuinberlin: has joined #ruby
[06:47:52] shime: has joined #ruby
[06:49:06] conta: has joined #ruby
[06:49:47] hs366: has joined #ruby
[06:56:58] Silthias: has joined #ruby
[06:57:10] dn`: has joined #ruby
[06:58:23] Cohedrin_: has joined #ruby
[07:01:56] morfin: has joined #ruby
[07:02:21] morfin: i guess better upgrade an application because i had so many problems with old gems
[07:02:32] morfin: but upgrading can create even more issues
[07:02:59] anas: has joined #ruby
[07:03:41] morfin: i am wondering does JRuby work with OpenJDK?
[07:05:52] mim1k: has joined #ruby
[07:06:12] morfin: or it's recommended to use Oracle JDK
[07:12:06] hahuang65: has joined #ruby
[07:13:59] harfangk: has joined #ruby
[07:19:36] Cohedrin_: has joined #ruby
[07:23:39] mim1k: has joined #ruby
[07:24:02] cdg: has joined #ruby
[07:24:42] ShalokShalom: has joined #ruby
[07:26:32] bronson: has joined #ruby
[07:27:32] mathys: has joined #ruby
[07:27:42] unshadow: has joined #ruby
[07:27:55] sysvalve: has joined #ruby
[07:29:16] voiceftp: has joined #ruby
[07:30:33] enterprisey: has joined #ruby
[07:31:49] alex``: has joined #ruby
[07:34:21] biberu: has joined #ruby
[07:35:21] dionysus69: has joined #ruby
[07:39:54] alex``: has joined #ruby
[07:47:03] SHyx0rmZ: has joined #ruby
[07:53:19] mim1k: has joined #ruby
[07:54:32] burgestrand: has joined #ruby
[07:55:40] TvL: has joined #ruby
[07:56:13] r7c: has joined #ruby
[07:56:28] shime: has joined #ruby
[07:57:25] dionysus69: has joined #ruby
[07:58:29] Stan: has joined #ruby
[07:59:33] Mon_Ouie: has joined #ruby
[08:01:08] uZiel: has joined #ruby
[08:01:53] ta: has joined #ruby
[08:11:11] phaul: has joined #ruby
[08:11:21] FastJack: has joined #ruby
[08:11:37] ta: has joined #ruby
[08:15:54] Mon_Ouie: has joined #ruby
[08:16:32] mark_66: has joined #ruby
[08:18:26] ta: has joined #ruby
[08:18:27] cadillac_: has joined #ruby
[08:20:44] blackmesa: has joined #ruby
[08:20:46] Stan: has joined #ruby
[08:23:10] marr: has joined #ruby
[08:24:12] ta: has joined #ruby
[08:24:23] Stan: has joined #ruby
[08:24:54] cdg: has joined #ruby
[08:25:31] jaruga: has joined #ruby
[08:26:27] ta: has joined #ruby
[08:29:52] Stan: has joined #ruby
[08:30:17] ldepandis: has joined #ruby
[08:34:05] mikecmpbll: has joined #ruby
[08:36:32] xco: has joined #ruby
[08:41:51] MyMind: has joined #ruby
[08:41:56] simmaniac: has joined #ruby
[08:42:49] Stan: has joined #ruby
[08:42:51] ldepandis: has joined #ruby
[08:46:14] lxsameer: has joined #ruby
[08:47:01] mim1k: has joined #ruby
[08:47:50] simmaniac: has joined #ruby
[08:48:22] ldepandis: has joined #ruby
[08:49:04] DoubleMalt: has joined #ruby
[08:51:27] Stan: has joined #ruby
[08:54:57] agimenez: has joined #ruby
[08:56:17] govg: has joined #ruby
[08:57:17] Nahra: has joined #ruby
[08:57:50] ur5us: has joined #ruby
[08:58:18] sysvalve: has joined #ruby
[09:02:08] Stan: has joined #ruby
[09:03:20] simmaniac: has joined #ruby
[09:03:45] tao_: has joined #ruby
[09:04:39] mr_foto: has joined #ruby
[09:07:23] Stan: has joined #ruby
[09:12:55] hahuang65: has joined #ruby
[09:14:12] Stan: has joined #ruby
[09:20:57] DrCode: has joined #ruby
[09:23:01] oetjenj: has joined #ruby
[09:23:47] oetjenj: has joined #ruby
[09:24:33] oetjenj: has joined #ruby
[09:25:19] oetjenj: has joined #ruby
[09:25:41] cdg: has joined #ruby
[09:26:43] burgestrand: has joined #ruby
[09:27:34] bronson: has joined #ruby
[09:28:44] r3kz: has joined #ruby
[09:32:38] MarkBilk: has joined #ruby
[09:32:39] workmad3: has joined #ruby
[09:41:20] charliesome: has joined #ruby
[09:43:57] al2o3-cr: has joined #ruby
[09:44:13] InfinityFye: has joined #ruby
[09:55:58] irick: has joined #ruby
[09:56:06] Silthias1: has joined #ruby
[09:56:20] mr_foto: has joined #ruby
[09:58:51] marr: has joined #ruby
[09:59:06] rgr: has joined #ruby
[09:59:09] stan__: has joined #ruby
[10:00:11] mr_foto: has joined #ruby
[10:00:41] stan__: has joined #ruby
[10:00:44] jphase: has joined #ruby
[10:06:52] stan__: has joined #ruby
[10:08:36] sepp2k: has joined #ruby
[10:08:40] mim1k_: has joined #ruby
[10:09:55] stan__: has joined #ruby
[10:16:26] al2o3-cr: has joined #ruby
[10:19:46] ldepandis: has joined #ruby
[10:21:47] rgr_: has joined #ruby
[10:25:54] DrCode: has joined #ruby
[10:26:34] cdg: has joined #ruby
[10:31:16] stan__: has joined #ruby
[10:32:01] stan_br: has joined #ruby
[10:38:41] stan__: has joined #ruby
[10:43:01] DoubleMalt: has joined #ruby
[10:45:05] tamouse__: has joined #ruby
[10:48:01] ur5us: has joined #ruby
[10:48:42] Alina-malina: has joined #ruby
[10:51:55] MarkBilk_: has joined #ruby
[10:55:45] alex``: has joined #ruby
[10:56:54] Paraxial: has joined #ruby
[10:58:50] Stan: has joined #ruby
[11:00:18] Paraxial: has joined #ruby
[11:03:58] lexruee: has joined #ruby
[11:04:18] alex``: has joined #ruby
[11:05:48] jokke: can someone explain what's going on here? There was an error while loading `spawning_logger.gemspec`: uninitialized constant SimpleDelegator. Bundler cannot continue.
[11:08:08] jokke: i don't have the usual structure that my main namespace is a module but rather that it's a class
[11:08:27] jokke: and its superclass is SimpleDelegator
[11:09:04] jokke: so in my version file i have class SpawningLogger < SimpleDelegator; VERSION = ... end
[11:09:33] jokke: my tests work fine, there's no problem with a missing constant there
[11:11:04] Stan: has joined #ruby
[11:12:01] Stan: has joined #ruby
[11:13:55] hahuang65: has joined #ruby
[11:14:50] Alina-malina: has joined #ruby
[11:16:28] charliesome: has joined #ruby
[11:21:06] mim1k: has joined #ruby
[11:23:55] Stan: has joined #ruby
[11:29:17] bronson: has joined #ruby
[11:35:55] jphase: has joined #ruby
[11:36:12] kapil___: has joined #ruby
[11:36:32] Stan: has joined #ruby
[11:38:19] stanc: has joined #ruby
[11:42:49] Stan: has joined #ruby
[11:46:28] stanc: has joined #ruby
[11:48:31] mim1k: has joined #ruby
[11:49:13] ta: has joined #ruby
[11:52:39] harfangk: has joined #ruby
[11:58:12] jaruga: has joined #ruby
[12:00:03] tcopeland: has joined #ruby
[12:00:46] shinnya: has joined #ruby
[12:02:08] ldnunes: has joined #ruby
[12:06:31] thinkpad: has joined #ruby
[12:06:35] jphase: has joined #ruby
[12:10:53] darix: jokke: require the file that provides SimpleDelegator in the file that defines the version
[12:11:35] jphase: has joined #ruby
[12:13:30] stan__: has joined #ruby
[12:15:35] ta: has joined #ruby
[12:16:12] jokke: darix: SimpleDelegator ist stdlib
[12:16:14] fmcgeough: has joined #ruby
[12:16:16] jokke: https://ruby-doc.org/stdlib-2.4.1/libdoc/delegate/rdoc/SimpleDelegator.html
[12:16:43] darix: jokke: you still need to require it
[12:16:57] darix: i also have to do "require 'openssl'" if i want to use that stdlib module
[12:17:57] jokke: nice. requiring 'delegate' did the trick
[12:19:47] minimalism: has joined #ruby
[12:31:05] bmurt: has joined #ruby
[12:31:22] Mon_Ouie: has joined #ruby
[12:32:54] rabajaj: has joined #ruby
[12:44:12] ShalokShalom: has joined #ruby
[12:50:06] DaniG2k: has joined #ruby
[12:52:23] lxsameer: has joined #ruby
[12:53:41] milardovich: has joined #ruby
[12:54:53] Stan: has joined #ruby
[13:00:14] workboy: has joined #ruby
[13:00:36] workboy: Hey guys, what's the best way to validate ruby online in a web page?
[13:01:19] bmurt: has joined #ruby
[13:01:21] workboy: I want to crate a simple text editor page where ppl can validate very simple scripts (couple of functions)
[13:01:51] workboy: just a single file
[13:02:14] zhunting: has left #ruby: ("WeeChat 1.9")
[13:02:36] fmcgeough: has joined #ruby
[13:03:22] truenito: has joined #ruby
[13:03:34] Paraxial: has joined #ruby
[13:04:47] sysvalve: has joined #ruby
[13:05:17] fmcgeough_: has joined #ruby
[13:09:35] elomatreb: Validate as in syntax?
[13:09:48] mim1k: has joined #ruby
[13:11:59] charliesome: has joined #ruby
[13:14:52] hahuang65: has joined #ruby
[13:15:45] FastJack: has joined #ruby
[13:17:55] mson: has joined #ruby
[13:17:58] workboy: elomatreb, more like evaluate this simple function that returns a string and if string match to a specific return then you "pass"
[13:18:12] workboy: elomatreb, sort of exercise like, if you'd like
[13:18:35] workboy: electrostat, i'd like to make something similar to this
[13:18:35] workboy: http://tryruby.org
[13:18:40] elomatreb: The problem with that is that you can't just run "simple" functions, code execution is code execution
[13:18:52] john__: has joined #ruby
[13:19:14] workboy: elomatreb, I agree, so my idea is that there might be some resp api services out there for code evaluation
[13:19:54] elomatreb: The eval bot in this channel uses https://eval.in/ as a backend
[13:21:17] LastWhisper____: has joined #ruby
[13:21:29] cdg: has joined #ruby
[13:22:07] workboy: elomatreb, i found the website before but can't see to find any api docs or anything to suggest i could use it like that
[13:23:08] elomatreb: I'm not sure it's intended for that either, I don't know any services that officially offer something like this
[13:25:11] Paraxial: has joined #ruby
[13:25:22] workboy: elomatreb, myea, think one of my most solid options is to pipe the code sample to a docker container run and return it
[13:25:52] jokke: is it possible to stub out `require` in rspec?
[13:26:12] jokke: (not via allow(Kernel).to receive(:require)
[13:27:38] cdg_: has joined #ruby
[13:29:31] DLSteve_: has joined #ruby
[13:29:39] cabotto: has joined #ruby
[13:30:14] bronson: has joined #ruby
[13:30:20] Paraxial: has joined #ruby
[13:33:10] Paraxial: has joined #ruby
[13:33:21] Mon_Ouie: workboy: There's no real API for eval.in, you just send the same POST request that would be sent if you were to fill out the form on the web page
[13:43:31] DaniG2k: has joined #ruby
[13:51:06] tamouse__: has joined #ruby
[13:56:39] FrostCandy: has joined #ruby
[14:00:05] jokke: i'm trying to test a lib which will prepend a class with a module depending on a class level setting. is there a possibility to remove all prepended module (and class methods) from the tested class?
[14:00:12] cabotto: has left #ruby: ()
[14:00:22] cabotto: has joined #ruby
[14:00:28] p0p0pr37: has joined #ruby
[14:00:28] p0p0pr37: has joined #ruby
[14:00:36] jokke: somehow to reload the original definition of the class?
[14:03:28] mikecmpbll: has joined #ruby
[14:04:49] ElDoggo: has joined #ruby
[14:05:33] yeticry: has joined #ruby
[14:06:47] jphase: has joined #ruby
[14:09:26] bruno-: has joined #ruby
[14:10:54] Rapture: has joined #ruby
[14:13:05] sepp2k1: has joined #ruby
[14:19:00] ResidentBiscuit: has joined #ruby
[14:20:52] ElDoggo: has joined #ruby
[14:22:20] mikecmpbll: has joined #ruby
[14:22:51] tamouse__: has joined #ruby
[14:23:49] griffindy: has joined #ruby
[14:24:21] griffindy: has joined #ruby
[14:26:59] bmurt: has joined #ruby
[14:28:45] rwb: has joined #ruby
[14:28:57] _aeris_: has joined #ruby
[14:29:51] p0p0pr37_: has joined #ruby
[14:29:51] p0p0pr37_: has joined #ruby
[14:30:21] cdg: has joined #ruby
[14:31:11] tamouse__: has joined #ruby
[14:34:08] cdg: has joined #ruby
[14:34:34] chriscarpenter12: has joined #ruby
[14:34:38] cdg_: has joined #ruby
[14:36:05] truenito: has joined #ruby
[14:36:43] burgestrand: has joined #ruby
[14:37:38] heftig: has joined #ruby
[14:39:07] jinie: has joined #ruby
[14:40:58] ldepandis: has joined #ruby
[14:42:52] simmaniac: has joined #ruby
[14:43:15] chriscarpenter12: I am in the process of creating an API wrapper for an internal API. I am struggling to figure out how to create method chaining in a class. Here's a gist of what I'm trying: https://gist.github.com/chriscarpenter12/e7974d4144c0723a54eb009f6efbbf5a
[14:44:29] chriscarpenter12: Running all or find should return some results, but I want to be able to chain another method to augment the results from the first set. Not sure if this is possible.
[14:45:09] chriscarpenter12: First results in google search goes to a sitepoint article: https://www.sitepoint.com/a-guide-to-method-chaining/
[14:46:00] chriscarpenter12: It says to return self on the methods, but how do you get results if you don't chain something else on them?
[14:47:38] jphase: has joined #ruby
[14:48:47] darix: chriscarpenter12: look at arel maybe
[14:48:51] darix: chriscarpenter12: or activerecord
[14:49:02] darix: chriscarpenter12: those basically implement the pattern you want.
[14:50:55] chriscarpenter12: darix: Thanks I'll look. I was skimming Active Record, but didn't know if there was a simpler way
[14:53:01] darix: chriscarpenter12: arel is the backend to AR
[14:54:35] polishdub: has joined #ruby
[14:56:35] oetjenj: has joined #ruby
[15:00:05] gusrub: has joined #ruby
[15:00:20] iHmD: has joined #ruby
[15:03:01] iHmD: has left #ruby: ("Good Bye")
[15:06:16] rippa: has joined #ruby
[15:07:02] milardovich: has joined #ruby
[15:07:21] cdg: has joined #ruby
[15:08:33] truenito: has joined #ruby
[15:09:16] charliesome: has joined #ruby
[15:09:57] alfiemax: has joined #ruby
[15:13:47] smelnicki: has joined #ruby
[15:15:39] hahuang65: has joined #ruby
[15:15:43] sysvalve: has joined #ruby
[15:15:53] mim1k: has joined #ruby
[15:16:48] agimenez: has joined #ruby
[15:17:35] jphase: has joined #ruby
[15:18:02] ElDoggo: has joined #ruby
[15:20:37] jphase_: has joined #ruby
[15:21:32] ElDoggo: has joined #ruby
[15:22:23] rabajaj: has joined #ruby
[15:28:22] john__: has joined #ruby
[15:31:16] bronson: has joined #ruby
[15:34:26] pr0ton: has joined #ruby
[15:35:33] __Yiota: has joined #ruby
[15:50:56] troys: has joined #ruby
[15:53:48] klaas: has joined #ruby
[15:54:18] cagomez: has joined #ruby
[15:56:56] cagomez: has joined #ruby
[15:57:25] [Butch]: has joined #ruby
[15:57:42] cagomez: has joined #ruby
[16:00:04] marxarelli: has joined #ruby
[16:01:45] [Butch]: has joined #ruby
[16:04:45] gizmore: has joined #ruby
[16:05:51] mostlybadfly: has joined #ruby
[16:09:29] nofxxx: has joined #ruby
[16:14:50] bmurt: has joined #ruby
[16:16:00] cpruitt: has joined #ruby
[16:17:11] marcux: has joined #ruby
[16:20:20] jphase: has joined #ruby
[16:22:52] gusrub: has joined #ruby
[16:24:19] pr0ton: has joined #ruby
[16:24:28] pr0ton: has left #ruby: ()
[16:25:33] bmurt: has joined #ruby
[16:27:10] Keytap: has joined #ruby
[16:27:39] Keytap: Hey guys, quick question, is there a way to source a script so that it executes in the current scope/environment?
[16:28:06] Keytap: load/require seems to act similar to calling a script from bash vs source'ing the script
[16:31:44] bmurt: has joined #ruby
[16:38:41] eckhardt: has joined #ruby
[16:40:53] orbyt_: has joined #ruby
[16:41:08] conta1: has joined #ruby
[16:41:54] selim: has joined #ruby
[16:42:10] Papierkorb: Keytap: Not that I recommend doing it, but check out `Binding#eval`: `a = 1; binding.eval("a = 2"); p a`
[16:44:03] matthewd: That's only partially true though.. you really want to define classes and methods and then call them, instead
[16:45:33] Keytap: Papierkorb: You familiar with Compass by any chance?
[16:45:35] havenwood: Keytap: #load takes a second argument for whether to wrap the loaded code in an anonymous module
[16:45:45] havenwood: Keytap: it's best to use explicit namespaces
[16:46:12] Keytap: havenwood: I can't really here, as far as I'm aware.
[16:46:30] Keytap: The rb file serves as a configuration for an application we use to compile our scss scripts
[16:46:48] Keytap: I'm trying to extend this file and add additional import directories
[16:49:52] blackmesa: has joined #ruby
[16:53:58] cdg: has joined #ruby
[16:54:04] chouhoulis: has joined #ruby
[16:55:27] hahuang65: has joined #ruby
[16:57:26] __Yiota: has joined #ruby
[16:58:19] brendan-: has joined #ruby
[16:58:47] centrx: has joined #ruby
[16:58:48] centrx: has joined #ruby
[16:59:21] nankyoku_: has joined #ruby
[16:59:37] imode: has joined #ruby
[17:01:13] zautomata: has joined #ruby
[17:01:53] alex``: has joined #ruby
[17:03:12] DmitryBochkarev: has joined #ruby
[17:03:33] alfiemax: has joined #ruby
[17:07:16] ycyclist: has joined #ruby
[17:08:40] leah2: has joined #ruby
[17:08:53] ycyclist: I would like a spec which gives the entire range of possible return values from Socket.gethostname external of exceptions.
[17:08:58] gusrub: has joined #ruby
[17:15:43] brian_penguin: has joined #ruby
[17:17:08] roswell: has joined #ruby
[17:18:17] roswell: hi folks. if anyone using rfuse, is there a way to set the readdir operation to nonblocking mode?
[17:24:04] paranoicsan: has joined #ruby
[17:26:00] someuser: has joined #ruby
[17:26:05] vdl: has joined #ruby
[17:26:33] FastJack: has joined #ruby
[17:28:55] Paraxial: has joined #ruby
[17:30:12] leah2: has joined #ruby
[17:31:46] whippythellama: has joined #ruby
[17:32:20] bmurt: has joined #ruby
[17:32:26] bronson: has joined #ruby
[17:33:12] _aeris_: has joined #ruby
[17:34:48] lxsameer: has joined #ruby
[17:35:12] shaman42: has joined #ruby
[17:35:23] alfiemax: has joined #ruby
[17:38:09] spheric: has joined #ruby
[17:39:00] paranoicsan: has joined #ruby
[17:39:27] Cohedrin_: has joined #ruby
[17:39:37] mson: has joined #ruby
[17:39:50] dionysus69: has joined #ruby
[17:47:40] kies: has joined #ruby
[17:48:47] FrostCandy: field_array = [], field_array.push[{:fn => 'f', :count => 1}] that produces the error no implicit conversion of Hash into Integer but I don't see why. Does the number need a quote around it in :count => 1?
[17:49:05] Mon_Ouie: has joined #ruby
[17:49:11] Algebr`: has joined #ruby
[17:49:24] centrx: FrostCandy: you're using brackets instead of parens for the push method
[17:49:52] FrostCandy: centrx: gah thanks. switching languages error heh
[17:50:39] jrabe: has joined #ruby
[17:50:46] bmurt: has joined #ruby
[17:55:27] orbyt_: has joined #ruby
[17:56:42] leah2: has joined #ruby
[17:59:25] xco: has joined #ruby
[18:00:10] xco: has joined #ruby
[18:01:10] xco: has joined #ruby
[18:02:01] xco: has joined #ruby
[18:02:46] xco: has joined #ruby
[18:02:53] _Andres: has joined #ruby
[18:03:36] xco: has joined #ruby
[18:04:21] xco: has joined #ruby
[18:05:11] xco: has joined #ruby
[18:05:56] pr0ton: has joined #ruby
[18:08:05] orbyt_: has joined #ruby
[18:13:22] gusrub: has joined #ruby
[18:13:56] postmodern: has joined #ruby
[18:14:09] milardovich: has joined #ruby
[18:14:40] rrichardsr3: has joined #ruby
[18:17:01] s3nd1v0g1us: has joined #ruby
[18:20:09] mikecmpbll: has joined #ruby
[18:21:01] zachk: has joined #ruby
[18:21:42] Mon_Ouie: has joined #ruby
[18:25:30] jphase: has joined #ruby
[18:26:28] gusrub: has joined #ruby
[18:27:38] ramfjord: has joined #ruby
[18:29:08] dinfuehr: has joined #ruby
[18:30:26] conta1: has joined #ruby
[18:30:42] tcopeland: has joined #ruby
[18:32:39] cdg_: has joined #ruby
[18:33:07] piotrj: has joined #ruby
[18:33:40] imode: has joined #ruby
[18:34:48] jphase: has joined #ruby
[18:35:14] [Butch]: has joined #ruby
[18:35:21] charliesome: has joined #ruby
[18:36:24] blackmesa: has joined #ruby
[18:41:48] csk: has joined #ruby
[18:42:30] mtkd: has joined #ruby
[18:44:00] csk_: has joined #ruby
[18:44:46] gusrub: has joined #ruby
[18:48:28] ur5us: has joined #ruby
[18:49:07] xuanrui: has joined #ruby
[18:57:55] dionysus70: has joined #ruby
[19:05:06] mahlon: has joined #ruby
[19:05:52] ta: has joined #ruby
[19:06:10] ben_: has joined #ruby
[19:07:06] Dimik: has joined #ruby
[19:07:46] jaruga: has joined #ruby
[19:11:39] jenrzzz: has joined #ruby
[19:11:39] jenrzzz: has joined #ruby
[19:12:57] marcux: has joined #ruby
[19:14:04] csk: has joined #ruby
[19:15:25] gusrub: has joined #ruby
[19:17:31] centrx: has joined #ruby
[19:17:31] centrx: has joined #ruby
[19:19:52] milardovich: has joined #ruby
[19:23:47] pawnbox: has joined #ruby
[19:24:57] morfin: has joined #ruby
[19:28:27] SeepingN: has joined #ruby
[19:29:52] coderphive: has joined #ruby
[19:30:33] coderphive: has joined #ruby
[19:32:15] yqt: has joined #ruby
[19:33:23] bronson: has joined #ruby
[19:37:44] jphase: has joined #ruby
[19:38:33] slackR: has joined #ruby
[19:44:16] _aeris_: has joined #ruby
[19:47:38] ycyclist: I thought I recall being able to put each additional or at the start of a new line, but it doesn't work now.
[19:48:22] roswell: ycyclist, as in a conditional expression?
[19:48:45] orbyt_: has joined #ruby
[19:48:56] ycyclist: Yes. So I thought I used to be able to do if true <return><tab>or not false then
[19:49:21] ycyclist: But that fails now. I may be going back to 1.87
[19:49:24] roswell: ycyclist, append the line break with backslash
[19:49:39] ycyclist: No, that's not worth it. Better to put it on one line for the trouble.
[19:49:51] roswell: ycyclist, up to you )
[19:50:04] matthewd: Or just put the 'or' on the end of the previous line
[19:50:18] ycyclist: Okay, but I would like to know why that changed, or if I am thinking of another language.
[19:50:52] matthewd: It didn't change
[19:51:42] ycyclist: Ok. Thanks.
[19:52:36] roswell: ycyclist, shell perharps
[19:56:06] gusrub: has joined #ruby
[19:59:31] enterprisey: has joined #ruby
[20:01:52] ben_: has joined #ruby
[20:04:05] elnner: has joined #ruby
[20:04:49] tamouse__: has joined #ruby
[20:05:44] cdg: has joined #ruby
[20:06:10] elnner: hello, anyone knows why Symbol#to_proc doesn't seem to work in this example? `%w(foo barz).min(&:length)`
[20:06:18] elnner: > ArgumentError: wrong number of arguments (given 1, expected 0)
[20:08:14] jenrzzz: has joined #ruby
[20:09:47] havenwood: elnner: You want #min_by
[20:10:06] havenwood: >> %w[foo bar].min_by &:size # elnner
[20:10:07] ruby[bot]: havenwood: # => "foo" (https://eval.in/872403)
[20:10:14] ModusPwnens: has joined #ruby
[20:10:22] ModusPwnens: How do I initialize a class variable from a self method in ruby?
[20:10:30] ModusPwnens: my googlefu appears to be failing me
[20:10:55] nofxxx: has joined #ruby
[20:11:00] matthewd: I'm slightly puzzled at the 1-for-0 error, but ¯\_(ツ)_/¯
[20:11:10] elnner: @havenwood you're right, thanks. It's a weird thing, however, since `%w(foo barz).min {|x| x.length }` do work
[20:11:27] eckhardt: has joined #ruby
[20:11:51] havenwood: >> %w(not-working foo bar).min {|x| x.length } # elnner
[20:11:57] ruby[bot]: havenwood: # => "not-working" (https://eval.in/872405)
[20:12:08] elomatreb: min with a block does comparison in the block
[20:13:35] elnner: it does an incorrect thing, yes. What I don't understand is why the error message is different when using &:length vs a real block, shouldn't it behave in the same way?
[20:14:17] matthewd: elnner: to_proc gives you: ary.min {|a,*x| a.length(*x) }
[20:14:24] havenwood: ModusPwnens: What are you trying? Do you really need a class variable or would a class instance variable suffice?
[20:14:41] matthewd: elnner: And the block is called with two parameters, so length gets passed the second one -- which it's not expecting
[20:15:15] matthewd: >> "foo".length("barz")
[20:15:16] ruby[bot]: matthewd: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/872406)
[20:16:40] ModusPwnens: havenwood: I just have some complex initialization logic in a self method and I want to initialize a common variable using that logic instead of initializing it in two places. I use a class variable because this entire class is essentially a series of self methods
[20:17:24] matthewd: ModusPwnens: gist what you're doing, and what's not working?
[20:18:18] elnner: matthewd: I understand, #to_proc gives you a proc which checks number of arguments, meanwhile normal block usage would not complain about that, thanks!
[20:18:42] ModusPwnens: matthewd: https://gist.github.com/djdawson3/7ecb1a546153eed2aff37a39cdc3b40e
[20:18:48] ModusPwnens: I've also tried doing:
[20:19:15] ModusPwnens: self.initialized_nested_hash and ClassName.initialize_nested_hash, but neither work.
[20:19:34] matthewd: ModusPwnens: Oh, you're just calling the method before you define it. Move the method above the call.
[20:20:52] ModusPwnens: matthewd: oh. Maybe it's because i come from javaland, but seems like that would mess with the organization of this file as one lone method would be above some field and constant declarations
[20:20:55] ModusPwnens: or is that just ruby style?
[20:21:10] cadillac_: has joined #ruby
[20:22:17] matthewd: It's certainly "ruby style" that you can't call a method you haven't defined yet ¯\_(ツ)_/¯
[20:23:12] roswell: has left #ruby: ("Leaving")
[20:23:13] matthewd: For a more convention-based definition of style, I'd say it's not ruby style to use class variables in the first place
[20:23:28] ModusPwnens: Obviously. My question is more: is it considered conventional or otherwise unremarkable to have variable and constant definitions sandwiched between method definitions?
[20:23:46] Mon_Ouie: has joined #ruby
[20:26:37] ModusPwnens: Or is there a way that using instance variables can avoid that type of sandwiching?
[20:26:39] bronson: has joined #ruby
[20:29:22] matthewd: We're really getting into "it depends" territory. Could be as simple as `def self.monitors_hash; @monitors_hash ||= initialize_nested_hash; end` (or even with the class variable)... or setting it up in an initialize on an actual instance of a class instead.
[20:30:02] mtkd: has joined #ruby
[20:30:31] matthewd: I can identify "that physically cannot work" without further context, but it's harder to suggest the most 'conventional' way to approach something without understanding more context of what you're doing.
[20:30:33] ModusPwnens: oh i forgot about that. you can initialize a ruby variable in its getter method, which would eliminate that issue, wouldn't it?
[20:30:48] cdg_: has joined #ruby
[20:30:57] ModusPwnens: this class is never initialized, unfortunately.
[20:31:05] ModusPwnens: the only entry point into the class is from a self method.
[20:31:10] morfin: matthewd, i like this more than "magical" methods
[20:31:20] matthewd: ModusPwnens: But maybe it should be
[20:31:56] matthewd: e.g. maybe it should be a singleton instance, instead of having all the methods as class methods
[20:32:07] ModusPwnens: matthewd: I'm not a ruby expert, so you probably know more than me on this. The reason that it currently isn't is because it just does one thing and the object would never be re-used. There's also no state associated with the object really.
[20:32:41] matthewd: Well what's the variable for, then? ;)
[20:33:21] ModusPwnens: It gets modified during the execution.
[20:33:24] pawnbox: has joined #ruby
[20:33:30] ModusPwnens: but it needs to be initialized to something
[20:33:38] matthewd: Sounds like state to me
[20:33:41] matthewd: But yeah.. I can only offer general possibilities without knowing what you're doing
[20:34:13] jamesaxl: has joined #ruby
[20:34:29] ModusPwnens: well, its state that needs to be maintained during execution. Once execution is over and the method returns, none of that state is needed anymore.
[20:35:15] tamouse__: has joined #ruby
[20:35:27] matthewd: That seems like a very good reason not to store it in a global, IMO
[20:35:40] ModusPwnens: and the reason i'm making it a class variable is that there are actually two entry points, but they are both self methods and i wanted to save the duplication of initialization
[20:36:33] ur5us: has joined #ruby
[20:37:17] lagweezle: Perhaps have a method that does the actual work, and those two entry points merely arrange things enough to make sense so the information can be passed to the method doing the actual work, and everything which is state is instead kept as a variable local to that 'work' method.
[20:39:09] jenrzzz: has joined #ruby
[20:39:18] matthewd: If there's state that only lasts as long as the method call, then it sounds like it should be creating a new instance of the class for each invocation
[20:39:55] matthewd: I really need a better idea of what we're doing, to flesh that thought out, though
[20:40:00] paddy_: has joined #ruby
[20:41:03] shime: has joined #ruby
[20:41:07] tvw: has joined #ruby
[20:41:24] jrabe: has joined #ruby
[20:41:32] troulouliou_dev: has joined #ruby
[20:48:18] kapil___: has joined #ruby
[20:50:54] DaniG2k: has joined #ruby
[20:51:58] quobo: has joined #ruby
[20:53:22] gusrub: has joined #ruby
[20:55:33] s3nd1v0g1us: has joined #ruby
[20:57:04] ElDoggo: has joined #ruby
[20:58:12] cagomez: has joined #ruby
[20:59:00] ElDoggo: has joined #ruby
[21:00:29] cdg: has joined #ruby
[21:02:43] cdg_: has joined #ruby
[21:06:58] knight33: has joined #ruby
[21:08:37] gusrub: has joined #ruby
[21:09:02] __Yiota: has joined #ruby
[21:09:09] tvw: has joined #ruby
[21:09:33] mtkd: has joined #ruby
[21:10:26] chrisco: has joined #ruby
[21:19:01] setient: has joined #ruby
[21:23:28] spt0: has joined #ruby
[21:26:39] tvw: has joined #ruby
[21:27:14] zapata: has joined #ruby
[21:29:17] __Yiota: has joined #ruby
[21:30:54] mim1k: has joined #ruby
[21:34:48] milardovich: has joined #ruby
[21:39:21] gusrub: has joined #ruby
[21:39:52] orbyt_: has joined #ruby
[21:39:54] jphase: has joined #ruby
[21:42:38] jphase_: has joined #ruby
[21:44:37] jphase: has joined #ruby
[21:48:46] shinnya: has joined #ruby
[21:50:04] ramfjord: has joined #ruby
[21:50:29] halt: has joined #ruby
[21:51:50] weaksauce: has joined #ruby
[21:52:29] oded: has joined #ruby
[21:52:37] dar123: has joined #ruby
[21:58:58] gusrub_: has joined #ruby
[22:00:59] emulator3: has joined #ruby
[22:02:32] Bock: has joined #ruby
[22:04:09] Bock: has joined #ruby
[22:05:35] FastJack_: has joined #ruby
[22:06:17] bmurt: has joined #ruby
[22:06:19] naquad: has joined #ruby
[22:09:12] ElDoggo: has joined #ruby
[22:10:23] mtkd: has joined #ruby
[22:12:21] nofxxx: has joined #ruby
[22:12:26] ElDoggo: has joined #ruby
[22:12:27] pawnbox: has joined #ruby
[22:17:43] jphase: has joined #ruby
[22:18:55] rwb: has joined #ruby
[22:24:28] milardovich: has joined #ruby
[22:24:55] psmolen: has joined #ruby
[22:25:02] jphase: has joined #ruby
[22:32:14] tcopeland: has joined #ruby
[22:34:30] milardovich: has joined #ruby
[22:38:06] raynold: has joined #ruby
[22:44:55] rrichardsr3: has joined #ruby
[22:45:33] fChanX: has joined #ruby
[22:46:12] enterprisey: has joined #ruby
[22:47:31] leah2: has joined #ruby
[22:48:50] tamouse__: has joined #ruby
[22:50:00] fChanX: has left #ruby: ()
[22:53:20] __Yiota: has joined #ruby
[22:53:49] naprimer: has joined #ruby
[22:56:54] jenrzzz: has joined #ruby
[22:56:54] jenrzzz: has joined #ruby
[23:03:06] bronson: has joined #ruby
[23:04:09] jrabe: has joined #ruby
[23:07:49] govg: has joined #ruby
[23:08:00] thinkpad: has joined #ruby
[23:11:40] pawnbox: has joined #ruby
[23:14:28] amirite: has joined #ruby
[23:19:32] GodFather: has joined #ruby
[23:19:41] milardovich: has joined #ruby
[23:21:33] jenrzzz: has joined #ruby
[23:21:34] jenrzzz: has joined #ruby
[23:23:02] orbyt_: has joined #ruby
[23:23:56] __Yiota: has joined #ruby
[23:25:25] bronson: has joined #ruby
[23:27:44] jrabe: has joined #ruby
[23:31:19] mim1k: has joined #ruby
[23:31:35] ozcanesen: has joined #ruby
[23:34:01] amirite: I want to add some code to a module that says if somehash[:suchandsuchCallback] != nil then call it, but I'm a lot of confusion from my google search results telling me the idiomatic way to implement callbacks in ruby is by using &blocks
[23:34:39] amirite: so my problem is that I can't envision how I would implement this using a block -- I want to set somehash[:suchandsuchCallback] = whatever from another method
[23:34:53] amirite: how would I assign a block as a value to a hash?
[23:35:19] baweaver: What are you trying to do specifically?
[23:35:20] baweaver: ignoring callbacks for the moment
[23:35:48] amirite: implement an optional "hook" that runs after a certain action happens
[23:35:52] amirite: i.e. a post-destroy hook
[23:36:00] baweaver: Those would just be lambda or proc or method
[23:36:22] baweaver: http://blog.honeybadger.io/using-lambdas-in-ruby/
[23:36:22] amirite: why is ruby so confusing
[23:36:35] nofxxx: has joined #ruby
[23:36:43] baweaver: Any new language is confusing.
[23:36:50] baweaver: It's not an exclusive trait
[23:36:52] amirite: yeah but this one is extra magical
[23:36:55] xco: has joined #ruby
[23:36:58] matthewd: Why the hash? :/
[23:37:19] baweaver: Just wait until you try Javascript
[23:37:24] amirite: because that's how this thing is implemented, it's a vagrant plugin -- i am setting the callback in the config hash
[23:37:27] amirite: it will get called later
[23:37:38] amirite: javascript is straightforward
[23:37:46] amirite: except es6 or whatever is magical
[23:37:56] lagweezle: Procs and lambdas can be stored "as a variable" kind of, and assigned to things.
[23:38:03] matthewd: Oh, this is vagrant-ruby, not ruby-ruby
[23:38:35] lagweezle: So what baweaver pointed out, pretty much. Except you can also directly use Proc as well.
[23:39:30] matthewd: I would advise against searching for ruby-idiomatic ways of doing things in vagrant. Everything I've seen of it suggests you'll be better off just following any existing nearby precedent.
[23:39:59] matthewd: IOW: do the thing you first intended to do, and don't worry about what would be "more right" in a proper ruby application
[23:41:19] baweaver: DSLs are their own special breed of magic.
[23:44:00] charliesome: has joined #ruby
[23:45:43] motstgo: has joined #ruby
[23:45:44] spt0: has joined #ruby
[23:48:02] hndk: has joined #ruby
[23:54:31] neachdainn: has joined #ruby
[23:55:21] Azure: has joined #ruby
[23:55:31] neachdainn: Hey all. Anyone know of a good C extension tutorial that doesn't require using gem/rake? Or are the two intimately tied?
[23:59:12] havenwood: neachdainn: Whatcha making? Consider using ffi: http://blog.honeybadger.io/use-any-c-library-from-ruby-via-fiddle-the-ruby-standard-librarys-best-kept-secret/
[23:59:50] neachdainn: I would prefer FFI, but having it be an extension is a requirement (it's for a class)