aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bundler/vendor
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-19 13:28:23 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-01-19 15:01:44 +0900
commitd22511fd7595ef1819baa42851d598d95b8f4d00 (patch)
tree83e823c033f5c39c314cf4379f0bac5c43adf3d4 /lib/bundler/vendor
parent5646f4b67b75e7e558c994ff8cbd374e4b4bd3b5 (diff)
downloadruby-d22511fd7595ef1819baa42851d598d95b8f4d00.tar.gz
Merge rubygems/rubygems HEAD.
Picked at 12aeef6ba9a3be0022be9934c1a3e4c46a03ed3a
Diffstat (limited to 'lib/bundler/vendor')
-rw-r--r--lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb5
-rw-r--r--lib/bundler/vendor/thor/lib/thor/version.rb2
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb b/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
index f52ced2bcd..bf013307f1 100644
--- a/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
+++ b/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb
@@ -107,10 +107,7 @@ class Bundler::Thor
#
def replace!(regexp, string, force)
content = File.read(destination)
- before, after = content.split(regexp, 2)
- snippet = (behavior == :after ? after : before).to_s
-
- if force || !snippet.include?(replacement)
+ if force || !content.include?(replacement)
success = content.gsub!(regexp, string)
File.open(destination, "wb") { |file| file.write(content) } unless pretend?
diff --git a/lib/bundler/vendor/thor/lib/thor/version.rb b/lib/bundler/vendor/thor/lib/thor/version.rb
index a3efa9f762..48a4788b3b 100644
--- a/lib/bundler/vendor/thor/lib/thor/version.rb
+++ b/lib/bundler/vendor/thor/lib/thor/version.rb
@@ -1,3 +1,3 @@
class Bundler::Thor
- VERSION = "1.1.0"
+ VERSION = "1.2.1"
end