matthewd

Activity Graph

Page 1 of 41 | Next »

2019-04-13

[16:50:12] matthewd: *.net *.split

2019-04-08

[22:30:30] matthewd: Ping timeout: 252 seconds
[22:32:02] matthewd: has joined #RubyOnRails
[22:32:03] matthewd: has joined #ruby-offtopic
[22:32:03] matthewd: has joined #ruby
[22:32:03] matthewd: has joined #RubyonRails-offtopic

2019-03-22

[12:14:36] matthewd: *.net *.split

2019-03-14

[09:34:40] matthewd: Ping timeout: 250 seconds
[09:39:59] matthewd: has joined #ruby-offtopic
[09:39:59] matthewd: has joined #ruby
[09:39:59] matthewd: has joined #RubyonRails-offtopic
[09:39:59] matthewd: has joined #RubyOnRails

2018-12-02

[14:06:19] matthewd: Ping timeout: 246 seconds
[14:06:35] matthewd: has joined #ruby-offtopic
[14:06:35] matthewd: has joined #ruby
[14:06:35] matthewd: has joined #RubyonRails-offtopic
[14:06:35] matthewd: has joined #RubyOnRails

2018-10-10

[01:38:04] matthewd: *.net *.split
[01:45:38] matthewd: has joined #RubyonRails-offtopic

2018-09-01

[18:18:58] matthewd: has joined #RubyonRails-offtopic
[18:18:58] matthewd: has joined #RubyOnRails
[18:18:59] matthewd: has joined #ruby-offtopic
[18:18:59] matthewd: has joined #ruby

2018-08-09

[04:32:58] matthewd: Read error: Connection reset by peer

2018-07-20

[00:07:05] matthewd: *.net *.split
[00:15:15] matthewd: has joined #RubyonRails-offtopic
[00:15:25] matthewd: has joined #RubyOnRails
[00:15:33] matthewd: has joined #ruby

2018-07-19

[05:30:30] matthewd: Ping timeout: 276 seconds
[05:35:43] matthewd: has joined #ruby
[05:35:43] matthewd: has joined #RubyonRails-offtopic
[05:35:43] matthewd: has joined #RubyOnRails

2018-07-18

[05:16:30] matthewd: *.net *.split
[05:35:19] matthewd: has joined #ruby
[05:35:20] matthewd: has joined #RubyonRails-offtopic
[05:35:20] matthewd: has joined #RubyOnRails

2018-06-21

[16:17:11] matthewd: https://github.com/rake-compiler/rake-compiler#cross-compilation---the-future-is-now
[16:17:34] matthewd: (but it's been a long time since I cared, so no idea how easy, or how current, that is)

2018-06-08

[01:49:21] matthewd: Ping timeout: 248 seconds
[01:49:37] matthewd: has joined #RubyOnRails
[01:49:38] matthewd: has joined #ruby
[01:49:38] matthewd: has joined #RubyonRails-offtopic

2018-05-29

[02:46:52] matthewd: *.net *.split
[02:47:33] matthewd: has joined #RubyonRails-offtopic
[02:47:43] matthewd: has joined #RubyOnRails
[02:47:50] matthewd: has joined #ruby

2018-04-25

[12:25:36] matthewd: *.net *.split
[12:26:59] matthewd: has joined #RubyonRails-offtopic
[12:27:14] matthewd: has joined #ruby
[12:27:31] matthewd: has joined #RubyOnRails
[15:01:05] matthewd: *.net *.split
[15:04:06] matthewd: has joined #RubyOnRails
[15:04:07] matthewd: has joined #ruby
[15:04:10] matthewd: has joined #RubyonRails-offtopic

2018-04-22

[02:04:16] matthewd: Ping timeout: 246 seconds
[02:05:53] matthewd: has joined #ruby
[02:05:53] matthewd: has joined #RubyonRails-offtopic
[02:05:53] matthewd: has joined #RubyOnRails

2018-03-26

[20:05:12] matthewd: Ping timeout: 276 seconds

2018-01-20

[23:04:27] matthewd: Ping timeout: 240 seconds
[23:05:42] matthewd: has joined #RubyOnRails
[23:05:43] matthewd: has joined #ruby-ops
[23:05:43] matthewd: has joined #ruby-offtopic
[23:05:43] matthewd: has joined #ruby-banned
[23:05:43] matthewd: has joined #ruby
[23:05:43] matthewd: has joined #RubyonRails-offtopic

2018-01-07

[20:35:03] matthewd: *.net *.split

2018-01-04

[11:41:45] matthewd: Ping timeout: 265 seconds
[11:46:21] matthewd: has joined #ruby-banned
[11:46:21] matthewd: has joined #ruby
[11:46:21] matthewd: has joined #RubyonRails-offtopic
[11:46:21] matthewd: has joined #RubyOnRails
[11:46:22] matthewd: has joined #ruby-ops
[11:46:22] matthewd: has joined #ruby-offtopic

2017-12-24

[13:26:00] matthewd: user3: The order of the comparison is significant; you probably need it the other way around
[13:26:28] matthewd: user3: `case x when y` is equivalent to `if y === x`
[13:37:50] matthewd: Nothing quite that exciting.. been busy getting up to speed at new job
[13:38:40] matthewd: Currently, a Rails upgrade; 3.2 to .. something newer
[13:39:33] matthewd: It's a good way to get a handle on the codebase while doing something I'm already familiar with ¯\_(ツ)_/¯

2017-12-21

[02:07:17] matthewd: *.net *.split
[02:08:13] matthewd: has joined #ruby-ops
[02:08:13] matthewd: has joined #ruby-offtopic
[02:08:13] matthewd: has joined #ruby-banned
[02:08:13] matthewd: has joined #ruby
[02:08:13] matthewd: has joined #RubyonRails-offtopic
[02:08:13] matthewd: has joined #RubyOnRails

2017-12-19

[07:37:01] matthewd: body && body['foo']

2017-12-04

[10:02:36] matthewd: okraits: Check config.cache_store; action_controller.perform_caching doesn't affect the low level cache
[10:06:09] matthewd: I don't recall what the defaults are, sorry. Probably?

2017-12-02

[02:47:27] matthewd: RickHull: You've thrown a bunch of code in there, but haven't managed to use many actual words
[02:48:27] matthewd: RickHull: Are you saying "this has changed behaviour; the thing that used to give a warning now raises"?
[02:49:57] matthewd: RickHull: Because yes, it does. It's the second feature listed on the release announcement.
[07:03:33] matthewd: Oh, okay. That is not at all clear from your wordless code dumps.
[07:06:08] matthewd: Personally, I think I would expect the raise when you define it in Kernel or BasicObject -- i.e., that it would raise when traversing Object, not just if it's found exactly inside Object.
[07:12:12] matthewd: The top level *is* Object
[07:12:34] matthewd: Yes, exactly
[07:14:45] matthewd: The top level constant namespace is Object
[07:14:59] matthewd: That's not redefining, it's overriding
[07:15:31] matthewd: >> module M; X = 1; end; module N; include M; X = 2; end
[07:18:10] matthewd: That is the exact documented behaviour of 2.5
[07:18:38] matthewd: I mean, that is exactly the behaviour that is identified as a feature in 2.5
[07:19:19] matthewd: ... because the above is just a slightly more verbose way of spelling `X = 1; String::X`
[07:20:10] matthewd: Yes. This is exactly what got changed.
[07:20:44] matthewd: Because ~everything subclasses Object, and everything is defined in Object. The old behaviour was confusing, because a subclass reference would always "work".
[07:21:05] matthewd: That's why it's had an aggressive warning for a while, and that's why it's now going away.
[07:22:24] matthewd: *for Object*
[07:23:01] matthewd: Object is the top level. It is not useful for its contents to be inherited like that. Because it is the top level.
[07:23:50] matthewd: We're talking about constant lookup
[07:25:20] matthewd: It's not; that's the behaviour you showed that I agreed was surprising. (And which fxn previously commented on.)
[07:27:15] matthewd: [12-02 17:36:08] <matthewd> Personally, I think I would expect the raise when you define it in Kernel or BasicObject -- i.e., that it would raise when traversing Object, not just if it's found exactly inside Object.
[07:29:42] matthewd: Yes, that particular behaviour is odd. But I think it's currently rather lost in your issue, which seems to mostly state things that are obvious to anyone who already knows how constant lookup works in principle.
[07:30:35] matthewd: Sorry, that sounds more condescending than I mean it to... I mean "for the subset of people with reasonable specialist knowledge here, there's eye-glazing before getting to the point they might in fact find surprising", not "any reasonable person should know this"
[07:31:59] matthewd: Well, it goes back to the fact that Object is the root of everything -- that's where "global" methods come from, and that's where "global" constants come from
[07:32:17] matthewd: (NB, pre-dates BasicObject)
[07:34:03] matthewd: Well it hasn't needed special rules for 20 years... it's just now being found that the lack of special rules can be confusing, because the generic rules have unfortunate overlapping implications
[07:34:53] matthewd: Or at least, it's just now being addressed by the introduction of special rules. The potential for confusion has been understood for a while.
[07:38:28] matthewd: I only recall people explicitly defining constants into Object where they specifically intended to define a top-level constant
[07:39:10] matthewd: So, I won't claim that no-one is doing so, but still... if people were getting the warning, and then they changed their code in a way that they no longer got the warning, then they're fine
[07:39:44] matthewd: If they got the warning then ignored it because they decided they knew better and that a strict reading meant it didn't actually apply to what they were doing, then that sounds too bad for them
[07:44:09] matthewd: And that's the problem here: the unreasonableness is having to be introduced, because the alternative is also disturbing
[07:44:25] matthewd: See https://bugs.ruby-lang.org/issues/11547, the OP's first comment, in fact
[07:45:10] matthewd: He sees no relationship between shugo's example and his, despite the fact the only difference between them is whether the parent is Foo vs Object
[07:49:42] matthewd: And in the OP, it finds Auth via inheritance, because Twitter < Object
[07:50:36] matthewd: Right. But that's how referencing `String` works.
[07:50:57] matthewd: `String` looks up that constant in the current scope's parents, and finds it in Object
[07:51:39] matthewd: The only thing special about Object as being top-level is the fact it has the `::Foo` special syntax
[07:52:12] matthewd: But unless you're using that leading-:: style, you're always using inheritance-based lookup
[07:53:35] matthewd: I understand your point, but I'm refuting your "now Object/toplevel is weird and special" point, by noting that a simple implementation of that idea would break all constants
[07:55:13] matthewd: Yeah. No-one should be putting constants into BasicObject, for a start.
[07:56:52] matthewd: I think modules may get trickier.. if someone explicitly does a top-level include of a module, then having that module's constants appear on every object isn't necessarily wrong
[07:57:01] matthewd: (e.g., its methods certainly do)

2017-12-01

[02:28:21] matthewd: has joined #ruby-ops
[02:28:22] matthewd: has joined #ruby-banned
[02:28:27] matthewd: has joined #ruby-offtopic
[02:28:55] matthewd: has joined #ruby
[15:47:14] matthewd: krawchyk: All dependencies are visible in the Gemfile.lock itself
[15:48:22] matthewd: Well, the Gemfile.lock tells you
[15:50:24] matthewd: It's also listed somewhere else in the file (unless something's broken)
[15:50:30] matthewd: dminuoso: o/
[15:51:33] matthewd: krawchyk: Either underneath some other top-level entry (which depends on it), or under dependencies at the bottom (meaning it's pulled in by your Gemfile explicitly)
[15:52:05] matthewd: krawchyk: So, mail appears at the "top" here: https://github.com/rails/rails/blob/master/Gemfile.lock#L308
[15:52:49] matthewd: krawchyk: That lists *its* dependencies, but there must also be some reason, in the file, for why it's included at all
[15:52:53] matthewd: In this case, we find it here: https://github.com/rails/rails/blob/master/Gemfile.lock#L55
[15:53:59] matthewd: What's strange about that? That's exactly what I described, isn't it?
[15:54:56] matthewd: Note that it's *not* a tree -- it's a two level list, showing "gem -> its dependencies"
[15:55:30] matthewd: *Why* that gem is in the list is found elsewhere -- whether it's as another dep (in this case), or an explicit reference
[15:56:10] matthewd: No worries!
[15:56:34] matthewd: Note your other option is the 'reverse dependencies' link on rubygems.org -- but that obviously tells you about all of them, not just the one(s) you have installed

2017-11-22

[11:34:55] matthewd: terens: Is there a competing suggestion/approach for you to compare & contrast? Or just general doubt?
[11:35:42] matthewd: morfin: Yes: http://rack.github.io/
[11:37:50] matthewd: morfin: I'd do it in the same migration that adds the column (or a nearby one)
[11:39:41] matthewd: morfin: Slightly more detailed reasoning: https://github.com/rails/rails/pull/31082#issuecomment-342656259
[12:28:03] matthewd: Guest90927: $1 looks like a global, but is actually a specially-scoped local.. tbh I'm actually not sure whether that's relevant in this case
[12:28:51] matthewd: Yeah, using different strings should confirm that
[12:33:27] matthewd: Oh, it must detect the arity
[12:33:32] matthewd: Add another parameter to your block

2017-11-19

[03:15:32] matthewd: habs: How does that controller relate to `Course.create({...})` ?
[03:20:19] matthewd: habs: How did you "do" Course.create({..}) ?
[03:25:52] matthewd: So you're not calling the controller at all
[03:26:06] matthewd: If you're not checking the result of create, you should call create!
[03:27:02] matthewd: Course is the model
[03:34:37] matthewd: Have you made the change I recommended?
[03:36:30] matthewd: Use create! instead of create
[03:42:30] matthewd: As I said, if you're not checking the result of `create` (which you obviously weren't), then you should call `create!`
[03:42:47] matthewd: ... because it will tell you if it fails to create for some reason, which you're now seeing
[03:43:11] matthewd: So yes, to address the problem, now that you can see it: you have a validation issue
[04:35:35] matthewd: hays: Use blocks
[04:39:08] matthewd: hays: See File
[04:40:39] matthewd: If the object goes away, its file will eventually get closed by the garbage collector anyway.. but it's better practice not to rely on that (partly just because it could be some time later)
[04:45:53] matthewd: Override the log's close to log caller to the log before it closes the log?
[04:46:00] matthewd: Yeah, `caller`
[04:51:17] matthewd: Sounds plausible -- though if things are convoluted, you might want more of the call stack
[04:54:47] matthewd: https://github.com/seattlerb/flay#flay might help in finding some of that
[06:04:45] matthewd: That's up to your database / migrations
[06:05:19] matthewd: The association tells it to *use* the attribute; whether the attribute *exists* depends on there being a suitably-named column
[06:06:09] matthewd: course_id is the default FK name for `belongs_to :course`, btw, so you don't need to specify that
[06:15:48] matthewd: I can never remember the details of the migration generator magic, but yeah that sounds right
[06:21:50] matthewd: Open the migration it generated and see what it contains
[06:24:13] matthewd: It should've told you the name of the file it created
[06:24:45] matthewd: Otherwise, look at the most recent file in db/migrate/
[06:27:27] matthewd: Right, so that's empty. You need to rollback the migrate you ran, then edit that file to tell it to add the new column
[06:28:22] matthewd: So first `rails db:rollback`
[06:31:00] matthewd: Okay, hopefully that's got you in the right place
[06:31:13] matthewd: So now you can delete one of those, and change the other to actually add the column

2017-11-18

[02:49:07] matthewd: hays_: What is your bar for reasonable?
[02:49:18] matthewd: It will do what you want, but you don't need me to tell you that
[02:51:01] matthewd: method_defined?
[02:54:13] matthewd: I wouldn't use an implementation that allocates two arrays
[03:26:05] matthewd: respond_to? would be checking the wrong thing
[03:26:45] matthewd: I personally prefer module_eval over the module keyword when reopening things, because it'll error if the thing isn't already there... but that doesn't really matter when you've already done the conditional, I guess
[03:27:21] matthewd: Right. Comparable doesn't [ever] respond_to?(:clamp)... but it does respond_to?(:method_defined?), say.
[03:28:37] matthewd: clamp! would be impossible because Comparable can't mutate its value, and Comparable can't mutate its value [partly] because many of its most popular values are always frozen
[03:38:39] matthewd: >> "ruby" <=> "JavaScript"
[03:42:34] matthewd: Mutter: If you have more specific questions, I'm sure we can be more helpful. But a full discussion comparing the syntaxes and trade-offs seems better covered by the various long-form articles that turn up in a Google search
[03:45:57] matthewd: Mutter: https://gist.github.com/baweaver/57a7c8296ca2c03effbd8fac1e7f6b40
[05:43:08] matthewd: MrCrackPotBuilde: I'm unclear what you're asking, sorry
[06:38:23] matthewd: RickHull: You get a NoMethdError, because your Foo instance doesn't have an include method
[06:40:29] matthewd: Have you defined a Foo#include elsewhere?
[06:40:54] matthewd: This is sounding like a bad idea in general, FWIW
[06:50:43] matthewd: That file isn't calling it
[06:50:57] matthewd: What did you just paste into irb?
[06:51:30] matthewd: Yes, as dminuoso said, the case isn't matching
[06:53:48] matthewd: By my count we're now three wrongs deep
[06:55:26] matthewd: Then why are you happy to include it into the class later?
[06:58:43] matthewd: I don't understand what this is doing.. too much code for me. But my gut says you need fewer classes, not more.
[07:04:31] matthewd: Still just feels like a load of code to implement a subset of Array
[07:06:39] matthewd: Why are Node and ChildNode separate?
[07:07:00] matthewd: I can see that. But why are they separate?
[07:08:07] matthewd: Isn't the whole point of a Node concept that you can treat everything equally?
[07:08:17] matthewd: Having a separate class for the root seems to undermine that
[07:10:55] matthewd: Similarly, why are Node and Tree separate? If the methods were on Node, they could naturally operate on a subtree
[07:15:13] matthewd: children.each {|c| return if c.push(v) }; children << v
[07:16:48] matthewd: I don't understand what problem this is solving. Right now, it looks like it's creating a complicated API that I wouldn't want to use, and then the implementation flows from that. How should you refactor the implementation? By changing the API.
[07:19:29] matthewd: Why are there separate Flex and non-Flex nodes?
[07:19:44] matthewd: Basically: why isn't this all one Node class?
[07:31:43] matthewd: hailey27: Does https://github.com/sparklemotion/nokogiri/issues/740#issuecomment-300370426 help?
[07:42:25] matthewd: Seems like you could do https://github.com/sparklemotion/nokogiri/blob/master/lib/nokogiri/xml/document_fragment.rb#L22-L25 for yourself
[07:43:01] matthewd: Create an empty fragment, parse as a full document, then move the children over
[07:43:59] matthewd: Alternatively, I don't know whether the ctx parameter there could be useful as an avenue to get some hints into the parser?
[07:46:04] matthewd: Given it's all the "real" documentfragment constructor seems to do, I don't think I'd even feel that bad about it :)
[07:48:36] matthewd: ACTION checks blame
[07:48:41] matthewd: Yup, checks out: https://github.com/sparklemotion/nokogiri/commit/c23eb88b2707a82bc04f807d2d043755ff503c8e
[07:49:44] matthewd: The person I assumed had written the comment :P
[07:56:11] matthewd: He's also on both the Ruby and Rails core teams
[09:34:37] matthewd: Andr3as: Use save! (and friends) if you're not checking the result of calling save (etc)
[09:38:03] matthewd: No. Use the bang unless you're checking the return value.
[10:19:58] matthewd: phedkvist: `git fetch origin; git rebase -i origin/master`, then delete all the lines that aren't yours
[10:35:58] matthewd: phedkvist: No worries! Do you happen to know how you got into that situation, btw?
[10:36:41] matthewd: I'm wondering if we have something to fix in our docs, because you're not the first person I've seen with that problem
[10:53:59] matthewd: phedkvist: Weird.. I don't immediately see where that could've gone wrong. (Though I assume it was the rebase, somehow)
[10:54:55] matthewd: megan1993: Forms are generated in views, which don't have any influence over the subsequent incoming request
[10:57:10] matthewd: megan1993: Correct. You'll probably want a separate validation on the model.
[10:58:12] matthewd: phedkvist: Ah, I thought the push was the end :) I guess the pull maybe, then

2017-11-16

[11:08:21] matthewd: It falls under the "everything that comes with it" banner
[11:10:43] matthewd: It's an important component in AR/Rails's flexiability
[11:13:46] matthewd: You may have confused me with yourself, there. But okay. Sequel is a great library, so if you're happy with that, great.
[11:15:27] matthewd: You seem to be trying very hard to pick a fight, while also trying pretty hard to throw vague insults instead of identifying concrete shortcomings
[11:16:03] matthewd: That's not going to provide a productive conversation, so it's time to call this discussion concluded
[11:16:09] matthewd: Bish: The trick is you don't have to share them
[11:20:25] matthewd: Ruby, and yes that's a stabby lambda
[11:21:29] matthewd: I don't know where you're seeing this example
[11:23:32] matthewd: Yes, it accepts both, mostly to allow using other non-proc callables. I don't have any particular reason one would use that form with a proc directly.
[11:24:09] matthewd: dminuoso: In this context, as a parameter to after_create
[11:24:57] matthewd: My guess would be that David's just unused to using that form, because he's more likely to use a symbol + a method