gem-default 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/gem-default.gemspec +1 -1
- data/lib/rubygems/commands/default_command.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41f4a06475772f02324b1ea31ccb1806e3bdb12e2a098502a699b00baffff21d
|
4
|
+
data.tar.gz: 871325e300d02277cb2a9d982e1fa20d85754d10cfb69a5b6637c8cb207d7cf4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5f41ab00b99d4e0d346a7f20bf08205d9cab323924cc36bedd04b87960f54dbcb0ff03573242e1ab99a5af0de642d1893514d493bb085604b005a838f2bb4f6
|
7
|
+
data.tar.gz: f50a5c1990a25da5618d1f27380a367f3fce70f439189abe1aa95a925eb05e31053378c2d38cd5d60af3e74031b1199eab62d4d25d10cf66bf4be9f6693072dc
|
data/README.md
CHANGED
@@ -16,7 +16,8 @@ Run `gem default xxx` after `gem install xxx`.
|
|
16
16
|
|
17
17
|
### Before
|
18
18
|
|
19
|
-
Usually, we cannot
|
19
|
+
Usually, we cannot use a non-default gem (`pry` for example) with `bundle exec`
|
20
|
+
if it's not written in Gemfile.
|
20
21
|
|
21
22
|
```bash
|
22
23
|
$ cat Gemfile
|
data/gem-default.gemspec
CHANGED
@@ -64,7 +64,7 @@ class Gem::Commands::DefaultCommand < Gem::Command
|
|
64
64
|
from = File.join(spec.gem_dir, require_path)
|
65
65
|
to = @ruby_lib_dir
|
66
66
|
glob_path = '**/*.rb'
|
67
|
-
when /\A#{File.join(@gem_home, 'extensions')}/
|
67
|
+
when /\A#{Regexp.escape(File.join(@gem_home, 'extensions'))}/
|
68
68
|
from = require_path
|
69
69
|
to = @ruby_arch_dir
|
70
70
|
glob_path = "**/*.#{@dlext}"
|
@@ -74,7 +74,7 @@ class Gem::Commands::DefaultCommand < Gem::Command
|
|
74
74
|
|
75
75
|
files = Dir.glob(File.join(from, glob_path)).select(&File.method(:file?)).map! do |path|
|
76
76
|
# delete_prefix is from Ruby 2.5 and too new
|
77
|
-
path.sub(/\A#{from}/, '')
|
77
|
+
path.sub(/\A#{Regexp.escape(from)}/, '')
|
78
78
|
end.sort!
|
79
79
|
copy_files(files, from: from, to: to)
|
80
80
|
end
|