Module: Jekyll::Minibundle::AssetFileProperties

Included in:
BundleFile, DevelopmentFile, StampFile
Defined in:
lib/jekyll/minibundle/asset_file_properties.rb

Instance Method Summary collapse

Instance Method Details

#asset_destination_pathObject



3
4
5
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 3

def asset_destination_path
  File.join(asset_destination_dir, asset_destination_filename)
end

#defaultsObject



63
64
65
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 63

def defaults
  {}
end

#destination(site_destination_dir) ⇒ Object



17
18
19
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 17

def destination(site_destination_dir)
  File.join(site_destination_dir, asset_destination_path)
end

#destination_rel_dirObject



41
42
43
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 41

def destination_rel_dir
  asset_destination_dir
end

#modified?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 37

def modified?
  stamped_at != mtime
end

#modified_timeObject



29
30
31
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 29

def modified_time
  File.stat(path).mtime
end

#mtimeObject



33
34
35
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 33

def mtime
  modified_time.to_i
end

#nameObject



25
26
27
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 25

def name
  asset_destination_filename
end

#pathObject

Conformance to remaining Jekyll StaticFile public API methods



9
10
11
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 9

def path
  asset_source_path
end

#placeholdersObject



67
68
69
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 67

def placeholders
  {}
end

#relative_pathObject



13
14
15
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 13

def relative_path
  path.sub(/\A#{@site.source}/, '')
end

#to_liquidObject



45
46
47
48
49
50
51
52
53
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 45

def to_liquid
  {
    'basename'      => File.basename(name, extname),
    'name'          => name,
    'extname'       => extname,
    'modified_time' => modified_time,
    'path'          => relative_path
  }
end

#typeObject



59
60
61
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 59

def type
  nil  # no collection present
end

#urlObject



21
22
23
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 21

def url
  asset_destination_path
end

#write?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 55

def write?
  true
end