bookstore/bin/spring

17 lines
525 B
Text
Raw Normal View History

2021-03-19 17:31:38 +02:00
#!/usr/bin/env ruby
2021-03-22 03:16:29 +01:00
# frozen_string_literal: true
if !defined?(Spring) && [nil, 'development', 'test'].include?(ENV['RAILS_ENV'])
gem 'bundler'
require 'bundler'
2021-03-19 17:31:38 +02:00
# Load Spring without loading other gems in the Gemfile, for speed.
2021-03-22 03:16:29 +01:00
Bundler.locked_gems&.specs&.find { |spec| spec.name == 'spring' }&.tap do |spring|
2021-03-19 17:31:38 +02:00
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
2021-03-22 03:16:29 +01:00
gem 'spring', spring.version
require 'spring/binstub'
2021-03-19 17:31:38 +02:00
rescue Gem::LoadError
# Ignore when Spring is not installed.
end
end