diff options
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/cli.rb | 4 | ||||
-rw-r--r-- | lib/bundler/cli/common.rb | 2 | ||||
-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/templates/Executable.bundler | 2 | ||||
-rw-r--r-- | lib/bundler/ui/shell.rb | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index da5950917b..bf6e0fbec9 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -127,8 +127,8 @@ module Bundler if man_pages.include?(command) man_page = man_pages[command] - if Bundler.which("man") && man_path !~ %r{^file:/.+!/META-INF/jruby.home/.+} - Kernel.exec "man #{man_page}" + if Bundler.which("man") && !man_path.match?(%r{^file:/.+!/META-INF/jruby.home/.+}) + Kernel.exec("man", man_page) else puts File.read("#{man_path}/#{File.basename(man_page)}.ronn") end diff --git a/lib/bundler/cli/common.rb b/lib/bundler/cli/common.rb index 0cf85c1d8d..dc2a889d2b 100644 --- a/lib/bundler/cli/common.rb +++ b/lib/bundler/cli/common.rb @@ -54,7 +54,7 @@ module Bundler Bundler.definition.specs.each do |spec| return spec if spec.name == name - specs << spec if regexp && spec.name =~ regexp + specs << spec if regexp && spec.name.match?(regexp) end default_spec = default_gem_spec(name) diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 23cbaae940..a214641ae1 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -329,7 +329,7 @@ module Bundler def set_rubyopt rubyopt = [ENV["RUBYOPT"]].compact setup_require = "-r#{File.expand_path("setup", __dir__)}" - return if !rubyopt.empty? && rubyopt.first =~ /#{Regexp.escape(setup_require)}/ + return if !rubyopt.empty? && rubyopt.first.include?(setup_require) rubyopt.unshift setup_require Bundler::SharedHelpers.set_env "RUBYOPT", rubyopt.join(" ") end diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 484a031835..8b6d420884 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -87,7 +87,7 @@ module Bundler def contains?(commit) allowed_with_path do result, status = git_null("branch", "--contains", commit, dir: path) - status.success? && result =~ /^\* (.*)$/ + status.success? && result.match?(/^\* (.*)$/) end end diff --git a/lib/bundler/templates/Executable.bundler b/lib/bundler/templates/Executable.bundler index e290fe91eb..caa2021701 100644 --- a/lib/bundler/templates/Executable.bundler +++ b/lib/bundler/templates/Executable.bundler @@ -27,7 +27,7 @@ m = Module.new do bundler_version = nil update_index = nil ARGV.each_with_index do |a, i| - if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) bundler_version = a end next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/ diff --git a/lib/bundler/ui/shell.rb b/lib/bundler/ui/shell.rb index a9053f2852..4555612dbb 100644 --- a/lib/bundler/ui/shell.rb +++ b/lib/bundler/ui/shell.rb @@ -130,7 +130,7 @@ module Bundler def tell_err(message, color = nil, newline = nil) return if @shell.send(:stderr).closed? - newline ||= message.to_s !~ /( |\t)\Z/ + newline ||= !message.to_s.match?(/( |\t)\Z/) message = word_wrap(message) if newline.is_a?(Hash) && newline[:wrap] color = nil if color && !$stderr.tty? |