Top Level Namespace
Defined Under Namespace
Modules: SpotlightSearch, WebpackerGemAssets
Instance Method Summary collapse
-
#default_assets_path ⇒ Object
config/initializers/webpacker_gem_assets.rb.
- #output_path ⇒ Object
- #resolve_gem_path(gem) ⇒ Object
Instance Method Details
#default_assets_path ⇒ Object
config/initializers/webpacker_gem_assets.rb
3 4 5 |
# File 'lib/generators/spotlight_search/templates/webpacker_gem_assets.rb', line 3 def default_assets_path 'app/assets/javascripts' end |
#output_path ⇒ Object
7 8 9 |
# File 'lib/generators/spotlight_search/templates/webpacker_gem_assets.rb', line 7 def output_path Webpacker.config.send(:data)[:resolved_gems_output_path] || '/tmp/_add_gem_paths.js' end |
#resolve_gem_path(gem) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/generators/spotlight_search/templates/webpacker_gem_assets.rb', line 11 def resolve_gem_path(gem) if gem.present? gem_path = Gem.loaded_specs[gem]&.full_gem_path if gem_path.present? return "#{gem_path}/#{default_assets_path}" end end abort("Gem '#{gem}' not found, please check webpacker config (#{Webpacker.config.config_path})") end |