Class: Jekyll::StaticFile

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/static_file.rb

Instance Method Summary collapse

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 and the file 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