module Cardio::Mod::Sow::YamlDump

Writing the card representations to yaml files in mod directories

Public Instance Methods

dump(hash) click to toggle source

write yaml to file

# File lib/cardio/mod/sow/yaml_dump.rb, line 7
def dump hash
  File.write filename, hash.to_yaml
  puts "#{filename} now contains #{hash.size} items".green
end
filename() click to toggle source

@return [String] – MOD_DIR/data/ENVIRONMENT.yml

# File lib/cardio/mod/sow/yaml_dump.rb, line 13
def filename
  @filename ||= File.join mod_path, "#{@podtype}.yml"
end
mod_path() click to toggle source

@return Path

# File lib/cardio/mod/sow/yaml_dump.rb, line 18
def mod_path
  Mod.dirs.subpaths("data")[@mod] ||
    raise(Card::Error::NotFound, "no data directory found for mod: #{@mod}")
end