diff --git a/.gitignore b/.gitignore index 0bb98b1d..3c40c8ba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ tmp pkg .swo *~ - +*.gem diff --git a/Gemfile.lock b/Gemfile.lock index 74d8c570..677a7e19 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - appraisal (0.3.4) + appraisal (0.3.5) aruba (~> 0.3.6) bundler rake diff --git a/lib/appraisal/file.rb b/lib/appraisal/file.rb index d05e91d9..246c9167 100644 --- a/lib/appraisal/file.rb +++ b/lib/appraisal/file.rb @@ -22,9 +22,9 @@ def each(&block) end def appraise(name, &block) - @appraisals << Appraisal.new(name, gemfile).tap do |appraisal| - appraisal.instance_eval(&block) - end + appraisal = Appraisal.new(name, gemfile) + appraisal.instance_eval(&block) + @appraisals << appraisal end private diff --git a/lib/appraisal/gemfile.rb b/lib/appraisal/gemfile.rb index a67aeaab..11d447a4 100644 --- a/lib/appraisal/gemfile.rb +++ b/lib/appraisal/gemfile.rb @@ -31,13 +31,13 @@ def to_s end def dup - Gemfile.new.tap do |gemfile| - gemfile.source @source - dependencies.values.each do |dependency| - gemfile.gem(dependency.name, *dependency.requirements) - end - gemfile.gemspec(@gemspec.options) if @gemspec + gemfile = Gemfile.new + gemfile.source @source + dependencies.values.each do |dependency| + gemfile.gem(dependency.name, *dependency.requirements) end + gemfile.gemspec(@gemspec.options) if @gemspec + gemfile end def gemspec(options = {})