Sha256: 76283a313b840d40d68fb9a0306a2848751c2b1e5970bf415c6c6957b6139491
Contents?: true
Size: 791 Bytes
Versions: 22
Compression:
Stored size: 791 Bytes
Contents
require 'awesome_print' module Babelyoda module SpecificationLoader def self.included(klass) klass.extend ClassMethods end def initialize(*args) super yield(self) if block_given? end def method_missing(method_name, *args, &block) msg = "You tried to call the method #{method_name}. There is no such method." raise msg end def dump unless ::Rake.application.options.trace ap self, :indent => -2 else p self end end module ClassMethods def load_from_file(filename) return nil unless File.exist?(filename) spec = eval(File.read(filename)) raise "Wrong specification class: #{spec.class.to_s}" unless spec.instance_of?(self) return spec end end end end
Version data entries
22 entries across 22 versions & 1 rubygems