lib/appbundler/app.rb in appbundler-0.11.4 vs lib/appbundler/app.rb in appbundler-0.11.5
- old
+ new
@@ -224,28 +224,27 @@
# Environment sanitization can be skipped by setting the
# APPBUNDLER_ALLOW_RVM environment variable to "true". This feature
# exists to make tests run correctly on travis.ci (which uses rvm).
def env_sanitizer
<<-EOS
+ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"
require "rubygems"
begin
# this works around rubygems/rubygems#2196 and can be removed in rubygems > 2.7.6
require "rubygems/bundler_version_finder"
rescue LoadError
# probably means rubygems is too old or too new to have this class, and we don't care
end
-unless ENV["BUNDLE_GEMFILE"]
- ENV["GEM_HOME"] = ENV["GEM_PATH"] = nil unless ENV["APPBUNDLER_ALLOW_RVM"] == "true"
- ::Gem.clear_paths
+::Gem.clear_paths
EOS
end
def runtime_activate
@runtime_activate ||= begin
- statements = runtime_dep_specs.map { |s| %Q{ gem "#{s.name}", "= #{s.version}"} }
+ statements = runtime_dep_specs.map { |s| %Q{gem "#{s.name}", "= #{s.version}"} }
activate_code = ""
activate_code << env_sanitizer << "\n"
activate_code << statements.join("\n") << "\n"
activate_code
end
@@ -257,15 +256,12 @@
def load_statement_for(bin_file)
name, version = app_spec.name, app_spec.version
bin_basename = File.basename(bin_file)
<<-E
- gem "#{name}", "= #{version}"
- spec = Gem::Specification.find_by_name("#{name}", "= #{version}")
-else
- spec = Gem::Specification.find_by_name("#{name}")
-end
+gem "#{name}", "= #{version}"
+spec = Gem::Specification.find_by_name("#{name}", "= #{version}")
bin_file = spec.bin_file("#{bin_basename}")
Kernel.load(bin_file)
E
end