Class: Panda::Core::AssetLoader
- Inherits:
-
Object
- Object
- Panda::Core::AssetLoader
- Defined in:
- lib/panda/core/asset_loader.rb
Overview
AssetLoader handles loading compiled assets from GitHub releases Falls back to local development assets when GitHub assets unavailable
Class Method Summary collapse
-
.asset_tags(options = {}) ⇒ Object
Generate HTML tags for loading Panda Core assets.
-
.css_url ⇒ Object
Get the CSS asset URL (if exists).
-
.javascript_url ⇒ Object
Get the JavaScript asset URL.
-
.use_github_assets? ⇒ Boolean
Check if GitHub-hosted assets should be used.
Class Method Details
.asset_tags(options = {}) ⇒ Object
Generate HTML tags for loading Panda Core assets
14 15 16 17 18 19 20 |
# File 'lib/panda/core/asset_loader.rb', line 14 def ( = {}) if use_github_assets? () else () end end |
.css_url ⇒ Object
Get the CSS asset URL (if exists)
32 33 34 35 36 37 38 |
# File 'lib/panda/core/asset_loader.rb', line 32 def css_url if use_github_assets? github_css_url else development_css_url end end |
.javascript_url ⇒ Object
Get the JavaScript asset URL
23 24 25 26 27 28 29 |
# File 'lib/panda/core/asset_loader.rb', line 23 def javascript_url if use_github_assets? github_javascript_url else development_javascript_url end end |
.use_github_assets? ⇒ Boolean
Check if GitHub-hosted assets should be used
41 42 43 44 45 46 47 |
# File 'lib/panda/core/asset_loader.rb', line 41 def use_github_assets? # Use GitHub assets in production or when explicitly enabled Rails.env.production? || ENV["PANDA_CORE_USE_GITHUB_ASSETS"] == "true" || !development_assets_available? || ((Rails.env.test? || in_test_environment?) && compiled_assets_available?) end |