Skip to content

Commit 5ff19c5

Browse files
Introduce ./bin/rails to fix broken test runner (#1139)
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
1 parent 5a6b6e4 commit 5ff19c5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

bin/rails

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env ruby
2+
# This command will automatically be run when you run "rails" with Rails gems
3+
# installed from the root of your application.
4+
5+
ENGINE_ROOT = File.expand_path("..", __dir__)
6+
APP_PATH = File.expand_path("../test/dummy/config/application", __dir__)
7+
8+
# Set up gems listed in the Gemfile.
9+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
10+
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
11+
12+
require "rails/all"
13+
require "rails/engine/commands"

0 commit comments

Comments
 (0)