Class: Octopress::Ink::Assets::FileAsset

Inherits:
Asset
  • Object
show all
Defined in:
lib/octopress-ink/assets/file.rb

Constant Summary

Constants inherited from Asset

Asset::FRONT_MATTER

Instance Attribute Summary

Attributes inherited from Asset

#base, #dir, #exists, #file, #plugin, #replacement, #root

Instance Method Summary collapse

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

#addObject



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

#destinationObject



26
27
28
# File 'lib/octopress-ink/assets/file.rb', line 26

def destination
  File.join(dir, file)
end