lib/qipowl/core/mapper.rb in qipowl-0.9.0 vs lib/qipowl/core/mapper.rb in qipowl-0.9.1

- old
+ new

@@ -35,11 +35,11 @@ @entities_dirty = true @hash.rmerge!(input.to_hash) incs.each { |inc| merge! inc - } rescue NoMethodError + } rescue NoMethodError # FIXME WTF rescueing here? end private # FIXME Make file search more flexible!!! def load_yaml input IO === input ? @@ -47,19 +47,21 @@ YAML.load_file("#{Qipowl.bowlers_dir}/#{input.downcase}.yaml") end end class BowlerMapper < Mapper + include TypoLogging + def initialize input = nil input = self.class.name.split('::').last.downcase.gsub(/bowlermapper\Z/, '') if input.nil? super input end @entities = nil @entities_dirty = true def entities - return @entities unless @entities_dirty + return @entities unless @entities_dirty && @hash[:entities] @entities = {} @hash[:entities].each { |key, value| # :block. :alone etc @entities[key] ||= {} value.each { |k, v| # Append keys @@ -75,13 +77,9 @@ } } @entities_dirty = false @entities end - end - - class HtmlBowlerMapper < BowlerMapper - end end if __FILE__ == $0 require '../../qipowl' \ No newline at end of file