Class: Jekyll::StaticFile
- Inherits:
-
Object
- Object
- Jekyll::StaticFile
- Defined in:
- lib/jekyll/static_file.rb
Instance Method Summary collapse
-
#initialize(site, base, dir, name) ⇒ StaticFile
constructor
Initialize a new StaticFile.
-
#write(dest) ⇒ Object
Write the static file to the destination directory.
Constructor Details
#initialize(site, base, dir, name) ⇒ StaticFile
Initialize a new StaticFile.
site is the Site
base is the String path to the dir is the String path between name is the String filename of the file
Returns
11 12 13 14 15 16 |
# File 'lib/jekyll/static_file.rb', line 11 def initialize(site, base, dir, name) @site = site @base = base @dir = dir @name = name end |
Instance Method Details
#write(dest) ⇒ Object
Write the static file to the destination directory.
dest is the String path to the destination dir
Returns nothing
22 23 24 25 |
# File 'lib/jekyll/static_file.rb', line 22 def write(dest) FileUtils.mkdir_p(File.join(dest, @dir)) FileUtils.cp(File.join(@base, @dir, @name), File.join(dest, @dir, @name)) end |