Sha256: b331807bba78e0e13b14b253fb8a9a03631e04d0b9ecf5c297cc49bc84919b27
Contents?: true
Size: 868 Bytes
Versions: 6
Compression:
Stored size: 868 Bytes
Contents
require 'appraisal/appraisal' require 'appraisal/errors' require 'appraisal/gemfile' module Appraisal # Loads and parses Appraisals file class AppraisalFile 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
6 entries across 6 versions & 3 rubygems