Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bin/rails routes: Propshaft::Server emits a lot of noise #37

Closed
ntl opened this issue Dec 1, 2021 · 1 comment · Fixed by #38
Closed

bin/rails routes: Propshaft::Server emits a lot of noise #37

ntl opened this issue Dec 1, 2021 · 1 comment · Fixed by #38

Comments

@ntl
Copy link
Contributor

ntl commented Dec 1, 2021

This is more of a "polish" kind of issue, but bin/rails routes inspects Propshaft::Server when it prints out the /assets entry:

rails-routes-propshaft-example

If Propshaft::Server is a singleton, perhaps the output should just be Propshaft::Server, which would look like this:

           Prefix Verb URI Pattern        Controller#Action
                       /assets            Propshaft::Server
          widgets GET  /widgets(.:format) widgets#index

I'd be happy to submit a PR, but I'm not sure whether implementing #inspect on Propshaft::Server is an ideal solution in this case, since #inspect is useful in many other scenarios besides the Rails route inspector.

Here is the relevant code in the route inspector: #37

Side note: Engines/Railties don't appear to have this problem, since the route inspector ends up calling inspect on the classes, rather than instances.

@dhh
Copy link
Member

dhh commented Dec 2, 2021

I think it's fine to change #inspect to be less noisy for this purpose 👍

ntl added a commit to ntl/propshaft that referenced this issue Dec 2, 2021
The Rails route inspector (typically invoked via `bin/rails routes`)
uses `#inspect` to print the action associated with routes that mount
Rack applications. The output now looks like this:

```
     Prefix Verb URI Pattern        Controller#Action
                 /assets            Propshaft::Server
    widgets GET  /widgets(.:format) widgets#index
```

Resolves rails#37
@dhh dhh closed this as completed in #38 Dec 2, 2021
dhh pushed a commit that referenced this issue Dec 2, 2021
* Propshaft::Server#inspect

The Rails route inspector (typically invoked via `bin/rails routes`)
uses `#inspect` to print the action associated with routes that mount
Rack applications. The output now looks like this:

```
     Prefix Verb URI Pattern        Controller#Action
                 /assets            Propshaft::Server
    widgets GET  /widgets(.:format) widgets#index
```

Resolves #37

* Automated test for Propshaft::Server#inspect is removed
brenogazzola pushed a commit that referenced this issue Dec 4, 2021
* Propshaft::Server#inspect

The Rails route inspector (typically invoked via `bin/rails routes`)
uses `#inspect` to print the action associated with routes that mount
Rack applications. The output now looks like this:

```
     Prefix Verb URI Pattern        Controller#Action
                 /assets            Propshaft::Server
    widgets GET  /widgets(.:format) widgets#index
```

Resolves #37

* Automated test for Propshaft::Server#inspect is removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants