Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A bit of cleanup.

  • Loading branch information...
commit 7a5af59c8f7777716e7a5bb0bf76353d9459ebac 1 parent cdc60a9
Gabe Berke-Williams gabebw authored
9 features/gemspec.feature
View
@@ -68,3 +68,12 @@ Feature: appraisals using an existing gemspec
When I run `bundle exec rake appraisal version --trace`
Then the output should contain "Loaded 1.3.0"
+ Scenario: run a gem in the gemspec via path
+ And I write to "Gemfile" with:
+ """
+ gemspec :path => './specdir'
+ """
+ When I add "appraisal" from this project as a dependency
+ When I successfully run `bundle exec rake appraisal:install --trace`
+ When I run `bundle exec rake appraisal version --trace`
+ Then the output should contain "Loaded 1.3.0"
11 lib/appraisal/dependency.rb
View
@@ -9,8 +9,7 @@ def initialize(name, requirements)
end
def to_s
- gem_name = %{gem "#{name}"}
- if requirements.nil? || requirements.empty?
+ if no_requirements?
gem_name
else
"#{gem_name}, #{inspect_requirements}"
@@ -19,6 +18,14 @@ def to_s
private
+ def gem_name
+ %{gem "#{name}"}
+ end
+
+ def no_requirements?
+ requirements.nil? || requirements.empty?
+ end
+
def inspect_requirements
requirements.map { |requirement| requirement.inspect.gsub(/^\{|\}$/, '') }.join(", ")
end
2  lib/appraisal/file.rb
View
@@ -30,7 +30,7 @@ def appraise(name, &block)
private
def run(definitions)
- instance_eval definitions, __FILE__, __LINE__
+ instance_eval(definitions, __FILE__, __LINE__)
end
def path
2  lib/appraisal/gemfile.rb
View
@@ -38,7 +38,7 @@ def to_s
def dup
gemfile = Gemfile.new
- @sources.each { |source| gemfile.source source }
+ @sources.each { |source| gemfile.source(source) }
dependencies.each do |dependency|
gemfile.gem(dependency.name, *dependency.requirements)
end
4 lib/appraisal/gemspec.rb
View
@@ -14,7 +14,9 @@ def exists?
end
def to_s
- "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}" if exists?
+ if exists?
+ "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}"
+ end
end
private
Please sign in to comment.
Something went wrong with that request. Please try again.