« Back to channel list

#ruby - 30 March 2017

« Back 1 day Forward 1 day »
[00:00:20] ozcanesen: has joined #ruby
[00:01:01] zzxc: cahoots: The default ruby that comes with OSX installs its pretty old, and the whole sudo gem install is a know issue. I'd really recommend homebrew and chruby, or rbenv
[00:01:58] zzxc: That being said, I'm still pretty new to ruby itself.
[00:02:46] JeanCarloMachado: has joined #ruby
[00:05:25] s2013: has joined #ruby
[00:05:51] zzxc: On that note... Does anyone know if there is a reason I can't seem to call Net::HTTP::Get::new in a self call? I keep getting an error saying "NoMethodError: undefined method `keys' for 3000:Integer". https://gist.github.com/anonymous/d83eec11694fdfdd1714e02c303e26ca
[00:07:47] cam27: has joined #ruby
[00:08:02] Derperperd: has joined #ruby
[00:09:33] adam12: zzxc: Are you sure those are the right arguments to that method?
[00:09:57] cahoots: thanks, will keep thinking
[00:10:06] adam12: zzxc: I feel like those are the args for Net::HTTP.start
[00:10:22] alibby1: has joined #ruby
[00:11:22] Rodya_: has joined #ruby
[00:11:56] Ericx2x: has joined #ruby
[00:11:57] zzxc: adam12: I'm pretty sure they are the same between new and start. I may be wrong, and I'll check in a second. I've run it withouth the instance class, def or instance variables (using just local vars) and it worked fine.
[00:12:51] rakm: has joined #ruby
[00:13:16] zzxc: adam12: Whelp yeah that works.
[00:15:47] cyphase: has joined #ruby
[00:16:52] zzxc: adam12: Ack. You're totally right. before I was using Net::HTTP.new(uri.host, uri.port). Sorry about that, boned-headed mistake on my part.
[00:17:07] zzxc: Thanks adam12
[00:17:08] adam12: It's cool. The net/http API is .. interesting
[00:17:26] planigan: has joined #ruby
[00:17:58] darix: adam12: for more advanced things i usually jump to mechanize
[00:18:06] adam12: I prefer HTTP.rb
[00:19:03] zzxc: That is definetly one way to put it... I'm working on a cli tool that makes a bunch of calls to a rest api with modified headers, so I'll definelty check that out. Thanks again.
[00:19:50] darix: zzxc: there are some rest client libraries with some more helpers specific for that.
[00:19:57] Rodya_: has joined #ruby
[00:20:44] zzxc: darix: Really? That would be awesome. which ones? I didn't see any when I was looking earlier.
[00:21:13] darix: one is actually called "rest-client"
[00:21:30] darix: https://rubygems.org/search?utf8=%E2%9C%93&query=rest
[00:21:46] darix: there might be even a client for your specific rest api
[00:22:33] BabyMario: I wish rest-client could do post requests
[00:22:39] BabyMario: it's a nice lib
[00:22:54] milardov_: has joined #ruby
[00:24:17] zzxc: darix: There is, but there is a pretty long list of dependencies, and there hasn't been an update to it in 3 years.
[00:24:25] havenwood: BabyMario: Do you mean open-uri in the stdlib? The rest-client gem can do post requets.
[00:24:32] havenwood: BabyMario: It's a wrapper around net/http.
[00:24:53] darix: huh ... rest-client had an update 2017-02-19
[00:25:14] darix: according to https://rubygems.org/gems/rest-client
[00:26:42] havenwood: zzxc: It has three deps, http-cookie, mime-types and netrc.
[00:27:45] BabyMario: havenwood: Ah yeah, I meant open-uri, and I switched to rest-client as a result of that limitation
[00:28:27] cyphase: has joined #ruby
[00:28:29] zzxc: havenwood: Yeah rest-client looks awesome. I meant regarding the "there might be even a client for your specific rest api"
[00:29:43] nobitanobi: has joined #ruby
[00:31:09] zzxc: darix: Yeah I was just looking at the gh page for this. I don't see a reason for the bump but hey its good its still being updated.
[00:32:33] erlend: has joined #ruby
[00:32:51] GSilva: has joined #ruby
[00:34:02] JeanCarloMachado: has joined #ruby
[00:35:57] aryaching: has joined #ruby
[00:41:04] planigan: has joined #ruby
[00:41:04] agent_white: has joined #ruby
[00:41:17] darix: even the gh page lists commits
[00:41:22] darix: github.com/rest-client/rest-client
[00:41:28] darix: maybe you looked at something else :p
[00:41:48] bungoman: has joined #ruby
[00:44:27] cyphase: has joined #ruby
[00:52:06] havenwood: zzak: ah, gotcha
[00:52:14] havenwood: zzak: oops, MT, sorry about that
[00:52:45] zzxc: havenwood: Haha no worries.
[00:52:47] havenwood: zzak: HTTP.rb is nice. There're quite a few nice HTTP clients in Ruby.
[00:52:47] Vingador: has joined #ruby
[00:52:55] Asher: has joined #ruby
[00:54:16] havenwood: zzxc: Typhoeus is great for parallel requests. Curb is the best libcurl wrapper. Excon and HTTPClient are excellent, full-featured pure-Ruby implementations.
[00:54:26] havenwood: zzxc: I do really like the HTTP.rb API.
[00:55:41] rgtk: has joined #ruby
[00:56:05] zzxc: For what I'm working on the rest-client gem sounds perfect. API looks pretty good do. But I'll probably avoid using Net::HTTP again...
[00:57:09] zzxc: havenwood: That being said I may check out Typheus as well. I'm still kind of clueless how to do much in parallel in Ruby right now
[00:57:11] uxp: has joined #ruby
[00:57:40] havenwood: zzxc: https://github.com/typhoeus/typhoeus#example
[00:57:58] cyphase: has joined #ruby
[00:58:08] havenwood: zzxc: or better link, straight to parallel requests: https://github.com/typhoeus/typhoeus#making-parallel-requests
[00:58:48] planigan: has joined #ruby
[01:00:28] ahrs: has joined #ruby
[01:02:28] rhyselsmore: has joined #ruby
[01:04:51] zzxc: Huh, alright cool. Honestly I was still trying to figure out how ruby did llamdbas I think that second one explains it pretty well.
[01:05:48] zzxc: Thats pretty nice though.
[01:06:22] davorb: has joined #ruby
[01:07:32] __Yiota: has joined #ruby
[01:07:49] dar123: has joined #ruby
[01:08:40] __Yiota: has joined #ruby
[01:10:41] cyphase: has joined #ruby
[01:12:04] lupine: has joined #ruby
[01:12:35] bkxd: has joined #ruby
[01:14:07] hutch34_: has joined #ruby
[01:14:18] Lyubo1: has joined #ruby
[01:14:43] [k-: has joined #ruby
[01:19:42] jdm: has joined #ruby
[01:19:51] herbmillerjr: has joined #ruby
[01:23:24] cyphase: has joined #ruby
[01:28:04] chouhoulis: has joined #ruby
[01:30:50] JoshS: has joined #ruby
[01:32:05] JeanCarloMachado: has joined #ruby
[01:36:38] skweek: has joined #ruby
[01:41:09] foxxx0: has joined #ruby
[01:44:48] Channel6: has joined #ruby
[01:47:03] mikecmpbll: anyone ever had an rspec after hook running in the middle of a spec? :/
[01:52:49] JeanCarloMachado: has joined #ruby
[01:56:04] KnownSyntax: has joined #ruby
[01:56:05] KnownSyntax: has joined #ruby
[01:57:22] bzb: has joined #ruby
[01:57:41] Trynemjoel: has joined #ruby
[02:00:47] AlHafoudh: has joined #ruby
[02:00:50] s2013: has joined #ruby
[02:00:51] montanonic: has joined #ruby
[02:01:31] d^sh: has joined #ruby
[02:02:39] foxxx0: has joined #ruby
[02:03:10] Trynemjoel: has joined #ruby
[02:04:22] libastral: has joined #ruby
[02:05:37] jshjsh: has joined #ruby
[02:11:28] rakm: has joined #ruby
[02:11:37] milardovich: has joined #ruby
[02:13:46] dar123: has joined #ruby
[02:15:06] astrobunny: has joined #ruby
[02:16:52] UserJosh: has joined #ruby
[02:18:44] Didac: has joined #ruby
[02:20:30] genpaku: has joined #ruby
[02:24:34] JeanCarloMachado: has joined #ruby
[02:26:19] raspado: has joined #ruby
[02:26:20] tdy: has joined #ruby
[02:32:05] hndk: has joined #ruby
[02:32:10] SeepingN: has joined #ruby
[02:32:24] jrafanie: has joined #ruby
[02:41:12] JeanCarloMachado: has joined #ruby
[02:44:26] jenrzzz: has joined #ruby
[02:44:26] jenrzzz: has joined #ruby
[02:46:57] araujo: has joined #ruby
[02:51:35] JeanCarloMachado: has joined #ruby
[02:58:24] bkxd: has joined #ruby
[03:04:56] hutch34_: has joined #ruby
[03:06:48] nOwz: has joined #ruby
[03:06:56] SuperLag: has joined #ruby
[03:06:56] davorb: has joined #ruby
[03:08:16] jdm: has joined #ruby
[03:09:15] Trynemjoel: has joined #ruby
[03:11:25] JeanCarloMachado: has joined #ruby
[03:14:30] gix: has joined #ruby
[03:15:10] s2013: has joined #ruby
[03:15:34] alan_w: has joined #ruby
[03:16:07] raspado: has joined #ruby
[03:16:32] ohcibi: has joined #ruby
[03:17:20] raspado: has joined #ruby
[03:19:33] cahoots: has joined #ruby
[03:20:19] LiquidInsect: has joined #ruby
[03:24:31] slackbotgz: has joined #ruby
[03:31:07] planigan: has joined #ruby
[03:31:46] JeanCarloMachado: has joined #ruby
[03:35:38] jerme_: has left #ruby: ()
[03:35:45] benlieb: has joined #ruby
[03:39:07] JeanCarloMachado: has joined #ruby
[03:39:33] milardovich: has joined #ruby
[03:40:09] cfec0b8d: has joined #ruby
[03:45:22] xall: has joined #ruby
[03:46:35] mazeinmaze_: has joined #ruby
[03:49:33] electrostat: has joined #ruby
[03:54:50] JoshS: has joined #ruby
[04:06:09] hostess_: has joined #ruby
[04:15:22] BabyMario: has joined #ruby
[04:15:53] bocaneri: has joined #ruby
[04:15:59] JoshS: has joined #ruby
[04:19:22] bocaneri: has joined #ruby
[04:22:20] mim1k: has joined #ruby
[04:24:41] patarr: has joined #ruby
[04:24:54] minimalism: has joined #ruby
[04:27:43] djbkd: has joined #ruby
[04:28:31] bocaneri: has joined #ruby
[04:29:15] bkxd: has joined #ruby
[04:31:15] nobitanobi: has joined #ruby
[04:34:31] cahoots: has joined #ruby
[04:36:01] renchan: has joined #ruby
[04:36:01] milardovich: has joined #ruby
[04:37:42] qmr: has joined #ruby
[04:41:18] yosafbridge: has joined #ruby
[04:43:27] cyphase: has joined #ruby
[04:44:29] bocaneri: has joined #ruby
[04:45:46] ishigoya: has joined #ruby
[04:50:39] jusa: has joined #ruby
[04:51:11] agent_white: has joined #ruby
[04:57:01] cyphase: has joined #ruby
[05:00:18] _whitelogger: has joined #ruby
[05:06:07] hutch34_: has joined #ruby
[05:06:31] davorb: has joined #ruby
[05:07:26] nOwz: has joined #ruby
[05:07:33] rakm: has joined #ruby
[05:11:15] libastral: has joined #ruby
[05:12:22] Robtop__: has joined #ruby
[05:13:55] slima_: has joined #ruby
[05:15:26] pabst: has joined #ruby
[05:15:34] cyphase: has joined #ruby
[05:15:54] cydrobolt_: has joined #ruby
[05:16:00] zzxc-: has joined #ruby
[05:16:32] hfp_work: has joined #ruby
[05:17:10] staticfox: has joined #ruby
[05:17:33] theRoUS: has joined #ruby
[05:17:35] jdm: has joined #ruby
[05:20:25] jenrzzz: has joined #ruby
[05:20:31] robnester: has joined #ruby
[05:21:04] gdonald: has joined #ruby
[05:23:36] Jameser: has joined #ruby
[05:30:19] Xiti: has joined #ruby
[05:31:53] gnarld_: has joined #ruby
[05:32:59] xtsee: has joined #ruby
[05:33:03] C0deMaver1ck: has joined #ruby
[05:33:20] pelegreno_: has joined #ruby
[05:33:27] cyphase: has joined #ruby
[05:33:31] Utkarsh: has joined #ruby
[05:33:41] Muz: has joined #ruby
[05:33:53] ChickeNES: has joined #ruby
[05:34:32] webnanners: has joined #ruby
[05:35:22] jasondotstar: has joined #ruby
[05:35:27] forgot: has joined #ruby
[05:36:16] jud^: has joined #ruby
[05:36:29] bodie_: has joined #ruby
[05:36:36] jdm_: has joined #ruby
[05:37:35] cyphase: has joined #ruby
[05:41:32] rakm: has joined #ruby
[05:44:21] brent__: has joined #ruby
[05:53:07] djbkd: has joined #ruby
[05:56:12] montanonic: has joined #ruby
[05:57:32] SeepingN: has joined #ruby
[05:57:37] CloCkWeRX: has joined #ruby
[06:02:57] cyphase: has joined #ruby
[06:08:46] enterprisey: has joined #ruby
[06:12:57] alibby1: has joined #ruby
[06:15:38] cyphase: has joined #ruby
[06:23:09] mim1k: has joined #ruby
[06:24:08] milardovich: has joined #ruby
[06:25:16] cyphase: has joined #ruby
[06:26:04] patarr: has joined #ruby
[06:27:16] ddffg: has joined #ruby
[06:27:34] Arpanet69: has joined #ruby
[06:28:49] User4587_: has joined #ruby
[06:30:02] bkxd: has joined #ruby
[06:31:13] arquebus: has joined #ruby
[06:31:19] jeyraof^mbpr: has joined #ruby
[06:31:58] nobitanobi: has joined #ruby
[06:33:03] chrisarcand: has joined #ruby
[06:33:24] tw1sted: has joined #ruby
[06:33:40] abort: has joined #ruby
[06:38:21] seitensei: has joined #ruby
[06:38:22] cyphase: has joined #ruby
[06:42:23] dionysus69: has joined #ruby
[06:45:22] axyjo: has joined #ruby
[06:45:40] last_staff: has joined #ruby
[06:48:51] aganov: has joined #ruby
[06:49:48] nOwz: has joined #ruby
[06:51:33] conta: has joined #ruby
[06:54:23] cyphase: has joined #ruby
[06:54:28] djbkd: has joined #ruby
[06:56:51] muelleme_: has joined #ruby
[06:59:52] wald0: has joined #ruby
[07:03:37] chuff: has joined #ruby
[07:04:09] SeepingN: has joined #ruby
[07:06:21] Arpanet69: has joined #ruby
[07:06:28] hutch34_: has joined #ruby
[07:07:06] davorb: has joined #ruby
[07:07:51] milardovich: has joined #ruby
[07:10:36] jgnagy: has joined #ruby
[07:12:52] JDeen: has joined #ruby
[07:14:08] JDeen: Hello.. I would appreciate some advice on Ruby style... i got a rubocop warning stating regarding ABC... how can i improve this code - break it down to multiple methods may be? https://gist.github.com/ziyan-junaideen/f9eb6d6faaa2b818d30950df56540a7b
[07:14:41] cyphase: has joined #ruby
[07:15:20] dminuoso: jdeen: The symptom you are experiencing happens because you blindly run rubocop over your application.
[07:15:32] dminuoso: jdeen: Look at your code and tell me if it needs refactoring.
[07:15:44] dminuoso: And don't answer yes because rubocop told you to. Use your own judgement.
[07:16:43] tAn: has joined #ruby
[07:17:27] dminuoso: jdeen: That being said, it would be sensible to have a singular is / elsif / else / end structure.
[07:17:36] TomyWork: has joined #ruby
[07:18:51] ddffg: has joined #ruby
[07:19:08] elomatreb: I'd probably also refactor that StreetViewImage instantiation into a method
[07:19:42] marr: has joined #ruby
[07:21:16] maattdd: has joined #ruby
[07:21:51] dminuoso: jdeen: Also remove those code comments.
[07:21:59] cajone: has left #ruby: ()
[07:22:16] dminuoso: They have 0 value and just unnecessarily increase your method body.
[07:22:28] dminuoso: (The TODO note is fine however)
[07:23:24] JDeen: dminuoso: :) it is the first time i am using with rubocop... ya i was wondering how better it can be done... thanks on the comments if else and comments...
[07:24:04] JDeen: elomatreb: thinking again it is a good idea... thanks
[07:24:14] dminuoso: jdeen: Rubocop can only identify potential smells with plenty of false positives. Ideally you should hand-configure rubocop to report about things you care about.
[07:24:23] dminuoso: Not because it's configured that way by default.
[07:24:54] JDeen: dminuoso: ah ha... you mean with a rubocop.yml to ignore/configure stuff?
[07:24:55] maattdd_: has joined #ruby
[07:25:02] dminuoso: jdeen: Precisely. :)
[07:25:24] JDeen: thanks for the ideas...
[07:26:59] JoshS: has joined #ruby
[07:28:02] jane_booty_doe: has joined #ruby
[07:28:08] andikr: has joined #ruby
[07:28:22] SeepingN: has joined #ruby
[07:29:04] cyphase: has joined #ruby
[07:30:07] mark_66: has joined #ruby
[07:32:23] doublemalt_: has joined #ruby
[07:35:34] grh: has joined #ruby
[07:35:45] charliesome: has joined #ruby
[07:35:59] snickers: has joined #ruby
[07:40:50] Tau: has joined #ruby
[07:44:13] kazo: has joined #ruby
[07:45:07] nobitanobi: has joined #ruby
[07:50:21] lel: has joined #ruby
[07:50:39] cyphase: has joined #ruby
[07:50:50] yurikoles: has joined #ruby
[07:52:02] aufi: has joined #ruby
[07:53:27] jsrn_: has joined #ruby
[07:53:50] sim0n: has joined #ruby
[07:54:37] shinnya: has joined #ruby
[07:56:27] mikecmpbll: has joined #ruby
[07:58:48] tonini: has joined #ruby
[08:03:06] Pumukel: has joined #ruby
[08:03:52] yurikoles: has joined #ruby
[08:03:58] jaruga: has joined #ruby
[08:04:45] tvw: has joined #ruby
[08:10:15] burgestrand: has joined #ruby
[08:10:18] cyphase: has joined #ruby
[08:11:18] blackmesa: has joined #ruby
[08:11:40] mim1k: has joined #ruby
[08:18:09] NL3limin4t0r: has joined #ruby
[08:22:14] tomphp: has joined #ruby
[08:22:54] sarbs: has joined #ruby
[08:26:24] patarr: has joined #ruby
[08:28:21] djbkd_: has joined #ruby
[08:28:43] phikes: has joined #ruby
[08:30:25] muelleme_: has joined #ruby
[08:30:45] bkxd: has joined #ruby
[08:32:15] dn`: has joined #ruby
[08:34:18] mim1k: has joined #ruby
[08:34:55] mikecmpbll: has joined #ruby
[08:37:00] nofxxxx: has joined #ruby
[08:37:07] antgel: has joined #ruby
[08:38:53] djbkd: has joined #ruby
[08:43:23] JoshS: has joined #ruby
[08:46:30] Beams: has joined #ruby
[08:46:56] maattdd: has joined #ruby
[08:47:01] flying: has joined #ruby
[08:47:33] mikecmpbll: how do i parse a time from a string in the local timezone?
[08:51:30] mikecmpbll: e.g. parse('10:00') => 2017-03-30 10:00:00 +0100
[08:52:14] tobiasvl: >> require 'date'; DateTime.parse('10:00') # mikecmpbll
[08:52:15] ruby[bot]: tobiasvl: # => #<DateTime: 2017-03-30T10:00:00+00:00 ((2457843j,36000s,0n),+0s,2299161j)> (https://eval.in/764235)
[08:52:38] mikecmpbll: tobiasvl : always parses to UTC for me
[08:52:48] burgestrand: mikecmpbll What does `Time.now.zone` return?
[08:53:00] mikecmpbll: nothing, there is no `zone` method for Time
[08:53:07] mikecmpbll: NoMethodError*
[08:53:33] burgestrand: mikecmpbll What's your ruby version?
[08:53:55] burgestrand: >> Time.now.zone
[08:53:56] ruby[bot]: Burgestrand: # => "UTC" (https://eval.in/764237)
[08:54:02] phikes: That's an activesupport method iirc
[08:54:10] burgestrand: No, it's part of stdlib.
[08:54:16] mikecmpbll: i typed it wrong 😭
[08:54:17] burgestrand: phikes You're thinking of `Time.zone.now` :)
[08:54:30] phikes: aaaah yeas my bad :D
[08:54:37] mikecmpbll: it was a late night, and i haven't had nearly enough coffee yet
[08:54:48] tobiasvl: >> require 'time'; Time.parse('10:00')
[08:54:49] ruby[bot]: tobiasvl: # => 2017-03-30 10:00:00 +0000 (https://eval.in/764239)
[08:54:55] burgestrand: Hm, peculiar, documentation says that Time.parse assumes that the time parsed is in the current time zone.
[08:55:08] tobiasvl: OK, it was UTC there, but on my computer it was mu timezone ;)
[08:55:20] djbkd: has joined #ruby
[08:55:25] burgestrand: mikecmpbll What does `Time.parse("10:00").zone` output?
[08:55:29] tobiasvl: Burgestrand: I first used DateTime.parse which maybe does not parse it in the current timezone
[08:55:38] tobiasvl: but Time.parse _does_ use my correct timezone
[08:55:44] burgestrand: tobiasvl oh :)
[08:55:51] mikecmpbll: eh, that's the trick
[08:55:55] burgestrand: I know Ruby and time zones isn't the most comfortable juggle.
[08:55:58] mikecmpbll: Time.parse. derppppp
[08:56:00] biberu: has joined #ruby
[08:56:11] mikecmpbll: ACTION kicks DateTime in the face
[08:57:00] burgestrand: mikecmpbll be aware that time zones in general can be a bit tricky, so if your time string contains a timezone identifier/offset you might be in for a surprise.
[08:57:11] burgestrand: mikecmpbll if you can, I recommend using strptime and specifying your format.
[08:57:16] burgestrand: >> Time.parse("monkeys")
[08:57:17] ruby[bot]: Burgestrand: # => undefined method `parse' for Time:Class (NoMethodError) ...check link for more (https://eval.in/764241)
[08:57:26] burgestrand: >> require "time"; Time.parse("monkeys")
[08:57:27] ruby[bot]: Burgestrand: # => no time information in "monkeys" (ArgumentError) ...check link for more (https://eval.in/764242)
[08:58:03] mikecmpbll: >> require "time"; Time.strptime("10:00", "%H:%M")
[08:58:05] ruby[bot]: mikecmpbll: # => 2017-03-30 10:00:00 +0000 (https://eval.in/764243)
[08:58:46] NL3limin4t0r: There is also Time::utc and Time::local
[08:59:03] NL3limin4t0r: They don't accept a string thoo.
[08:59:06] mikecmpbll: next question, seeing as i'd rather not think for myself; what's the simplest way to add a day to a Time object?
[08:59:35] mikecmpbll: + 24 * 60 * 60 i guess
[08:59:40] gigetoo: has joined #ruby
[09:01:20] phikes: For readability of my code I prefer to use ActiveSupport, so you can do something like `1.day`
[09:01:28] phikes: http://api.rubyonrails.org/classes/ActiveSupport/Duration.html
[09:01:42] phikes: e.g. `Time.now + 1.day`
[09:01:49] vali: has joined #ruby
[09:02:04] vall: has joined #ruby
[09:02:25] phikes: http://api.rubyonrails.org/classes/ActiveSupport/Duration.html#method-i-to_i Here you can see that this represents the same integer as 24*60*60
[09:02:56] phikes: The above even more concise is `1.day.from_now`
[09:03:46] jaruga: has joined #ruby
[09:04:12] dionysus69: has joined #ruby
[09:04:55] jaruga: has joined #ruby
[09:06:41] cfec0b8d: has joined #ruby
[09:07:43] hutch34_: has joined #ruby
[09:11:15] jgnagy: has joined #ruby
[09:11:50] djbkd: has joined #ruby
[09:13:12] lxsameer: has joined #ruby
[09:13:15] maloik: has joined #ruby
[09:17:10] dionysus70: has joined #ruby
[09:18:15] mazeinmaze_: has joined #ruby
[09:20:27] Maven: has joined #ruby
[09:22:23] mjago: has joined #ruby
[09:22:24] gdonald: has joined #ruby
[09:23:23] marr: has joined #ruby
[09:24:17] jamesaxl: has joined #ruby
[09:27:07] burgestrand: mikecmpbll Also depends, are you adding a day, or adding a certain amount of seconds?
[09:27:18] mikecmpbll: Burgestrand : a day, preferably.
[09:27:23] burgestrand: mikecmpbll they can be very different regarding leap seconds, time zones and so on.
[09:27:45] burgestrand: mikecmpbll DateTime allows you to easily add a day, I believe you should be able to convert your Time object to a DateTime and go from there.
[09:28:21] djbkd: has joined #ruby
[09:28:22] mikecmpbll: >> require 'time'; (Time.parse("10:00").to_datetime + 1).to_time
[09:28:23] ruby[bot]: mikecmpbll: # => 2017-03-31 10:00:00 +0000 (https://eval.in/764278)
[09:28:49] bascht1: has joined #ruby
[09:29:26] uncertainty: has joined #ruby
[09:30:03] workmad3: has joined #ruby
[09:31:57] pandaant: has joined #ruby
[09:32:04] dn`_: has joined #ruby
[09:41:43] heftig: has joined #ruby
[09:41:44] aviraldg: has joined #ruby
[09:41:44] travisr: has joined #ruby
[09:41:44] daveyboi[m]: has joined #ruby
[09:41:44] Giphy[m]: has joined #ruby
[09:41:44] Tagami[m]: has joined #ruby
[09:41:44] M107262[m]: has joined #ruby
[09:41:44] thulsa_legume[m]: has joined #ruby
[09:41:44] jakebriggs[m]: has joined #ruby
[09:41:44] dman[m]: has joined #ruby
[09:41:45] MicaFox[m]: has joined #ruby
[09:41:50] el_ocho[m]: has joined #ruby
[09:41:51] velu_aon[m]: has joined #ruby
[09:45:33] djbkd: has joined #ruby
[09:48:31] dn`: has joined #ruby
[09:49:48] burgestrand: has joined #ruby
[09:55:14] sarbs: has joined #ruby
[09:55:48] leitz: has joined #ruby
[09:57:49] Silthias: has joined #ruby
[09:58:11] senayar: has joined #ruby
[09:58:11] senayar: has joined #ruby
[09:58:17] hutch34_: has joined #ruby
[10:01:16] djbkd: has joined #ruby
[10:01:25] brent__: has joined #ruby
[10:01:28] burgestrand: has joined #ruby
[10:05:03] leitz: has joined #ruby
[10:11:33] chuff: has joined #ruby
[10:11:44] Prira: has joined #ruby
[10:12:47] burgestrand: has joined #ruby
[10:14:37] troulouliou_div2: has joined #ruby
[10:17:42] roshanavand: has joined #ruby
[10:18:10] djbkd: has joined #ruby
[10:18:21] ferr1: has joined #ruby
[10:18:55] doublemalt__: has joined #ruby
[10:19:52] grh: has joined #ruby
[10:20:24] dn`: has joined #ruby
[10:21:08] mim1k: has joined #ruby
[10:21:45] jusa: has joined #ruby
[10:22:11] dn`: has joined #ruby
[10:24:48] burgestrand: has joined #ruby
[10:27:18] patarr: has joined #ruby
[10:31:28] bkxd: has joined #ruby
[10:34:42] djbkd: has joined #ruby
[10:36:12] burgestrand: has joined #ruby
[10:39:09] bkxd: has joined #ruby
[10:41:39] Olipro: has joined #ruby
[10:45:27] bkxd: has joined #ruby
[10:46:44] patarr: has joined #ruby
[10:46:47] grillon: has joined #ruby
[10:46:53] duckpupp1: has joined #ruby
[10:47:30] burgestrand: has joined #ruby
[10:49:35] volty: has joined #ruby
[10:50:10] hutch34_: has joined #ruby
[10:51:33] djbkd: has joined #ruby
[10:54:04] marahin: has joined #ruby
[10:57:31] vali: has joined #ruby
[10:59:51] burgestrand: has joined #ruby
[11:00:15] NL3limin4t0r: has left #ruby: ()
[11:01:48] JeanCarloMachado: has joined #ruby
[11:07:02] uncertainty: has joined #ruby
[11:07:10] charliesome: has joined #ruby
[11:07:41] djbkd: has joined #ruby
[11:08:36] ytti: has joined #ruby
[11:08:40] millerti: has joined #ruby
[11:11:56] jgnagy: has joined #ruby
[11:19:51] ytti: has joined #ruby
[11:24:28] djbkd: has joined #ruby
[11:25:00] p0p0pr37: has joined #ruby
[11:25:00] p0p0pr37: has joined #ruby
[11:31:06] jrafanie: has joined #ruby
[11:31:58] jane_booty_doe: has joined #ruby
[11:33:32] dionysus69: has joined #ruby
[11:35:46] cajone: has joined #ruby
[11:36:21] deviation: has joined #ruby
[11:36:34] ytti: has joined #ruby
[11:38:52] nowhere_man: has joined #ruby
[11:40:00] ldnunes: has joined #ruby
[11:40:22] hemebond: has joined #ruby
[11:41:09] hemebond: Is there someone who can explain to me what https://github.com/Icinga/puppet-icinga2/blob/master/lib/puppet_x/icinga2/utils.rb#L88 is doing?
[11:41:14] djbkd: has joined #ruby
[11:42:24] nobitanobi: has joined #ruby
[11:47:56] kristofferR: has joined #ruby
[11:48:15] meshsmith: has joined #ruby
[11:50:06] HoierM: has joined #ruby
[11:53:23] JeanCarloMachado: has joined #ruby
[11:54:42] sepp2k: has joined #ruby
[11:55:23] mim1k: has joined #ruby
[11:56:50] flopsec: has joined #ruby
[11:57:19] djbkd: has joined #ruby
[11:59:05] synthroid: has joined #ruby
[11:59:27] duckpupp1: has joined #ruby
[12:00:04] unshadow: has joined #ruby
[12:01:45] hndk: has joined #ruby
[12:02:08] synthroid: has joined #ruby
[12:03:21] jamesaxl: has joined #ruby
[12:06:37] mark_66: has joined #ruby
[12:08:17] pmunt: has joined #ruby
[12:09:05] t-recx: has joined #ruby
[12:12:33] unreal: has joined #ruby
[12:13:50] djbkd: has joined #ruby
[12:14:22] Pumukel: has joined #ruby
[12:15:20] Pumukel: has joined #ruby
[12:17:14] brent__: has joined #ruby
[12:18:00] chouhoulis: has joined #ruby
[12:19:09] loechel: has joined #ruby
[12:19:43] loechel: has joined #ruby
[12:23:03] JeanCarloMachado: has joined #ruby
[12:26:26] kjetilho: has joined #ruby
[12:27:45] kjetilho: hey! what's the recommended way of publishing my own gems internally? I tried gemirro, but it just fails in mysterious ways (the on-demand caching of any dependencies timeout or get forgotten.)
[12:29:54] djbkd: has joined #ruby
[12:30:03] pagios: does CORS apply on loading <script src="domainX"> or only on HTTP GET/POST / Xmlrequests?
[12:32:38] jusa: has joined #ruby
[12:34:43] aupadhye: has joined #ruby
[12:35:45] pmunt: get doesnt have cors, but post does
[12:36:14] pmunt: generally
[12:39:29] workmad3: pagios: CORS is only applicable to ajax requests
[12:39:31] meshsmith_: has joined #ruby
[12:39:51] workmad3: pagios: if you want to affect things like script sources, you should investigate the ContentSecurityPolicy header
[12:39:59] pagios: workmad3, and even if cors is enabled, the ajax request would go to the malicious site but wont be read by client
[12:40:49] chouhoulis: has joined #ruby
[12:41:01] workmad3: pagios: not sure what you're asking/saying there
[12:41:17] pagios: cors is mainly to protect the client browser right
[12:41:23] mim1k: has joined #ruby
[12:41:31] workmad3: cors is to allow you to break out of the same-origin sandbox
[12:42:14] pagios: so if my siteA communicates with siteB i would including origin:siteB on my serverA and thus allow clients that load this site to communicate with siteB
[12:42:54] workmad3: no, that would allow siteB to talk to your server
[12:43:24] ddffg: has joined #ruby
[12:43:53] pagios: so users from siteB can talk using xhr to my siteA
[12:43:54] workmad3: pagios: or are you meaning the 'origin' header? the browser doesn't let you set that
[12:44:06] workmad3: and is only half of the CORS picture...
[12:44:17] brent__: has joined #ruby
[12:45:11] pagios: so if i want a user that loaded a page from google.com to communicate with my server, i would add origin:google.com to my server and thus users loading the google page and have a xhr to my server would go through
[12:45:38] workmad3: pagios: I'd suggest reading https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS for a full picture (there's a fair bit of detail that isn't easy to communicate over IRC :) )
[12:46:20] djbkd: has joined #ruby
[12:46:26] workmad3: and I need lunch :) so bbl
[12:46:43] Guest96: has joined #ruby
[12:47:04] pagios: if i want siteB to make xhr requests to my siteA without accessing siteA pages directly, i can include siteB in the origin of site siteA. on site A: allowed-origin: SiteB
[12:47:50] marahin: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[12:51:13] jaruga: has joined #ruby
[12:54:09] meshsmith: has joined #ruby
[12:58:09] Vingador: has joined #ruby
[13:02:36] burgestrand: pagios Yes, whoever receives the API request replies to the browser if the originating site is allowed to do that request or not.
[13:02:46] djbkd: has joined #ruby
[13:05:41] milardovich: has joined #ruby
[13:07:41] davorb: has joined #ruby
[13:19:39] djbkd: has joined #ruby
[13:21:10] raspado: has joined #ruby
[13:26:50] sagax: has joined #ruby
[13:27:06] millerti: has joined #ruby
[13:27:17] GodFather: has joined #ruby
[13:27:25] ramortegui: has joined #ruby
[13:28:55] chuff: has joined #ruby
[13:29:31] gtifbv: has joined #ruby
[13:30:22] pupsicle: has joined #ruby
[13:34:29] millerti: has joined #ruby
[13:35:16] djbkd: has joined #ruby
[13:39:31] jrafanie: has joined #ruby
[13:44:32] sepp2k: has joined #ruby
[13:48:43] deviation: has joined #ruby
[13:49:05] jdm: has joined #ruby
[13:50:31] arooni: has joined #ruby
[13:51:44] djbkd: has joined #ruby
[13:52:20] xall: has joined #ruby
[13:52:43] mim1k_: has joined #ruby
[13:55:26] SeepingN: has joined #ruby
[13:55:59] duckpupp1: has joined #ruby
[13:58:54] jrafanie: has joined #ruby
[14:00:20] ledestin: has joined #ruby
[14:01:08] mim1k: has joined #ruby
[14:04:04] benlieb: has joined #ruby
[14:08:11] djbkd: has joined #ruby
[14:09:13] nobitanobi: any recommendations on Ruby parsers? I am trying to find the line number of the beginning and end of a method.
[14:09:26] millerti: has joined #ruby
[14:10:02] rindolf: has joined #ruby
[14:10:55] rindolf: Hi all! Can anyone help me with transpec - http://www.shlomifish.org/Files/files/text/ruby-gem-rpsec-transpec-problem.txt ?
[14:10:56] snickers: has joined #ruby
[14:11:34] harfangk: has joined #ruby
[14:13:06] yeticry_: has joined #ruby
[14:14:56] nocco: has joined #ruby
[14:20:29] Arpanet69: has joined #ruby
[14:20:52] cdg: has joined #ruby
[14:21:44] nOwz: has joined #ruby
[14:23:03] jge: has left #ruby: ("WeeChat 1.2")
[14:24:36] cdg: has joined #ruby
[14:25:04] djbkd: has joined #ruby
[14:25:08] stoffus: has joined #ruby
[14:26:39] agent_white: has joined #ruby
[14:26:58] mim1k: has joined #ruby
[14:26:58] duckpupp1: has joined #ruby
[14:27:38] jrafanie: has joined #ruby
[14:28:01] tenderlove: has joined #ruby
[14:28:39] testnick[m]: has joined #ruby
[14:28:45] tenderlo_: has joined #ruby
[14:28:59] phikes: rindolf: I guess you should not specify your file in the -c parameter of transpec
[14:29:24] phikes: rindolf: just skip that all together and use `transpec -f test/deduction.rb`
[14:32:02] agent_white: Mornin' folks
[14:32:34] antoniobeyah: has joined #ruby
[14:33:00] rindolf: phikes: let me see
[14:34:37] rindolf: phikes: with that I am getting this - http://paste.debian.net/925130/
[14:35:53] phikes: rindolf: AFAIK transpec needs to run in a git repo
[14:36:24] jrafanie: has joined #ruby
[14:36:32] hxegon: morning agent_white
[14:36:58] rindolf: phikes: i run it there
[14:38:12] phikes: rindolf: Are you absolutely sure? Try a `git status` in the same directory? To me it seems like the automatic discovery of the git repository root fails (and something else below, but let's sort out this one first)
[14:38:53] bkxd: has joined #ruby
[14:39:02] rindolf: phikes: git status works fine
[14:39:31] phikes: rindolf: Is it a git submodule or something? Or a plain non-bare git repository?
[14:39:54] VoIPConference[m: has joined #ruby
[14:39:59] VoIPConference[m: has left #ruby: ()
[14:40:04] rindolf: phikes: the latter, but note that it's a subdir of the repo
[14:40:41] djbkd: has joined #ruby
[14:40:55] phikes: maybe try it from the root and adjust the path like this? `transpec ../test/deduction.rb`
[14:41:01] Didac: has joined #ruby
[14:41:26] rindolf: phikes: root?
[14:41:53] phikes: rindolf: sorry, the root directory of the git repository
[14:42:07] yehowyada: has joined #ruby
[14:42:11] ferr1: has joined #ruby
[14:43:14] rindolf: phikes:« transpec -f ruby/test/deduction.rb» seemed to have worked - thanks
[14:43:27] phikes: rindolf: you're welcome ;)
[14:45:46] rindolf: phikes: :-)
[14:46:01] rindolf: phikes: do you want to be credited somehow?
[14:46:03] GSilva: has joined #ruby
[14:46:27] phikes: rindolf: Oh, thanks! No need to :)
[14:46:45] rindolf: phikes: ok. :-)
[14:49:24] amclain: has joined #ruby
[14:49:24] flying: has joined #ruby
[14:53:20] rippa: has joined #ruby
[14:56:29] jamesaxl: has joined #ruby
[14:57:12] djbkd: has joined #ruby
[14:58:06] jrafanie: has joined #ruby
[15:01:44] milardovich: has joined #ruby
[15:02:58] Lord_of_Life: has joined #ruby
[15:03:19] cdg: has joined #ruby
[15:05:57] milardovich: has joined #ruby
[15:06:13] milardovich: has joined #ruby
[15:06:47] uncertainty: has joined #ruby
[15:07:15] davorb: has joined #ruby
[15:07:15] rindolf: has joined #ruby
[15:09:07] ozcanesen: has joined #ruby
[15:10:27] s2013: has joined #ruby
[15:11:41] DLSteve: has joined #ruby
[15:13:23] James123: has joined #ruby
[15:13:35] James123: What is the difference between Math::sqrt(x) and Math.sqrt(x)?
[15:13:36] jgnagy: has joined #ruby
[15:13:41] djbkd: has joined #ruby
[15:13:50] moei: has joined #ruby
[15:14:20] moei: has joined #ruby
[15:14:54] skweek: has joined #ruby
[15:17:02] herwin: they do the same
[15:17:09] herwin: but the second syntax is preferred
[15:17:10] herwin: https://github.com/bbatsov/ruby-style-guide#syntax
[15:17:31] herwin: (which is not absolute science of course)
[15:18:12] James123: herwin, thank you :)
[15:19:21] patarr: has joined #ruby
[15:19:24] slash_nick: has joined #ruby
[15:19:24] slash_nick: has joined #ruby
[15:24:22] jrafanie: has joined #ruby
[15:26:08] jgnagy: has joined #ruby
[15:26:12] troulouliou_div2: has joined #ruby
[15:28:35] cow[baby]: has joined #ruby
[15:29:40] djbkd: has joined #ruby
[15:29:53] gdonald: has joined #ruby
[15:32:27] ResidentBiscuit: has joined #ruby
[15:33:29] choke: has joined #ruby
[15:33:33] brent__: has joined #ruby
[15:33:46] cow[baby]: has joined #ruby
[15:35:34] __Yiota: has joined #ruby
[15:36:40] synthroid: has joined #ruby
[15:37:33] synthroid: has joined #ruby
[15:38:47] xall: has joined #ruby
[15:38:56] lxsameer: has joined #ruby
[15:42:58] Lord_of_Life: has joined #ruby
[15:45:28] Lord_of_Life: has joined #ruby
[15:45:48] raspado: has joined #ruby
[15:46:42] hfp: has joined #ruby
[15:47:51] hfp: Hey, I'm using schacon's ruby-git gem. Is there a way to get the name for the currently checked out branch with it? I want to save the name, checkout master, pull/merge master, and then checkout the branch that was originally checked out
[15:48:21] jrafanie: has joined #ruby
[15:49:03] TheCompWiz: has joined #ruby
[15:49:19] ytti: dunno, but you probably should be using 'rugged' not 'ruby-git'
[15:50:12] djbkd: has joined #ruby
[15:50:15] TheCompWiz: I have an interesting question... does anyone know how to use the "gets" method on a stream with multiple line separators instead of just 1? i.e. instead of just "\n" ... also separate on ":" or something else.
[15:50:32] TheCompWiz: I really don't want to bang on the stream one byte at a time.
[15:53:22] jonjitsu: I used bundlers gem generator to create a cli app. Is there an easy way of installing this locally? Also, is there an easy way to dockerize this so I could do docker run cli-app [options]?
[15:53:34] djbkd: has joined #ruby
[15:56:03] rakm: has joined #ruby
[15:57:26] brent__: has joined #ruby
[15:59:20] [Butch]: has joined #ruby
[15:59:52] chuff: has joined #ruby
[16:00:01] huddy: has joined #ruby
[16:03:27] nowhere_man: has joined #ruby
[16:03:31] mim1k: has joined #ruby
[16:04:15] synthroid: has joined #ruby
[16:04:55] doublemalt__: has joined #ruby
[16:06:16] chouhoul_: has joined #ruby
[16:06:21] GodFather: has joined #ruby
[16:07:34] uncertainty: has joined #ruby
[16:09:18] TheCompWiz: well... I guess since nobody knows if I can use 2 separators instead of 1... how about this. Is there an equivalent "peek" method on streams that can see what is in the buffer without moving the current position in the stream?
[16:09:56] TheCompWiz: i.e. a gets without consuming the data?
[16:14:47] xall: has joined #ruby
[16:14:48] somebody_: has joined #ruby
[16:17:17] MittelDank: has joined #ruby
[16:17:20] hxegon: TheCompWiz: Try getting an enumerator from the file and using #lazy
[16:19:06] Xiti: has joined #ruby
[16:20:59] TheCompWiz: @hxegon.... sadly... it's not a stream :(
[16:21:14] TheCompWiz: s/stream/file/
[16:22:13] gusrub: has joined #ruby
[16:22:58] hxegon: TheCompWiz: is it an IO?
[16:23:23] hxegon: you could try IO#foreach, but it's by line so not sure if you can use it
[16:23:28] Lord_of_Life: has joined #ruby
[16:23:35] vhscrb: has joined #ruby
[16:23:49] TheCompWiz: the problem is... some lines end in newlines... others end in \r only. /sigh.
[16:24:24] tenderlove: has joined #ruby
[16:24:42] TheCompWiz: all in the same stream I will see both.
[16:25:07] hxegon: TheCompWiz: hmm... there's also each_char
[16:25:28] hxegon: and #each_byte, but it sounded like those wouldn't work :(
[16:25:31] TheCompWiz: yeah... was hoping to avoid reading byte-by-byte.
[16:25:39] Pumukel: has joined #ruby
[16:25:46] TheCompWiz: that puts a heavy toll on the CPU...
[16:26:28] Pumukel: has joined #ruby
[16:26:35] polishdub: has joined #ruby
[16:27:14] Pumukel: has joined #ruby
[16:27:15] TheCompWiz: I am hoping that there is a more elegant way than to setup my own buffer that I chunk together and parse every cycle.
[16:27:44] Pumukel: has joined #ruby
[16:28:01] hxegon: TheCompWiz: for #each_line, you can pass in the separator as a regex
[16:28:48] TheCompWiz: it doesn't seem to match non-printable characters unfortunately. :(
[16:30:02] TomyLobo2: has joined #ruby
[16:32:37] cfec0b8d: has joined #ruby
[16:37:03] TheCompWiz: grr... gets doesn't seem to like regex :(
[16:37:39] _aeris_: has joined #ruby
[16:37:56] rob_: anyone know how to recursively turn child hashes in a hash into a hashie type hash?
[16:39:02] rob_: well, substitute 'hashie' for any other type of object
[16:39:18] __Yiota: has joined #ruby
[16:39:43] hxegon: Gonna have to be a bit more specific rob_
[16:40:02] TheCompWiz: I was gonna say the same thing... :D
[16:41:11] hxegon: >> { hash1: {}, hash2: {} }.map { |_, _| "foo" }
[16:41:12] ruby[bot]: hxegon: # => ["foo", "foo"] (https://eval.in/764693)
[16:42:25] Ishido: has joined #ruby
[16:42:41] hxegon: >> { hash1: {}, hash2: {} }.map { |k, _| [k, "foo"] }.to_h # or this
[16:42:42] ruby[bot]: hxegon: # => {:hash1=>"foo", :hash2=>"foo"} (https://eval.in/764694)
[16:43:22] tomphp: has joined #ruby
[16:43:36] minimalism: has joined #ruby
[16:44:23] chuff: has joined #ruby
[16:44:50] tenderlove: has joined #ruby
[16:48:41] millerti: has joined #ruby
[16:50:36] montanonic: has joined #ruby
[16:52:49] rgtk: has joined #ruby
[16:54:26] dviola: has joined #ruby
[16:55:42] rob_: https://gist.github.com/roobert/a040523953728f3f6af718f68a6e2db7
[16:55:47] jrafanie: has joined #ruby
[16:55:56] rob_: i'd like the last two lines to evaluate to true
[16:57:18] milardovich: has joined #ruby
[16:58:03] AndrewIsHere: has joined #ruby
[16:58:04] mim1k: has joined #ruby
[16:58:35] mejja: has joined #ruby
[16:58:40] mejja: has left #ruby: ()
[17:02:04] marsjaninzmarsa: has joined #ruby
[17:03:23] pankaj: has joined #ruby
[17:03:40] _djbkd: has joined #ruby
[17:05:15] tenderlove: has joined #ruby
[17:05:24] bocaneri: has joined #ruby
[17:06:03] skweek: has joined #ruby
[17:07:49] davorb: has joined #ruby
[17:10:33] slackR: has joined #ruby
[17:11:00] Arpanet69: has joined #ruby
[17:11:48] xall: has joined #ruby
[17:11:50] cagomez: has joined #ruby
[17:12:42] hndk: has joined #ruby
[17:13:36] cd-rum: has joined #ruby
[17:14:27] ger0: has joined #ruby
[17:15:11] herwin: hxegon: Ruby 2.4 has a Hash#transform_values to simplify that last example
[17:18:35] willardg: has joined #ruby
[17:21:10] willardg: has left #ruby: ()
[17:21:56] jrafanie: has joined #ruby
[17:23:51] synthroid: has joined #ruby
[17:25:20] hxegon: thanks herwin!
[17:25:36] tenderlove: has joined #ruby
[17:27:16] nadir: has joined #ruby
[17:27:57] montanonic: has joined #ruby
[17:29:10] grh: has joined #ruby
[17:31:09] kirun: has joined #ruby
[17:31:54] KevinMGranger: has joined #ruby
[17:33:08] tomphp: has joined #ruby
[17:33:12] gusrub: has joined #ruby
[17:33:35] jusa: has joined #ruby
[17:38:17] roger_rabbit: has joined #ruby
[17:38:59] tenderlove: has joined #ruby
[17:40:38] marxarelli: has joined #ruby
[17:40:53] slackR: has joined #ruby
[17:41:03] doublemalt__: has joined #ruby
[17:41:59] jrafanie: has joined #ruby
[17:43:27] kitikonti: has joined #ruby
[17:43:28] pankaj: has joined #ruby
[17:44:03] enterprisey: has joined #ruby
[17:46:07] cagomez: what does this do? `Foo.someMethod do; methodCall(Foo); end` do? does it only run if `Foo.someMethod` exists?
[17:47:09] hxegon: cagomez: it should give an error if someMethod is undefined on Foo, but are you asking what the do...end syntax is?
[17:47:20] cagomez: hxegon: yes, that too
[17:47:30] ytti: it's anonymous function passed to someMethod
[17:47:41] ytti: which calls it via yield
[17:47:55] cagomez: in the first place, if that code exists, is the programmer assuming that `Foo` always has a `someMethod`?
[17:48:10] enterprisey: has joined #ruby
[17:48:16] ytti: and that someMethod takes block
[17:48:36] hxegon: essentially you are passing a function as an argument to someMethod
[17:49:14] cagomez: what if that `methodCall(Foo)` returns a value? is that value passed to `someMethod`?
[17:49:58] hxegon: cagomez: no, you have to use yield in someMethod to pass a value to the block, but because the block doesn't have any arguments, it wouldn't do anything
[17:50:12] hxegon: for example
[17:51:30] hxegon: [1, 2, 3].map { |n| n * 2 } # { = do, } = end here. map passes the elements of the list to the block, the block executes on each thing it's passed and map returns the values returned by the block
[17:51:39] hxegon: whoops, forgot the >>
[17:51:50] hxegon: >> [1, 2, 3].map { |n| n * 2 }
[17:51:51] ruby[bot]: hxegon: # => [2, 4, 6] (https://eval.in/764763)
[17:53:21] Keltia_: has joined #ruby
[17:54:14] joaomdmoura___: has joined #ruby
[17:54:22] cagomez: hmm ok, the Foo in question is actually an XmlMarkup obj . http://builder.rubyforge.org/classes/Builder/XmlMarkup.html
[17:54:24] ckrailo_: has joined #ruby
[17:54:46] Tony-St4rk_: has joined #ruby
[17:54:55] jxf_: has joined #ruby
[17:55:07] cagomez: but it looks like it creates `xml.Foo` on demand?
[17:55:13] mroth_: has joined #ruby
[17:55:13] mitsuhiko_: has joined #ruby
[17:55:25] hxegon: ?code cagomez
[17:55:26] ruby[bot]: cagomez: We can't help you without your code, please post it to https://gist.github.com
[17:55:57] ec\: has joined #ruby
[17:56:04] Travis-42_: has joined #ruby
[17:56:13] rflot_: has joined #ruby
[17:56:27] cagomez: xml_builder = Builder::XmlMarkup.new; xml_builder.div { |xml| xml.stong("text”) }
[17:56:32] cagomez: ^they show that
[17:56:44] Mattias: has joined #ruby
[17:57:06] hndk: has joined #ruby
[17:57:18] pleiosau1: has joined #ruby
[17:57:19] cagomez: but I'm sure that `.div` isn't defined on the object already since they call all sorts of different "attributes" on the xml_builder object
[17:57:30] roar: has joined #ruby
[17:57:33] alnewkir1: has joined #ruby
[17:57:39] cagomez: eg `builder.name`
[17:58:33] elomatreb: You don't have to explicitely define every method you want to call in Ruby, they can be dynamically created
[17:59:04] slackR: has joined #ruby
[17:59:36] gusrub: has joined #ruby
[17:59:44] KevinMGranger: Am I misunderstanding this issue? Shouldn't it be fixed on rubygems.org's side? Or does that only apply to newly uploaded stuff? http://blog.rubygems.org/2011/08/31/shaving-the-yaml-yak.html
[17:59:48] spk: has joined #ruby
[17:59:58] jhass: has joined #ruby
[18:00:08] ghormoon: has joined #ruby
[18:00:08] KevinMGranger: I'm stuck on 1.9.3, so :/
[18:00:09] tekacs: has joined #ruby
[18:00:36] EvilJStoker: has joined #ruby
[18:00:44] Iota-: has joined #ruby
[18:00:44] redondos: has joined #ruby
[18:00:45] csaunders: has joined #ruby
[18:01:12] bjmllr: has joined #ruby
[18:01:16] dminuoso: KevinMGranger: Why are you stuck?
[18:01:21] dminuoso: 1.9.3 is like from 1983
[18:01:42] ReinH_: has joined #ruby
[18:01:56] zeroDivisible: has joined #ruby
[18:02:01] cyberRodent: has joined #ruby
[18:02:07] nOwz: has joined #ruby
[18:02:28] Paradox: has joined #ruby
[18:03:01] KevinMGranger: Upgrading the version isn't within the scope of the project, unfortunately. I'd like the latest and greatest too
[18:04:42] Tharbakim: has joined #ruby
[18:04:42] Tharbakim: has joined #ruby
[18:07:29] muelleme_: has joined #ruby
[18:11:43] nofxxxx: KevinMGranger, ruby's 1x -> 2x isn't big deal really... maybe minutes
[18:12:11] ytti: 1.8 => newer
[18:12:14] ytti: may be work
[18:12:14] heinrich5991: has joined #ruby
[18:12:21] BSaboia: has joined #ruby
[18:12:25] KevinMGranger: I agree! It's not my choice, though. And it's definitely not our biggest fish to fry.
[18:12:25] ytti: after that, you likely won't break shit
[18:12:47] KevinMGranger: I also just found out prod is running an even older version of rubygems, so it doesn't have the issue :/ that's one workaround, eh?
[18:16:19] moeSizlak: has joined #ruby
[18:16:32] moeSizlak: for some reason File.write is adding newlines
[18:16:37] moeSizlak: how do i make it not do that
[18:17:14] ozcanesen: has joined #ruby
[18:17:46] synthroid: has joined #ruby
[18:20:21] Rodya_: has joined #ruby
[18:23:31] DEac-: has joined #ruby
[18:24:35] uncertainty: has joined #ruby
[18:26:36] DEac-: has joined #ruby
[18:26:38] moeSizlak: https://gist.github.com/moeSizlak/8fe44fd6f1523716387bf6955110c7b1
[18:26:46] moeSizlak: nowhere in there do i ever write a \n to the file
[18:26:53] moeSizlak: but the file ends up with 5 of them
[18:27:26] moeSizlak: (it writes 80,000 lines to the file, so its not doing it on every line, probably only when it flushes some buffer. the last line in the file has a \n
[18:27:37] enterprisey: has joined #ruby
[18:28:21] code_zombie: has joined #ruby
[18:30:56] adam12: moeSizlak: so you want just \r and not \n or \r\n?
[18:31:12] adam12: Seems weird that #write would be adding \n.
[18:31:23] moeSizlak: only on 5 of the 80,000 lines it writes
[18:31:36] adam12: Is it possible the \r is being converted to \n on the platform?
[18:31:38] moeSizlak: inclusing the last line
[18:31:46] pankaj: has joined #ruby
[18:31:46] moeSizlak: not possible
[18:32:02] A124: has joined #ruby
[18:32:38] moeSizlak: i changed the write line to this:
[18:32:39] moeSizlak: file.write("some shit\rmore shit\ryadda yadda yadda\r")
[18:32:45] moeSizlak: still got 2 \n's in the file
[18:35:03] audy: has joined #ruby
[18:35:18] nitric: has joined #ruby
[18:37:30] hfp: I switched to rugged, but I still don't see how can I pull and rebase the master branch programatically
[18:37:53] hfp: (from Ruby, manipulating a git repo on disk)
[18:38:04] BTRE: has joined #ruby
[18:40:09] tenderlove: has joined #ruby
[18:40:37] tenderlo_: has joined #ruby
[18:41:10] moeSizlak: fyi, it was just notepad++ seeing \n'es even though there were none
[18:41:16] moeSizlak: never had np++ lie to me like that before :/
[18:44:04] dminuoso: havenwood: Im about to do a naughty.
[18:44:10] dminuoso: Im about to do redux in ruby.
[18:44:42] hahuang65: has joined #ruby
[18:46:20] KevinMGranger: Why would that be naughty?
[18:46:23] moeSizlak: has left #ruby: ("Leaving")
[18:47:10] dminuoso: KevinMGranger: I have stopped mutating Ruby objects left and right.
[18:47:12] renchan: has joined #ruby
[18:47:22] dminuoso: I even started writing my rails views like react components..
[18:47:26] baweaver: dminuoso: nice pun
[18:47:32] KevinMGranger: I'm relatively new to ruby compared to other langs, but that sounds like the opposite of naughty
[18:47:45] KevinMGranger: Unless it truly results in bad performance
[18:47:59] dminuoso: KevinMGranger: Leave your performance wishes outside the door if you enter this channel.
[18:48:27] bmurt: has joined #ruby
[18:48:39] tomphp: has joined #ruby
[18:48:47] KevinMGranger: That's my philosophy. I've always seen immutability as a best practice, I wouldn't call it naughty. Heck, rails partials are pretty close to react components, no?
[18:50:05] dminuoso: Not at all.
[18:50:08] dminuoso: Like. Completely not at all.
[18:51:52] KevinMGranger: As long as you don't use local state, I don't see how they're not the same
[18:51:58] KevinMGranger: Or, similar, at least
[18:52:27] dminuoso: The only thing they have in common is that they produce HTML somehow.
[18:52:40] dminuoso: But thats the extend of it.
[18:52:47] ozcanesen: has joined #ruby
[18:53:02] dminuoso: Well, technically a rails view can output other things too.
[18:53:49] KevinMGranger: And are composable with other components / partials, and you can pass them local variables so they're not dependent on how you set up your instance variables. Close enough for me :P
[18:54:24] KevinMGranger: Okay, a better question, then: how have you been changing your rails views so that they're closer to react components
[18:55:17] dminuoso: KevinMGranger: Decomposing inside the same file using lambdas.. putting lambdas to calculate things inside the same view :D
[18:55:42] dminuoso: Which is quite horrible but well. It reads nicer.
[18:56:10] KevinMGranger: That sounds like you're putting redux reducers in your view, more than react components, but I might still be misunderstanding. Still sounds fun :P
[18:56:11] mim1k: has joined #ruby
[18:56:24] _sfiguser: has joined #ruby
[18:56:28] dminuoso: Redux reducers are a completely different thing again.
[18:56:59] baweaver: dminuoso: I may pick your brain later on Redux
[18:57:09] baweaver: meantime, long meeting time
[18:57:44] baweaver: http://randycoulman.com/blog/2016/05/24/thinking-in-ramda-getting-started/
[18:57:46] baweaver: Also read that
[18:57:56] dminuoso: Yeah you gave it to me the other day.
[18:58:02] dminuoso: I wasnt entirely sold.
[18:58:12] baweaver: General idea more than anything
[18:58:42] baweaver: Evolutions and lenses would be super handy for state reduction
[18:58:55] baweaver: (it's a multipart article)
[18:59:39] baweaver: off I go then
[19:00:24] alxgsv: has joined #ruby
[19:00:43] dminuoso: >> arr1 = [1,2,3]; arr2 = [3,4]; puts [*arr1, *arr2, 5, 6]
[19:00:44] ruby[bot]: dminuoso: # => 1 ...check link for more (https://eval.in/764781)
[19:00:55] dminuoso: >> arr1 = [1,2,3]; arr2 = [3,4]; p [*arr1, *arr2, 5, 6]
[19:00:56] ruby[bot]: dminuoso: # => [1, 2, 3, 3, 4, 5, 6] ...check link for more (https://eval.in/764782)
[19:01:02] dminuoso: Merging arrays like a professional!
[19:01:33] patarr1: has joined #ruby
[19:01:38] mikecmpbll: has joined #ruby
[19:02:24] mim1k: has joined #ruby
[19:02:42] meshsmith: has joined #ruby
[19:02:49] naprimer: has joined #ruby
[19:03:10] x0F: has joined #ruby
[19:06:08] TPug: has joined #ruby
[19:06:10] hahuang61: has joined #ruby
[19:07:25] davorb: has joined #ruby
[19:08:36] biberu: has joined #ruby
[19:09:13] hahuang65: has joined #ruby
[19:09:22] electrostat: has joined #ruby
[19:12:20] FoX_77: has joined #ruby
[19:13:24] tAn: has joined #ruby
[19:14:12] hahuang61: has joined #ruby
[19:14:19] jdm: has joined #ruby
[19:14:49] pupsicle: Ramda doesn't look like anything too groundbreaking.
[19:19:47] patarr: has joined #ruby
[19:20:27] jrafanie: has joined #ruby
[19:24:24] loincloth: has joined #ruby
[19:24:35] tvw: has joined #ruby
[19:25:43] haylon: has joined #ruby
[19:26:08] dhollinger: has joined #ruby
[19:26:46] montanonic: has joined #ruby
[19:27:24] skweek: has joined #ruby
[19:28:11] cagomez: has joined #ruby
[19:28:12] PaulCapestany: has joined #ruby
[19:34:58] PaulCapestany: has joined #ruby
[19:35:44] cagomez: has joined #ruby
[19:38:41] bmurt: has joined #ruby
[19:38:42] johnzorn: has joined #ruby
[19:39:32] DarkBushido: has joined #ruby
[19:39:33] DarkBushido: has joined #ruby
[19:43:01] jrafanie: has joined #ruby
[19:43:29] patarr: has joined #ruby
[19:44:44] __Yiota: has joined #ruby
[19:44:45] Doow: So, I was writing some code on windows and used the handy File.stat(myfile).birthtime(). But when I move it to the production environment (ubuntu 16.04 with ruby 2.3) I get "birthtime() function is unimplemented on this machine". What's the best alternative option?
[19:45:19] dminuoso: Doow: Docker!
[19:46:09] Doow: Also, is there some way to check when developing in windows what functions might not be available in linux? There may be several functions I'm using that's just not been called yet.
[19:46:10] dminuoso: Doow: What is the filesystem?
[19:46:17] Doow: dminuoso, ext4
[19:46:35] dminuoso: Doow: Yeah you are screwed on Windows kind of.
[19:46:46] PaulCapestany: has joined #ruby
[19:48:58] cagomez: has joined #ruby
[19:51:22] Doow: The documentation says that birthtime() will return ctime() on platform where a birthtime is not available, however, I'm not quite sure what "Returns the change time for stat (that is, the time directory information about the file was changed, not the file itself)." means and in what situation that would change.
[19:51:45] Doow: but I guess I should use ctime() instead?
[19:52:56] Doow: damn it, I was reading the documentation for 2.2, not 2.3. Looks like it has changed
[19:53:42] knight33: has joined #ruby
[19:55:27] vayan: has joined #ruby
[19:55:31] mattwc: has joined #ruby
[19:56:09] bkxd: has joined #ruby
[19:58:09] Rodya_: has joined #ruby
[20:02:58] nOwz: has joined #ruby
[20:05:25] enterprisey: has joined #ruby
[20:06:50] kcning: has joined #ruby
[20:12:09] dionysus69: has joined #ruby
[20:13:42] cydrobolt: has joined #ruby
[20:13:43] cydrobolt: has joined #ruby
[20:14:19] drale2k_: has joined #ruby
[20:17:32] cdg: has joined #ruby
[20:18:00] jrafanie: has joined #ruby
[20:22:23] mnemon: has joined #ruby
[20:22:27] ozcanesen: has joined #ruby
[20:22:33] chouhoulis: has joined #ruby
[20:22:49] __Yiota: has joined #ruby
[20:24:59] cd-rum: has joined #ruby
[20:25:06] benlieb: has joined #ruby
[20:25:53] matled: has joined #ruby
[20:28:53] CGibsonmm: has joined #ruby
[20:29:14] Nicmavr: has joined #ruby
[20:29:15] gremax: has joined #ruby
[20:29:46] mlehrer: has joined #ruby
[20:30:15] crayfishx: has joined #ruby
[20:30:36] synthroid: has joined #ruby
[20:30:45] RenatoSilva: has joined #ruby
[20:31:10] g0d355__: has joined #ruby
[20:31:43] dellavg: has joined #ruby
[20:32:33] synthroid: has joined #ruby
[20:34:09] PaulCape_: has joined #ruby
[20:38:18] gdonald: has joined #ruby
[20:41:04] gnufied: has joined #ruby
[20:41:26] svkurowski: has joined #ruby
[20:43:43] pankaj: has joined #ruby
[20:44:12] milardovich: has joined #ruby
[20:45:22] DEac-: has joined #ruby
[20:46:00] CGibsonmm: anyone here today>
[20:46:26] tolerablyjake: has joined #ruby
[20:47:32] MrBusiness: has joined #ruby
[20:48:09] Lyubo1: has joined #ruby
[20:48:10] Mutter: has joined #ruby
[20:48:46] millerti: has joined #ruby
[20:49:44] jusa: has joined #ruby
[20:50:01] cagomez: say I want to pass `foo.thing1` to a method bar like so: bar(foo.thing1) . I have `thing1` to `thingN` so I need to make N method calls. how do I do this in a loop? Is it
[20:51:39] adaedra: you can use public_send to make dynamic calls
[20:53:09] cagomez: adaedra: what about `send`? what's the difference?
[20:53:24] adaedra: `send` allows you to call private methods.
[20:53:57] adaedra: It has its uses, but you should use `public_send` by default, so you don't break the private line.
[20:54:01] jrafanie: has joined #ruby
[21:00:30] hemebond: has left #ruby: ()
[21:04:11] JeanCarloMachado: has joined #ruby
[21:04:21] Jayson_Virissimo: has joined #ruby
[21:07:58] davorb: has joined #ruby
[21:12:11] jenrzzz: has joined #ruby
[21:12:12] jenrzzz: has joined #ruby
[21:12:42] CloCkWeRX1: has joined #ruby
[21:13:04] hahuang61: has joined #ruby
[21:14:10] knight33: has joined #ruby
[21:15:43] tfitts: has joined #ruby
[21:16:02] ikopico: has joined #ruby
[21:16:31] jdm: has joined #ruby
[21:16:52] Jayson_Virissimo: has joined #ruby
[21:17:50] Jayson_V_: has joined #ruby
[21:17:53] cd-rum: has joined #ruby
[21:18:22] rhyselsmore: has joined #ruby
[21:19:45] fuzzyhorns: has joined #ruby
[21:19:54] fuzzyhorns: pry question im having trouble googling:
[21:20:10] fuzzyhorns: the output of `whereami` shows line numbers of the file i'm in
[21:20:19] fuzzyhorns: any way to execute what is on a line number from within pry?
[21:21:47] galeido: has joined #ruby
[21:22:08] workmad3: has joined #ruby
[21:22:56] GSilva: has joined #ruby
[21:29:21] ecnalyr: has joined #ruby
[21:31:54] bmurt: has joined #ruby
[21:33:48] JeanCarloMachado: has joined #ruby
[21:34:22] rgtk: has joined #ruby
[21:34:32] darix: fuzzyhorns: copy paste?
[21:34:54] kcning: has joined #ruby
[21:35:25] xenops: has joined #ruby
[21:36:47] chouhoulis: has joined #ruby
[21:36:51] gloscombe_: has joined #ruby
[21:37:03] fuzzyhorns: darix: i was hoping there'd be an equivalent of !line_number in shell
[21:37:48] z64: i mean.. can read the file split into lines and then eval it
[21:38:05] z64: if theres something to do that already, i dunno
[21:38:22] fuzzyhorns: z64: it seemed like the kind of thing pry might already have an api for
[21:41:38] jamesaxl: has joined #ruby
[21:42:05] bkxd: has joined #ruby
[21:43:49] jdm: has joined #ruby
[21:44:17] bastilian: has left #ruby: ()
[21:47:51] Vircung: has joined #ruby
[21:49:46] mjuhl: has joined #ruby
[21:49:58] cagomez: has joined #ruby
[21:51:46] patarr: Is there a way to have an error "fall-through" to the next rescue block?
[21:52:31] maattdd: has joined #ruby
[21:52:38] patarr: e.g. rescue SpecificError => e #check e.something, don't find what you want, pass it to the next block# .... rescue => e Logger.error(e)
[21:52:47] TPug: has joined #ruby
[21:55:06] SeepingN: just rescue it in the outter block
[21:55:53] adam12: patarr: you can re-raise
[21:56:01] adam12: but we'd probably need to see some code to see what you're doing.
[21:59:18] postmodern: has joined #ruby
[22:00:37] ruby[bot]: has joined #ruby
[22:00:37] ChanServ: +o ruby[bot]
[22:01:46] JeanCarloMachado: has joined #ruby
[22:06:13] patarr: adam12: if I re-raise, will that allow it to be evaluated by rescue blocks that come after?
[22:06:28] adam12: patarr: in the same block, probably not.
[22:06:47] adam12: could you rescue a bunch of exceptions and setup a case on them?
[22:06:49] adam12: so only one block
[22:08:15] blackwind_123: has joined #ruby
[22:08:47] alibby2: has joined #ruby
[22:09:23] patarr: I could give that a shot. I can skin this cat a few different ways, I was just wondering if ruby had such a facility. Thank you adam12
[22:09:57] adam12: patarr: You can always try re-raising, but I suspect it's not going to be in the same block as where the raise was handled the first time. Somewhere further up.
[22:10:10] alibby1: has joined #ruby
[22:10:10] adam12: Go get em :)
[22:11:12] JeanCarloMachado: has joined #ruby
[22:11:34] centrx: has joined #ruby
[22:11:41] knight33: has joined #ruby
[22:11:44] cjk101010: has joined #ruby
[22:12:48] lpaste: has joined #ruby
[22:13:31] muelleme_: has joined #ruby
[22:14:53] enterprisey: has joined #ruby
[22:16:21] Didac: has joined #ruby
[22:19:35] Tau: has joined #ruby
[22:21:16] __Yiota: has joined #ruby
[22:30:54] CloCkWeRX: has joined #ruby
[22:37:26] zipper: has joined #ruby
[22:40:59] houhoulis: has joined #ruby
[22:43:20] marsjaninzmarsa: has joined #ruby
[22:46:19] JeanCarloMachado: has joined #ruby
[22:46:21] patarr: has joined #ruby
[22:47:32] duckpupp1: has joined #ruby
[22:50:39] jusa: has joined #ruby
[22:50:52] al2o3-cr: has joined #ruby
[22:52:59] bmurt: has joined #ruby
[22:54:49] knight33: has joined #ruby
[22:57:00] cagomez: has joined #ruby
[22:58:05] username1: has joined #ruby
[22:59:32] edgr: has joined #ruby
[23:02:33] phansch: has joined #ruby
[23:04:48] rakm: has joined #ruby
[23:06:57] eb0t: has joined #ruby
[23:08:05] t-recx: has joined #ruby
[23:08:33] davorb: has joined #ruby
[23:13:26] charliesome: has joined #ruby
[23:14:33] patarr: has joined #ruby
[23:20:09] alan_w: has joined #ruby
[23:21:03] gloscombe_: has left #ruby: ()
[23:21:12] benlieb: has joined #ruby
[23:23:57] patarr: has joined #ruby
[23:26:01] Didac: has joined #ruby
[23:26:03] gnufied: has joined #ruby
[23:27:41] bkxd: has joined #ruby
[23:30:50] tolerablyjake: has joined #ruby
[23:33:22] patarr: has joined #ruby
[23:35:52] CloCkWeRX: has joined #ruby
[23:42:45] patarr: has joined #ruby
[23:43:53] SimpleIRC_VLBcT: has joined #ruby
[23:45:17] charliesome: has joined #ruby
[23:49:16] jaequery: has joined #ruby
[23:51:54] patarr: has joined #ruby