Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load bundled gems on expected version #859

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions template-dir/hooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/overcommit-hook
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/post-commit
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/post-rewrite
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/pre-rebase
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
10 changes: 2 additions & 8 deletions template-dir/hooks/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
end

# Check if Overcommit should invoke a Bundler context for loading gems
require 'yaml'
# rubocop:disable Style/RescueModifier
gemfile =
begin
YAML.load_file('.overcommit.yml', aliases: true)['gemfile']
rescue ArgumentError
YAML.load_file('.overcommit.yml')['gemfile']
end rescue nil
config = File.read('.overcommit.yml') =~ /gemfile: "?(.*)"?/
gemfile = Regexp.last_match(1)

if gemfile
ENV['BUNDLE_GEMFILE'] = gemfile
Expand Down
Loading