Module: Dry::System::Plugins::Bootsnap
- Defined in:
- lib/dry/system/plugins/bootsnap.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ load_path_cache: true, disable_trace: true, compile_cache_iseq: true, compile_cache_yaml: true, autoload_paths_cache: false }.freeze
Class Method Summary collapse
- .dependencies ⇒ Object private
- .extended(system) ⇒ Object private
Instance Method Summary collapse
- #bootsnap_available? ⇒ Boolean private
-
#setup_bootsnap ⇒ Object
Set up bootsnap for faster booting.
Class Method Details
.dependencies ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 |
# File 'lib/dry/system/plugins/bootsnap.rb', line 22 def self.dependencies 'bootsnap' end |
.extended(system) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
14 15 16 17 18 19 |
# File 'lib/dry/system/plugins/bootsnap.rb', line 14 def self.extended(system) super system.use(:env) system.setting :bootsnap, DEFAULT_OPTIONS system.after(:configure, &:setup_bootsnap) end |
Instance Method Details
#bootsnap_available? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/dry/system/plugins/bootsnap.rb', line 35 def bootsnap_available? RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.3.0" && RUBY_VERSION < "2.5.0" end |
#setup_bootsnap ⇒ Object
Set up bootsnap for faster booting
29 30 31 32 |
# File 'lib/dry/system/plugins/bootsnap.rb', line 29 def setup_bootsnap return unless bootsnap_available? ::Bootsnap.setup(config.bootsnap.merge(cache_dir: root.join('tmp/cache').to_s)) end |