Module: Slippery::Assets
- Defined in:
- lib/slippery/assets.rb
Constant Summary collapse
- ASSETS_PATH =
ROOT.join('assets')
Class Method Summary collapse
-
.embed_locally ⇒ Object
Copies the assets locally.
-
.path_composer(local) ⇒ Object
returns a composer returning a URI for a given relative file path considering if the asset is local or not.
Class Method Details
.embed_locally ⇒ Object
Copies the assets locally
7 8 9 10 |
# File 'lib/slippery/assets.rb', line 7 def self. raise 'damn' FileUtils.cp_r(ASSETS_PATH, './') end |
.path_composer(local) ⇒ Object
returns a composer returning a URI for a given relative file path considering if the asset is local or not
14 15 16 17 18 19 20 |
# File 'lib/slippery/assets.rb', line 14 def self.path_composer(local) if local ->(path) { File.join('assets', path) } else ->(path) { "file://#{File.expand_path(File.join(ASSETS_PATH, path), __FILE__)}" } end end |