GarethAdams

Activity Graph

Page 1 of 5 | Next »

2019-06-27

[10:12:26] GarethAdams: has joined #ruby
[10:13:35] GarethAdams: I’m using Faraday and trying to write tests that assert a particular HTTP header is added to outgoing requests by a method call
[10:16:41] GarethAdams: Examples I’ve seen suggest mocking `Faraday.new` to return a `Faraday::Adapter::Test` that I can call assertions on. That’s fine in principle, but if I mock `Faraday.new` then I’m overriding the call where I actually add the API key: `Faraday.new { |c| c.headers[“API-KEY”] = “123” }`
[17:09:06] GarethAdams: Quit: garethadams

2019-06-18

[01:08:23] GarethAdams: Quit: GarethAdams
[07:06:38] GarethAdams: has joined #ruby
[08:35:49] GarethAdams: Quit: GarethAdams
[09:03:20] GarethAdams: has joined #ruby
[09:11:25] GarethAdams: Quit: GarethAdams

2019-06-17

[12:06:13] GarethAdams: has joined #ruby
[12:07:35] GarethAdams: has joined #ruby
[12:07:35] GarethAdams: Changing host
[17:23:19] GarethAdams: Ping timeout: 256 seconds
[18:32:54] GarethAdams: has joined #ruby
[20:22:18] GarethAdams: xco: how were you thinking that Ruby would know that %w(Some Brand Ferrari Toyota) would be [“Some Brand”, “Ferrari”, “Toyota”] and not [“Some”, “Brand Ferrari”, “Toyota”] ?
[20:26:06] GarethAdams: xco: ok, but you’re happy that split(‘ ‘, 3) probably *isn’t* what you want, right?
[20:27:00] GarethAdams: Because that means the answer to “How would Ruby know?” is “Every word from the 3rd word is part of the same brand name” which is almost certainly not useful to you in any real sense
[20:27:56] GarethAdams: Ok right. So you’re not asking for a general solution to do this in other scenarios, gotcha
[20:28:47] GarethAdams: Are you happy with this?
[20:28:54] GarethAdams: &>> "Toyota Ferrari Aston Martin Jaguar”.split(' ',3)
[20:29:35] GarethAdams: &>> “Toyota Ferrari Aston Martin Jaguar”.split(‘ ‘,3)
[20:29:40] GarethAdams: Stupid IRC client
[20:30:34] GarethAdams: This is some kind of exercise I take it
[20:31:33] GarethAdams: to be honest, if this was in real code I’d just use BRANDS = [“Toyota”, “Ferrari”, “Aston Martin”]
[20:32:01] GarethAdams: No, but if it’s fixed I think it’s weird you’re transforming a literal dynamically
[20:33:14] GarethAdams: your tab-completion failed you there, but I got who you meant
[20:35:40] GarethAdams: Maybe you have a custom text file that’s like “2019-06-15 12:00:14 progname user-335 A bunch of text that the user typed in a chat”
[20:36:07] GarethAdams: date, time, prog, user, text = row.split(‘ ‘, 5) would get you that
[20:36:40] GarethAdams: xco: it’s a pretty niche use case and there are probably better ways. I’ve only seen it very rarely
[22:43:18] GarethAdams: Quit: GarethAdams
[23:29:02] GarethAdams: has joined #ruby

2017-09-10

[13:29:01] GarethAdams: has joined #ruby
[13:29:02] GarethAdams: has joined #RubyOnRails

2016-06-17

[12:42:58] GarethAdams: has joined #ruby
[12:42:59] GarethAdams: has joined #RubyOnRails
[12:49:26] GarethAdams: Quit: Linkinus - http://linkinus.com

2016-06-07

[08:43:49] GarethAdams: Quit: Leaving...
[08:51:15] GarethAdams: has joined #ruby
[08:51:16] GarethAdams: has joined #RubyOnRails
[09:07:03] GarethAdams: Ping timeout: 250 seconds
[09:31:03] GarethAdams: has joined #ruby
[09:31:04] GarethAdams: has joined #RubyOnRails
[14:05:28] GarethAdams: Read error: Connection reset by peer

2016-06-06

[15:25:52] GarethAdams: has joined #ruby
[15:25:53] GarethAdams: has joined #RubyOnRails
[19:41:06] GarethAdams: Quit: Leaving...
[20:54:40] GarethAdams: has joined #ruby
[20:54:41] GarethAdams: has joined #RubyOnRails
[21:05:45] GarethAdams: Quit: Leaving...
[23:10:29] GarethAdams: has joined #ruby
[23:10:30] GarethAdams: has joined #RubyOnRails

2016-05-26

[11:38:17] GarethAdams: has joined #ruby
[11:38:18] GarethAdams: has joined #RubyOnRails
[12:44:30] GarethAdams: skroon: params are generally be for user-supplied data. If you're setting an encrypted value just to receive the same value, what's the use in sending it to the user?
[12:45:46] GarethAdams: skroon: are you saying, you want an external process to make a request and be authenticated as a user?
[12:58:32] GarethAdams: Quit: Linkinus - http://linkinus.com

2016-05-25

[09:23:49] GarethAdams: has joined #ruby
[09:23:50] GarethAdams: has joined #RubyOnRails
[09:23:53] GarethAdams: has joined #ruby
[09:23:53] GarethAdams: has joined #RubyOnRails
[09:23:53] GarethAdams: Changing host
[10:40:10] GarethAdams: raz: what makes one book better than another, for you?
[10:41:22] GarethAdams: Difficult to recommend the best one without knowing what kind of book they're after
[12:11:28] GarethAdams: Quit: Leaving...
[12:14:27] GarethAdams: has joined #ruby
[12:14:28] GarethAdams: has joined #RubyOnRails
[13:24:16] GarethAdams: Read error: Connection reset by peer
[13:30:06] GarethAdams: has joined #ruby
[13:30:07] GarethAdams: has joined #RubyOnRails
[18:58:33] GarethAdams: Quit: Leaving...

2016-05-24

[07:51:39] GarethAdams: has joined #ruby
[07:51:40] GarethAdams: has joined #RubyOnRails
[08:26:17] GarethAdams: Quit: Leaving...
[09:16:55] GarethAdams: has joined #ruby
[09:16:56] GarethAdams: has joined #RubyOnRails
[14:42:37] GarethAdams: *.net *.split
[15:45:54] GarethAdams: has joined #ruby
[15:45:55] GarethAdams: has joined #RubyOnRails
[15:57:33] GarethAdams: *.net *.split
[16:06:16] GarethAdams: has joined #ruby
[16:06:17] GarethAdams: has joined #RubyOnRails
[17:38:06] GarethAdams: jolamb: what is `v` in relation to the item in the loop?
[17:39:35] GarethAdams: so are you *selecting* items equal to :a or :b?
[17:43:02] GarethAdams: jolamb: my point is, when you're iterating, the way you're iterating (what you're trying to output) often changes the best way to write the thing in the loop
[17:43:19] GarethAdams: so whether you're `select`ing or something else might affect your question
[17:45:55] GarethAdams: Hash order is guaranteed since 1.9 :)
[17:47:20] GarethAdams: http://ruby-doc.org/core-1.9.1/Hash.html > "Hashes enumerate their values in the order that the corresponding keys were inserted"
[18:06:24] GarethAdams: Quit: Leaving...
[21:46:06] GarethAdams: has joined #ruby
[21:46:07] GarethAdams: has joined #RubyOnRails
[23:43:02] GarethAdams: Quit: Leaving...

2016-05-23

[15:32:03] GarethAdams: has joined #ruby
[15:32:04] GarethAdams: has joined #RubyOnRails
[17:53:49] GarethAdams: Quit: Leaving...
[22:25:20] GarethAdams: has joined #ruby
[22:25:21] GarethAdams: has joined #RubyOnRails
[23:32:52] GarethAdams: Quit: Leaving...

2016-05-22

[05:39:13] GarethAdams: indianowl: you have `Problem :has_one :question` and `Question has_one :problem`. One of those is probably wrong
[05:39:41] GarethAdams: One of those should almost certainly be a belongs_to
[09:14:31] GarethAdams: Disconnected by services
[09:15:11] GarethAdams: has joined #ruby
[09:15:12] GarethAdams: has joined #RubyOnRails

2016-05-21

[13:13:00] GarethAdams: has joined #ruby
[13:13:01] GarethAdams: has joined #RubyOnRails
[14:34:20] GarethAdams: Disconnected by services
[14:35:07] GarethAdams: has joined #ruby
[14:35:08] GarethAdams: has joined #RubyOnRails
[14:55:06] GarethAdams: Quit: Linkinus - http://linkinus.com
[23:56:54] GarethAdams: has joined #ruby
[23:56:55] GarethAdams: has joined #RubyOnRails

2016-01-06

[13:59:36] GarethAdams: has joined #ruby
[13:59:37] GarethAdams: has joined #RubyOnRails
[14:08:16] GarethAdams: Why is caching disabled by default in development? I assume it's related to accidentally showing cached things which have changed, but what kind of changes wouldn't be detected by Rails' existing cache invalidation techniques?
[14:10:12] GarethAdams: actually, never mind! There are plenty of changes that could happen in development which could cause problems. I was only thinking about one stupidly specific case
[14:11:50] GarethAdams: well cache invalidation is supposed to handle that, but what I forgot was that in development you might be changing things that aren't related to the cache key
[14:11:59] GarethAdams: so yes, my original question is moot
[14:12:06] GarethAdams: but thanks for replying anyway!
[14:20:35] GarethAdams: Quit: Linkinus - http://linkinus.com

2015-12-14

[11:10:53] GarethAdams: has joined #ruby
[11:10:54] GarethAdams: has joined #RubyOnRails
[11:52:56] GarethAdams: Quit: Linkinus - http://linkinus.com

2015-12-02

[15:01:23] GarethAdams: Ping timeout: 264 seconds

2015-11-30

[18:18:26] GarethAdams: Ping timeout: 240 seconds
[18:25:04] GarethAdams: has joined #ruby
[18:25:04] GarethAdams: has joined #RubyOnRails

2015-11-27

[08:42:02] GarethAdams: *.net *.split
[10:34:48] GarethAdams: *.net *.split
[10:42:49] GarethAdams: has joined #ruby
[10:42:49] GarethAdams: has joined #RubyOnRails
[10:45:59] GarethAdams: *.net *.split
[10:47:03] GarethAdams: has joined #ruby
[10:47:03] GarethAdams: has joined #RubyOnRails

2015-11-26

[08:13:04] GarethAdams: has joined #RubyOnRails
[08:13:04] GarethAdams: has joined #ruby
[08:13:30] GarethAdams: has joined #ruby
[08:13:30] GarethAdams: has joined #RubyOnRails
[08:13:30] GarethAdams: Changing host

2015-11-23

[09:59:54] GarethAdams: has joined #RubyOnRails
[09:59:54] GarethAdams: has joined #ruby
[10:02:24] GarethAdams: has joined #ruby
[10:02:25] GarethAdams: has joined #RubyOnRails
[10:12:50] GarethAdams: has joined #RubyOnRails
[10:12:50] GarethAdams: has joined #ruby
[10:55:51] GarethAdams: Quit: Leaving...
[11:28:54] GarethAdams: has joined #ruby
[11:28:55] GarethAdams: has joined #RubyOnRails
[12:28:56] GarethAdams: Quit: Leaving...
[13:35:10] GarethAdams: has joined #ruby
[13:35:11] GarethAdams: has joined #RubyOnRails

2015-11-20

[02:39:51] GarethAdams: Quit: Leaving...

2015-11-19

[23:54:56] GarethAdams: has joined #RubyOnRails
[23:54:56] GarethAdams: has joined #ruby
[23:55:10] GarethAdams: has joined #RubyOnRails
[23:55:10] GarethAdams: Changing host
[23:55:11] GarethAdams: has joined #ruby

2015-11-18

[11:42:28] GarethAdams: has joined #RubyOnRails
[11:42:28] GarethAdams: has joined #ruby
[11:42:43] GarethAdams: has joined #ruby
[11:42:43] GarethAdams: has joined #RubyOnRails
[11:42:43] GarethAdams: Changing host
[11:45:36] GarethAdams: I don't know what I'm doing wrong that my field interpolation isn't working for nested fields. `mutate { add_field => { "field" => "%{event}" } }` correctly replaces with the dynamic value, but `mutate { add_field => { "field" => "%{[properties][userId]}" } }` adds the literal value "%{[properties][userId]}" to the field
[11:46:02] GarethAdams: oops, wrong channel
[13:27:35] GarethAdams: Ping timeout: 240 seconds
[13:31:04] GarethAdams: has joined #RubyOnRails
[13:31:04] GarethAdams: has joined #ruby
[13:36:00] GarethAdams: Read error: Connection reset by peer
[14:41:36] GarethAdams: has joined #RubyOnRails
[14:41:36] GarethAdams: has joined #ruby
[14:41:39] GarethAdams: has joined #ruby
[14:41:39] GarethAdams: has joined #RubyOnRails
[14:41:39] GarethAdams: Changing host
[15:51:50] GarethAdams: Quit: Linkinus - http://linkinus.com

2015-11-17

[05:25:23] GarethAdams: *.net *.split
[05:30:23] GarethAdams: has joined #RubyOnRails
[05:30:23] GarethAdams: has joined #ruby
[05:30:52] GarethAdams: has joined #ruby
[05:30:52] GarethAdams: has joined #RubyOnRails
[05:30:52] GarethAdams: Changing host
[10:27:52] GarethAdams: Disconnected by services
[10:56:23] GarethAdams: has joined #ruby
[10:56:35] GarethAdams: has joined #RubyOnRails
[12:58:47] GarethAdams: Papierkorb: and then he'll want dates which are parameterised based on other dates that have been set in the config, etc etc ;)
[14:20:02] GarethAdams: emilkarl: the line you pasted had a syntax error ;)
[14:20:16] GarethAdams: emilkarl: tap returns whatever the original object is
[14:22:50] GarethAdams: emilkarl: not one that has Rails methods like .months.ago, AFAIK
[14:25:27] GarethAdams: emilkarl: works for me!
[14:28:57] GarethAdams: emilkarl: what is `config[:number].send(config[:type]).class` for you?
[14:29:20] GarethAdams: emilkarl: it should be ActiveSupport::Duration
[14:30:13] GarethAdams: emilkarl: what version of Rails is this?
[14:31:35] GarethAdams: emilkarl: does `5.method(:months).source_location` look like something in activesupport?
[14:33:16] GarethAdams: I mean that method directly returns an ActiveSupport::Duration
[14:33:32] GarethAdams: I can't see how that's turning into a Fixnum for you
[14:36:46] GarethAdams: emilkarl: how about `ActiveSupport::Duration.new(150.days, [[:months, 5]]).class`
[14:37:15] GarethAdams: emilkarl: you've got some other gem that's breaking ActiveSupport then
[14:37:31] GarethAdams: ActiveSupport::Duration.new should *not* return a Fixnum
[16:01:08] GarethAdams: Quit: Linkinus - http://linkinus.com

2015-11-14

[10:20:39] GarethAdams: Ping timeout: 252 seconds
[10:20:41] GarethAdams: has joined #ruby
[10:20:41] GarethAdams: has joined #RubyOnRails
[10:20:42] GarethAdams: has joined #RubyOnRails
[10:20:42] GarethAdams: has joined #ruby
[10:20:42] GarethAdams: Changing host

2015-11-09

[14:19:35] GarethAdams: Ping timeout: 252 seconds
[14:25:36] GarethAdams: has joined #RubyOnRails
[14:25:37] GarethAdams: has joined #ruby

2015-11-02

[15:35:20] GarethAdams: *.net *.split
[16:06:41] GarethAdams: has joined #ruby
[16:06:41] GarethAdams: Changing host
[16:06:41] GarethAdams: has joined #ruby
[16:06:41] GarethAdams: has joined #RubyOnRails
[16:06:42] GarethAdams: has joined #RubyOnRails

2015-10-29

[16:09:11] GarethAdams: Ping timeout: 256 seconds
[16:15:44] GarethAdams: has joined #ruby
[16:15:44] GarethAdams: has joined #RubyOnRails

2015-10-23

[10:07:46] GarethAdams: *.net *.split
[10:10:08] GarethAdams: has joined #ruby
[10:10:08] GarethAdams: has joined #RubyOnRails

2015-10-16

[18:20:41] GarethAdams: Ping timeout: 252 seconds
[18:26:19] GarethAdams: has joined #ruby
[18:26:19] GarethAdams: has joined #RubyOnRails

2015-10-09

[19:30:06] GarethAdams: Ping timeout: 256 seconds
[19:36:51] GarethAdams: has joined #ruby
[19:36:51] GarethAdams: has joined #RubyOnRails

2015-10-03

[10:08:34] GarethAdams: Ping timeout: 256 seconds
[10:14:06] GarethAdams: has joined #ruby
[10:14:06] GarethAdams: has joined #RubyOnRails

2015-09-29

[21:11:24] GarethAdams: Ping timeout: 256 seconds
[21:16:49] GarethAdams: has joined #ruby
[21:16:49] GarethAdams: has joined #RubyOnRails

2015-09-22

[22:08:12] GarethAdams: Ping timeout: 252 seconds
[22:10:08] GarethAdams: has joined #ruby
[22:10:08] GarethAdams: has joined #RubyOnRails

2015-09-18

[23:01:26] GarethAdams: Ping timeout: 252 seconds
[23:07:24] GarethAdams: has joined #ruby
[23:07:24] GarethAdams: has joined #RubyOnRails

2015-09-12

[00:11:48] GarethAdams: Ping timeout: 252 seconds
[00:17:51] GarethAdams: has joined #ruby
[00:17:51] GarethAdams: has joined #RubyOnRails

2015-09-05

[01:20:58] GarethAdams: Ping timeout: 256 seconds
[01:27:32] GarethAdams: has joined #ruby
[01:27:32] GarethAdams: has joined #RubyOnRails