Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't load Spring, just check if it is already loaded #510

Closed
runephilosof-abtion opened this issue Sep 17, 2024 · 0 comments · Fixed by #511
Closed

Don't load Spring, just check if it is already loaded #510

runephilosof-abtion opened this issue Sep 17, 2024 · 0 comments · Fixed by #511

Comments

@runephilosof-abtion
Copy link
Contributor

Steps to reproduce

dotenv-rails loads Spring.

require "spring/commands"

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

It would be nice if dotenv-rails instead checks defined?(Spring).

# Gemfile
gem 'rails'
gem 'dotenv-rails'
gem 'spring', require: false

Expected behavior

bundle exec rails runner 'puts defined?(Spring)' should output nothing

Actual behavior

bundle exec rails runner 'puts defined?(Spring)' outputs constant

System configuration

dotenv version: 3.1.2
Rails version: 7.1.4
Ruby version: 3.3.3

runephilosof-abtion added a commit to runephilosof-abtion/dotenv that referenced this issue Sep 17, 2024
This makes it possible for the user to selectively use Spring on a command to command basis

Fixes bkeepers#510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant