« Back to channel list

#ruby - 28 January 2019

« Back 1 day Forward 1 day »
[00:09:31] AJA4351: has joined #ruby
[00:23:31] Ocampa: has joined #ruby
[00:31:31] themsay: has joined #ruby
[00:35:24] uplime: has joined #ruby
[00:40:13] matchaw: has joined #ruby
[00:44:23] AJA4351: has joined #ruby
[00:48:42] uplime: has joined #ruby
[00:49:57] SuperLag: has joined #ruby
[01:13:46] Swyper: has joined #ruby
[01:15:09] rkazak: has joined #ruby
[01:22:45] themsay: has joined #ruby
[01:27:26] ansraliant: has joined #ruby
[01:30:51] AJA4350: has joined #ruby
[01:41:41] JanMrlth: has joined #ruby
[01:46:22] lucz: has joined #ruby
[01:47:16] sonofentropy: has joined #ruby
[01:57:55] tdy: has joined #ruby
[02:06:35] cschneid: has joined #ruby
[02:15:27] ocampa2: has joined #ruby
[02:21:36] uplime: has joined #ruby
[02:23:48] ocampa2: has joined #ruby
[02:27:58] ocampa2: has joined #ruby
[02:32:28] uplime: has joined #ruby
[02:38:43] tdy: has joined #ruby
[02:50:41] tdy: has joined #ruby
[03:03:56] tdy: has joined #ruby
[03:13:22] cschneid: has joined #ruby
[03:17:01] duderonomy: has joined #ruby
[03:24:33] code_zombie: has joined #ruby
[03:30:41] eckhardt: has joined #ruby
[03:37:56] brandoncc: has joined #ruby
[03:40:25] houhoulis: has joined #ruby
[03:46:16] Swyper: has joined #ruby
[03:50:33] cschneid: has joined #ruby
[03:57:24] pskosinski: has joined #ruby
[03:57:53] cschneid: has joined #ruby
[04:03:57] cschneid: has joined #ruby
[04:05:49] Renich: has joined #ruby
[04:09:03] braincrash: has joined #ruby
[04:09:42] Swyper: has joined #ruby
[04:33:09] pskosinski: has joined #ruby
[04:33:21] laaron: has joined #ruby
[04:35:12] tdy: has joined #ruby
[04:44:31] stooj: has joined #ruby
[04:57:55] Xiti: has joined #ruby
[05:11:37] laaron: has joined #ruby
[05:20:16] esrse: has joined #ruby
[05:21:39] brandoncc: has joined #ruby
[05:25:12] mr_roybot: has joined #ruby
[05:36:11] _whitelogger: has joined #ruby
[05:47:48] laaron: has joined #ruby
[05:57:21] laaron: has joined #ruby
[06:16:57] tdy: has joined #ruby
[06:17:51] tdy: has joined #ruby
[06:19:34] segy: has joined #ruby
[06:26:24] reber: has joined #ruby
[06:28:18] asphyxia: has joined #ruby
[06:34:37] conta: has joined #ruby
[06:39:10] _whitelogger: has joined #ruby
[06:43:38] Paraxial: has joined #ruby
[06:48:05] arup_r: has joined #ruby
[06:48:07] rkazak: has joined #ruby
[06:50:20] Paraxial: has joined #ruby
[07:11:51] aupadhye: has joined #ruby
[07:12:16] aufi: has joined #ruby
[08:01:22] nowhere_man: has joined #ruby
[08:02:51] zming: has joined #ruby
[08:03:46] mikecmpbll: has joined #ruby
[08:09:54] blackmesa: has joined #ruby
[08:11:54] nowhere_man: has joined #ruby
[08:21:30] dellavg_: has joined #ruby
[08:25:18] blackmesa: has joined #ruby
[08:30:20] asphyxia: has joined #ruby
[08:31:58] nowhere_man: has joined #ruby
[08:38:34] Knappe: has joined #ruby
[08:38:35] Dbugger: has joined #ruby
[08:38:50] Dbugger: has joined #ruby
[08:40:16] Knappe: Hi, is there a way in ruby, maybe utilizing the IO class, to get behaviour like the tail tool from Linux? I'd like to read only the last n lines of a log file. The logfile can have >20k line at times and it would be really expensive to read the whole file when I know the information I want must be in the last 50 lines or so.
[08:45:04] baweaver: http://ruby-doc.org/core-2.6/IO.html#method-i-seek
[08:45:54] Knappe: Nice thanks. That looks like what I'm looking for
[09:06:35] mikecmpbll: has joined #ruby
[09:13:17] aufi: has joined #ruby
[09:13:51] wildermind: has joined #ruby
[09:39:48] keden: has joined #ruby
[09:42:12] arup_r: has joined #ruby
[09:51:45] GodFather: has joined #ruby
[09:54:44] clemens3: has joined #ruby
[10:04:48] za1b1tsu: has joined #ruby
[10:08:03] laaron: has joined #ruby
[10:21:28] laaron: has joined #ruby
[10:27:24] AndreYuhai: has joined #ruby
[10:28:04] AndreYuhai: Hello there, I am using Mechanize and I sometimes get 503 exception. I am rescuing this exception but how can I make it sleep(5) and try again as long as it gets this exception?
[10:28:43] AndreYuhai: I can just sleep and try it again by simply putting agent.get url inside the rescue block but what I want is a loop to do that as long as it gets that code
[10:29:55] canton7: AndreYuhai, look at the redo and retry keywords
[10:32:19] khalella: im trying to get a clue as to what is missing here. im getting an error "rake aborted! LoadError: cannot load such file -- rake/pathmap /var/lib/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'"
[10:32:22] AndreYuhai: canton7: thank you, I am searching
[10:32:35] khalella: am i missing a gem? surely it isn't 'rake'
[10:32:51] khalella: is there something different about this between ruby 2.2 and 2.3
[10:33:32] khalella: the gems in the Gemfile should satisfy dependencies with bundle install
[10:33:47] Pisuke: has joined #ruby
[10:35:56] jhass: khalella: try prefixing the comamnd with bundle exec
[10:36:47] laaron: has joined #ruby
[10:38:23] bruce_lee: has joined #ruby
[10:39:05] khalella: jhass: no change. i think it is implied anyway
[10:39:25] jhass: not necessarily, no
[10:39:48] jhass: especially since it errors out on trying to load a part of rake, which is loaded before Bundler gets a chance to restrict the load paths
[10:40:46] jhass: Looks like it was removed with rake 11
[10:40:52] jhass: https://github.com/ruby/rake/commit/f804fc2b56558100f840d2341823e74f25fc1e4a#diff-dbc34d9d73d6859840ceb61605d344c0
[10:41:18] jhass: so your AS version is either too old or your rake version is to new, depending on how you want to put it
[10:41:29] jhass: either restrict to an older rake version in your Gemfile or update your AS version
[10:42:23] jhass: well or maybe something else triggers it actually, given the trace part you showed is just the by AS overwritten version of require
[10:42:33] jhass: more of the traceback could hint the real culprit
[10:42:57] khalella: nice. thank you jhass
[10:46:26] ellcs: has joined #ruby
[10:47:27] khalella: jhass: it looks like this https://dpaste.de/KfSe
[10:48:48] jhass: should be lib/tasks/import_to_tes.rake:5 then
[10:49:28] jhass: just remove that line and if that doesn't work out replace it with require 'rake/ext/string'
[10:55:15] khalella: wow. that rules jhass thank you
[10:56:52] jhass: (btw I guess the filename is typoed and meand to say test at the end :D)
[10:57:23] ldnunes: has joined #ruby
[10:58:00] catphish: has joined #ruby
[10:59:36] Paraxial: has joined #ruby
[11:02:57] catphish: i have a strange bug whereby i have a gem that uses readline to ask a user for some input, if i run the gem's bin directly, all is well, but if i run it via rubygems's wrapper, readline randomly prints "\r" to my screen when i've entered a line of text
[11:04:40] catphish: short demonstration: https://paste.ubuntu.com/p/8KzxFKdpxC/
[11:06:08] lxsameer: has joined #ruby
[11:08:06] laaron: has joined #ruby
[11:10:37] conta: has joined #ruby
[11:11:30] laaron: has joined #ruby
[11:15:54] Guest16678: has joined #ruby
[11:18:14] Dwarf: has joined #ruby
[11:19:59] Dwarf: Hello folks. I'm trying to use OpenSSL and I want to use a client certificate, but it seems the server (in this case, an IRC server) is not receiving the client certificate. Code is as follows: https://p.bcome.nl/?8607c13436915bc0#A1bVmEiDM1l3vu7iuFRFq3gF6NzAJfNg1fi//+H5B80=
[11:20:44] conta: has joined #ruby
[11:21:18] Dwarf: Admittedly the docs at https://ruby-doc.org/stdlib-2.4.5/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html aren't really clear on what to use to send a client certificate. Perhaps what I'm looking for is client_cert_cb?
[11:22:22] Dwarf: Though that doesn't seem right either
[11:25:04] aufi: has joined #ruby
[11:27:07] catphish: found my problem, caused by loading rb-readline
[11:27:32] catphish: so it's using a totally different implementation of readline
[11:27:57] Dwarf: Hm. Passing the .pem file to context.cert and context.key worked.
[11:28:01] Dwarf: Guess that solves my issue!
[11:28:44] catphish: Dwarf: your paste is gone
[11:29:20] Dwarf: I was using context.cert without context.key
[11:29:31] catphish: you certainly need both
[11:31:17] Cthulu201: has joined #ruby
[11:42:16] AJA4350: has joined #ruby
[11:47:23] themsay: has joined #ruby
[12:25:28] Nicmavr: has joined #ruby
[12:29:34] Leifr: has joined #ruby
[12:36:48] n13z: has joined #ruby
[12:41:51] fanta7531: has joined #ruby
[12:44:22] AJA4351: has joined #ruby
[12:49:03] BH23: has joined #ruby
[12:49:20] _joes_: has joined #ruby
[13:07:14] stryek: has joined #ruby
[13:08:50] sysvalve: has joined #ruby
[13:09:11] bmurt: has joined #ruby
[13:19:03] dviola: has joined #ruby
[13:26:20] BH23: has joined #ruby
[13:37:54] blackmesa: has joined #ruby
[13:41:04] blackmesa1: has joined #ruby
[13:43:02] mr_roybot: has joined #ruby
[13:50:35] lucasb: has joined #ruby
[14:01:58] jcalla: has joined #ruby
[14:13:21] conta: has joined #ruby
[14:14:43] dellavg_: has joined #ruby
[14:28:57] Renich: has joined #ruby
[14:32:24] AJA4350: has joined #ruby
[14:40:23] spiette: has joined #ruby
[14:42:52] Dwarf: has left #ruby: ()
[14:52:14] arekushi: has joined #ruby
[14:53:51] donofrio: has joined #ruby
[15:04:09] gnufied: has joined #ruby
[15:04:19] dellavg_: has joined #ruby
[15:16:27] dellavg_: has joined #ruby
[15:18:22] polishdub: has joined #ruby
[15:20:17] bmurt: has joined #ruby
[15:21:09] Inline: has joined #ruby
[15:22:19] kapil____: has joined #ruby
[15:28:34] AJA4351: has joined #ruby
[15:30:00] rippa: has joined #ruby
[15:30:42] polishdub: has joined #ruby
[15:32:29] dellavg_: has joined #ruby
[15:46:36] ogres: has joined #ruby
[15:48:53] tdy: has joined #ruby
[15:54:29] hurricanehrndz: has joined #ruby
[15:55:51] lxsameer: has joined #ruby
[16:04:18] Renich: has joined #ruby
[16:04:35] AJA4351: has joined #ruby
[16:05:24] nowhere_man: has joined #ruby
[16:19:27] matchaw: has joined #ruby
[16:23:47] gregf_: has joined #ruby
[16:24:23] Dbugger: has joined #ruby
[16:29:58] Renich: has joined #ruby
[16:42:48] maryo: has joined #ruby
[16:43:29] maryo: I have a open call for reading a file, something like this https://dpaste.de/kMWZ does it really need a close call too?
[16:44:42] \void: has joined #ruby
[16:49:56] AJA4351: has joined #ruby
[16:50:37] canton7: maryo, yes. However, prefer the version of File.open which takes a block - that way it automatically calls close for you
[16:51:49] maryo: canton7, so this code is fine -> https://dpaste.de/kMWZ ?
[16:51:56] jcarl43: has joined #ruby
[16:52:20] canton7: maryo, I said it needs a close call too, and to prefer the version of File.open which takes a block
[16:52:35] canton7: you just re-pasted the same code which doesn't call File.close *or* use the version of File.open which takes a block
[16:56:06] maryo: canton7, sorry about it. Just bit confused about this file operations. Does this close call looks valid now? Please suggest -> https://dpaste.de/COkA
[16:56:19] orbyt_: has joined #ruby
[16:57:14] darris: has joined #ruby
[16:57:48] canton7: maryo, no, you close it after reading only the first line
[16:57:59] canton7: I did say to prefer the version of File.open which takes a block
[16:59:13] maryo: canton7, sorry I am bit new here. Could you please show me an example on what you mean
[16:59:27] canton7: File.open(a, "r") do |f| ......... end
[17:01:14] phaul: maryo: when you open a file / keep open the file, internally a structure is created a file descriptor aka IO object that keeps track of how far you have read into the file, what position to read next etc. That's how read_line calls can progress through a file. opening is for creating this tracking structure, and closing is destroying this tracking structure
[17:02:50] phaul: maryo: does this^ make sense?
[17:02:51] maryo: phaul, is there an option to see the count of open file descriptors?
[17:02:59] maryo: phaul, yep that makes sense
[17:04:09] phaul: I'm not sure about Ruby API for a count. unix has tools like lsof (man lsof)
[17:09:04] maryo: phaul, thanks a lot
[17:09:10] maryo: thank you so much canton7 o/
[17:09:58] orbyt_: has joined #ruby
[17:15:38] maryo: canton7, am I still missing something here -> https://dpaste.de/5Squ
[17:15:57] canton7: maryo, you deleted 'f.each_line'
[17:16:59] canton7: maryo, https://dpaste.de/jyqK/raw
[17:17:09] canton7: oops, not quite
[17:17:26] canton7: here: https://dpaste.de/DKS7/raw
[17:18:26] maryo: canton7, thanks o/
[17:23:24] bruce_lee: has joined #ruby
[17:25:08] cthulchu_: has joined #ruby
[17:31:32] nowhere_man: has joined #ruby
[17:38:06] tdy: has joined #ruby
[17:44:49] lytol_: has joined #ruby
[17:45:53] perique: has joined #ruby
[17:47:01] cd: has joined #ruby
[17:56:31] zeamp: has joined #ruby
[18:05:06] matchaw_: has joined #ruby
[18:05:09] brandoncc: has joined #ruby
[18:08:51] sonofentropy: has joined #ruby
[18:09:41] jinie: has joined #ruby
[18:18:09] keden: has joined #ruby
[18:18:34] Eiam: has joined #ruby
[18:21:26] grvgr: has joined #ruby
[18:24:26] grvgr_: has joined #ruby
[18:27:24] tdy: has joined #ruby
[18:36:54] conta: has joined #ruby
[18:36:59] s2013: has joined #ruby
[18:47:03] bga57: has joined #ruby
[19:01:48] rkazak: has joined #ruby
[19:01:53] ravenousmoose: has joined #ruby
[19:12:32] cnsvc: has joined #ruby
[19:20:21] catbusters: has joined #ruby
[19:21:58] havenwood: catbusters: hi!
[19:22:04] catbusters: I'm trying to use Ruby to parse some HTML, and I'm getting some text that looks like this: "they're in a"
[19:22:17] catbusters: I assume it's supposed to be "they're"
[19:22:24] catbusters: How do I fix this?
[19:23:41] havenwood: catbusters: Nokogiri::HTML("they're in a").text #=> "they're in a"
[19:29:57] havenwood: &>> require 'cgi'; CGI.unescape_html "they're in a" # catbusters
[19:30:00] rubydoc: # => "they're in a" (https://carc.in/#/r/63yh)
[19:30:36] catbusters: What's the difference?
[19:33:12] s2013: has joined #ruby
[19:33:23] nowhere_man: has joined #ruby
[19:33:44] agent_white: has joined #ruby
[19:36:02] havenwood: catbusters: Nokogiri is a gem. It's the most popular Ruby HTML parser. CGI is in the stdlib.
[19:36:49] catbusters: I'm already loading Nokogiri so I guess I'll go with that
[19:37:16] havenwood: catbusters: I wasn't sure if you were already using Nokogiri. Yeah, it's a good way.
[19:41:59] AJA4350: has joined #ruby
[19:50:43] BH23: has joined #ruby
[19:55:01] Sembei: has joined #ruby
[19:56:44] MzrE: has joined #ruby
[20:00:11] krawchyk: has joined #ruby
[20:08:14] cnsvc: has joined #ruby
[20:11:53] akem: has joined #ruby
[20:17:03] ravenousmoose: has joined #ruby
[20:26:30] johari: has joined #ruby
[20:30:52] tdy: has joined #ruby
[20:32:13] s2013: has joined #ruby
[20:37:07] tankf33der: maybe someone wants create a gem for monocypher.org?
[20:37:30] tankf33der: does site gemrequest.org exists? :)
[20:40:15] ravenousmoose: has joined #ruby
[20:45:48] code_zombie: has joined #ruby
[20:47:57] catphish: has left #ruby: ("Leaving")
[20:48:24] AJA4350: has joined #ruby
[20:59:30] sagax: has joined #ruby
[21:01:10] Swyper: has joined #ruby
[21:10:33] SeepingN: has joined #ruby
[21:24:15] duderonomy: has joined #ruby
[21:27:33] Xiti: has joined #ruby
[21:28:34] conta: has joined #ruby
[21:34:51] conta: has joined #ruby
[21:37:08] keden: has joined #ruby
[21:38:00] roshanavand: has joined #ruby
[21:40:54] postmodern: has joined #ruby
[21:47:45] cnsvc: has joined #ruby
[21:55:50] GodFather: has joined #ruby
[22:00:39] AJA4350: has joined #ruby
[22:39:19] AJA4350: has joined #ruby
[22:45:14] code_zombie: has joined #ruby
[23:05:43] Nicmavr: has joined #ruby
[23:21:19] SCHAPiE: has joined #ruby
[23:23:00] ltd: has joined #ruby
[23:23:04] Swyper: has joined #ruby
[23:24:08] ltd: has joined #ruby
[23:26:36] DTZUZO_: has joined #ruby
[23:35:45] AJA4350: has joined #ruby
[23:52:12] tdy: has joined #ruby
[23:58:53] akem: has joined #ruby