File tree 10 files changed +20
-80
lines changed
10 files changed +20
-80
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
Original file line number Diff line number Diff line change @@ -27,14 +27,8 @@ if hook_type == 'overcommit-hook'
27
27
end
28
28
29
29
# Check if Overcommit should invoke a Bundler context for loading gems
30
- require 'yaml'
31
- # rubocop:disable Style/RescueModifier
32
- gemfile =
33
- begin
34
- YAML . load_file ( '.overcommit.yml' , aliases : true ) [ 'gemfile' ]
35
- rescue ArgumentError
36
- YAML . load_file ( '.overcommit.yml' ) [ 'gemfile' ]
37
- end rescue nil
30
+ config = File . read ( '.overcommit.yml' ) =~ /gemfile: ['"]?(.*)['"]?/
31
+ gemfile = Regexp . last_match ( 1 )
38
32
39
33
if gemfile
40
34
ENV [ 'BUNDLE_GEMFILE' ] = gemfile
You can’t perform that action at this time.
0 commit comments