Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only include url_helpers in Preview class when they are defined (#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) ```
- Loading branch information