lib/yarrow/output/web/indexed_file.rb
# Write an output file to the specified path under the docroot.
#
# @param path [String]
# @param content [String]
Write an output file to the specified path under the docroot.
Write an output file to the specified path under the docroot .
def write(path, content)
          if path[path.length-1] == '/'
            path = "#{path}#{index_name}"
          end
          target_path = Pathname.new("#{docroot}#{path}")
          FileUtils.mkdir_p(target_path.dirname)
          File.open(target_path.to_s, WRITE_MODE) do |file|
            file.puts(content)
          end
        end
def write ( path , content ) if path [ path . length - 1 ] == '/' path = "#{path}#{index_name}" end target_path = Pathname . new ( "#{docroot}#{path}" ) FileUtils . mkdir_p ( target_path . dirname ) File . open ( target_path . to_s , WRITE_MODE ) do | file | file . puts ( content ) end end
Write an output file to the specified path under the docroot.
Write an output file to the specified path under the docroot .
# If the target path is a directory, # generate a default index filename.
path
<not_specific>
content
<not_specific>
<not_specific>
None