diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/constants.rb | 2 | ||||
-rw-r--r-- | lib/bundler/lockfile_parser.rb | 6 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 2 | ||||
-rw-r--r-- | lib/bundler/source/path.rb | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/constants.rb b/lib/bundler/constants.rb index d9bf6830..704bcac8 100644 --- a/lib/bundler/constants.rb +++ b/lib/bundler/constants.rb @@ -1,5 +1,5 @@ module Bundler - WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)! + WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/ FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/ NULL = WINDOWS ? "NUL" : "/dev/null" end diff --git a/lib/bundler/lockfile_parser.rb b/lib/bundler/lockfile_parser.rb index 78d5cb9d..5fa1f5aa 100644 --- a/lib/bundler/lockfile_parser.rb +++ b/lib/bundler/lockfile_parser.rb @@ -132,9 +132,9 @@ module Bundler end NAME_VERSION = '(?! )(.*?)(?: \(([^-]*)(?:-(.*))?\))?' - NAME_VERSION_2 = %r{^ {2}#{NAME_VERSION}(!)?$} - NAME_VERSION_4 = %r{^ {4}#{NAME_VERSION}$} - NAME_VERSION_6 = %r{^ {6}#{NAME_VERSION}$} + NAME_VERSION_2 = /^ {2}#{NAME_VERSION}(!)?$/ + NAME_VERSION_4 = /^ {4}#{NAME_VERSION}$/ + NAME_VERSION_6 = /^ {6}#{NAME_VERSION}$/ def parse_dependency(line) if line =~ NAME_VERSION_2 diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 33689123..1f6c4910 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -81,7 +81,7 @@ module Bundler # Set RUBYOPT rubyopt = [ENV["RUBYOPT"]].compact - if rubyopt.empty? || rubyopt.first !~ /-rbundler\/setup/ + if rubyopt.empty? || rubyopt.first !~ %r{-rbundler/setup} rubyopt.unshift %|-rbundler/setup| ENV["RUBYOPT"] = rubyopt.join(" ") end diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index b3f8816c..f49ab4b0 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -86,7 +86,7 @@ module Bundler git_retry %|clone --no-checkout --quiet "#{path}" "#{destination}"| File.chmod(((File.stat(destination).mode | 0777) & ~File.umask), destination) rescue Errno::EEXIST => e - file_path = e.message[/.*?(\/.*)/, 1] + file_path = e.message[%r{.*?(/.*)}, 1] raise GitError, "Bundler could not install a gem because it needs to " \ "create a directory, but a file exists - #{file_path}. Please delete " \ "this file and try again." diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb index 0c408b4b..1772a819 100644 --- a/lib/bundler/source/path.rb +++ b/lib/bundler/source/path.rb @@ -165,7 +165,7 @@ module Bundler end def relative_path - if path.to_s.match(%r{^#{Regexp.escape Bundler.root.to_s}}) + if path.to_s.start_with?(Bundler.root.to_s) return path.relative_path_from(Bundler.root) end path |