diff --git a/.gitignore b/.gitignore index d66cc4ac..e1c39ba2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,10 @@ config/settings/*.local.yml config/environments/*.local.yml config/secrets.yml +# ignore local crt and key file for self signed ssl +config/localhost.crt +config/localhost.key + # Ignore RubyMine files .idea/* .DS_Store diff --git a/bin/rails b/bin/rails index 9d86a132..bfa551b6 100644 --- a/bin/rails +++ b/bin/rails @@ -1,7 +1,8 @@ #!/usr/bin/env ruby.exe begin - load File.expand_path("../spring", __FILE__) -rescue LoadError + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' diff --git a/bin/rake b/bin/rake index 19a971d5..92a626e8 100644 --- a/bin/rake +++ b/bin/rake @@ -1,7 +1,8 @@ #!/usr/bin/env ruby.exe begin - load File.expand_path("../spring", __FILE__) -rescue LoadError + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') end require_relative '../config/boot' require 'rake' diff --git a/bin/rspec b/bin/rspec index 20060ebd..6e670921 100755 --- a/bin/rspec +++ b/bin/rspec @@ -1,7 +1,8 @@ #!/usr/bin/env ruby begin - load File.expand_path("../spring", __FILE__) -rescue LoadError + load File.expand_path('../spring', __FILE__) +rescue LoadError => e + raise unless e.message.include?('spring') end require 'bundler/setup' load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/spring b/bin/spring index 5e7ecc47..d89ee495 100755 --- a/bin/spring +++ b/bin/spring @@ -1,15 +1,17 @@ #!/usr/bin/env ruby -# This file loads spring without using Bundler, in order to be fast. +# This file loads Spring without using Bundler, in order to be fast. # It gets overwritten when you run the `spring binstub` command. unless defined?(Spring) - require "rubygems" - require "bundler" + require 'rubygems' + require 'bundler' - if (match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)) - Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq } - gem "spring", match[1] - require "spring/binstub" + lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read) + spring = lockfile.specs.detect { |spec| spec.name == 'spring' } + if spring + Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path + gem 'spring', spring.version + require 'spring/binstub' end end