woodruffw

Activity Graph

Page 1 of 4 | Next »

2019-01-13

[05:22:24] woodruffw: elcontrastador: `require` returns false when the library is already loaded
[05:22:38] woodruffw: so it's possible you've already loaded it; see if the `URI` constant is available
[05:24:10] woodruffw: yeah, that's strange, maybe it's become part of the corelib (i.e., the default requires)?
[05:24:39] woodruffw: or something in the corelib is requiring it transitively

2019-01-03

[20:50:28] woodruffw: Haris: if you user bundler, you can remove the whole vendor/ subdirectory
[20:50:40] woodruffw: i don't think there's a clean way to do it if you used `gem` directly

2018-12-11

[03:45:55] woodruffw: Ping timeout: 246 seconds
[03:48:48] woodruffw: has joined #ruby

2018-12-07

[20:38:39] woodruffw: Scriptonaut: enumerable.find { |x| x.blah? }
[20:39:04] woodruffw: you want the index?
[20:39:26] woodruffw: hmm, you could do find + tap probably
[20:39:42] woodruffw: err sorry no, that wouldn't work
[20:41:27] woodruffw: return `enumerable.find { |x| x.blah? }.first` maybe?
[20:51:13] woodruffw: right, i'm saying that you should return the element and then chain the calculation after it
[20:52:09] woodruffw: yeah, reduce then

2018-12-06

[12:53:06] woodruffw: Ping timeout: 244 seconds
[12:55:08] woodruffw: has joined #ruby

2018-12-03

[01:53:02] woodruffw: Quit: And then he took off.
[01:58:08] woodruffw: has joined #ruby

2018-11-28

[02:22:10] woodruffw: Ping timeout: 246 seconds
[02:27:44] woodruffw: has joined #ruby

2018-11-18

[01:33:28] woodruffw: galaxie: `require 'open-uri'; open('https://whatever')` doesn't work?
[02:48:24] woodruffw: galaxie: yeah, that's a problem with `open-uri` as a whole. as nchambers mentioned, net/http is probably the right way to go
[02:49:35] woodruffw: FWIW, using `net/http` is as simple as this: `Net::HTTP.get(URI(your_url))`
[02:49:48] woodruffw: that returns a `String` containing just the response body
[02:50:38] woodruffw: ref for open-uri being generally dangerous: https://sakurity.com/blog/2015/02/28/openuri.html
[03:00:47] woodruffw: galaxie: for that, you'll need to create a `Net::HTTP::Get` object, i think. that object can then be treated like a hash to add headers, e.g. `foo['X-Whatever'] = 'bar'`
[03:01:03] woodruffw: this seems to cover it: https://stackoverflow.com/questions/44839503/ruby-send-get-request-with-headers
[03:01:36] woodruffw: in terms of personal choice, that's where i'd switch to `httparty` or another gem for simplicity, unless it's just a short script
[05:02:07] woodruffw: woah, i had no idea __method__ or __callee__ existed

2018-11-16

[05:12:46] woodruffw: Ping timeout: 246 seconds
[06:24:32] woodruffw: has joined #ruby

2018-11-12

[21:19:33] woodruffw: Quit: And then he took off.
[21:21:17] woodruffw: has joined #ruby

2018-10-23

[17:51:26] woodruffw: if the string is exactly two words, String#split and Array#last are what you want
[17:51:37] woodruffw: otherwise, String#split and then get the first element
[17:51:44] woodruffw: err, second element, index 1

2018-09-14

[01:00:08] woodruffw: *.net *.split
[01:03:40] woodruffw: has joined #ruby

2018-09-13

[03:20:30] woodruffw: Resolv::MDNS is part of the stdlib, not familiar with anything for netbios or llmnr though

2018-09-03

[03:49:49] woodruffw: sounds like a mutex is what you want? https://ruby-doc.org/core-2.5.1/Mutex.html

2018-09-01

[03:53:53] woodruffw: JJonah: yes, you can define default values via the block that you pass to `define_method`
[03:55:29] woodruffw: see: https://eval.in/1052921
[03:59:22] woodruffw: hmm...this maybe? https://eval.in/1052922
[03:59:46] woodruffw: you should be able to split a hash in there instead, e.g., `foo **your_hash`
[03:59:54] woodruffw: splat*, not split
[04:01:04] woodruffw: that eval service is giving me internal server errors, maybe i should have chosen a better one :p
[04:01:54] woodruffw: here we go: https://repl.it/repls/BeneficialRoastedCron
[04:12:25] woodruffw: JJonah: yeah, i don't know if you can get both arbitrary keyword arguments *and* default values under ruby, unfortunately
[04:12:53] woodruffw: you can get what you want in that example, but i think you'll lose flexibility in terms of passing an arbitrary hash
[04:14:25] woodruffw: this works, but it doesn't handle default values for the trailing hash: https://hastebin.com/awupogezat.sql
[04:15:35] woodruffw: you could fake it by storing a default set of values somewhere and comparing the ones passed in **hsh to those
[04:28:03] woodruffw: nice; glad it works

2018-08-21

[20:19:28] woodruffw: *.net *.split
[20:20:02] woodruffw: has joined #ruby

2018-08-14

[00:57:13] woodruffw: *.net *.split
[01:04:29] woodruffw: has joined #ruby

2018-08-01

[09:28:02] woodruffw: Ping timeout: 248 seconds
[09:32:14] woodruffw: has joined #ruby

2018-07-20

[00:07:06] woodruffw: *.net *.split
[00:15:48] woodruffw: has joined #ruby

2018-06-19

[04:32:38] woodruffw: Ping timeout: 256 seconds
[04:39:50] woodruffw: has joined #ruby
[04:39:50] woodruffw: Changing host
[04:39:50] woodruffw: has joined #ruby

2018-06-18

[03:43:07] woodruffw: has joined #ruby
[03:43:07] woodruffw: Changing host
[03:43:07] woodruffw: has joined #ruby

2018-06-15

[03:51:27] woodruffw: has joined #ruby
[03:51:28] woodruffw: has joined #ruby
[03:51:28] woodruffw: Changing host
[06:52:47] woodruffw: Ping timeout: 255 seconds
[06:52:59] woodruffw: has joined #ruby
[06:52:59] woodruffw: Changing host
[06:52:59] woodruffw: has joined #ruby
[21:05:31] woodruffw: Quit: And then he took off.

2018-05-18

[16:08:33] woodruffw: Quit: And then he took off.

2018-05-15

[13:44:44] woodruffw: Excess Flood
[13:46:01] woodruffw: has joined #ruby
[13:46:01] woodruffw: Changing host
[13:46:01] woodruffw: has joined #ruby

2018-05-07

[05:14:20] woodruffw: Ping timeout: 268 seconds
[06:04:11] woodruffw: has joined #ruby
[06:04:11] woodruffw: Changing host
[06:04:11] woodruffw: has joined #ruby

2018-04-29

[16:51:21] woodruffw: Ping timeout: 264 seconds
[16:57:17] woodruffw: has joined #ruby
[16:57:17] woodruffw: Changing host
[16:57:17] woodruffw: has joined #ruby

2018-04-14

[17:44:46] woodruffw: Ping timeout: 256 seconds
[17:48:26] woodruffw: has joined #ruby
[17:48:27] woodruffw: has joined #ruby
[17:48:27] woodruffw: Changing host

2018-04-09

[01:50:09] woodruffw: has joined #ruby

2018-04-08

[22:02:12] woodruffw: has left #ruby: ("And then he took off.")

2018-03-24

[00:49:12] woodruffw: has joined #ruby
[00:49:12] woodruffw: Changing host
[00:49:12] woodruffw: has joined #ruby

2018-03-20

[23:40:33] woodruffw: Ping timeout: 264 seconds

2018-03-13

[12:55:52] woodruffw: Ping timeout: 268 seconds
[13:07:26] woodruffw: has joined #ruby
[13:07:26] woodruffw: Changing host
[13:07:26] woodruffw: has joined #ruby

2018-02-22

[10:57:57] woodruffw: Ping timeout: 264 seconds
[10:59:58] woodruffw: Ping timeout: 264 seconds

2018-02-18

[21:25:33] woodruffw: Ping timeout: 264 seconds
[21:33:07] woodruffw: has joined #ruby
[21:33:07] woodruffw: Changing host
[21:33:07] woodruffw: has joined #ruby

2018-02-09

[02:43:53] woodruffw: Quit: And then he took off.
[03:01:31] woodruffw: has joined #ruby
[03:01:31] woodruffw: Changing host
[03:01:31] woodruffw: has joined #ruby
[15:23:14] woodruffw: Ping timeout: 265 seconds
[15:26:58] woodruffw: has joined #ruby
[15:26:59] woodruffw: has joined #ruby
[15:26:59] woodruffw: Changing host

2018-02-07

[20:51:11] woodruffw: Ping timeout: 248 seconds
[20:53:39] woodruffw: has joined #ruby
[20:53:40] woodruffw: has joined #ruby
[20:53:40] woodruffw: Changing host

2018-02-03

[15:14:10] woodruffw: Ping timeout: 260 seconds
[18:01:13] woodruffw: has joined #ruby
[18:01:13] woodruffw: Changing host
[18:01:13] woodruffw: has joined #ruby
[18:52:36] woodruffw: Quit: And then he took off.
[18:57:42] woodruffw: has joined #ruby
[18:57:43] woodruffw: has joined #ruby
[18:57:43] woodruffw: Changing host

2018-01-14

[19:45:35] woodruffw: Ping timeout: 240 seconds
[19:47:04] woodruffw: has joined #ruby
[19:47:04] woodruffw: Changing host
[19:47:04] woodruffw: has joined #ruby
[20:37:32] woodruffw: Read error: Connection timed out
[20:46:50] woodruffw: has joined #ruby
[20:51:26] woodruffw: Ping timeout: 255 seconds
[23:32:12] woodruffw: has joined #ruby

2018-01-10

[18:45:45] woodruffw: Ping timeout: 260 seconds
[18:50:28] woodruffw: has joined #ruby
[18:50:28] woodruffw: Changing host
[18:50:28] woodruffw: has joined #ruby

2018-01-09

[02:22:29] woodruffw: Ping timeout: 252 seconds
[02:23:15] woodruffw: has joined #ruby
[02:23:15] woodruffw: Changing host
[02:23:15] woodruffw: has joined #ruby

2018-01-07

[04:47:24] woodruffw: Excess Flood
[04:51:05] woodruffw: has joined #ruby
[04:51:05] woodruffw: Changing host
[04:51:05] woodruffw: has joined #ruby

2018-01-06

[18:40:32] woodruffw: Ping timeout: 248 seconds
[18:46:32] woodruffw: has joined #ruby
[18:46:32] woodruffw: Changing host
[18:46:32] woodruffw: has joined #ruby

2018-01-02

[02:31:59] woodruffw: Ping timeout: 256 seconds
[02:34:58] woodruffw: has joined #ruby
[02:34:58] woodruffw: Changing host
[02:34:58] woodruffw: has joined #ruby

2017-12-14

[18:44:55] woodruffw: Ping timeout: 268 seconds
[18:48:26] woodruffw: has joined #ruby
[18:48:26] woodruffw: Changing host
[18:48:26] woodruffw: has joined #ruby

2017-12-12

[01:10:10] woodruffw: Ping timeout: 246 seconds
[01:16:53] woodruffw: has joined #ruby
[01:16:54] woodruffw: has joined #ruby
[01:16:54] woodruffw: Changing host
[03:46:22] woodruffw: Quit: And then he took off.
[03:50:00] woodruffw: has joined #ruby
[03:50:34] woodruffw: Changing host
[03:50:35] woodruffw: has joined #ruby
[04:46:21] woodruffw: Remote host closed the connection
[04:46:54] woodruffw: has joined #ruby
[04:46:55] woodruffw: has joined #ruby
[04:46:55] woodruffw: Changing host

2017-12-11

[00:19:29] woodruffw: Ping timeout: 268 seconds
[00:22:19] woodruffw: Changing host
[00:22:19] woodruffw: has joined #ruby
[00:22:20] woodruffw: has joined #ruby

2017-12-08

[20:51:58] woodruffw: has joined #ruby
[20:51:59] woodruffw: has joined #ruby
[20:51:59] woodruffw: Changing host

2017-12-04

[23:28:55] woodruffw: Read error: Connection reset by peer

2017-12-01

[02:28:42] woodruffw: has joined #ruby
[04:28:30] woodruffw: Read error: Connection reset by peer
[05:26:00] woodruffw: has joined #ruby
[05:26:00] woodruffw: Changing host
[05:26:00] woodruffw: has joined #ruby

2017-11-28

[02:40:50] woodruffw: Read error: Connection reset by peer
[02:41:06] woodruffw: has joined #ruby
[02:41:06] woodruffw: Changing host
[02:41:06] woodruffw: has joined #ruby
[02:54:35] woodruffw: Ping timeout: 240 seconds
[02:56:01] woodruffw: has joined #ruby
[02:56:01] woodruffw: Changing host
[02:56:01] woodruffw: has joined #ruby
[02:58:48] woodruffw: Read error: Connection reset by peer
[02:59:44] woodruffw: has joined #ruby
[02:59:45] woodruffw: has joined #ruby
[02:59:45] woodruffw: Changing host
[03:04:38] woodruffw: Ping timeout: 255 seconds
[03:06:26] woodruffw: has joined #ruby
[03:06:26] woodruffw: Changing host
[03:06:26] woodruffw: has joined #ruby
[03:11:43] woodruffw: Read error: Connection reset by peer
[03:17:46] woodruffw: has joined #ruby
[03:17:46] woodruffw: Changing host
[03:17:46] woodruffw: has joined #ruby
[03:28:08] woodruffw: Ping timeout: 276 seconds
[03:33:06] woodruffw: has joined #ruby
[03:33:07] woodruffw: has joined #ruby
[03:33:07] woodruffw: Changing host
[03:53:20] woodruffw: Quit: And then he took off.
[04:07:21] woodruffw: has joined #ruby
[04:07:21] woodruffw: Changing host
[04:07:21] woodruffw: has joined #ruby
[04:12:17] woodruffw: Ping timeout: 248 seconds
[04:19:11] woodruffw: has joined #ruby
[04:19:12] woodruffw: has joined #ruby
[04:19:12] woodruffw: Changing host
[04:25:14] woodruffw: Read error: Connection reset by peer
[04:25:44] woodruffw: has joined #ruby
[04:25:45] woodruffw: has joined #ruby
[04:25:45] woodruffw: Changing host
[11:20:27] woodruffw: Read error: Connection reset by peer
[14:21:38] woodruffw: has joined #ruby
[14:21:38] woodruffw: Changing host
[14:21:38] woodruffw: has joined #ruby

2017-11-27

[18:23:02] woodruffw: Read error: Connection reset by peer
[18:55:46] woodruffw: has joined #ruby
[18:55:46] woodruffw: Changing host
[18:55:46] woodruffw: has joined #ruby

2017-11-19

[20:04:05] woodruffw: Ping timeout: 268 seconds
[20:05:04] woodruffw: has joined #ruby
[20:05:05] woodruffw: has joined #ruby
[20:05:05] woodruffw: Changing host

2017-11-13

[21:51:54] woodruffw: Ping timeout: 255 seconds
[21:52:41] woodruffw: has joined #ruby
[21:52:41] woodruffw: Changing host
[21:52:41] woodruffw: has joined #ruby

2017-09-26

[10:56:32] woodruffw: Ping timeout: 260 seconds
[11:03:41] woodruffw: has joined #ruby
[11:03:41] woodruffw: Changing host
[11:03:41] woodruffw: has joined #ruby

2017-09-25

[18:41:37] woodruffw: has joined #ruby
[18:41:37] woodruffw: Changing host