appraisal 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- appraisal (0.3.3)
4
+ appraisal (0.3.4)
5
5
  aruba (~> 0.3.6)
6
6
  bundler
7
7
  rake
@@ -74,3 +74,11 @@ Feature: run a rake task through several appraisals
74
74
  But the output should not contain "Fail 1.3.0"
75
75
  And the exit status should be 1
76
76
 
77
+ @disable-bundler
78
+ Scenario: run a cleanup task
79
+ When I run `bundle exec rake appraisal:cleanup --trace`
80
+ Then a file named "gemfiles/1.3.0.gemfile" should not exist
81
+ And a file named "gemfiles/1.3.0.gemfile.lock" should not exist
82
+ And a file named "gemfiles/1.3.2.gemfile" should not exist
83
+ And a file named "gemfiles/1.3.2.gemfile.lock" should not exist
84
+
@@ -6,10 +6,7 @@ module Appraisal
6
6
 
7
7
  def initialize(options = {})
8
8
  @options = options
9
-
10
- # figure out the right path for the gemspec
11
9
  @options[:path] ||= '.'
12
- @options[:path] = ::File.expand_path(@options[:path])
13
10
  end
14
11
 
15
12
  def exists?
@@ -17,7 +14,20 @@ module Appraisal
17
14
  end
18
15
 
19
16
  def to_s
20
- "gemspec #{@options.inspect.gsub(/^\{|\}$/, '')}" if exists?
17
+ "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}" if exists?
18
+ end
19
+
20
+ private
21
+
22
+ def exported_options
23
+ # Check to see if this is an absolute path
24
+ if @options[:path] =~ /^(?:\/|\S:)/
25
+ @options
26
+ else
27
+ # Remove leading ./ from path, if any
28
+ exported_path = ::File.join("..", @options[:path].sub(/^\.\/?/,''))
29
+ @options.merge(:path => exported_path)
30
+ end
21
31
  end
22
32
  end
23
33
  end
@@ -21,6 +21,12 @@ module Appraisal
21
21
  end
22
22
  end
23
23
 
24
+ desc "Remove all generated gemfiles from gemfiles/ folder"
25
+ task :cleanup do
26
+ require 'fileutils'
27
+ FileUtils.rm_f Dir['gemfiles/*.{gemfile,gemfile.lock}']
28
+ end
29
+
24
30
  File.each do |appraisal|
25
31
  desc "Run the given task for appraisal #{appraisal.name}"
26
32
  task appraisal.name do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: appraisal
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.3
5
+ version: 0.3.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Joe Ferris
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-27 00:00:00 -04:00
13
+ date: 2011-05-30 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -108,7 +108,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - ">="
110
110
  - !ruby/object:Gem::Version
111
- hash: 2578223033123597217
111
+ hash: -2316706314772101401
112
112
  segments:
113
113
  - 0
114
114
  version: "0"
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- hash: 2578223033123597217
120
+ hash: -2316706314772101401
121
121
  segments:
122
122
  - 0
123
123
  version: "0"