Closed runephilosof-abtion closed 2 months ago
dotenv-rails loads Spring. https://github.com/bkeepers/dotenv/blob/b86d9e4c23a9f1bc83f8853f6a1b244449c65cd0/lib/dotenv/rails.rb#L14
I like to have spring in my projects' Gemfiles with require: false and only have Spring loaded when I manually choose to use it, by running something like bin/spring rspec spec/models
require: false
bin/spring rspec spec/models
It would be nice if dotenv-rails instead checks defined?(Spring).
defined?(Spring)
# Gemfile gem 'rails' gem 'dotenv-rails' gem 'spring', require: false
bundle exec rails runner 'puts defined?(Spring)' should output nothing
bundle exec rails runner 'puts defined?(Spring)'
bundle exec rails runner 'puts defined?(Spring)' outputs constant
constant
dotenv version: 3.1.2 Rails version: 7.1.4 Ruby version: 3.3.3
Steps to reproduce
dotenv-rails loads Spring. https://github.com/bkeepers/dotenv/blob/b86d9e4c23a9f1bc83f8853f6a1b244449c65cd0/lib/dotenv/rails.rb#L14
I like to have spring in my projects' Gemfiles with
require: false
and only have Spring loaded when I manually choose to use it, by running something likebin/spring rspec spec/models
It would be nice if dotenv-rails instead checks
defined?(Spring)
.Expected behavior
bundle exec rails runner 'puts defined?(Spring)'
should output nothingActual behavior
bundle exec rails runner 'puts defined?(Spring)'
outputsconstant
System configuration
dotenv version: 3.1.2 Rails version: 7.1.4 Ruby version: 3.3.3