lumi-api/bin/spring

16 lines
524 B
Text
Raw Permalink Normal View History

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