Module: Card::Assets
- Defined in:
- mod/assets/lib/card/assets.rb
Overview
Provides methods to refresh script and style assets
Constant Summary collapse
- REFRESHED =
"ASSETS_REFRESHED".freeze
Class Method Summary collapse
-
.active_theme_cards ⇒ Object
-
.inputter_types ⇒ Object
FIXME: if we need this (not sure we do? see below), these types should probably be in a basket so that monkeys can add them.
-
.make_output_coded ⇒ Object
-
.refresh(force: false) ⇒ Object
-
.wipe ⇒ Object
Class Method Details
.active_theme_cards ⇒ Object
46 47 48 49 50 51 |
# File 'mod/assets/lib/card/assets.rb', line 46 def active_theme_cards style_rule = { left: { type_id: SetID }, right_id: StyleID } Card.search(referred_to_by: style_rule).select do |theme| theme.respond_to? :theme_name end end |
.inputter_types ⇒ Object
FIXME: if we need this (not sure we do? see below), these types should probably be in a basket so that monkeys can add them.
9 10 11 12 13 14 15 16 |
# File 'mod/assets/lib/card/assets.rb', line 9 def inputter_types [ JavaScriptID, CoffeeScriptID, CssID, ScssID ] end |
.make_output_coded ⇒ Object
42 43 44 |
# File 'mod/assets/lib/card/assets.rb', line 42 def make_output_coded asset_outputters.each(&:make_asset_output_coded) end |
.refresh(force: false) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'mod/assets/lib/card/assets.rb', line 18 def refresh force: false return unless force || refresh? inputters = standard_inputters # typically nonstandard inputters are standard cards, so their events # should manage normal (non-forced) refreshing. # (standard_inputters, by contrast, are in code, so this refreshing is # needed eg in development mode to detect changes) inputters += nonstandard_inputters if force inputters.each(&:refresh_asset) generate_asset_output_files if force end |