File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ * ` bootsnap precompile --gemfile ` now look for ` .rb ` files in the whole gem and not just the ` lib/ ` directory. See #466 .
4
+
3
5
# 1.17.1
4
6
5
7
* Fix a compatibility issue with the ` prism ` library that ships with Ruby 3.3. See #463 .
Original file line number Diff line number Diff line change @@ -60,14 +60,16 @@ def precompile_command(*sources)
60
60
precompile_json_files ( main_sources )
61
61
62
62
if compile_gemfile
63
- # Some gems embed their tests, they're very unlikely to be loaded, so not worth precompiling.
64
- gem_exclude = Regexp . union ( [ exclude , "/spec/" , "/test/" ] . compact )
65
- precompile_ruby_files ( $LOAD_PATH. map { |d | File . expand_path ( d ) } , exclude : gem_exclude )
66
-
67
63
# Gems that include JSON or YAML files usually don't put them in `lib/`.
68
64
# So we look at the gem root.
65
+ # Similarly, gems that include Rails engines generally file Ruby files in `app/`.
66
+ # However some gems embed their tests, they're very unlikely to be loaded, so not worth precompiling.
67
+ gem_exclude = Regexp . union ( [ exclude , "/spec/" , "/test/" ] . compact )
68
+
69
69
gem_pattern = %r{^#{ Regexp . escape ( Bundler . bundle_path . to_s ) } /?(?:bundler/)?gems/[^/]+}
70
- gem_paths = $LOAD_PATH. map { |p | p [ gem_pattern ] } . compact . uniq
70
+ gem_paths = $LOAD_PATH. map { |p | p [ gem_pattern ] || p } . uniq
71
+
72
+ precompile_ruby_files ( gem_paths , exclude : gem_exclude )
71
73
precompile_yaml_files ( gem_paths , exclude : gem_exclude )
72
74
precompile_json_files ( gem_paths , exclude : gem_exclude )
73
75
end
You can’t perform that action at this time.
0 commit comments