Skip to content

Commit

Permalink
Introduce ./bin/rails to fix broken test runner (#1139)
Browse files Browse the repository at this point in the history
This is a work around for an [issue][] with `vim-test`. Borrowed an
[existing][] `./bin/rails` configuration from an [Engine][], which is
very similar to a [plugin][]. The only difference is that we do not need
the `ENGINE_ROOT` setting.

[issue]: vim-test/vim-test#477
[existing]: https://github.com/rails/rails/blob/main/railties/lib/rails/generators/rails/plugin/templates/bin/rails.tt
[Engine]: https://guides.rubyonrails.org/engines.html
[plugin]: https://guides.rubyonrails.org/plugins.html
  • Loading branch information
stevepolitodesign authored Nov 9, 2023
1 parent 5a6b6e4 commit 5ff19c5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENGINE_ROOT = File.expand_path("..", __dir__)
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)

# Set up gems listed in the Gemfile.
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])

require "rails/all"
require "rails/engine/commands"

0 comments on commit 5ff19c5

Please sign in to comment.