lib/psd.rb in psd-2.1.0 vs lib/psd.rb in psd-2.1.1

- old
+ new

@@ -30,13 +30,13 @@ # Opens the named file, parses it, and makes it available for reading. Then, closes it after you're finished. # @param filename [String] the name of the file to open # @return [PSD] the {PSD} object if no block was given, otherwise the value of the block def self.open(filename, opts={}, &block) + raise "Must supply a block. Otherwise, use PSD.new." unless block_given? + psd = PSD.new(filename, opts) psd.parse! - - return psd unless block_given? if 0 == block.arity psd.instance_eval(&block) else yield psd \ No newline at end of file