module Wanko::Write

Functions for writing data out to files or similar. All functions can be considered to have destructive side-effects.

Public Class Methods

config(dir, config) click to toggle source
# File lib/wanko/write.rb, line 22
def self.config(dir, config)
  File.write File.join(dir, 'config.yaml'), config.to_yaml
end
history(dir, history) click to toggle source

Public: Write a YAML representation of an object to a file named 'history.yaml'.

This function will clobber an existing file.

dir - Path of the directory to write the file in. history - Object to write out. Responds to to_yaml.

Returns nothing

# File lib/wanko/write.rb, line 18
def self.history(dir, history)
  File.write File.join(dir, 'history.yaml'), history.to_yaml
end