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

Only include url_helpers in Preview class when they are defined #1795

Merged

Conversation

rmacklin
Copy link
Collaborator

@rmacklin rmacklin commented Jul 7, 2023

What are you trying to accomplish?

Addresses #1765 (comment)

Without this, we encounter the following error when running bundle exec rake docs:build:

Converting YARD documentation to Markdown files.
rake aborted!
NoMethodError: undefined method `routes' for nil:NilClass
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:7:in `<class:Preview>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:6:in `<module:ViewComponent>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:5:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `block (2 levels) in <top (required)>'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `load'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `<main>'
Tasks: TOP => docs:build
(See full trace by running task with --trace)

Without this, we encounter the following error when running
`bundle exec rake docs:build`:

```
Converting YARD documentation to Markdown files.
rake aborted!
NoMethodError: undefined method `routes' for nil:NilClass
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:7:in `<class:Preview>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:6:in `<module:ViewComponent>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:5:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `block (2 levels) in <top (required)>'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `load'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `<main>'
Tasks: TOP => docs:build
(See full trace by running task with --trace)
```
@rmacklin rmacklin force-pushed the only-include-route-helpers-when-they-are-defined branch from 21c98b3 to 40fd68a Compare July 7, 2023 21:34
@joelhawksley joelhawksley merged commit 0d6564a into main Jul 8, 2023
@joelhawksley joelhawksley deleted the only-include-route-helpers-when-they-are-defined branch July 8, 2023 01:39
claudiob pushed a commit to claudiob/view_component that referenced this pull request Dec 22, 2023
…Component#1795)

Without this, we encounter the following error when running
`bundle exec rake docs:build`:

```
Converting YARD documentation to Markdown files.
rake aborted!
NoMethodError: undefined method `routes' for nil:NilClass
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:7:in `<class:Preview>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:6:in `<module:ViewComponent>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:5:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `block (2 levels) in <top (required)>'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `load'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `<main>'
Tasks: TOP => docs:build
(See full trace by running task with --trace)
```
claudiob pushed a commit to claudiob/view_component that referenced this pull request Jan 3, 2024
…Component#1795)

Without this, we encounter the following error when running
`bundle exec rake docs:build`:

```
Converting YARD documentation to Markdown files.
rake aborted!
NoMethodError: undefined method `routes' for nil:NilClass
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:7:in `<class:Preview>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:6:in `<module:ViewComponent>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/preview.rb:5:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/lib/view_component/base.rb:11:in `<top (required)>'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `require'
/Users/rmacklin/src/github.com/ViewComponent/view_component/Rakefile:81:in `block (2 levels) in <top (required)>'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `load'
/Users/rmacklin/.asdf/installs/ruby/2.7.5/bin/bundle:23:in `<main>'
Tasks: TOP => docs:build
(See full trace by running task with --trace)
```
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 this pull request may close these issues.

2 participants