« Back to channel list

#ruby - 24 May 2017

« Back 1 day Forward 1 day »
[00:02:49] amitchellbullard: has joined #ruby
[00:02:54] Travis-42: has joined #ruby
[00:02:57] railswebdev: has joined #ruby
[00:07:02] dnewkerk: has left #ruby: ()
[00:07:08] jusa: has joined #ruby
[00:07:20] eightlimbed: def wonky_coins(n)
[00:07:27] eightlimbed: return 1 if n == 0
[00:07:49] eightlimbed: wonky_coins(n/2) + wonky_coins(n/3) + wonky_coins(n/4)
[00:08:49] eightlimbed: how does wonky_coins(5) = 11? I can't get my mind around what is happening
[00:09:26] dope_canoe: has joined #ruby
[00:09:38] rfoust: has joined #ruby
[00:10:09] lucz: has joined #ruby
[00:10:17] Yzguy: has joined #ruby
[00:11:32] dope_canoe: has left #ruby: ()
[00:15:20] charliesome: has joined #ruby
[00:18:37] rakm: has joined #ruby
[00:21:48] ur5us: has joined #ruby
[00:22:11] kspencer: for some reason nothing works when trying to verify github signatures, I have no clue whats wrong, and have followed all documentation to the best of my ability
[00:23:11] kspencer: signature = "sha1=#{OpenSSL::HMAC.hexdigest('sha1', token, request.body.read)}"
[00:23:32] jenrzzz: has joined #ruby
[00:23:41] rkoller: has joined #ruby
[00:23:57] rkazak: has joined #ruby
[00:24:01] Cohedrin_: has joined #ruby
[00:24:07] havenwood: eightlimbed: consider the following "puts-based" debugging: https://gist.github.com/havenwood/970823af50030f89aa74c789add058d2
[00:24:34] havenwood: eightlimbed: count the number of times it breaks with a 1 value
[00:24:57] havenwood: kspencer: can you gist the content of your ~/.gitconfig file?
[00:26:02] havenwood: eightlimbed: consider if you called: wonky_coins 0
[00:26:04] havenwood: eightlimbed: it makes sense that'd return: 1
[00:26:12] havenwood: (since it hits the early return right away)
[00:26:28] kspencer: havenwood: I'm doing webhooks, I'm 99% sure I don't need to gist .gitconfig (granted I didn't say webhook before sorry)
[00:26:57] havenwood: eightlimbed: how about if you called? try to trace it's flow. what is the value? why?: wonky_coins 1
[00:27:25] havenwood: i meant: "called `wonky_coins 1`?"
[00:28:02] havenwood: kspencer: I assumed you meant you wanted to get gpgsign and signingkey setup for verified commits, nevermind
[00:28:23] havenwood: kspencer: Is this Ruby-related? You might try the Github support if it's Github-related.
[00:29:17] havenwood: kspencer: https://github.com/contact
[00:29:36] kspencer: havenwood: Well I'm having to use ruby's openssl library to compare the sha1+hmac signatures
[00:29:59] kspencer: I've already sent them a message
[00:30:02] havenwood: kspencer: Maybe I missed the question. I restarted my bouncer a while back.
[00:30:11] Cohedrin: has joined #ruby
[00:30:30] havenwood: kspencer: Why are you comparing sha1+hmac signatures? What is it you're doing?/
[00:32:38] kspencer: :| GitHub's Webhook payloads to endpoints that have 'secrets' are hashed behind a hmac+sha1, otherwise I have to go by IP for github, and secret for gitlab
[00:33:21] jason^: has joined #ruby
[00:35:05] jason^: i have an array of search terms i want to run over a string, is there a good way to do this other than search_terms.each {|term| str.include?(term)} ?
[00:36:02] havenwood: jsaak: look at #grep
[00:36:11] havenwood: err, or say more about what you're doing
[00:36:11] roamingdog: has joined #ruby
[00:36:14] cam27: Not sure why my setter method does not change the health of my instance object? https://gist.github.com/cam271/a44eef440a6072cf41a24c556e9c7cad
[00:36:19] havenwood: i assumed you meant #select, but you said #each
[00:37:21] havenwood: >> ['cat', 'dog', 'space station'].grep /at/ # jason^
[00:37:22] ruby[bot]: havenwood: # => ["cat", "space station"] (https://eval.in/803863)
[00:37:41] jason^: oh cool yeah select would be better in this instance
[00:39:20] jason^: i forgot to look at the enumerable mixin :)
[00:39:33] dlitvak: has joined #ruby
[00:40:32] kspencer: havenwood: GitHub's Webhook payloads are sent with a header hashed behind a hmac+sha1 'X-Hub-Signature: sha1=dsd4f56sdf465dsf64sd', otherwise I have to go by IP for github, and secret for gitlab
[00:40:50] eightlimbed: havenwood: looking at it now...
[00:42:35] ecuanaso: has joined #ruby
[00:46:06] rfoust: has joined #ruby
[00:47:55] Rich_Morin: has joined #ruby
[00:48:12] gothicsouth: has joined #ruby
[00:49:58] apparition: has joined #ruby
[00:50:40] planigan: has joined #ruby
[00:53:16] Rich_Morin: I've been geting irb nastygrams for a while, but given that I just updated my copy of Ruby and all the Gems, I was hoping that it would go away. Help? - https://gist.github.com/RichMorin/731f02684684df8cc47ee5db4a3ab40b
[00:55:37] skixlix: has joined #ruby
[00:56:03] cam27: If I try to print out an instance method using self it will put this right? <Class:0x007fcb3f910fc0>
[00:56:16] BSAlb: has joined #ruby
[00:58:17] olivier__: has joined #ruby
[01:00:53] moombah567: has joined #ruby
[01:03:24] moombah5_: has joined #ruby
[01:03:39] havenwood: Rich_Morin: Try updating your RubyGems `gem update --system` then try a pristine all the things `gem pristine --all`.
[01:04:11] havenwood: skixlix: hi
[01:06:10] gizmore|2: has joined #ruby
[01:06:12] patarr: has joined #ruby
[01:08:20] eightlimbed: havenwood: thank you for your help and writing that debugger! I'm starting to see it now... But It's not clear. Can you explain what you did on this line?
[01:08:22] eightlimbed: wonky_coins(n/2).tap { |v| puts "n/#{v}" } + wonky_coins(n/3).tap { |v| puts "n/#{v}" } + wonky_coins(n/4).tap { |v| puts "n/#{v}" }
[01:08:38] cam27: baweaver: just saw your comment, never got an alert on Github, thank you
[01:08:44] eightlimbed: where is v coming from?
[01:09:21] baweaver: &ri Object#tap
[01:09:21] `derpy: http://ruby-doc.org/core-2.4.1/Object.html#method-i-tap
[01:09:31] baweaver: v is the object you tapped
[01:12:17] Rich_Morin: havenwood: Sigh. Still getting the same nastygrams
[01:14:24] lucz: has joined #ruby
[01:17:06] patarr: has joined #ruby
[01:17:18] uZiel: has joined #ruby
[01:18:39] enterprisey: has joined #ruby
[01:19:54] jenrzzz: has joined #ruby
[01:20:13] edwardly: has joined #ruby
[01:20:14] edwardly: has joined #ruby
[01:21:08] enterprisey: has joined #ruby
[01:21:33] cdg: has joined #ruby
[01:22:50] patr0clus: has joined #ruby
[01:23:19] Cohedrin: has joined #ruby
[01:24:07] mtkd: has joined #ruby
[01:26:35] lucz: has joined #ruby
[01:28:21] yehowyada: has joined #ruby
[01:29:57] bruce_lee: has joined #ruby
[01:29:57] bruce_lee: has joined #ruby
[01:30:23] nofxxxx: has joined #ruby
[01:30:53] havenwood: Rich_Morin: What do you get for?: gem which sqlite3
[01:31:04] havenwood: Rich_Morin: And?: gem which libxml
[01:32:01] Rich_Morin: ERROR: Can't find ruby library file or shared library sqlite3
[01:32:02] Rich_Morin: ERROR: Can't find ruby library file or shared library libxml
[01:36:59] havenwood: Rich_Morin: What do you get for?: [[ "$(dirname $(which irb))" == "$(dirname $(which gem))" ]] && echo sane || echo insane
[01:37:03] havenwood: Rich_Morin: sane or insane?
[01:37:20] Rich_Morin: [[ "$(dirname $(which irb))" == "$(dirname $(which gem))" ]] && echo sane || echo insane
[01:37:29] havenwood: (from your shell)
[01:38:01] eightlimbs: has joined #ruby
[01:38:03] havenwood: so we're dealing with irb and gem executables from the same ruby
[01:38:09] havenwood: yet it's complaining about extensions for gems that aren't installed...
[01:38:35] havenwood: Rich_Morin: do you mind trying uninstalling all non-default gems?
[01:39:25] havenwood: Rich_Morin: If that's fine by you: gem uninstall --all
[01:39:42] havenwood: Rich_Morin: Though they're already not installed... at least not with this Ruby.
[01:39:50] Rich_Morin: erm, I just finished upgrading Ruby and all my gems - won't that make me do a bunch of that all over again?
[01:40:02] havenwood: yeah, you'd have to reinstall all the gems
[01:40:05] havenwood: maybe you don't want to do that
[01:40:09] olivier__: has joined #ruby
[01:40:20] havenwood: hmm, at least find sqlite3 and libxml gem locations
[01:40:21] Rich_Morin: maybe I'll keep living with the ng...
[01:40:29] havenwood: Rich_Morin: which os/distro?
[01:40:35] havenwood: do you have locate or mdfind available?
[01:41:51] LastWhisper____: has joined #ruby
[01:42:12] Ryzokuken: has joined #ruby
[01:42:19] Rich_Morin: locate sqlite3 finds 4873 files
[01:43:36] havenwood: Rich_Morin: Try: mdfind -name sqlite3.rb
[01:43:42] d^sh_: has joined #ruby
[01:45:11] duderonomy: has joined #ruby
[01:46:06] Rich_Morin: see https://gist.github.com/RichMorin/731f02684684df8cc47ee5db4a3ab40b
[01:46:10] leeda: has joined #ruby
[01:46:34] havenwood: Rich_Morin: So it might be complaining about gems further back in your path.
[01:46:49] havenwood: It looks like it. That's the only thing that makes sense.
[01:47:08] havenwood: Rich_Morin: What are you using to switch Ruby versions?
[01:48:17] Rich_Morin: AFAIK, the brew version should override the OS version.
[01:49:04] havenwood: Rich_Morin: check?: which -a ruby
[01:49:15] t-recx: has joined #ruby
[01:49:39] havenwood: Rich_Morin: You might even try `brew unlink ruby` then check `gem list sqlite3` etc. You can then `brew link ruby` to get your Homebrew Ruby and its executable s back.
[01:50:36] havenwood: But looking at your error, it's the 1.3.9 version of sqlite3 it's complaining about.
[01:50:50] havenwood: /Library/Ruby/Gems/2.0.0/gems/sqlite3-1.3.9/lib/sqlite3.rb
[01:51:01] havenwood: Which looks like the version on your system Ruby.
[01:51:42] Jameser: has joined #ruby
[01:52:37] havenwood: Rich_Morin: You could try: sudo gem pristine sqlite3 libxml-ruby
[01:52:51] havenwood: (Which would drop env and be system Ruby.)
[01:53:05] Rich_Morin: Failed to find gems ["sqlite3", "libxml-ruby"] >= 0
[01:53:39] havenwood: Rich_Morin: Do you see them with?: sudo gem list
[01:53:49] Rich_Morin: I wonder if it's a search path problem.
[01:54:11] Dreamer3: has joined #ruby
[01:54:27] Rich_Morin: no, they don't show up then
[01:54:28] havenwood: I am curious why they're coming up at all. Check your PATH and GEM_PATH for sanity. You don't need system Ruby in your paths.
[01:54:31] houhoulis: has joined #ruby
[01:54:51] havenwood: Rich_Morin: Err, so which Ruby is system Ruby?: sudo ruby -v
[01:55:07] havenwood: Rich_Morin: Or look at: sudo which -a ruby
[01:55:29] Rich_Morin: sudo which -a ruby
[01:55:57] Rich_Morin: lists /usr/local/bin/ruby and /usr/bin/ruby
[01:56:03] havenwood: Rich_Morin: But yeah, multiple Rubies can get odd. Especially if PATH, GEM_PATH, etc aren't all set right.
[01:56:19] havenwood: Rich_Morin: Okay, so you have a Ruby in front of your system Ruby that has the sqlite3 gem in question.
[01:56:32] havenwood: The Homebrew Ruby.
[01:56:40] havenwood: Rich_Morin: gem unlink ruby
[01:56:44] Rich_Morin: GEM_PATH isn't set. PATH is /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/rdm/bin:/Users/rdm/Dropbox/cfcl/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/sbin:/usr/sbin:/usr/bin:/bin:/etc:/usr/games:.:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/X11R6/bin
[01:56:48] havenwood: Rich_Morin: brew unlink ruby
[01:57:19] havenwood: Rich_Morin: then: sudo gem pristine ...
[01:57:27] havenwood: Rich_Morin: and: brew link ruby
[01:57:44] havenwood: (Go to system Ruby, pristine those funky gems, then go back to Homebrew Ruby.
[01:58:10] Rich_Morin: It seems to be trying...
[01:59:26] enterprisey: has joined #ruby
[02:00:36] Rich_Morin: that cleaned it up; Thanks!
[02:02:02] havenwood: Rich_Morin: you're welcome
[02:02:27] Rich_Morin: It also cleared up a problem I was having with ruby-path :-)
[02:03:24] jenrzzz: has joined #ruby
[02:03:24] jenrzzz: has joined #ruby
[02:05:48] rfoust: has joined #ruby
[02:06:06] Rich_Morin: except now I get "-bash: /usr/local/bin/gem: No such file or directory"
[02:07:57] jusa: has joined #ruby
[02:10:47] tgragnato: has joined #ruby
[02:11:18] patarr: has joined #ruby
[02:11:28] Rich_Morin: and ruby --version is back at 2.0.0p481
[02:12:16] alibby: has left #ruby: ()
[02:14:27] kspencer: havenwood: :| my problem was '\n' in part of it, so i had to .chomp
[02:14:28] mmasaki_: has joined #ruby
[02:15:39] kspencer: per github support email
[02:18:18] gnufied: has joined #ruby
[02:19:29] bronson: has joined #ruby
[02:19:41] patarr: has joined #ruby
[02:20:24] genpaku: has joined #ruby
[02:20:51] Bespoormsed: Rich_Morin: type: which gem
[02:22:53] charliesome: has joined #ruby
[02:23:43] Rich_Morin: has joined #ruby
[02:24:21] mmasaki_: has joined #ruby
[02:24:22] Rich_Morin: sorry; had to kill and restart Colloquy
[02:24:58] Rich_Morin: which gem -> /usr/bin/gem
[02:25:28] Rich_Morin: I seem to have a PATH snafu
[02:26:28] havenwood: Rich_Morin: brew link ruby
[02:27:11] Rich_Morin: still /usr/bin/ruby
[02:27:24] havenwood: Rich_Morin: restart your terminal?
[02:27:31] havenwood: Rich_Morin: linking brew should do the trick
[02:27:50] havenwood: Rich_Morin: if not, gist us: brew doctor
[02:30:07] mim1k: has joined #ruby
[02:30:13] rkazak: has joined #ruby
[02:30:54] roamingdog: has joined #ruby
[02:33:34] ineb: has joined #ruby
[02:43:00] jenrzzz: has joined #ruby
[02:48:54] ecuanaso: has joined #ruby
[02:51:38] Rich_Morin: havenwood: Do I need to define GEM_PATH somewhere if I'm using the brew version of Ruby?
[02:52:54] pb122: has joined #ruby
[02:55:59] railswebdev: has joined #ruby
[02:56:07] postmodern: has joined #ruby
[02:59:12] charliesome: has joined #ruby
[03:04:43] roamingdog: has joined #ruby
[03:09:36] mim1k: has joined #ruby
[03:09:53] akkad: has joined #ruby
[03:11:27] bronson: has joined #ruby
[03:11:57] jrafanie: has joined #ruby
[03:15:29] bkxd: has joined #ruby
[03:20:33] agent_white: has joined #ruby
[03:23:42] hkdsun: has joined #ruby
[03:29:15] gothicsouth: has joined #ruby
[03:39:17] mmasaki: has joined #ruby
[03:39:42] hndk: has joined #ruby
[03:40:31] mmasaki: has joined #ruby
[03:41:12] mmasaki: has joined #ruby
[03:41:25] akkad: has joined #ruby
[03:44:14] mmasaki: has joined #ruby
[03:48:55] akkad: has joined #ruby
[03:54:12] hays: has joined #ruby
[03:54:12] hays: has joined #ruby
[03:57:08] nofxxx: has joined #ruby
[04:03:49] moombah567: has joined #ruby
[04:07:04] leeda: has joined #ruby
[04:07:41] al2o3-cr: has joined #ruby
[04:11:10] cjhowe: has joined #ruby
[04:14:24] skweek: has joined #ruby
[04:16:21] bronson: has joined #ruby
[04:19:44] skweek: has joined #ruby
[04:20:51] bronson: has joined #ruby
[04:32:04] cfec0b8d: has joined #ruby
[04:32:44] __Yiota: has joined #ruby
[04:33:42] apparition: has joined #ruby
[04:35:20] renchan: has joined #ruby
[04:35:24] Hanna: has joined #ruby
[04:38:28] Bilge: has joined #ruby
[04:39:45] yolongboi: has joined #ruby
[04:51:10] _whitelogger: has joined #ruby
[04:51:22] konsolebox: has joined #ruby
[04:52:28] olivier__: has joined #ruby
[04:52:57] mmasaki: has joined #ruby
[04:54:23] brent__: has joined #ruby
[05:00:53] kristofferR: has joined #ruby
[05:01:48] moei: has joined #ruby
[05:08:44] droidburgundy: has joined #ruby
[05:09:38] uZiel: has joined #ruby
[05:10:05] patarr: has joined #ruby
[05:10:14] jenrzzz: has joined #ruby
[05:11:42] LastWhisper____: how do i persist a variable that is set during a loop?
[05:14:43] LastWhisper____: im basically doing
[05:15:38] aupadhye: has joined #ruby
[05:15:53] LastWhisper____: result_array = []; [1,2,3].each do |x|; hash = { derp: x}; result_array << hash; end;
[05:16:02] LastWhisper____: once im outside of the loop though result_array is still []
[05:17:38] elomatreb: LastWhisper____: Maybe show your actual code? Because it's not: result_array = []; [1,2,3].each do |x|; hash = { derp: x}; result_array << hash; end;
[05:17:45] elomatreb: Uh, sorry. https://eval.in/803915#
[05:18:22] kt2: has joined #ruby
[05:21:00] LastWhisper____: welp.. it's using a gem called parallel
[05:21:01] LastWhisper____: https://eval.in/803917
[05:21:21] Bilge: has joined #ruby
[05:21:54] LastWhisper____: https://github.com/grosser/parallel
[05:23:13] olivier__: has joined #ruby
[05:23:20] LastWhisper____: https://github.com/grosser/parallel/issues/162
[05:23:29] LastWhisper____: maybe this explains
[05:24:59] anisha: has joined #ruby
[05:25:40] mim1k: has joined #ruby
[05:28:28] Dimik: has joined #ruby
[05:29:08] Bock: has joined #ruby
[05:31:23] Xakotu: has joined #ruby
[05:31:35] Jameser`: has joined #ruby
[05:37:15] zenspider: LastWhisper____: I'd avoid that
[05:37:33] LastWhisper____: you'd avoid what?
[05:39:27] zenspider: the parallel gem. needless complexity
[05:40:12] wuyin: has joined #ruby
[05:41:29] vali: has joined #ruby
[05:43:20] cam27: has joined #ruby
[05:43:27] LastWhisper____: well, i'm currently trying to parallelize some headless browser spin ups using ruby and i wanted to fetch some of their data that i get back
[05:43:52] pusewicz: has joined #ruby
[05:43:54] Jameser: has joined #ruby
[05:44:06] LastWhisper____: im thinking maybe i just pass that data back via redis instead of storing it in db
[05:44:13] zenspider: clearly that requires 1kloc and obviously confusing code that should Just Work
[05:44:14] LastWhisper____: or in a variable rather
[05:44:56] zenspider: that stupid gem is about a thousand lines of confusion
[05:45:14] zenspider: LastWhisper____: so why not spawn some threads do the work and get the data back?
[05:45:30] LastWhisper____: i was told to not use threads as a requirement
[05:45:38] LastWhisper____: and to specifically use processes
[05:45:45] jamesaxl: has joined #ruby
[05:45:55] zenspider: threads can use processes and I don't see why that's a requirement in the first place
[05:46:02] LastWhisper____: i wanted to do this in elixir... would have been ezpz but there are no libs that do the browser work i want
[05:46:08] LastWhisper____: yeah i dont come up with the requirements unfortunately
[05:47:11] zenspider: anyone who tells you HOW to do something should be the one doing it... or shutting the fuck up
[05:49:11] LastWhisper____: haha trust me i would love to say that but that person is the highest ranking dev at work
[05:49:14] LastWhisper____: im not tryna get fired
[05:49:27] LastWhisper____: i am however going to test your proposed solution though
[05:51:24] zenspider: n.times.map { Thread.new { do the work and get the result } }.map(&:join)... or if it is bigger than that, put the work to be done in a Queue, spawn N threads to do the work and put the results in another queue.
[05:51:31] jenrzzz: has joined #ruby
[05:51:31] jenrzzz: has joined #ruby
[05:51:36] Ryzokuken: has joined #ruby
[05:52:29] LastWhisper____: thanks bud. I'll be sure to cherish the memory of the creator of minitest telling me to tell my boss to shut the fuck up xD
[05:52:53] KeyJoo: has joined #ruby
[05:53:39] Xakotu: has joined #ruby
[05:59:41] nofxxxx: has joined #ruby
[06:04:57] moombah567: has joined #ruby
[06:11:06] ActuallyPlatypus: has joined #ruby
[06:13:00] Jameser`: has joined #ruby
[06:13:02] jusa: has joined #ruby
[06:20:46] Mortomes|Work: has joined #ruby
[06:21:48] crankharder: has joined #ruby
[06:23:40] bronson: has joined #ruby
[06:26:15] DoubleMalt: has joined #ruby
[06:28:12] Cohedrin: has joined #ruby
[06:29:25] olivier__: has joined #ruby
[06:30:24] Coldblackice: has joined #ruby
[06:31:28] cjhowe: has joined #ruby
[06:32:18] cjhowe: has joined #ruby
[06:33:03] cjhowe: has joined #ruby
[06:33:08] tvw: has joined #ruby
[06:33:53] cjhowe: has joined #ruby
[06:34:33] cjhowe: has joined #ruby
[06:35:28] cjhowe: has joined #ruby
[06:36:16] cjhowe: has joined #ruby
[06:38:49] biberu: has joined #ruby
[06:42:19] conta: has joined #ruby
[06:47:09] dionysus69: has joined #ruby
[06:53:30] aufi: has joined #ruby
[06:56:54] pusewicz: has joined #ruby
[06:57:01] vali: has joined #ruby
[06:57:58] tomphp: has joined #ruby
[06:58:11] arquebus: has joined #ruby
[06:58:38] mdw: has joined #ruby
[07:02:18] jusa: has joined #ruby
[07:04:19] nobitanobi: has joined #ruby
[07:06:10] blackmesa: has joined #ruby
[07:07:22] roamingdog: has joined #ruby
[07:08:12] roamingdog: has joined #ruby
[07:08:54] AnoHito: has joined #ruby
[07:08:58] roamingdog: has joined #ruby
[07:09:14] zenguy_pc: has joined #ruby
[07:09:47] roamingdog: has joined #ruby
[07:09:58] nobitano_: has joined #ruby
[07:10:20] brent__: has joined #ruby
[07:10:39] jgnagy: has joined #ruby
[07:11:06] patarr: has joined #ruby
[07:11:09] droidburgundy: has joined #ruby
[07:14:22] andikr: has joined #ruby
[07:19:25] zenguy_pc: has joined #ruby
[07:20:27] olivier__: has joined #ruby
[07:20:29] statikowsky: has joined #ruby
[07:24:05] bronson: has joined #ruby
[07:26:14] mim1k: has joined #ruby
[07:27:44] govg: has joined #ruby
[07:27:58] mark_66: has joined #ruby
[07:30:39] djbkd: has joined #ruby
[07:35:28] Jameser: has joined #ruby
[07:42:45] stoffus: has joined #ruby
[07:45:13] etehtsea: has joined #ruby
[07:45:25] olivier__: has joined #ruby
[07:48:24] Axy: has joined #ruby
[07:48:24] Axy: has joined #ruby
[07:52:55] pandaant: has joined #ruby
[07:55:35] DeeJayh_: has joined #ruby
[08:00:22] AlexRussia_: has joined #ruby
[08:02:33] mikecmpbll: has joined #ruby
[08:05:01] kt2: has joined #ruby
[08:05:50] moombah567: has joined #ruby
[08:08:18] dionysus69: is there a cool way to create a shortcut to method call?
[08:09:03] dionysus69: i have method calls that are couple lines long and in order to disable it I have to comment out multiple lines which is just tedious, I wonder if theres a better way to switch those calls on off more concisely
[08:09:08] etehtsea: has joined #ruby
[08:10:21] teclator: has joined #ruby
[08:10:21] burgestrand: has joined #ruby
[08:11:07] roamingdog: has joined #ruby
[08:12:25] marr: has joined #ruby
[08:13:17] ltd: has joined #ruby
[08:13:48] nhhc: has joined #ruby
[08:16:50] Beams: has joined #ruby
[08:17:46] olivier__: has joined #ruby
[08:18:00] claw: https://zgab33vy595fw5zq-zippykid.netdna-ssl.com/wp-content/uploads/2017/05/exit_vim_by_language-1-3-1024x1024.png
[08:18:05] claw: good job #ruby
[08:18:17] ineb: has joined #ruby
[08:18:21] yxhuvud: dionysus69: if you have lots of arguments that repeat themselves, then that is a typical sign that you should extract a class using the arguments as instance variables.
[08:18:30] ltd: has joined #ruby
[08:19:56] vali: has joined #ruby
[08:19:59] charliesome: has joined #ruby
[08:22:14] jenrzzz: has joined #ruby
[08:22:14] jenrzzz: has joined #ruby
[08:23:39] ltd: has joined #ruby
[08:26:03] akkad: has joined #ruby
[08:29:36] mdw: has joined #ruby
[08:30:01] mim1k: has joined #ruby
[08:31:22] bkxd: has joined #ruby
[08:32:36] Puffball: has joined #ruby
[08:33:20] kassav_: has joined #ruby
[08:34:32] kassav_: hello, any quick method to get the total memory of the host in ruby?
[08:38:46] fxa90id: has joined #ruby
[08:38:46] fxa90id: has joined #ruby
[08:41:15] apeiros: kassav_: shell out to the proper command line utility (platform dependent)
[08:41:41] kassav_: i did like this
[08:41:43] kassav_: free -m | grep -oP '\d+' | head -n 1
[08:41:54] kassav_: it's working on the shell
[08:42:25] apeiros: total_memory = `free -m | grep -oP '\d+' | head -n 1`
[08:42:26] kassav_: in irb i got this
[08:42:30] kassav_: @memory = `free -m | grep -oP '\d+' | head -n 1`
[08:42:51] apeiros: just be aware that this will be a string
[08:43:07] kassav_: the result is wrong = "d\n"
[08:43:09] apeiros: you need to escape the \
[08:43:27] apeiros: total_memory = `free -m | grep -oP '\\d+' | head -n 1`
[08:43:42] kassav_: yes but still get 7850\n
[08:43:58] kassav_: where does the \n came from
[08:45:04] ljarvis: the output from your command includes a newline
[08:45:16] ljarvis: so you'll have to remove it yourself
[08:49:56] DeeJayh_: has joined #ruby
[08:50:16] workmad3: has joined #ruby
[08:50:24] govg: has joined #ruby
[08:51:05] SpComb: kassav_: https://rubygems.org/gems/vmstat/
[08:51:20] mim1k: has joined #ruby
[08:52:03] kassav_: total_memory = `free -m | grep -oP '\\d+' | head -n 1`.strip.to_i
[08:52:05] kassav_: thank you all
[08:56:08] lxsameer: has joined #ruby
[09:00:52] bronson: has joined #ruby
[09:01:10] tomphp: has joined #ruby
[09:01:47] teclator: has joined #ruby
[09:02:18] im0nde: has joined #ruby
[09:03:47] DoubleMalt: has joined #ruby
[09:03:57] Bhootrk_: has joined #ruby
[09:05:11] roshanavand: has joined #ruby
[09:06:37] Bhootrk_: has joined #ruby
[09:11:49] roamingdog: has joined #ruby
[09:11:49] patarr: has joined #ruby
[09:11:56] droidburgundy: has joined #ruby
[09:21:31] tvw: has joined #ruby
[09:22:36] ledestin: has joined #ruby
[09:24:19] qwasz: has joined #ruby
[09:25:07] arup_r: has joined #ruby
[09:26:16] brent__: has joined #ruby
[09:26:38] arup_r: Can anyone tell me what is wrong with my `assert_raise` ? My test is failing. https://gist.github.com/aruprakshit/989f0cdaeb5b41c15667362bded838f1
[09:26:38] Puffball: has joined #ruby
[09:27:31] jackrandom: has joined #ruby
[09:28:38] ljarvis: arup_r: the exception is raised in initialize called on line 25, not in #import which is what your test asserts
[09:29:06] arup_r: ljarvis: thanks. how can I miss that details :(
[09:29:17] dminuoso: arup_r: By making blind assumptions.
[09:29:47] arup_r: dminuoso: nothing like that.. I am testing my own code.. somehow I overlooked it.
[09:30:00] dminuoso: arup_r: Your assumption was that the block was throwing the exception.
[09:31:10] workmad3_: has joined #ruby
[09:31:17] arup_r: No. I was thinking the exception comes when I call .import, although it is not. it from .new. I know how the syntax.. just lack of something. :)
[09:31:42] arup_r: anyway thanks.
[09:31:56] dminuoso: arup_r: Which is what I just said. You thought the block in 27 was throwing the exception not the line 25. :-P
[09:32:05] ljarvis: dminuoso is literally saying the same thing as you, you just said "thinking" and dminuoso said "assuming"
[09:32:26] latemus: has left #ruby: ()
[09:32:31] dminuoso: Assumption is the mother of all fuck-ups. If a bug doesn't make sense, it's that one of your assumptions is wrong.
[09:32:45] arup_r: ljarvis: Are you also in #javascript IRC right? :)
[09:32:56] dminuoso: arup_r: No, the person you are referring to has a very similar nickname.
[09:32:59] ljarvis: no, i hate javascript
[09:33:07] dminuoso: arup_r: That person is ljharb
[09:33:32] arup_r: hmm.. I should sleep :)
[09:33:38] arup_r: dminuoso: u are right again.
[09:34:00] ljarvis: arup_r: btw, Tempfile.open doesn't return the last thing in the block, so you could need the explicit `f` lines
[09:34:10] ljarvis: s/could/don't/
[09:34:55] nofxxxx: has joined #ruby
[09:35:17] AnoHito: has joined #ruby
[09:35:29] arup_r: ok.. https://ruby-doc.org/stdlib-1.9.3/libdoc/tempfile/rdoc/Tempfile.html#method-c-open here I see *The call returns the value of the block.* What does it mean?
[09:36:30] ljarvis: i suck, ignore me
[09:37:01] dminuoso: arup_r: Are you using Ruby 1.9.3 ?
[09:37:06] arup_r: ok :) np..
[09:37:09] arup_r: dminuoso: 2.3.1
[09:37:16] dminuoso: arup_r: Then use the documentation for 2.3.1
[09:37:40] dminuoso: Im not saying its gonna make a difference, but this kind of carelessness can waste time. ;-)
[09:37:40] romank: has joined #ruby
[09:37:47] arup_r: yeah ^ :D
[09:38:19] dminuoso: arup_r: Also 2.3.1 is outdated. Upgrade to 2.3.4 :-)
[09:38:34] ljarvis: and then 2.4.1
[09:38:55] olivier__: has joined #ruby
[09:42:46] romank_: has joined #ruby
[09:45:07] ur5us: has joined #ruby
[09:45:24] olivier__: has joined #ruby
[09:45:46] Puppet`: has joined #ruby
[09:46:15] postmodern: has joined #ruby
[09:46:40] zepy_aq_: has joined #ruby
[09:48:30] mim1k: has joined #ruby
[09:51:23] mdw: has joined #ruby
[09:59:25] vuoto: has joined #ruby
[10:00:15] arup_r: has joined #ruby
[10:00:31] govg: has joined #ruby
[10:00:44] vuoto: has left #ruby: ()
[10:05:36] cschneid_: has joined #ruby
[10:06:36] moombah567: has joined #ruby
[10:06:41] vuoto: has joined #ruby
[10:07:01] patarr: has joined #ruby
[10:07:33] bkxd: has joined #ruby
[10:12:34] roamingdog: has joined #ruby
[10:14:25] bkxd: has joined #ruby
[10:17:45] blackmesa: has joined #ruby
[10:21:53] olivier__: has joined #ruby
[10:24:31] yqt: has joined #ruby
[10:26:40] Puffball: has joined #ruby
[10:29:31] vuoto: has joined #ruby
[10:33:22] jinie: has joined #ruby
[10:36:50] kt: has joined #ruby
[10:37:33] romank: has joined #ruby
[10:37:55] rikai: has joined #ruby
[10:38:56] aglorei: has joined #ruby
[10:40:11] teclator: has joined #ruby
[10:40:45] sobersabre: has joined #ruby
[10:43:07] kt2: has joined #ruby
[10:46:46] sobersabre: hi. I'm a bit rusty with ruby (last time I touched ruby code was 5 years ago)
[10:47:15] sobersabre: I want to hack on a project, I expect rake test to run and fail in tests, but instead it prints me some migrations/depdency problems.
[10:47:45] sobersabre: I am in rvm with ruby: ~/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
[10:48:09] sobersabre: I ran bundle, and it seems all required gems are installed.
[10:48:16] sobersabre: here's the curse rake it printing:
[10:50:29] sobersabre: https://pastebin.com/tp5T21At
[10:50:29] ruby[bot]: sobersabre: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[10:50:30] yeticry_: has joined #ruby
[10:51:17] sobersabre: https://gist.github.com/mvk/5b4b695f6419ba6224c044ad321817f8
[10:51:49] sobersabre: well, I probably didn't run something I should have.
[10:51:55] tomphp: has joined #ruby
[10:52:15] sobersabre: Also, I am in webstorm, and I pointed it properly to the right rvm ruby. I can see all the gems are there.
[10:54:19] antgel: has joined #ruby
[10:55:02] sobersabre: well, do not be shy. I promise to understand quickly.
[10:55:29] FastJack: has joined #ruby
[10:57:35] stamina: has joined #ruby
[11:02:33] bronson: has joined #ruby
[11:03:13] jcputter: has joined #ruby
[11:05:17] AnoHito: has joined #ruby
[11:11:48] ddffg: has joined #ruby
[11:12:40] droidburgundy: has joined #ruby
[11:20:53] tomphp: has joined #ruby
[11:23:26] tomphp: has joined #ruby
[11:23:28] d^sh: has joined #ruby
[11:25:22] jenrzzz: has joined #ruby
[11:28:52] robouk: has joined #ruby
[11:31:23] SenpaiSilver: has joined #ruby
[11:32:15] ldnunes: has joined #ruby
[11:34:07] Vingador: has joined #ruby
[11:35:12] JoshS: has joined #ruby
[11:39:48] kt: has joined #ruby
[11:43:35] bkxd: has joined #ruby
[11:43:49] statikowsky: has joined #ruby
[11:44:01] Rich_Morin: has joined #ruby
[11:45:15] swills: has joined #ruby
[11:46:06] roamingdog: has joined #ruby
[11:46:20] Fernando-Basso: has joined #ruby
[11:48:03] dionysus69: has joined #ruby
[11:48:42] marens: has joined #ruby
[11:49:00] uZiel: can I split a string into chunks of length n each?
[11:49:34] cout: has joined #ruby
[11:49:53] teclator: has joined #ruby
[11:50:41] ljarvis: uZiel: see String#split and Enumerable#each_slice
[11:50:44] majuscule: has joined #ruby
[11:50:45] VladGh: has joined #ruby
[11:50:54] russt: has joined #ruby
[11:50:56] daemonwrangler: has joined #ruby
[11:51:06] yeticry: has joined #ruby
[11:51:16] ljarvis: or just use rgexp
[11:51:19] hxegon: has joined #ruby
[11:51:22] gimmic: has joined #ruby
[11:51:41] ljarvis: >> "foobar".scan(/.{3}/)
[11:51:43] ruby[bot]: ljarvis: # => ["foo", "bar"] (https://eval.in/804274)
[11:52:02] ryotarai: has joined #ruby
[11:52:10] canton7: >> "foobar".scan(/.{4}/)
[11:52:11] ruby[bot]: canton7: # => ["foob"] (https://eval.in/804275)
[11:52:37] ljarvis: there are of course caveats :)
[11:54:05] uZiel: I am not good with ruby regexp, any sources where I can learn from?
[11:54:19] jcputter: has joined #ruby
[11:54:39] uZiel: or are these just normal regexp and I just need to learn what 'scan' does?
[11:55:20] ljarvis: yeah, the latter
[11:55:26] ljarvis: &Enumerable#scan
[11:55:31] ljarvis: %Enumerable#scan
[11:55:46] zzxc: has joined #ruby
[11:55:49] ljarvis: &ri Enumerable#scan
[11:55:50] `derpy: No results
[11:56:02] ljarvis: &ri String#scan
[11:56:03] `derpy: http://ruby-doc.org/core-2.4.1/String.html#method-i-scan
[11:56:10] ljarvis: 4th time lucky
[11:56:44] uZiel: lol, practice makes perfect :)
[11:56:45] ljarvis: also, as per canton7's example, if you actually want ["foob", "ar"] then maybe you dont want regexp
[11:56:50] ljarvis: >> "foobar".chars.each_slice(4).map(&:join)
[11:56:52] ruby[bot]: ljarvis: # => ["foob", "ar"] (https://eval.in/804278)
[11:57:42] uZiel: and that &: function too, what is that?
[11:58:20] govg: has joined #ruby
[11:59:54] tobiasvl: uZiel: https://ruby-doc.org/core-1.9.3/Symbol.html#method-i-to_proc
[12:00:02] tgragnato: has joined #ruby
[12:02:25] jphase: has joined #ruby
[12:04:20] olivier__: has joined #ruby
[12:05:34] bmurt: has joined #ruby
[12:07:26] moombah567: has joined #ruby
[12:08:08] tgragnato: has left #ruby: ("Sto andando via")
[12:10:07] keyjoo_: has joined #ruby
[12:11:27] Vingador: has joined #ruby
[12:11:52] Vingador: has joined #ruby
[12:12:57] jcputter: has joined #ruby
[12:17:20] gnufied: has joined #ruby
[12:17:27] kt: has joined #ruby
[12:17:46] im0nde: has joined #ruby
[12:18:58] nowhere_man: has joined #ruby
[12:22:56] hashrocket: has joined #ruby
[12:23:33] DeeJayh_: has joined #ruby
[12:23:55] gnufied: has joined #ruby
[12:24:53] User458764: has joined #ruby
[12:25:22] tgragnato: has joined #ruby
[12:26:27] rfoust: has joined #ruby
[12:27:32] t-recx: has joined #ruby
[12:29:08] herbmillerjr: has joined #ruby
[12:29:41] HoierM_: has joined #ruby
[12:29:42] anisha_: has joined #ruby
[12:30:06] VgpC: has joined #ruby
[12:32:48] benjen: has joined #ruby
[12:33:24] dionysus69: how do I make crossplatform file creation tool script ? I want it to work on linux and windows
[12:33:48] dionysus69: for example I am going to create dir in linux home dir which is different from windows homedir path
[12:35:20] charliesome: has joined #ruby
[12:35:23] tobiasvl: dionysus69: I think ENV['HOME'] works on both linux and windows?
[12:35:31] tobiasvl: or Dir.home
[12:37:04] tobiasvl: yes, Dir.home is best
[12:41:59] dionysus69: dir home is only on linux i guess
[12:42:17] dionysus69: windows has env vars like USERPROFILE
[12:42:32] dionysus69: or HOMEPATH which is /USERS/USERNAME
[12:42:41] houhoulis: has joined #ruby
[12:42:54] dionysus69: so I will need conditional in any case
[12:45:09] bmurt: has joined #ruby
[12:45:34] tobiasvl: dionysus69: Dir.home works for both windows and linux
[12:46:50] roamingdog: has joined #ruby
[12:48:51] rfoust: has joined #ruby
[12:50:17] Xiti: has joined #ruby
[12:52:51] volty: has joined #ruby
[12:53:43] dionysus69: oh nice, I ll keep that in mind when I setup windows compatibility
[12:54:35] statikow_: has joined #ruby
[12:56:23] bubkiss: has joined #ruby
[12:57:17] bubkiss: has left #ruby: ()
[12:59:55] SuperLag: has joined #ruby
[13:01:06] romeoh: has joined #ruby
[13:02:07] cdg: has joined #ruby
[13:02:11] jeffreylevesque: has joined #ruby
[13:03:37] ramortegui: has joined #ruby
[13:04:46] mim1k: has joined #ruby
[13:07:20] centrx: has joined #ruby
[13:08:29] haylon: has joined #ruby
[13:10:02] blackwind_123: has joined #ruby
[13:11:49] jphase: has joined #ruby
[13:13:30] droidburgundy: has joined #ruby
[13:16:32] anisha: has joined #ruby
[13:21:00] bkxd: has joined #ruby
[13:21:18] DoubleMalt: has joined #ruby
[13:22:29] burgestrand: has joined #ruby
[13:23:26] nyuszika7h: has joined #ruby
[13:27:21] DLSteve: has joined #ruby
[13:32:48] roshanavand: has joined #ruby
[13:33:20] hays: has joined #ruby
[13:34:42] __Yiota: has joined #ruby
[13:38:39] tgragnato: has joined #ruby
[13:40:27] burgestrand: has joined #ruby
[13:41:23] DeeJayh_: has joined #ruby
[13:41:51] haylon: has joined #ruby
[13:42:09] anisha: has joined #ruby
[13:46:19] blackwind_123: has joined #ruby
[13:51:18] olivier__: has joined #ruby
[13:51:42] griffindy: has joined #ruby
[13:52:29] oleo: has joined #ruby
[13:57:18] droidburgundy: has joined #ruby
[14:01:10] __Yiota: has joined #ruby
[14:03:44] railswebdev: has joined #ruby
[14:05:51] jrafanie: has joined #ruby
[14:06:24] cam27: has joined #ruby
[14:08:20] moombah567: has joined #ruby
[14:08:23] anisha_: has joined #ruby
[14:10:56] olivier__: has joined #ruby
[14:11:12] nobodyzxc: has joined #ruby
[14:11:19] DeeJayh_: has joined #ruby
[14:14:44] konsolebox: has joined #ruby
[14:22:47] xall: has joined #ruby
[14:25:56] statikowsky: has joined #ruby
[14:27:41] lucz: has joined #ruby
[14:29:47] quobo: has joined #ruby
[14:31:32] shinnya: has joined #ruby
[14:31:36] Asher: has joined #ruby
[14:32:20] tristanp: has joined #ruby
[14:32:50] nowhere_man: has joined #ruby
[14:34:52] jrafanie_: has joined #ruby
[14:37:22] coding_kai: has joined #ruby
[14:37:56] __Yiota: has joined #ruby
[14:38:51] lucz: has joined #ruby
[14:41:39] chouhoulis: has joined #ruby
[14:42:56] statikowsky: has joined #ruby
[14:44:26] rc48: has joined #ruby
[14:50:16] leeda: has joined #ruby
[14:51:51] romank: has joined #ruby
[14:52:50] droidburgundy: has joined #ruby
[14:54:12] rc48: Anyone know how efficient Enumerable#reduce is compared to each_with_object?
[14:55:34] centrx: rc48: You can test it, but historically each_with_object was significantly slower
[14:55:55] centrx: rc48: Test it with Benchmark.bmbm
[14:56:11] roamingdog: has joined #ruby
[14:56:46] rc48: I'll give it a shot
[14:57:29] bronson: has joined #ruby
[14:58:36] rakm: has joined #ruby
[14:59:34] haylon: has joined #ruby
[15:00:28] hkdsun: has joined #ruby
[15:04:44] rippa: has joined #ruby
[15:04:52] danguita: has joined #ruby
[15:05:33] cfec0b8d: has joined #ruby
[15:07:09] Dimik: has joined #ruby
[15:07:09] jgnagy: has joined #ruby
[15:08:30] olivier__: has joined #ruby
[15:08:42] sepp2k: has joined #ruby
[15:09:15] oleingem_: has joined #ruby
[15:09:34] raspado: has joined #ruby
[15:10:03] Pumukel: has joined #ruby
[15:13:53] im0nde: has joined #ruby
[15:14:01] mim1k: has joined #ruby
[15:14:30] tomphp: has joined #ruby
[15:14:36] SenpaiSilver_: has joined #ruby
[15:16:20] conta: has joined #ruby
[15:17:05] hellfar: has joined #ruby
[15:19:14] ascarter: has joined #ruby
[15:19:47] dn`: has joined #ruby
[15:23:11] ljarvis: it's not really significantly slower anymore, but it'll probably be slightly slower
[15:24:08] insane_tesla: has joined #ruby
[15:24:42] ascarter: has joined #ruby
[15:24:46] insane_tesla: How can I implement token authentication with ruby? what I want is to mimic curl .... -u USER/token:TOKEN, that -u in curl
[15:24:50] droidburgundy: has joined #ruby
[15:25:31] JBbankss: has joined #ruby
[15:26:39] nowhere_man: has joined #ruby
[15:27:12] patarr: has joined #ruby
[15:28:09] jrafanie: has joined #ruby
[15:31:09] yqt: has joined #ruby
[15:31:15] cschneid_: has joined #ruby
[15:34:23] brent__: has joined #ruby
[15:35:30] dionysus69: I get undefined method `open_timeout_sec=' for #<Google::Apis::RequestOptions but I can check in irb that the method really exists. what can be wrong ?
[15:36:24] ljarvis: dionysus69: it's a getter only, there's no setter method
[15:36:43] ljarvis: e.g. `open_timeout_sec` works, but `open_timeout_sec = x` does not
[15:37:00] dionysus69: yes but there are both methods in suggested method list
[15:37:09] dionysus69: both open_timeout_sec and open_timeout_sec=
[15:37:11] ljarvis: for tab completion?
[15:37:23] ljarvis: yeah it happens :/
[15:37:47] dionysus69: there are over 4k suggestions tab completion suggestions for google api
[15:38:39] haylon: has joined #ruby
[15:39:40] ljarvis: dionysus69: what are you using the library for?
[15:40:24] dionysus69: for uploading videos on youtube
[15:40:45] dionysus69: downloading from drive and updating gdoc sheets too
[15:42:25] newrubycoder: has joined #ruby
[15:42:58] jgnagy: anybody on here know some things about Sinatra or rack apps in general?
[15:43:11] havenwood: jgnagy: yes
[15:43:14] havenwood: ?anyone jgnagy
[15:43:14] ruby[bot]: jgnagy: Just ask your question, if anyone has, is or can, they will respond.
[15:44:27] jgnagy: just so you have all the deets
[15:44:28] jgnagy: https://github.com/knuedge/authify-api
[15:44:44] jgnagy: trying to make my metrics "service" only available from localhost
[15:45:05] jgnagy: is it possible to mount a single app at a different port
[15:45:13] jgnagy: https://github.com/knuedge/authify-api/blob/master/config.ru
[15:45:29] Rutix: has joined #ruby
[15:45:30] Rutix: has joined #ruby
[15:45:50] jgnagy: for instance, make my /monitoring bind to something not :9292, or even better force it to bind to localhost and not 0.0.0.0
[15:47:13] lacuna: has joined #ruby
[15:47:35] jgnagy: wasn't sure if a subclass of Sinatra::Base will have some `set` configurable for port or something
[15:47:46] [Butch]: has joined #ruby
[15:48:54] jgnagy: all my Services (including Services::Monitoring) are subclasses of https://github.com/knuedge/authify-api/blob/master/lib/authify/api/service.rb
[15:49:52] jgnagy: if there's something I can do in a `configure` block I'd do it, or if config.ru supports a way to map the URL _and_ port
[15:50:36] jgnagy: but I'm assuming I'm not crazy by wanting monitoring / metrics / analytics to not just be exposed, but if I can't figure it out from Sinatra / rack I'll just use nginx in front to restrict requests to /monitoring
[15:51:19] dionysus69: anyways my problem is that I get this error: syswrite': execution expired (Google::Apis::TransmissionError). There is a 2 minute timeout on file upload to youtube, but I failed to change timeout attributes in the class
[15:51:47] dionysus69: I tried something like this https://github.com/google/google-api-ruby-client/issues/357 my line goes like this though Google::Apis::YoutubeV3::YouTubeService.new
[15:52:16] bronson: has joined #ruby
[15:52:16] dionysus69: but it tells me the previous error I posted, setter nomethoderrors even though tabcompletion clearly shows they are there
[15:53:51] hxegon: jgnagy: There might be a way to do this in sinatra, but the best I can find with some cursory googlery is https://github.com/kickstarter/rack-attack
[15:55:20] cam27: has joined #ruby
[15:56:11] jgnagy: I actually really like rack-attack, and I looked at it for implementing throttling on the API
[15:56:14] tgragnato: has joined #ruby
[15:56:58] roamingdog: has joined #ruby
[15:57:09] jgnagy: just didn't think of using it for this purpose since what I need seems so simple
[15:58:13] jgnagy: but I might go with that option if there isn't a simpler way
[15:58:21] jgnagy: thanks hxegon
[16:00:04] glmglmglm: has joined #ruby
[16:00:13] glmglmglm: hey guys, good morning
[16:00:34] glmglmglm: i have this regex, i believe its javascript regex, how can we convert it to ruby regex?
[16:01:23] mim1k: has joined #ruby
[16:02:54] nadir: has joined #ruby
[16:03:36] abort: has joined #ruby
[16:03:58] newrubycoder: hey guys I wonder if there's a simple way to ping between a server and client in ruby without fancy gems? i tried .puts and .gets between server and client while using Time.now, but compared to the windows CMD ping, it was off by around 80ms. trying to calculate the delay so i can synchronize applications between computers
[16:05:44] benjen: has joined #ruby
[16:07:28] jrafanie: has joined #ruby
[16:08:02] pusewicz_: has joined #ruby
[16:09:06] moombah567: has joined #ruby
[16:10:19] Papierkorb: newrubycoder: Call out to the `ping` utility
[16:13:24] hobodave: has joined #ruby
[16:14:36] PainBreak: has joined #ruby
[16:15:36] newrubycoder: papierkorb how? im fresh in networking
[16:16:23] Papierkorb: newrubycoder: You can use `foo bar` to run program "foo" with arguments "bar" in the background, and you'll get the programs output as string once it returned
[16:17:11] newrubycoder: ok so i can run windows CMD from ruby?
[16:17:20] Papierkorb: newrubycoder: So you'll want to look up how to make windows "ping" do e.g. 3 pings and return afterwards, then you'll have to dig out the average ping time (or whatever you're interested in) output
[16:17:30] Papierkorb: newrubycoder: Try it from irb
[16:17:58] u0_a190: has joined #ruby
[16:18:06] Yzguy: has joined #ruby
[16:18:55] Papierkorb: newrubycoder: Use the `` quotes, I actually meant them as I wrote them, you can't use "" instead :)
[16:19:38] havenwood: newrubycoder: Take a look at netping if you'd like to see how you'd implement an icmp (or other type of) ping: https://github.com/chernesk/net-ping/blob/master/lib/net/ping/icmp.rb
[16:20:46] Papierkorb: Note that for that, your ruby program likely needs to run with administrator permissions.
[16:21:33] rc48: newrubycoder: I second havenwood - net-ping is super easy - though you do have to install a gem - it's not a "fancy" gem ;-)
[16:22:07] rc48: newrubycoder: Net::Ping::External.new('google.com').ping? # => true
[16:22:32] rc48: Can get a boolean in one line
[16:22:55] newrubycoder: i wanna develop a program using only standard gems, not sure if i'm allowed to add other people's gem inside my github projects
[16:23:12] newrubycoder: maybe if its GNU
[16:23:29] PainBreak: So... I'm running 2.3.3 in Windows, and DNS resolution is no longer functional. I tried a reinstall of 2.3.3 which did not resolve the issue. I also installed 2.4.1-RC1 and DNS lookups fail there as well. This began after a series of Windows update installs and uninstalls, as MS recently cranked out some reactionary patches that broke the crap out of the network stack.
[16:23:43] Papierkorb: newrubycoder: You reference them in your Gemfile, the user of your gem will then be able to download dependencies through bundler. No problem.
[16:24:01] PainBreak: The question is... What does Ruby look for in Windows as far as how to perform a DNS lookup? Is there a registry entry that might have gotten borked up?
[16:24:13] qsx: has joined #ruby
[16:24:32] jeffreybaks: has joined #ruby
[16:24:47] PainBreak: DNS resolution works a-ok for everything else on the server. nslookup does its thing, I can browse the interwebs all day long, connect to IRC, all is well.
[16:26:16] __Yiota: has joined #ruby
[16:27:24] rakm: has joined #ruby
[16:27:33] bronson: has joined #ruby
[16:27:50] chouhoulis: has joined #ruby
[16:28:20] olivier__: has joined #ruby
[16:28:24] rc48: newrubycoder: You could shell out to ping on Windows: got_ping = !!`ping -c 1 google.com`.lines.grep(/\d+ bytes from/) #=> true. Make sure to use the correct flags for Windows' ping
[16:29:31] newrubycoder: what does !! do?
[16:29:46] ljarvis: newrubycoder: "not not", it's just a double negative
[16:30:04] ljarvis: it's often used to coerce to a boolean
[16:31:03] nitric: has joined #ruby
[16:31:05] newrubycoder: nice that will be useful
[16:31:09] armyriad: has joined #ruby
[16:31:11] ljarvis: e.g. turn nil into false and anything else into true
[16:31:16] ljarvis: imo you should generally avoid it :)
[16:33:20] havenwood: let what is truthy be truthy and what is falsey be falsey...
[16:33:53] havenwood: so sayeth the Rubyists
[16:34:34] ljarvis: i use !! in one place in a medium size (~100k lines) app, and it's to convert objects into booleans for string representation (e.g. for reporting purposes)
[16:35:06] ljarvis: tbh i shouldn't even use it there :)
[16:35:23] cbyrda: has joined #ruby
[16:35:23] havenwood: I guess I should King James that: "But let your truthy be your truthy and your falsey be your falsey. For whatever is more than these is from the evil one."
[16:38:00] cjhowe: has joined #ruby
[16:38:03] rc48: newrubycoder: here is a quick and dirty method that covers good pings and no pings better than my earlier code. It captures standard error using Open3 with is in Ruby standard library: def ping?(host); Open3.capture3("ping -c 1 #{host}")[0].lines.grep(/\d+ bytes from/).any?; end
[16:38:18] rc48: ping? 'google.com' #=> true
[16:38:27] rc48: ping? 'fake.fake.com' #=>false
[16:39:40] rc48: newrubycoder: Make sure to require 'open3' at the top of your file first.
[16:40:43] newrubycoder: doing it completely in ruby is nice cuz then i have ubuntu support too
[16:40:51] rc48: And again, make sure you research the correct ping flags you needs on Windows. My example is on Mac (BSD i think)
[16:40:51] ljarvis: system "ping -c 1 #{host} >/dev/null"
[16:41:01] havenwood: newrubycoder: that's ^ till shelling out
[16:41:08] MarkBilk: I had problems running an external program (wget) from Ruby in Windows 8.1. %x() works better than backquotes. I had to put a copy of wget in the current directory, and call it like this %x(.\\wget #{img_url}) . There are two backslashes between the period and the wget. I don't know how it will print out here.
[16:41:14] havenwood: and you'd need the right flag for Win
[16:41:16] havenwood: (it's not -c)
[16:41:22] ljarvis: stupid windows
[16:41:42] havenwood: newrubycoder: If you'd like pure Ruby, try this gem: https://github.com/chernesk/net-ping
[16:42:16] baweaver: havenwood: those are dangerous words
[16:42:28] baweaver: havenwood: don't let the Rails team catch you saying them :P
[16:42:41] havenwood: baweaver: haha, i've seen the threads!
[16:43:02] baweaver: matthewd loves them :D
[16:43:28] havenwood: https://xkcd.com/386/
[16:43:57] nfk: has joined #ruby
[16:44:40] JBbanks: has joined #ruby
[16:45:00] rc48: newrubycoder: if you're running the same "ping?" method I gave earlier on different platforsm, youll have to put a conditional in it that check which platform. There are different inplemenation of ping (GNU/Linux, BSD/Mac, and Windows) with likly all different flags
[16:45:38] commonerror: has joined #ruby
[16:45:40] dionysus69: hey guys, I don't know whats wrong with this library. but I can't change timeout_sec in anyway I tried. www.rubydoc.info/github/google/google-api-ruby-client/Google/Apis/RequestOptions also notice all github links are down
[16:45:40] baweaver: Hehe, POSIX
[16:46:06] havenwood: The convention for appending an underscore to avoid naming conflict with a keyword in PEP 8 is somewhat appealing: http://pep8.org/#descriptive-naming-styles
[16:46:07] havenwood: class_ or klass, mmm
[16:46:11] MarkBilk: Even though I made sure that the directory with the original copy of wget was on the PATH, and I could run it from the command-line, I couldn't run it from Ruby until I made a copy in the current directory.
[16:46:11] havenwood: def_ or deph ;-P
[16:46:38] jrafanie: has joined #ruby
[16:46:44] ljarvis: havenwood: but i'd have to look it up every time
[16:46:49] ljarvis: better to just freestyle
[16:46:57] commonerror: I'm working on a Rack base app (using Roda) and I'm requiring all my gems with Bundler in the config.ru. The app boots just fine but my tests aren't loading dependencies for some reason. I'm initializing the app with `Rack::Builder.parse_file("config.ru").first` - shouldn't that require the gems that are in config.ru?
[16:46:59] newrubycoder: rc48 thanks i will try my best, maybe it's above my head right now but as i improve my program will too
[16:47:01] havenwood: there are only so many letters to try!
[16:47:38] ljarvis: commonerror: require your code inside config.ru and inside your tests separately
[16:47:41] havenwood: -v -V --version --srsly-no-version-flag?
[16:48:15] ljarvis: havenwood: -v #=> ["version", "verbose"].sample
[16:48:15] baweaver: havenwood: I'm making that a flag later
[16:48:56] commonerror: ljarvis: Why? When I used Bundler.require within the app.rb they both worked. It's just when I moved the requirement to config.ru that it broke.
[16:49:11] ljarvis: commonerror: because of this very issue, mostly
[16:49:20] rc48: newrubycode: You're welcome. I'm happy to pair with you if you need any more help. Let me know
[16:49:23] havenwood: i'm excited to see my convention of including a Snakefile in Ruby projects is catching on: https://github.com/epitron/epitools/blob/master/Snakefile
[16:49:38] ljarvis: havenwood: lol wtf?
[16:49:39] baweaver: havenwood: epitron doesn't count
[16:49:56] baweaver: you've already corrupted him and banisterfiend long ago
[16:50:13] ljarvis: banister did not need corrupting
[16:50:22] commonerror: ljarvis: Heh, gotcha. I figured I was missing a setting or something.
[16:51:25] baweaver: ljarvis: I suspect banister did the corrupting
[16:51:34] baweaver: we've already lost cirwin to his madness
[16:51:36] ljarvis: he's corrupted us all
[16:51:52] wuyin: has joined #ruby
[16:51:53] ljarvis: you think pry is just an irb replacement?
[16:52:05] baweaver: Mother of god.....
[16:52:11] ramortegui: has left #ruby: ("Ex-Chat")
[16:52:21] baweaver: He's a fiend! A banisterfiend
[16:53:09] cjhowe: has joined #ruby
[16:53:35] roshanavand: has joined #ruby
[16:54:00] JBbanks: has joined #ruby
[16:54:42] nobitanobi: has joined #ruby
[16:57:23] hobodave: has joined #ruby
[16:57:23] rrr1000: has joined #ruby
[16:57:49] rrr1000: has left #ruby: ()
[16:58:53] ltem: has joined #ruby
[16:59:03] hkdsun: has joined #ruby
[17:00:46] milardovich: has joined #ruby
[17:02:30] kafloopascope: has joined #ruby
[17:03:18] kafloopascope: Hello! I asked in #rubyonrails but this may be simply a ruby question. Hello! I'm on an old 3.x project and am unfortunately not very familiar with the framework or even ruby, but need to debug a problem. A directory needs to be created, but can't with a permissions error. The app is served by nginx/passenger, and the passenger process are run as a particular user which _does_ have write permissions.
[17:03:19] kafloopascope: The directory is created with Dir.mkdir. Is there a way to be sure which (linux) user that operation is being run as?
[17:05:21] damireh: has joined #ruby
[17:06:55] mim1k: has joined #ruby
[17:07:19] uZiel: has joined #ruby
[17:08:19] havenwood: kafloopascope: What's the exact error?
[17:08:46] Guest66: has joined #ruby
[17:08:56] mtkd: has joined #ruby
[17:10:22] kafloopascope: havenwood, Errno::EACCES (Permission denied @ dir_s_mkdir
[17:12:25] haylon: has joined #ruby
[17:15:30] havenwood: kafloopascope: You could take a look at the Elvis gem: https://github.com/square/prodeng/tree/master/elvis
[17:15:48] havenwood: kafloopascope: Though you might want to set it up so things work properly with the user running the script.
[17:16:16] havenwood: Rather than changing the user mid-stream, which is hacky, nonportable and error prone.
[17:16:53] kafloopascope: havenwood, yes, I'd rather not hack it up. Was hoping there'd be a way to verify what Dir.mkdir is doing exactly
[17:20:45] mdw: has joined #ruby
[17:22:10] Cohedrin: has joined #ruby
[17:22:38] millerti: has joined #ruby
[17:30:47] ResidentBiscuit: has joined #ruby
[17:30:48] ledestin: has joined #ruby
[17:30:54] skweek: has joined #ruby
[17:30:58] ascarter: has joined #ruby
[17:31:12] ResidentBiscuit: has joined #ruby
[17:31:26] rc48: Does anyone know if there's a Object method to do this without monkeypatching? (Basically like Object#tap, but returns the last value in the the block rather than self): class Object; def hijack; yield self; end; end; "this".hijack {|o| "is now #{o}!" } #=>"is now this!"
[17:31:42] ResidentBiscuit: has joined #ruby
[17:32:12] AndBobsYourUncle: has joined #ruby
[17:34:50] gothicsouth: has joined #ruby
[17:36:32] olivier__: has joined #ruby
[17:36:41] jeffreylevesque: has joined #ruby
[17:37:32] mtkd: has joined #ruby
[17:38:09] AndBobsYourUncle: has joined #ruby
[17:38:36] eightlimbed: has joined #ruby
[17:41:37] rc48: has joined #ruby
[17:43:46] muelleme: has joined #ruby
[17:46:49] kent\n: has joined #ruby
[17:47:11] skweek: has joined #ruby
[17:49:15] mikecmpbll: has joined #ruby
[17:54:28] sp4rrow: has joined #ruby
[17:58:48] d10n-work: has joined #ruby
[18:04:08] chouhoulis: has joined #ruby
[18:04:31] baweaver: rc48: havenwood would know
[18:05:10] baweaver: yield_self was the latest proposal iirc
[18:05:43] jrafanie_: has joined #ruby
[18:06:14] Vircung: has joined #ruby
[18:06:32] tgragnato: has joined #ruby
[18:06:50] PatrikasZvaigzde: has joined #ruby
[18:07:20] havenwood: rc48: Yup, #yield_self is in Ruby 2.5-dev, which comes out this Christmas.
[18:07:24] hxegon: has joined #ruby
[18:08:09] havenwood: rc48: "this".yield_self {|o| "is now #{o}!" } #=> "is now this!"
[18:08:14] SeepingN: has joined #ruby
[18:08:37] uZiel: has joined #ruby
[18:08:44] havenwood: rc48: "this".yield_self.class #=> Enumerator
[18:08:58] havenwood: rc48: "this".yield_self.size #=> 1
[18:09:17] olivier__: has joined #ruby
[18:09:58] moombah567: has joined #ruby
[18:10:18] rc48: havenwood: That's cool. Any link to the source? And how is it (e.g., a String) enumerable?
[18:10:43] havenwood: rc48: i happen to have written the current implementation ;-)
[18:11:20] havenwood: rc48: https://github.com/ruby/ruby/blob/trunk/object.c#L500-L521
[18:12:48] raatiniemi: has joined #ruby
[18:13:14] rc48: havenwood: That's interesting. I'm interested to know what the motivation was for it? I know for me, I was trying to make a general "monadic" method for chaining - the lovechild of tap and reduce.
[18:13:36] cjhowe: has joined #ruby
[18:13:40] havenwood: rc48: It's long been requested for such reasons and the long-term holdup was the name.
[18:14:17] rc48: I submit: "hijack". LOL ;-)
[18:14:28] electrostat: has joined #ruby
[18:14:35] havenwood: rc48: I'm pretty sure that's one that's been proposed.
[18:15:24] havenwood: nobu implemented #yield_self as an enumerator after matz approved the name
[18:15:59] havenwood: nobu merged my patch to change it to sized enumerator and have a ruby object lazily know its size is 1
[18:16:59] havenwood: rc48: it's fun to look through past proposals that have been accepted or denied: https://bugs.ruby-lang.org/projects/ruby-trunk/issues
[18:17:51] rc48: havenwood: til the release of yield_self, is my monkeypatch implementation effectively the same?
[18:17:55] havenwood: rc48: I liked baweaver's suggestion for #pat to compliment #tap
[18:18:47] rc48: havenwood: yeah, yield_self is long. A short name like #pat would be ideal IMO
[18:19:21] rc48: havenwood: but I'm not complaining - just glad it's getting into Ruby core
[18:20:24] coding_kai: #pat would be better for golfing :P
[18:22:03] haylon: has joined #ruby
[18:22:29] Antiarc: has joined #ruby
[18:22:30] havenwood: module Kernel; alias pat yield_self end
[18:22:35] Vircung: has joined #ruby
[18:22:50] havenwood: it's fair game to propose an alias as well
[18:22:58] jrafanie: has joined #ruby
[18:24:25] romank: has joined #ruby
[18:26:16] RedNifre: has joined #ruby
[18:28:52] electrostat: has joined #ruby
[18:33:15] cfec0b8d: has joined #ruby
[18:45:59] gusrub: has joined #ruby
[18:48:45] duderonomy: has joined #ruby
[18:49:31] postmodern: has joined #ruby
[18:51:52] jphase: has joined #ruby
[18:52:58] jackjackdripper: has joined #ruby
[18:53:24] dionysus69: has joined #ruby
[18:58:43] gnufied: has joined #ruby
[19:01:36] tgragnato_: has joined #ruby
[19:01:36] jackrandom: has joined #ruby
[19:05:45] theunraveler: has joined #ruby
[19:06:02] agent_white: has joined #ruby
[19:09:07] milardovich: has joined #ruby
[19:13:49] gusrub: has joined #ruby
[19:14:49] gusrub: has joined #ruby
[19:17:33] jenrzzz: has joined #ruby
[19:17:38] rfoust: has joined #ruby
[19:17:57] tgragnato_: has joined #ruby
[19:22:06] Ericx2x: has joined #ruby
[19:22:23] ascarter: has joined #ruby
[19:24:47] pankaj_: has joined #ruby
[19:25:26] eightlimbed: has joined #ruby
[19:26:18] cek: >> dev m; yield; end; m(&proc{})
[19:26:19] ruby[bot]: cek: # => /tmp/execpad-ec089ccf1672/source-ec089ccf1672:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/804670)
[19:26:48] cek: >> def m; yield; end; m(&proc{})
[19:26:49] ruby[bot]: cek: # => nil (https://eval.in/804671)
[19:26:53] cek: >> def m; yield; end; m(&lambda{})
[19:26:54] ruby[bot]: cek: # => nil (https://eval.in/804672)
[19:27:03] cek: >> def m; yield; end; m(&->{})
[19:27:34] cek: it seems i got out of my mind
[19:29:54] t-recx: has joined #ruby
[19:30:31] Charliebr73: has joined #ruby
[19:30:47] cek: to illustrate: https://gist.github.com/celesteking/f18d5c30322486c50cd069016de84d71
[19:36:45] apeiros: cek: lambdas (-> are lambdas) are like methods in that they enforce their argument requirements
[19:36:49] apeiros: procs don't
[19:37:13] apeiros: >> (->() { 1 })(2)
[19:37:14] ruby[bot]: apeiros: # => /tmp/execpad-362c61a55bbc/source-362c61a55bbc:2: syntax error, unexpected '(', expecting keyword_end ...check link for more (https://eval.in/804675)
[19:37:38] apeiros: >> (->() { 1 }).(2)
[19:37:40] ruby[bot]: apeiros: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/804676)
[19:37:48] apeiros: >> (proc { 1 }).(2)
[19:37:49] ruby[bot]: apeiros: # => 1 (https://eval.in/804677)
[19:37:51] cek: nah, I thought it's mm that's throwing the error, not yielded lambda
[19:38:32] al2o3-cr: cek: try with proc and see the diff
[19:38:43] cek: i'm well aware of differences
[19:39:16] cek: yea, the arity and the control statements
[19:39:18] pankaj_: has joined #ruby
[19:40:33] dviola: has joined #ruby
[19:42:44] muelleme: has joined #ruby
[19:44:18] sp4rrow: has joined #ruby
[19:44:55] Hanna: has joined #ruby
[19:45:31] al2o3-cr: >> ->{:foo}.yield :bar
[19:45:32] ruby[bot]: al2o3-cr: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/804678)
[19:47:33] al2o3-cr: wth, this connection is lagging :(
[19:48:44] cek: >> yield next
[19:48:45] ruby[bot]: cek: # => /tmp/execpad-5cfa308214ca/source-5cfa308214ca:2: void value expression (https://eval.in/804679)
[19:48:52] cek: >> yield &proc
[19:48:53] ruby[bot]: cek: # => /tmp/execpad-ed2bb93f4094/source-ed2bb93f4094:2: block argument should not be given (https://eval.in/804680)
[19:48:59] cek: funny, isn't it
[19:49:16] Oclair: has joined #ruby
[19:49:21] cek: has left #ruby: ()
[19:49:22] al2o3-cr: well, no, next is a keyword
[19:50:03] unreal: has joined #ruby
[19:50:45] postmodern: has joined #ruby
[19:51:26] govg: has joined #ruby
[19:56:59] chouhoulis: has joined #ruby
[19:57:41] mtkd: has joined #ruby
[20:02:59] cdg: has joined #ruby
[20:06:08] hkdsun: has joined #ruby
[20:09:14] ltem: has joined #ruby
[20:10:43] moombah567: has joined #ruby
[20:11:21] CrazyEddy: has joined #ruby
[20:14:37] arup_r: has joined #ruby
[20:14:56] arup_r: Where is shevy? these days..
[20:15:47] mtkd: has joined #ruby
[20:16:43] SeepingN: at the fjord
[20:17:13] Papierkorb: arup_r: Haven't seen them in some time. Sad to see people go, but also great to welcome new on board.
[20:18:39] w4x: has joined #ruby
[20:19:06] hkdsun: has joined #ruby
[20:19:15] postmodern: has joined #ruby
[20:19:27] zenspider: yield &proc??
[20:19:33] zenspider: what would you expect that to do?
[20:23:14] jrafanie: has joined #ruby
[20:24:30] olivier__: has joined #ruby
[20:25:32] dnewkerk: has joined #ruby
[20:26:03] Papierkorb: >> def foo; yield proc; end; foo{|x| p x}; foo{|x| x.call}
[20:26:04] ruby[bot]: Papierkorb: # => #<Proc:0x41aa18d8@/tmp/execpad-e4ad6c4533a4/source-e4ad6c4533a4:2> ...check link for more (https://eval.in/804685)
[20:26:05] gusrub: has joined #ruby
[20:26:16] Papierkorb: The second one throws a `NoMethodError` Oo
[20:26:48] olivier__: has joined #ruby
[20:27:31] hkdsun: has joined #ruby
[20:28:11] eightlimbed: has joined #ruby
[20:28:30] romank: has joined #ruby
[20:28:47] mustmodify___: has joined #ruby
[20:28:59] mustmodify___: does chruby work out-of-the-box with osx?
[20:31:01] zenspider: chruby is problematic for my shell setup, but yeah, it should work
[20:31:33] zenspider: assuming out-of-the-box includes developer tools
[20:32:18] shinnya: has joined #ruby
[20:37:53] yeticry: has joined #ruby
[20:38:06] ascarter: has joined #ruby
[20:40:45] Fallen_Zen: has joined #ruby
[20:42:05] cjhowe: has joined #ruby
[20:43:31] Fallen_Zen: Can anyone help me with building ruby from source on macOS and point it to openssl installed /usr/local/bin/openssl ?
[20:44:46] zenspider: Fallen_Zen: brew install ruby-build then use it
[20:45:18] zenspider: tho you probably shouldn't have openssl linked in /usr/local/
[20:46:37] zenspider: you can talk to me in here. DM isn't necessary
[20:47:07] ascarter: has joined #ruby
[20:47:10] Fallen_Zen: zenspider: would prefer from source instead of homebrew
[20:47:26] volty: has joined #ruby
[20:47:42] zenspider: ruby-build, as the name implies, BUILDS from source
[20:47:47] Fallen_Zen: zenspider: and what's wrong with /usr/local for openssl? It's the default location when you install it from source as well
[20:48:02] tomphp: has joined #ruby
[20:48:26] zenspider: it conflicts with ssl code that ships in the system... so homebrew strongly recommends installing privately and using that, but not linking into /usr/local/*
[20:49:54] millerti: has joined #ruby
[20:50:00] Fallen_Zen: zenspider: you can't use built-in openssl for building software as Apple no longer provides header files
[20:50:40] zenspider: Fallen_Zen: follow my advice or not. it works.
[20:50:53] im0nde: has joined #ruby
[20:52:01] dru`: has joined #ruby
[20:53:53] jenrzzz: has joined #ruby
[20:54:56] brent__: has joined #ruby
[20:55:51] Fallen_Zen: zenspider: thx for the help
[20:58:04] havenwood: Fallen_Zen: You might consider using ruby-install instead of ruby-build.
[20:58:25] havenwood: Fallen_Zen: Since ruby-build ships its own openssl and doesn't build against system openssl while ruby-install uses the package manager version.
[20:59:02] havenwood: Fallen_Zen: https://github.com/postmodern/ruby-install#features
[20:59:16] Fallen_Zen: havenwood: thx will have a look
[20:59:43] gothicsouth: has joined #ruby
[21:00:02] havenwood: Here's latest Ruby for example, and the openssl that's downloaded and used with it in ruby-build: https://github.com/rbenv/ruby-build/blob/master/share/ruby-build/2.4.1
[21:00:24] havenwood: It does mean that just updating your system Ruby and rebuilding with ruby-build doesn't use a new OpenSSL, which I've seen confuse several people.
[21:00:54] zenspider: havenwood: what?
[21:01:26] havenwood: zenspider: ruby-build, the install tool that rbenv uses automagically ships its own openssl for each Ruby and disregards your package manager Ruby
[21:01:43] havenwood: err, i mean package manager OpenSSL
[21:01:58] havenwood: anyhow, ruby-install installs nicely for rbenv
[21:02:01] havenwood: or whatever else
[21:02:19] zenspider: can you point to evidence of that?
[21:02:27] jrafanie: has joined #ruby
[21:02:53] ascarter: has joined #ruby
[21:02:55] zenspider: I'm looking at a function called use_homebrew_openssl
[21:03:01] zenspider: and it seems to work fine
[21:03:57] Hanna: has joined #ruby
[21:04:20] latemus: has joined #ruby
[21:04:27] jenrzzz: has joined #ruby
[21:04:47] skweek: has joined #ruby
[21:05:05] havenwood: zenspider: it looks like that's only used if `has_broken_mac_openssl` is called in the definitino
[21:06:30] dru`: this might be an odd question, but does anyone have any idea where one would start if they wanted to define an additional keyword block on methods (similar to how rescue functions in def..rescue..end)?
[21:07:16] havenwood: zenspider: they put that one check on the end of the first line: https://github.com/rbenv/ruby-build/blob/master/share/ruby-build/2.4.1#L1
[21:08:26] havenwood: zenspider: i guess i should say, other than OS X systems where the OpenSSL they install is broken, they use an OpenSSL they ship themselves and not your package manager
[21:08:28] zenspider: in basically every recipe where it applies
[21:08:46] zenspider: "they ship themselves"... no. this is just FUD as far as I can tell
[21:09:00] dru`: for context, this is the syntax of what I'd like to ideally accomplish: https://gist.github.com/drusepth/1972c40fd030ce3ef06e4e4dc9b22eaa
[21:09:01] havenwood: where ruby-install will use the apt, or yum, or zypper, or brew or whatever openssl
[21:09:50] havenwood: zenspider: is it fud, when they do it? i've seen multiple people thinking they've updated openssl on say ubuntu to realize they didn't build against it with ruby-build
[21:09:51] havenwood: zenspider: it's actually something of an issue, from my perspective
[21:10:01] lele: has joined #ruby
[21:10:21] zenspider: dru`: you can't extend the syntax the way you want to... you could do some sort of preprocessor ... but I wouldn't recommend it
[21:10:34] havenwood: OpenSSL is not exactly the lib you want to be accidentally building against an old version of.
[21:10:50] havenwood: Folk don't know they need to update ruby-build to get the new one.
[21:11:03] havenwood: If they update ruby-build, perfect, build openssl yourself, no prob.
[21:11:14] havenwood: I'd rather use a package, but pick your poison...
[21:11:50] zenspider: dru`: neat idea tho
[21:12:57] dru`: zenspider: figured it'd be difficult; just looking into how much so. I could probably technically inject wrappers around each method and treat the tests keyword as a trigger to return (and just unindent it to pretend), but not sure about going down that path either
[21:13:39] dru`: this is coming from someone who monkeypatched method_missing to inject executable functions from stackoverflow so I'm definitely not looking for anything production-ready any time soon :P
[21:13:45] ascarter: has joined #ruby
[21:13:50] dru`: just trying to stretch the language in new ways
[21:15:04] gusrub: has joined #ruby
[21:15:17] ascarter: has joined #ruby
[21:15:48] ur5us: has joined #ruby
[21:18:43] nofxxxx: has joined #ruby
[21:20:17] dcluna: has joined #ruby
[21:20:22] sp4rrow: has joined #ruby
[21:21:09] patr0clus: has joined #ruby
[21:24:10] ascarter: has joined #ruby
[21:25:46] mim1k: has joined #ruby
[21:25:47] millerti: has joined #ruby
[21:26:33] enterprisey: has joined #ruby
[21:27:40] rc48: has joined #ruby
[21:31:52] nobitanobi: has joined #ruby
[21:33:57] agent_white: has joined #ruby
[21:35:25] olivier__: has joined #ruby
[21:35:46] olivier__: has joined #ruby
[21:36:21] rfoust: has joined #ruby
[21:36:30] ecuanaso: has joined #ruby
[21:37:37] olivier__: has joined #ruby
[21:37:55] gnufied: has joined #ruby
[21:37:59] romank: has joined #ruby
[21:38:47] olivier__: has joined #ruby
[21:39:48] mustmodify___: I'm "helping" someone set up Rails on OSX.
[21:39:52] lacuna: has joined #ruby
[21:40:01] mustmodify___: segfault from hpricot
[21:40:05] mustmodify___: has anyone seen this/
[21:40:34] havenwood: mustmodify___: If they must use 2.1 it'd be better to use 2.1.9.
[21:44:31] nofxxx: has joined #ruby
[21:44:49] dru`: is there an easy way to access the ruby interpreter's value stack directly (for grabbing/manipulating what values get implicitly returned from a method)?
[21:45:46] ascarter: has joined #ruby
[21:51:29] statikowsky: has joined #ruby
[21:54:14] statikowsky: has joined #ruby
[21:57:54] romank: has joined #ruby
[22:06:50] olivier__: has joined #ruby
[22:07:31] jusa: has joined #ruby
[22:07:35] minimalism: has joined #ruby
[22:11:31] olivier__: has joined #ruby
[22:14:05] rakm: has joined #ruby
[22:14:20] ecuanaso: has joined #ruby
[22:18:09] JBbanks: has joined #ruby
[22:18:45] Ferdroid: has joined #ruby
[22:20:23] raspado: has joined #ruby
[22:21:09] raspado: has joined #ruby
[22:25:28] bkxd: has joined #ruby
[22:26:53] latemus: has joined #ruby
[22:27:06] im0nde_: has joined #ruby
[22:28:27] erlend: has joined #ruby
[22:31:41] Radar: dru`: why
[22:32:35] dru`: I'd like to store what value would be returned at a given point so I can inject some logic afterward and return the original value
[22:33:57] __Yiota: has joined #ruby
[22:34:19] zenspider: mustmodify___: hpricot is ancient and was crashy way back when... you should use nokogiri instead. it has very similar feel and is much more solid.
[22:35:07] zenspider: dru`: you can alias the origial method to the side, dynamically create a new method that calls the old and manipulates the result before it returns it
[22:35:26] zenspider: again, I wouldn't recommend it
[22:35:33] zenspider: but... you know you're playing with dragons
[22:36:10] dru`: oh, I suppose that's true
[22:36:10] ineb: has joined #ruby
[22:38:51] segmond: has joined #ruby
[22:39:32] Cohedrin: has joined #ruby
[22:40:26] ineb: has joined #ruby
[22:40:33] gusrub: has joined #ruby
[22:41:06] lacuna: has joined #ruby
[22:49:13] __Yiota: has joined #ruby
[22:50:22] SeepingN: has joined #ruby
[22:52:10] BSaboia: has joined #ruby
[22:52:19] dru`: hrm, have gotten all of these syntaxes working (except the last one), not sure if any of them are actually beneficial enough to move tests to the function after all: https://gist.github.com/drusepth/081572f8c7123edd8cd49abf73597407
[22:52:31] dru`: will keep hackin'
[22:56:21] rc48: has joined #ruby
[22:57:38] sp4rrow: has joined #ruby
[22:59:37] bkxd: has joined #ruby
[23:02:51] __Yiota: has joined #ruby
[23:06:18] zenspider: dru`: there's also some setups that put those assertions in rdoc blocks
[23:08:01] roamingdog: has joined #ruby
[23:09:07] Authenticator: I'm using Typhoeus and I can't get client-cert authentication working. The same cert/key object work with Net::HTTP and other libs. I get :return_code=>:ssl_certproblem
[23:10:42] ineb: has joined #ruby
[23:11:25] bkxd: has joined #ruby
[23:13:33] SeepingN: maybe you have a certificate problem
[23:13:40] olivier__: has joined #ruby
[23:15:20] jackjackdripper: has joined #ruby
[23:18:35] millerti: has joined #ruby
[23:21:21] Cohedrin: has joined #ruby
[23:21:39] milardovich: has joined #ruby
[23:26:02] Vile`: has joined #ruby
[23:26:15] mim1k: has joined #ruby
[23:27:38] dasher00: has joined #ruby
[23:29:15] haylon: has joined #ruby
[23:30:32] dmtd: has joined #ruby
[23:34:50] haylon: has joined #ruby
[23:34:56] Cohedrin: has joined #ruby
[23:39:35] railswebdev: has joined #ruby
[23:42:09] Cohedrin: has joined #ruby
[23:45:34] olivier__: has joined #ruby
[23:45:52] olivier__: has joined #ruby
[23:48:34] sp4rrow: has joined #ruby
[23:48:38] hugo_dc: has joined #ruby
[23:49:51] gnufied: has joined #ruby
[23:53:31] gothicsouth: has joined #ruby
[23:56:26] bkxd: has joined #ruby
[23:57:15] rc48: has joined #ruby
[23:57:30] cschneid_: has joined #ruby
[23:58:43] hellfar: has joined #ruby
[23:59:41] Cohedrin: has joined #ruby
[23:59:51] ascarter: has joined #ruby