Module: Jekyll::Minibundle::AssetFileProperties
- Included in:
- BundleFile, DevelopmentFile, StampFile
- Defined in:
- lib/jekyll/minibundle/asset_file_properties.rb
Instance Method Summary collapse
- #asset_destination_path ⇒ Object
- #defaults ⇒ Object
- #destination(site_destination_dir) ⇒ Object
- #destination_rel_dir ⇒ Object
- #modified? ⇒ Boolean
- #modified_time ⇒ Object
- #mtime ⇒ Object
- #name ⇒ Object
-
#path ⇒ Object
Conformance to remaining Jekyll StaticFile public API methods.
- #placeholders ⇒ Object
- #relative_path ⇒ Object
- #to_liquid ⇒ Object
- #type ⇒ Object
- #url ⇒ Object
- #write? ⇒ Boolean
Instance Method Details
#asset_destination_path ⇒ Object
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 |
#defaults ⇒ Object
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_dir ⇒ Object
41 42 43 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 41 def destination_rel_dir asset_destination_dir end |
#modified? ⇒ Boolean
37 38 39 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 37 def modified? stamped_at != mtime end |
#modified_time ⇒ Object
29 30 31 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 29 def modified_time File.stat(path).mtime end |
#mtime ⇒ Object
33 34 35 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 33 def mtime modified_time.to_i end |
#name ⇒ Object
25 26 27 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 25 def name asset_destination_filename end |
#path ⇒ Object
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 |
#placeholders ⇒ Object
67 68 69 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 67 def placeholders {} end |
#relative_path ⇒ Object
13 14 15 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 13 def relative_path path.sub(/\A#{@site.source}/, '') end |
#to_liquid ⇒ Object
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 |
#type ⇒ Object
59 60 61 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 59 def type nil # no collection present end |
#url ⇒ Object
21 22 23 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 21 def url asset_destination_path end |
#write? ⇒ Boolean
55 56 57 |
# File 'lib/jekyll/minibundle/asset_file_properties.rb', line 55 def write? true end |