summaryrefslogtreecommitdiff
path: root/tool/sync_default_gems.rb
diff options
context:
space:
mode:
authorKevin Deisz <kevin.deisz@gmail.com>2019-10-29 10:08:37 -0400
committerYuki Nishijima <yk.nishijima@gmail.com>2019-11-30 21:08:19 -0500
commit171803d5d34feb1b4244ca81b9db0a7bc2171c85 (patch)
tree664ee644da144f28152097fbe5ea43329bfc0576 /tool/sync_default_gems.rb
parenta2fc6a51dd2e1a153559038795e1e2509f9c6a94 (diff)
Promote did_you_mean to default gem
At the moment, there are some problems with regard to bundler + did_you_mean because of did_you_mean being a bundled gem. Since the vendored version of thor inside bundler and ruby itself explicitly requires did_you_mean, it can become difficult to load it when using Bundler.setup. See this issue: https://github.com/yuki24/did_you_mean/issues/117#issuecomment-482733159 for more details.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2689
Diffstat (limited to 'tool/sync_default_gems.rb')
-rw-r--r--tool/sync_default_gems.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/tool/sync_default_gems.rb b/tool/sync_default_gems.rb
index 810f1e9a92..1c07073e2d 100644
--- a/tool/sync_default_gems.rb
+++ b/tool/sync_default_gems.rb
@@ -48,6 +48,7 @@
# * https://github.com/ruby/yaml
# * https://github.com/ruby/uri
# * https://github.com/ruby/openssl
+# * https://github.com/ruby/did_you_mean
#
require 'fileutils'
@@ -102,6 +103,7 @@ $repositories = {
yaml: "ruby/yaml",
uri: "ruby/uri",
openssl: "ruby/openssl",
+ did_you_mean: "ruby/did_you_mean"
}
def sync_default_gems(gem)
@@ -262,6 +264,12 @@ def sync_default_gems(gem)
when "readlineext"
sync_lib "readline-ext"
mv "lib/readline-ext.gemspec", "ext/readline"
+ when "did_you_mean"
+ rm_rf(%w[lib/did_you_mean* test/did_you_mean])
+ cp_r(Dir.glob("#{upstream}/lib/did_you_mean*"), "lib")
+ cp_r("#{upstream}/did_you_mean.gemspec", "lib/did_you_mean")
+ cp_r("#{upstream}/test", "test/did_you_mean")
+ rm_rf(%w[test/did_you_mean/tree_spell/test_explore.rb])
else
sync_lib gem
end