Class: Octopress::Ink::Assets::FileAsset
- Defined in:
- lib/octopress-ink/assets/file.rb
Constant Summary
Constants inherited from Asset
Instance Attribute Summary
Attributes inherited from Asset
#base, #dir, #exists, #file, #plugin, #replacement, #root
Instance Method Summary collapse
- #add ⇒ Object
- #destination ⇒ Object
-
#initialize(plugin, base, file) ⇒ FileAsset
constructor
A new instance of FileAsset.
Methods inherited from Asset
#asset_info, #content, #copy, #data, #disable, #disabled?, #ext, #info, #is_disabled, #path, #payload, #read, #remove_jekyll_asset, #replaced?
Constructor Details
#initialize(plugin, base, file) ⇒ FileAsset
Returns a new instance of FileAsset.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/octopress-ink/assets/file.rb', line 9 def initialize(plugin, base, file) @root = plugin.assets_path @plugin = plugin @base = base @filename = file @dir = File.dirname(file) @file = File.basename(file) @exists = {} file_check end |
Instance Method Details
#add ⇒ Object
20 21 22 23 24 |
# File 'lib/octopress-ink/assets/file.rb', line 20 def add if !exists?(local_plugin_path) Plugins.static_files << StaticFile.new(File.join(source_dir, file), destination) end end |
#destination ⇒ Object
26 27 28 |
# File 'lib/octopress-ink/assets/file.rb', line 26 def destination File.join(dir, file) end |