mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
I observed a significant speed-up on the second run. The first run seems to be a lot slower though. Additional output suggests that it's now loading the Rails environment which it doesn't do without spring. ``` time bundle exec rubocop Gemfile 0m2.496s time rubocop Gemfile # not always right version 0m1.999s time ./bin/rubocop Gemfile 0m7.543s time ./bin/rubocop Gemfile 0m0.670s ```
15 lines
494 B
Ruby
Executable File
15 lines
494 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
# This file loads Spring without loading other gems in the Gemfile in order to be fast.
|
|
# It gets overwritten when you run the `spring binstub` command.
|
|
|
|
if !defined?(Spring) && [nil, "development", "test"].include?(ENV["RAILS_ENV"])
|
|
require "bundler"
|
|
|
|
Bundler.locked_gems.specs.find { |spec| spec.name == "spring" }&.tap do |spring|
|
|
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
|
|
gem "spring", spring.version
|
|
require "spring/binstub"
|
|
end
|
|
end
|