lib/rouge/theme.rb in rouge-0.1.2 vs lib/rouge/theme.rb in rouge-0.2.0

- old
+ new

@@ -1,40 +1,6 @@ module Rouge class Theme - class InheritableHash < Hash - def initialize(parent=nil) - @parent = parent - end - - def [](k) - _sup = super - return _sup if own_keys.include?(k) - - _sup || parent[k] - end - - def parent - @parent ||= {} - end - - def include?(k) - super or parent.include?(k) - end - - def each(&b) - keys.each do |k| - b.call(k, self[k]) - end - end - - alias own_keys keys - def keys - keys = own_keys.concat(parent.keys) - keys.uniq! - keys - end - end - class Style < Hash def initialize(theme, hsh={}) super() @theme = theme merge!(hsh)