File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
require "dotenv"
2
2
3
- # Fix for rspec rake tasks loading in development
3
+ # Fix for rake tasks loading in development
4
4
#
5
5
# Dotenv loads environment variables when the Rails application is initialized.
6
6
# When running `rake`, the Rails application is initialized in development.
9
9
#
10
10
# See https://github.com/bkeepers/dotenv/issues/219
11
11
if defined? ( Rake . application )
12
- if Rake . application . top_level_tasks . grep ( /^(parallel:spec|spec(:|$))/ ) . any?
13
- Rails . env = ENV [ "RAILS_ENV" ] ||= "test"
12
+ task_regular_expression = /^(default$|parallel:spec|spec(:|$))/
13
+ if Rake . application . top_level_tasks . grep ( task_regular_expression ) . any?
14
+ environment = Rake . application . options . show_tasks ? "development" : "test"
15
+ Rails . env = ENV [ "RAILS_ENV" ] ||= environment
14
16
end
15
17
end
16
18
You can’t perform that action at this time.
0 commit comments