class RhetButler::Stasis::Writer

Attributes

store_log[RW]

Public Class Methods

new(root) click to toggle source
# File lib/rhet-butler/stasis/writer.rb, line 5
def initialize(root)
  @root = root
end

Public Instance Methods

store(path, content) click to toggle source
# File lib/rhet-butler/stasis/writer.rb, line 15
def store(path, content)
  File::open(File::join(@root, path), "w") do |file|
    file.write(content)
  end
end
write(path, content) click to toggle source
# File lib/rhet-butler/stasis/writer.rb, line 10
def write(path, content)
  store_log.puts "Writing: #{path}" if store_log.respond_to? :puts
  store(path, content)
end