andrewray

Activity Graph

Page 1 of 3 | Next »

2019-02-28

[01:36:33] andrewray: has joined #RubyOnRails
[01:37:14] andrewray: Has anyone set up an api user (with token based auth, not username/pass) in a rails app that's normally done with devise?
[02:02:03] andrewray: Ping timeout: 256 seconds

2019-02-14

[00:46:46] andrewray: I think the conclusion of this deep dive is that rails autoloading is the worst thing since my son
[01:57:34] andrewray: rails autoloading is a leaky abstraction and the abstraction is a toilet
[01:57:50] andrewray: not surprised coming from the author who made a module named "concern" that's a mixin
[02:02:19] andrewray: Ping timeout: 256 seconds
[18:09:00] andrewray: has joined #RubyOnRails
[19:05:43] andrewray: Ping timeout: 256 seconds

2019-02-13

[00:21:19] andrewray: has joined #RubyOnRails
[00:21:38] andrewray: when developing a local gem that i'm including in a rails app, how do I ensure the gem source code automatically reloads in the rails app?
[02:35:17] andrewray: Ping timeout: 256 seconds
[18:09:13] andrewray: has joined #RubyOnRails
[18:09:26] andrewray: https://stackoverflow.com/a/12117203/743464 seems to semi-work for allowing auto reloading of locally developed gems in a rails app
[18:09:46] andrewray: rails's file watcher abstraction is 1 leaky boy
[18:36:29] andrewray: rails irc is dead I just post here to scream into the void
[18:36:45] andrewray: I added a constant to rails explicitly_unloadable_constants and I think it works the first time the app loads
[18:36:49] andrewray: but on reloads I get the error
[18:37:05] andrewray: LoadError (Unable to autoload constant NameSpace::Module, expected /Users/user/repo/gems/namespace-gem/lib/file.rb - but that file exists and does define the constant it complains about
[18:43:25] andrewray: who thought autoloading was a good idea
[19:18:52] andrewray: sprockets is a non-transferrable rails specific thing
[19:30:11] andrewray: Ping timeout: 256 seconds
[19:56:57] andrewray: has joined #RubyOnRails
[19:57:12] andrewray: whyyy is rails autoloading non-deterministic nonsense
[22:15:39] andrewray: Ping timeout: 256 seconds
[22:21:39] andrewray: has joined #RubyOnRails
[22:21:43] andrewray: what causes rails to unload a constant?
[22:24:32] andrewray: could I log when a constant is loaded/unloaded?
[22:30:24] andrewray: I see rails ActiveSupport::Dependencies.autoloaded_constants contains my constant
[22:30:37] andrewray: but then the next line that references it dies with LoadError (Unable to autoload constant...)
[23:04:24] andrewray: TIL rails autoloading eats thousands of exceptions and raises an empty one https://github.com/rails/rails/blob/7d7372c14df4ad5b546f012a82538753c5991905/activesupport/lib/active_support/dependencies.rb#L386
[23:04:31] andrewray: truly pinnacle of SE
[23:21:30] andrewray: wow what those exceptions are all "cannot load such file" and that's how it checks??

2019-02-04

[18:43:39] andrewray: has joined #RubyOnRails
[19:43:15] andrewray: I have a grape api mounted inside a rails engine. I can get the engine to reload, but not the grape API. has anyone dealt with this nightmare?
[20:01:41] andrewray: Ping timeout: 256 seconds
[20:18:19] andrewray: has joined #RubyOnRails
[20:18:22] andrewray: havenwood: in my engine routes I have mount MyEngine::API => 'path'. when I change api.rb, it does not reload the change
[20:19:05] andrewray: I'm using this hacky solution in my main app, which works for the main app grape api. https://github.com/ruby-grape/grape/issues/131#issuecomment-10413342
[20:19:52] andrewray: but it doesn't work when I include that in an initializer in my rails engine. the fileUpdaterCheck block *is* called when I change the api file, but the change isn't reflected in the API when I load the page
[20:20:19] andrewray: havenwood: yeah i'm struggin with why that's not working in the engine
[20:23:15] andrewray: In my engine, I can see that callback getting called, and Rails.application.reload_routes! is execurting
[20:25:44] andrewray: I can see my Engine.routes.draw block being called again when I change the grape API file
[20:25:54] andrewray: so the mount API is getting called again I assume
[20:26:17] andrewray: but what I don't see is my api.rb file itself getting re-executed
[20:32:28] andrewray: My grape api file lives in lib/api/file.rb
[20:32:39] andrewray: I have Engine.root/lib/api added to autoload_paths
[20:39:54] andrewray: ok, this is weird, new grape api paths I add in the file do auto reload
[20:39:57] andrewray: but existing ones don't
[20:48:07] andrewray: ah, it was ActiveSupport::Dependencies.explicitly_unloadable_constants that was missing
[20:48:19] andrewray: auto reloading is not a well designed feature in rails :P
[20:54:30] andrewray: all I had to do was rtm
[21:19:27] andrewray: hmm now i'm getting "LoadError (Unable to autoload constant MyEngine::API, expected /file/path/api.rb to define it" - but that file path exists and does define that module with the correct namespace
[21:20:29] andrewray: what's weird is that the file path it points to exists and does define the thing. the logging I have at the top of that file never executes
[21:21:20] andrewray: that same constant loads fine inside the file itself..
[21:43:24] andrewray: what I wouldn't give for a sane require system with statically analyzable file resolution like all other dynamic language ecosystems have mature to :P
[23:37:01] andrewray: Ping timeout: 256 seconds

2019-02-02

[00:36:15] andrewray: Ping timeout: 256 seconds

2019-02-01

[23:37:27] andrewray: has joined #RubyOnRails
[23:38:24] andrewray: I have a Grape api mounted at /api in my routes.rb. I'm also trying to mount a Rails Engine, which itself contains a Grape API, at the same parent namespace
[23:38:33] andrewray: as in mount Parent::Grape::API => '/api' and mount RailsEngine::Engine, at: '/api'
[23:39:23] andrewray: can those both coexist? when I run rake routes in parent app, I don't see the mounted Grape API inside the Engine making URLs

2019-01-26

[04:30:54] andrewray: has joined #RubyOnRails
[07:31:49] andrewray: Quit: andrewray

2019-01-25

[08:00:03] andrewray: Quit: andrewray
[16:58:50] andrewray: has joined #RubyOnRails
[17:54:45] andrewray: Quit: andrewray

2019-01-24

[03:37:56] andrewray: has joined #RubyOnRails

2019-01-23

[03:00:36] andrewray: Quit: andrewray
[05:22:55] andrewray: has joined #RubyOnRails
[08:11:39] andrewray: Quit: andrewray
[17:38:53] andrewray: has joined #RubyOnRails
[18:28:53] andrewray: Quit: andrewray

2019-01-22

[02:12:11] andrewray: does a gem's name have nothing to do with requiring it?
[08:19:41] andrewray: Quit: andrewray
[16:04:51] andrewray: has joined #RubyOnRails

2019-01-21

[03:18:46] andrewray: because it's correct normalization to put the fk on the "child"
[07:43:00] andrewray: Quit: andrewray
[19:04:03] andrewray: has joined #RubyOnRails
[21:43:45] andrewray: when writing a gem, why use autoload instead of explicitly requiring a sub module/class ?
[21:47:04] andrewray: wait, autoload is being deprecated?!?!? oh thank god
[21:47:15] andrewray: I thought ruby was unsalvagable

2019-01-20

[04:05:12] andrewray: has joined #RubyOnRails
[04:22:14] andrewray: Quit: andrewray
[04:26:11] andrewray: has joined #RubyOnRails
[05:50:48] andrewray: Software Engineering: "Separation of concerns is important!"
[05:51:03] andrewray: Ruby on Rails: "Say no more! I have a module called Concern!"
[05:51:13] andrewray: SE: "That's not what I... jesus, what?"
[05:51:31] andrewray: RoR: "And it's a mixin! That you mix in to your own module! And that itself becomes a mixin! And it's all metaprogramming!"
[07:14:48] andrewray: Quit: andrewray
[17:40:08] andrewray: has joined #RubyOnRails
[19:30:28] andrewray: Quit: andrewray
[19:43:00] andrewray: has joined #RubyOnRails
[23:42:08] andrewray: rails's design is bonkers, but there's probably zero math knowledge required to build a simple website
[23:45:02] andrewray: you can build a static web page with html and css, and the use that as a template for any web framework, including rails, yes

2018-12-17

[00:04:00] andrewray: Quit: Page closed

2018-12-16

[22:27:53] andrewray: has joined #ruby
[22:28:16] andrewray: I want to make a custom rspec matcher so I can do expect { x() }.to do_my_thing <- but having trouble definining do_my_thing
[22:28:47] andrewray: oh wait maybe it's https://relishapp.com/rspec/rspec-expectations/docs/custom-matchers/define-a-matcher-supporting-block-expectations
[22:41:25] andrewray: but I can't figure out how to do expect{a}.to raise_error().or *not* eq(some_thing)
[22:41:34] andrewray: is there a .or_not ?
[22:42:22] andrewray: I want to verify something either raises an error, *or* doesn't match some condition
[23:09:40] andrewray: I'm doing `RSpec::Matchers.define_negated_matcher :not_eq, :eq` but it's not letting me `expect{a}.to raise_error().or not_eq('yyy')`
[23:13:04] andrewray: rspec dsl so funky

2018-12-14

[01:22:03] andrewray: Ping timeout: 256 seconds

2018-12-13

[19:22:50] andrewray: has joined #ruby
[19:23:44] andrewray: I'm trying to put a nested gem in my project (subfolder with a gemspec), and i'm trying to run specs from the root of the project
[19:24:50] andrewray: when i run the specs in the gem folder from root, rspec starts, but it complains when I try to provide a config option that comes from another rspec plugin gem
[19:25:25] andrewray: and i'm not sure why it's not loading the rspec plugin when I run rspec from the root
[19:26:53] andrewray: it's loading the .rspec file from the root, and executing the root's gemfile
[20:18:53] andrewray: Ping timeout: 256 seconds
[20:37:44] andrewray: has joined #ruby
[21:12:05] andrewray: I have a root level gems/ folder which contains gem source codes, including gemname.gemspec files
[21:12:34] andrewray: when I try to run specs inside those folders, from the root level of the project (with rspec) - rspec executes, but an rspec dependency defined in the *root* level gemfile does not load
[21:13:23] andrewray: and the rspec config fails to fully execute, blocking the test run. Does executing a spec (with bundle exec rspec gems/project/spec/my_spec.rb) from outside that folder, do something with gem context?
[21:13:46] andrewray: the root level Gemfile is getting executed, including the `gem 'rspec-dependnecy'` line
[21:14:11] andrewray: does having the child folder Gemfile do something different?
[21:20:47] andrewray: havenwood: if my top level project has a Gemfile (but no gemspec) - can I execute code in a subfolder that has subfolder/Gemfile and subfolder/project.gemspec ?
[21:25:59] andrewray: havenwood: that's what i'm doing in my root Gemfile, i'm calling gem 'myproject', path: './myproject' and that part seems to be working
[21:30:54] andrewray: havenwood: i'm using the full path for the path. my root level Gemfile has 'rspec' and 'rspec-retry', and when it gets into the spec itself in the nested folder, it tries to do Rspec.configure |c| c.retry_key = true
[21:31:16] andrewray: and fails because the retry_key provided by rspec-retry doesn't seem to be getting loaded
[21:35:36] andrewray: hmmm, when it executes the child folder's project.gemspec file, it doesn't have Rspec in there, at least I can't run rspec.configure
[21:37:16] andrewray: I'm trying to follow this pattern https://medium.com/@dan_manges/the-modular-monolith-rails-architecture-fb1023826fc4 but don't understand how they have the tests set up
[21:56:39] andrewray: ah, my sub gem spec run isn't loading rails's boot.rb
[21:56:43] andrewray: which does some magic garbo
[22:17:49] andrewray: oh, maybe it's not boot.rb

2018-12-12

[17:38:19] andrewray: has joined #RubyOnRails
[17:38:46] andrewray: Is it possible to see the sprockets manifest in a rails console?
[17:38:58] andrewray: looks like it's an instantiated class but im' not sure where it lives
[18:06:23] andrewray: Ping timeout: 256 seconds

2018-12-06

[02:03:41] andrewray: has joined #RubyOnRails
[02:03:58] andrewray: Is this redundant? File.open(Tempfile.new())
[02:18:42] andrewray: I'm calling file.close then File.delete(file) and I'm getting this answer
[02:18:45] andrewray: has joined #ruby
[02:18:59] andrewray: Is this redundant? File.open(Tempfile.new())
[02:19:15] andrewray: I'm calling file.close then File.delete(file) on the resulting file, and I'm getting this error
[02:19:20] andrewray: Errno::ENOENT: No such file or directory @ apply2files IOError: not opened for reading
[02:58:46] andrewray: lol why are ruby core docs like this
[02:59:06] andrewray: showing me 10 years old versions by default
[03:15:03] andrewray: Ping timeout: 256 seconds

2018-07-13

[00:02:54] andrewray: Ping timeout: 252 seconds
[02:15:53] andrewray: has joined #RubyOnRails
[03:22:37] andrewray: Quit: andrewray
[03:23:06] andrewray: has joined #RubyOnRails
[03:23:24] andrewray: Client Quit
[03:23:56] andrewray: has joined #RubyOnRails
[03:24:10] andrewray: Client Quit
[16:25:09] andrewray: has joined #RubyOnRails
[16:25:12] andrewray: Client Quit

2018-07-12

[05:02:43] andrewray: has joined #RubyOnRails
[06:55:28] andrewray: Quit: andrewray
[16:21:27] andrewray: has joined #RubyOnRails
[17:13:59] andrewray: Quit: andrewray
[17:24:06] andrewray: has joined #RubyOnRails
[17:31:12] andrewray: Quit: andrewray
[17:34:17] andrewray: has joined #RubyOnRails
[18:35:33] andrewray: Quit: andrewray
[18:36:03] andrewray: has joined #RubyOnRails
[18:36:19] andrewray: Client Quit
[18:36:51] andrewray: has joined #RubyOnRails
[18:37:06] andrewray: Client Quit
[18:37:38] andrewray: has joined #RubyOnRails
[18:37:52] andrewray: Client Quit
[18:38:23] andrewray: has joined #RubyOnRails
[18:38:38] andrewray: Client Quit
[18:39:12] andrewray: has joined #RubyOnRails
[18:39:25] andrewray: Client Quit
[18:39:55] andrewray: has joined #RubyOnRails
[18:40:11] andrewray: Client Quit
[18:40:42] andrewray: has joined #RubyOnRails
[18:40:57] andrewray: Client Quit
[23:18:13] andrewray: has joined #RubyOnRails
[23:18:35] andrewray: What happens if you both javascript_include_tag jquery, and in another manifest file, //= require jquery ?

2018-07-11

[02:34:13] andrewray: has joined #RubyOnRails
[02:45:57] andrewray: I like ruby because it's literally impossible to tell if a variable, method, module, or class, is defined until your program executes. it's exciting
[02:46:07] andrewray: *and* it depends on the order! your program executes in
[02:46:37] andrewray: I think(?) it's the only dynamic language that has this excitement. every other dynamic language i've wored in has a static analysis tool that can determine if a variable is defined before the program executes
[02:55:12] andrewray: I can't begin to describe how happy I am knowing that things like these are core rails RUNTIME errors https://github.com/rails/rails/blob/9480618f06ada9e06e8c95ca85d6242debad693a/activesupport/lib/active_support/dependencies.rb#L491 that are almost undebuggable
[02:56:13] andrewray: it's cool that ruby is so flexible and core designed to elude static analysis, and the book Eloquent Ruby has three chapters on how to use "method_missing?" making it impossible to remotely know if your program is correct until execution
[02:56:47] andrewray: I really enjoy renaming a method in a module having no idea if was ever called or will ever be called again, and having the definition of that method change based on the order in which people navigate my rails app
[02:57:17] andrewray: i like that I can't do explicit imports and everything is magically global in the current namespace, which is different than any other dynamic language
[02:57:48] andrewray: I like that "fat models" is the "solution" to MVC
[02:58:13] andrewray: sevenseacat: I don't think my opinion matters, I'm 15 years late to a party that won't change
[02:58:57] andrewray: that's not gonna stop me from ranting
[03:17:18] andrewray: it is, I just wish companies I liked didn't turn to rails first because of the speed of early development and lock in to all of these problems
[03:22:10] andrewray: I wish rails wasn't built on memorizing conventions when all I want is a function that takes regular arguments
[03:31:11] andrewray: some places I want to work are locked in to it
[03:31:49] andrewray: I wish we would recognize basecamp isn't a good example of a monolith, and stop using it as an exemplary rails application
[03:36:02] andrewray: I don't get how sorbet can add static type checking to a langauge where even class definitions are runtime Class.new
[06:30:18] andrewray: Quit: andrewray
[16:11:36] andrewray: has joined #RubyOnRails
[17:03:03] andrewray: Quit: andrewray
[17:13:11] andrewray: has joined #RubyOnRails
[17:16:56] andrewray: Client Quit
[17:17:26] andrewray: has joined #RubyOnRails
[17:17:43] andrewray: Client Quit
[17:18:06] andrewray: has joined #RubyOnRails
[17:18:29] andrewray: Client Quit
[17:19:01] andrewray: has joined #RubyOnRails
[17:19:16] andrewray: Client Quit
[17:19:46] andrewray: has joined #RubyOnRails
[17:20:03] andrewray: Client Quit

2018-07-02

[00:22:01] andrewray: Quit: andrewray
[00:28:54] andrewray: has joined #RubyOnRails
[01:22:37] andrewray: Quit: andrewray
[01:37:29] andrewray: has joined #RubyOnRails
[01:58:57] andrewray: Ping timeout: 240 seconds
[01:59:35] andrewray: has joined #RubyOnRails
[02:14:25] andrewray: Ping timeout: 245 seconds

2018-07-01

[22:52:06] andrewray: has joined #RubyOnRails
[22:52:47] andrewray: I feel frustrated reading the rails guides, because they seem to be haphazardly written and little effort put in for readability, especially for newcomers to the conventions
[22:53:11] andrewray: pull requests accepted, I understand, but I'm curious if anyone else has felt this way? for example http://guides.rubyonrails.org/routing.html - reading this top to bottom has been surprisingly painful for me
[23:36:44] andrewray: "1.2 Generating Paths and URLs from Code" does not clearly point out what is actually being generated and what "this" is when "reducing britleness" - lots of things like this where no attempt is made to help the newcomer. I only know it's refering to `patient_path` from convention
[23:37:11] andrewray: "2 Resource Routing: the Rails Default" - never attempts to explain what a "resource" is
[23:37:54] andrewray: "resource :geocoder
[23:37:55] andrewray: resolve('Geocoder') { [:geocoder] }" - never explains what that random second resolve() line is doing
[23:38:56] andrewray: could really use an introduction to rails convention here, saying that instead of regular method defintions you can easily follow, rails is built on naming conventions you must memorize, like snake_case_name_path(thing)
[23:41:40] andrewray: noooo Radar I don't want the answers to these questions, these are just general examples of how I wish the docs were explicit about what they were describing
[23:42:40] andrewray: they seem more like api-ish docs than guides you read top to bottom, which isn't clear from "rails guides"
[23:47:31] andrewray: to me it reads like wikipedia, lots of disjoint editing with no attempt at narrative / flow
[23:54:15] andrewray: The order is strange to me, for example "Rails would dispatch that request to the destroy action on the photos controller" happens *before* they explain what the resources method does
[23:56:14] andrewray: I think I suffer from cognitive disconnect between the site name "Rails Guides", the title "Rails Routing from the Outside In", and the reality that it's more of a top-to-bottom api doc than an intro guide.
[23:56:28] andrewray: even something like a page layout with a sticky sidebar for each section would help make it obvious this is more of a topic-by-topic coverage than my mental model of a "guide"

2018-06-19

[01:37:24] andrewray: has joined #ruby
[01:51:41] andrewray: Ping timeout: 260 seconds
[01:56:55] andrewray: has joined #ruby
[02:31:41] andrewray: Quit: andrewray
[02:43:24] andrewray: has joined #ruby
[03:04:14] andrewray: Quit: andrewray
[05:00:59] andrewray: has joined #ruby
[05:48:53] andrewray: Quit: andrewray

2018-06-18

[19:42:12] andrewray: has joined #ruby
[19:46:30] andrewray: Hello. I feel frustrated writing ruby, because the adopted design patterns are all pseudo-OO, when it seems like only using functions/lambdas is possible, but not explored
[19:46:56] andrewray: are there any articles or mentalities that explore a non-OO approach to ruby, like other dynamic languages have adopted? Or should I give up my dream and acknowledge that OO is the "ruby way"
[19:47:59] andrewray: havenwood: hmm, the first example dry gem http://dry-rb.org/gems/dry-auto_inject/ is a class mixin, and I want to avoid both classes and mixins :P
[19:48:48] andrewray: but I also want a thinkpiece on if this is possible and scalable in ruby. there's some fundamental issues with the language that I suspect would make it difficult, but I don't have enough experience to make a judgement call
[19:49:14] andrewray: havenwood: understood, I'm not aiming for pure FP (and don't have any pure fp experience)
[19:50:50] andrewray: this question is also specific to a rails ecosystem, where i'm also wondering if I can do anything to structure the app that's not class-hard-baked 24/7. it's already difficult because models are central to everything
[19:51:53] andrewray: I don't have immutable data, I have a "thing" that knows how to update itself, what its connected to, how to manipulate and mutate itself, and I'm frustrated that the design patterns around models don't consider making a model just data
[19:56:09] andrewray: thank you havenwood and dminuoso this is something to explore. i'm still unclear if I can write closer-to-explicit-functions-everywhere especially in a rails ecosystem, or if I should bolster on an anti-class mentality wherever I can, and acknowledge that there are some things I can't change
[20:15:28] andrewray: Quit: andrewray
[20:43:01] andrewray: has joined #ruby
[21:32:09] andrewray: Quit: andrewray

2018-06-12

[01:54:24] andrewray: has joined #RubyOnRails
[01:54:24] andrewray: has joined #ruby
[01:56:55] andrewray: Client Quit

2018-06-11

[16:44:25] andrewray: Quit: andrewray