Sha256: 1ccbcd19175293f586644cbacaa7f72b39a93051fad0f9a565502b1890fcd75e
Contents?: true
Size: 1.27 KB
Versions: 3
Compression:
Stored size: 1.27 KB
Contents
# Author:: Nicolas Pouillard <ertai@lrde.epita.fr>. # Copyright:: Copyright (c) 2004, 2005 TTK team. All rights reserved. # License:: LGPL # $Id: YamlOld.rb 567 2005-04-13 08:00:06Z polrop $ require 'yaml' class Object # :nodoc: def yaml_load_map self end end class Array # :nodoc: def yaml_load_map map { |x| x.yaml_load_map } end end class Hash # :nodoc: def yaml_load_map res = {} each do |k,v| k = k.to_s.to_sym unless k.is_a? Symbol or k.is_a? Integer if k == :class or k == :strategy if k == :class k = :strategy end unless v.is_a? Strategies::Strategy v = v.to_s if v =~ /TestT/ v.gsub!(/TestTBase/, 'Strategy') v.gsub!(/TTK::Test::TestT/, 'TTK::Strategies::') v.gsub!(/Test::TestT/, 'Strategies::') v.gsub!(/TestT/, '') end end res[k] = Loaders.get_class(v) elsif k == :content res[:contents] = v.yaml_load_map else res[k] = v.yaml_load_map end end res end end module TTK module Loaders class YamlOld < Loader include Concrete def load_doc(io) YAML::load(io).yaml_load_map end end # class Yaml end # module Loaders end # module TTK
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ttk-0.1.576 | lib/ttk/loaders/YamlOld.rb |
ttk-0.1.580 | lib/ttk/loaders/YamlOld.rb |
ttk-0.1.579 | lib/ttk/loaders/YamlOld.rb |