Skip to content

Commit 4401942

Browse files
committed
Switch to Regexp.last_match
1 parent 84e44ed commit 4401942

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

template-dir/hooks/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/overcommit-hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/post-checkout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/post-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/post-merge

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/post-rewrite

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/pre-rebase

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

template-dir/hooks/prepare-commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
config = File.read('.overcommit.yml')
3131

3232
if config =~ /gemfile: "?(.*)"?/
33-
ENV['BUNDLE_GEMFILE'] = $1
33+
ENV['BUNDLE_GEMFILE'] = Regexp.last_match(1)
3434
require 'bundler'
3535

3636
begin

0 commit comments

Comments
 (0)