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



11
12
13
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 11

def asset_destination_path
  File.join(asset_destination_dir, asset_destination_basename)
end

#destination(site_destination_dir) ⇒ Object



15
16
17
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 15

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

#destination_rel_dirObject



31
32
33
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 31

def destination_rel_dir
  asset_destination_dir
end

#extnameObject



19
20
21
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 19

def extname
  File.extname(relative_path)
end

#modified?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 27

def modified?
  stamped_at != mtime
end

#mtimeObject



23
24
25
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 23

def mtime
  File.stat(path).mtime.to_i
end

#pathObject



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

def path
  asset_source_path
end

#relative_pathObject



7
8
9
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 7

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

#to_liquidObject



35
36
37
38
39
40
41
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 35

def to_liquid
  {
    'path'          => relative_path,
    'modified_time' => mtime.to_s,
    'extname'       => extname
  }
end

#write?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 43

def write?
  true
end