Skip to content

Commit 7d861db

Browse files
committed
Fixups following the move from lib/ruby/gems/2.6.0 to lib/gems
1 parent 714ccee commit 7d861db

File tree

9 files changed

+36
-34
lines changed

9 files changed

+36
-34
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/lib/json/tools/* linguist-vendored
2727
/src/main/c/Makefile linguist-vendored
2828
/src/main/c/truffleposix/Makefile linguist-vendored
29-
/lib/ruby/gems/*/gems/*/bin/setup linguist-vendored
29+
/lib/gems/gems/*/bin/setup linguist-vendored
3030
/lib/truffle/post_install_hook.sh linguist-vendored
3131
/src/test/* linguist-vendored
3232
/src/processor/* linguist-vendored
@@ -41,7 +41,7 @@
4141

4242
# Documentation
4343

44-
/lib/ruby/gems/*/gems/*/doc/* linguist-documentation
44+
/lib/gems/gems/*/doc/* linguist-documentation
4545

4646
# All our headers are C - don't magically work out they're ObjectiveC or C++
4747

doc/contributor/updating-ruby.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ then copy the original source of `flori/json` into `lib/json`.
5959
## Updating .gemspec of default gems
6060

6161
Default gems are imported from MRI files, except the .gemspec files in
62-
`lib/ruby/gems/n.n.n/specifications/default`.
62+
`lib/gems/specifications/default`.
6363
To update those, copy the files over from an installed MRI.
6464
```
65-
rm -rf lib/ruby/gems/n.n.n/specifications/default
66-
cp -r ~/.rubies/ruby-n.n.n/lib/ruby/gems/n.n.n/specifications/default lib/ruby/gems/n.n.n/specifications
65+
rm -rf lib/gems/specifications/default
66+
cp -r ~/.rubies/ruby-n.n.n/lib/ruby/gems/n.n.n/specifications/default lib/gems/specifications
6767
```
6868

6969
## Updating bundled gems
7070

7171
To update a bundled gem, follow these steps:
7272

73-
* Remove the current gem and gemspec from `lib/ruby/gems/a.b.c/gems` and
74-
`lib/ruby/gems/a.b.c/specifications`
73+
* Remove the current gem and gemspec from `lib/gems/gems` and
74+
`lib/gems/specifications`
7575
* Run the gem install command with the desired version
7676
`gem install rake -v 10.4.2 --no-doc`
7777
* Update the project `.gitignore` to allow the newly install gem sources

doc/user/ruby-managers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ are picked up by TruffleRuby (as any other Ruby implementation would do)
123123
causing TruffleRuby to pickup the wrong Gem home instead of its own.
124124

125125
One way to fix this for all sessions is to tell TruffleRuby to ignore `GEM_*`
126-
variables and always use its own Gem home under `truffleruby/lib/ruby/gems`:
126+
variables and always use its own Gem home under `truffleruby/lib/gems`:
127127

128128
```bash
129129
# In ~/.bashrc or ~/.zshenv

lib/truffle/rubygems/defaults/truffleruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
module Gem
1515
# The path to the gems shipped with TruffleRuby
1616
def self.default_dir
17-
@default_dir ||= "#{Truffle::Boot.ruby_home or raise 'TruffleRuby home not found'}/lib/ruby/gems/#{Truffle::RUBY_BASE_VERSION}"
17+
@default_dir ||= "#{Truffle::Boot.ruby_home or raise 'TruffleRuby home not found'}/lib/gems"
1818
end
1919
end

mx.truffleruby/suite.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -428,27 +428,27 @@
428428
"lib/mri/rbconfig/": [
429429
"dependency:org.truffleruby.cext/src/main/c/rbconfig-sizeof/sizeof.su",
430430
],
431-
"lib/ruby/gems/2.6.0/": [
432-
"file:lib/ruby/gems/2.6.0/truffleruby_gem_dir_marker.txt",
431+
"lib/gems/": [
432+
"file:lib/gems/truffleruby_gem_dir_marker.txt",
433433
],
434-
"lib/ruby/gems/2.6.0/gems/": [
435-
"file:lib/ruby/gems/2.6.0/gems/did_you_mean-1.3.0",
436-
"file:lib/ruby/gems/2.6.0/gems/minitest-5.11.3",
437-
"file:lib/ruby/gems/2.6.0/gems/net-telnet-0.2.0",
438-
"file:lib/ruby/gems/2.6.0/gems/power_assert-1.1.3",
439-
"file:lib/ruby/gems/2.6.0/gems/rake-12.3.2",
440-
"file:lib/ruby/gems/2.6.0/gems/test-unit-3.2.9",
441-
"file:lib/ruby/gems/2.6.0/gems/xmlrpc-0.3.0",
434+
"lib/gems/gems/": [
435+
"file:lib/gems/gems/did_you_mean-1.3.0",
436+
"file:lib/gems/gems/minitest-5.11.3",
437+
"file:lib/gems/gems/net-telnet-0.2.0",
438+
"file:lib/gems/gems/power_assert-1.1.3",
439+
"file:lib/gems/gems/rake-12.3.2",
440+
"file:lib/gems/gems/test-unit-3.2.9",
441+
"file:lib/gems/gems/xmlrpc-0.3.0",
442442
],
443-
"lib/ruby/gems/2.6.0/specifications/": [
444-
"file:lib/ruby/gems/2.6.0/specifications/default",
445-
"file:lib/ruby/gems/2.6.0/specifications/did_you_mean-1.3.0.gemspec",
446-
"file:lib/ruby/gems/2.6.0/specifications/minitest-5.11.3.gemspec",
447-
"file:lib/ruby/gems/2.6.0/specifications/net-telnet-0.2.0.gemspec",
448-
"file:lib/ruby/gems/2.6.0/specifications/power_assert-1.1.3.gemspec",
449-
"file:lib/ruby/gems/2.6.0/specifications/rake-12.3.2.gemspec",
450-
"file:lib/ruby/gems/2.6.0/specifications/test-unit-3.2.9.gemspec",
451-
"file:lib/ruby/gems/2.6.0/specifications/xmlrpc-0.3.0.gemspec",
443+
"lib/gems/specifications/": [
444+
"file:lib/gems/specifications/default",
445+
"file:lib/gems/specifications/did_you_mean-1.3.0.gemspec",
446+
"file:lib/gems/specifications/minitest-5.11.3.gemspec",
447+
"file:lib/gems/specifications/net-telnet-0.2.0.gemspec",
448+
"file:lib/gems/specifications/power_assert-1.1.3.gemspec",
449+
"file:lib/gems/specifications/rake-12.3.2.gemspec",
450+
"file:lib/gems/specifications/test-unit-3.2.9.gemspec",
451+
"file:lib/gems/specifications/xmlrpc-0.3.0.gemspec",
452452
],
453453
"src/main/c/openssl/": [
454454
"file:src/main/c/openssl/deprecation.rb",

src/main/java/org/truffleruby/RubyContext.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,9 @@ private String searchRubyHome(Options options) throws IOException {
760760

761761
private boolean isRubyHome(File path) {
762762
final File lib = new File(path, "lib");
763-
return new File(lib, "truffle").isDirectory() && new File(lib, "ruby").isDirectory() && new File(lib, "patches").isDirectory();
763+
return new File(lib, "truffle").isDirectory() &&
764+
new File(lib, "gems").isDirectory() &&
765+
new File(lib, "patches").isDirectory();
764766
}
765767

766768
public TruffleNFIPlatform getTruffleNFI() {

src/main/java/org/truffleruby/language/loader/FileLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private boolean isInternal(String path) {
108108
}
109109

110110
if (canonicalPath.startsWith(context.getRubyHome() + "/lib/") &&
111-
!canonicalPath.startsWith(context.getRubyHome() + "/lib/ruby/gems/")) {
111+
!canonicalPath.startsWith(context.getRubyHome() + "/lib/gems/")) {
112112
return context.getOptions().STDLIB_AS_INTERNAL;
113113
} else {
114114
return false;

src/main/ruby/truffleruby/post-boot/post-boot.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
# Load DidYouMean here manually, to avoid loading RubyGems eagerly
5454
Truffle::Boot.print_time_metric :'before-did-you-mean'
5555
begin
56-
$LOAD_PATH << "#{Truffle::Boot.ruby_home}/lib/ruby/gems/#{Truffle::RUBY_BASE_VERSION}/gems/did_you_mean-1.3.0/lib"
56+
$LOAD_PATH << "#{Truffle::Boot.ruby_home}/lib/gems/gems/did_you_mean-1.3.0/lib"
5757
require 'did_you_mean'
5858
rescue LoadError => e
5959
Truffle::Debug.log_warning "#{File.basename(__FILE__)}:#{__LINE__} #{e.message}"

tool/jt.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,7 +2261,7 @@ def dockerfile(*args)
22612261

22622262
if basic_test || full_test
22632263
configs.each do |config|
2264-
lines.push "RUN cp -r #{ruby_base}/lib/ruby/gems /test/clean-gems"
2264+
lines.push "RUN cp -r #{ruby_base}/lib/gems /test/clean-gems"
22652265

22662266
if config == '' && install_method != :source
22672267
gem = "gem"
@@ -2278,8 +2278,8 @@ def dockerfile(*args)
22782278
lines.push "RUN " + setup_env["#{gem} install unf"]
22792279
lines.push "RUN " + setup_env["ruby #{config} -runf -e 'raise unless defined?(UNF)'"]
22802280

2281-
lines.push "RUN rm -rf #{ruby_base}/lib/ruby/gems"
2282-
lines.push "RUN mv /test/clean-gems #{ruby_base}/lib/ruby/gems"
2281+
lines.push "RUN rm -rf #{ruby_base}/lib/gems"
2282+
lines.push "RUN mv /test/clean-gems #{ruby_base}/lib/gems"
22832283
end
22842284
end
22852285

0 commit comments

Comments
 (0)