lib/review/catalog.rb in review-2.0.0.beta1 vs lib/review/catalog.rb in review-2.0.0
- old
+ new
@@ -1,10 +1,14 @@
require 'yaml'
module ReVIEW
class Catalog
def initialize(file)
- @yaml = YAML.load(file.read)
+ if file.respond_to? :read
+ @yaml = YAML.load(file.read)
+ else ## as Object
+ @yaml = file
+ end
@yaml ||= {}
end
def predef
return "" unless @yaml["PREDEF"]