From 97063c303ef80e1beca58367eb9c9113df5e0b2f Mon Sep 17 00:00:00 2001 From: Juan Vasquez Date: Wed, 20 Mar 2024 13:37:46 -0600 Subject: [PATCH] Add Next Gemfile Support Closes #1 --- lib/language_pack/helpers/bundler_wrapper.rb | 2 +- lib/language_pack/ruby.rb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/language_pack/helpers/bundler_wrapper.rb b/lib/language_pack/helpers/bundler_wrapper.rb index 6caa5eca8..db8b4a1e4 100644 --- a/lib/language_pack/helpers/bundler_wrapper.rb +++ b/lib/language_pack/helpers/bundler_wrapper.rb @@ -223,7 +223,7 @@ def needs_ruby_global_append_path? end def bundler_version_escape_valve! - topic("Removing BUNDLED WITH version in the Gemfile.lock") + topic("Removing BUNDLED WITH version in the #{@gemfile_lock_path}") contents = File.read(@gemfile_lock_path, mode: "rt") File.open(@gemfile_lock_path, "w") do |f| f.write contents.sub(/^BUNDLED WITH$(\r?\n) (?\d+)\.\d+\.\d+/m, '') diff --git a/lib/language_pack/ruby.rb b/lib/language_pack/ruby.rb index b9574dba6..578e58930 100644 --- a/lib/language_pack/ruby.rb +++ b/lib/language_pack/ruby.rb @@ -29,7 +29,7 @@ def self.use? end def self.bundler - @@bundler ||= LanguagePack::Helpers::BundlerWrapper.new.install + @@bundler ||= LanguagePack::Helpers::BundlerWrapper.new(gemfile_path: "./Gemfile").install end def bundler @@ -81,6 +81,7 @@ def best_practice_warnings def compile # check for new app at the beginning of the compile + warn("JUAN starting compile #{env('BUNDLE_GEMFILE')}", inline: true) new_app? Dir.chdir(build_path) remove_vendor_bundle @@ -93,6 +94,7 @@ def compile bundle_path: "vendor/bundle", bundle_default_without: "development:test" ) + warn("JUAN starting compile allow_git #{env('BUNDLE_GEMFILE')}", inline: true) allow_git do install_bundler_in_app(slug_vendor_base) load_bundler_cache @@ -102,12 +104,14 @@ def compile install_binaries run_assets_precompile_rake_task end + warn("JUAN ending compile allow_git #{env('BUNDLE_GEMFILE')}", inline: true) config_detect best_practice_warnings warn_outdated_ruby setup_profiled(ruby_layer_path: "$HOME", gem_layer_path: "$HOME") # $HOME is set to /app at run time setup_export cleanup + warn("JUAN ending compile #{env('BUNDLE_GEMFILE')}", inline: true) super rescue => e warn_outdated_ruby @@ -116,6 +120,7 @@ def compile def build + warn("JUAN starting build #{ENV['BUNDLE_GEMFILE']}", inline: true) new_app? remove_vendor_bundle warn_bad_binstubs @@ -162,6 +167,7 @@ def build best_practice_warnings cleanup + warn("JUAN ending build", inline: true) super end