Sha256: 911f2601b536c42627250e4490253f1c296d3cb92973d4b325993eda0379eb05
Contents?: true
Size: 861 Bytes
Versions: 9
Compression:
Stored size: 861 Bytes
Contents
require 'appraisal/appraisal' require 'appraisal/errors' require 'appraisal/gemfile' module Appraisal # Loads and parses Appraisals file class File attr_reader :appraisals, :gemfile def self.each(&block) new.each(&block) end def initialize @appraisals = [] @gemfile = Gemfile.new @gemfile.load(ENV['BUNDLE_GEMFILE'] || 'Gemfile') if ::File.exist? path run IO.read(path) else raise AppraisalsNotFound end end def each(&block) appraisals.each(&block) end def appraise(name, &block) appraisal = Appraisal.new(name, gemfile) appraisal.instance_eval(&block) @appraisals << appraisal end private def run(definitions) instance_eval(definitions, __FILE__, __LINE__) end def path 'Appraisals' end end end
Version data entries
9 entries across 7 versions & 2 rubygems