Sha256: 72752de780ddbf1075338a6e22940490907f84c0af1aebf4f7b36f64dfd83cf2
Contents?: true
Size: 653 Bytes
Versions: 5
Compression:
Stored size: 653 Bytes
Contents
module Tolk class Export attr_reader :name, :data, :destination def initialize(args) @name = args.fetch(:name, '') @data = args.fetch(:data, {}) @destination = args.fetch(:destination, self.class.dump_path) end def dump File.open("#{destination}/#{name}.yml", "w+") do |file| data.respond_to?(:ya2yaml) ? file.write(data.ya2yaml(:syck_compatible => true)) : file.write(YAML.dump(data).force_encoding file.external_encoding.name) end end class << self def dump(args) new(args).dump end def dump_path Tolk::Locale._dump_path end end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
tolk-1.3.13 | lib/tolk/export.rb |
tolk-1.4.00 | lib/tolk/export.rb |
tolk-1.3.12 | lib/tolk/export.rb |
tolk-1.3.11 | lib/tolk/export.rb |
tolk-1.3.10 | lib/tolk/export.rb |