appraisal 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -4,3 +4,5 @@ pkg
4
4
  .swo
5
5
  *~
6
6
  *.gem
7
+ Gemfile.lock
8
+ .bundle
@@ -0,0 +1,7 @@
1
+ rvm:
2
+ - 1.8.7
3
+ - 1.9.2
4
+ - 1.9.3
5
+ branches:
6
+ only:
7
+ - master
@@ -0,0 +1,38 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repo.
4
+
5
+ 2. Run the tests. We only take pull requests with passing tests, and it's great
6
+ to know that you have a clean slate: `bundle && rake`
7
+
8
+ 3. Add a test for your change. Only refactoring and documentation changes
9
+ require no new tests. If you are adding functionality or fixing a bug, we need
10
+ a test!
11
+
12
+ 4. Make the test pass.
13
+
14
+ 5. Push to your fork and submit a pull request.
15
+
16
+
17
+ At this point you're waiting on us. We like to at least comment on, if not
18
+ accept, pull requests within three business days (and, typically, one business
19
+ day). We may suggest some changes or improvements or alternatives.
20
+
21
+ Some things that will increase the chance that your pull request is accepted,
22
+ taken straight from the Ruby on Rails guide:
23
+
24
+ * Use Rails idioms and helpers
25
+ * Include tests that fail without your code, and pass with it
26
+ * Update the documentation, the surrounding one, examples elsewhere, guides,
27
+ whatever is affected by your contribution
28
+
29
+ Syntax:
30
+
31
+ * Two spaces, no tabs.
32
+ * No trailing whitespace. Blank lines should not have any space.
33
+ * Prefer &&/|| over and/or.
34
+ * MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
35
+ * a = b and not a=b.
36
+ * Follow the conventions you see used in the source already.
37
+
38
+ And in case we didn't emphasize it enough: we love tests!
data/GOALS ADDED
@@ -0,0 +1,5 @@
1
+ Appraisal hits 1.0.0 when:
2
+
3
+ * It can reliably reproduce bugs in specific configurations of gems.
4
+ * It has standalone binary for controlling the infrastructure.
5
+ * It is transparent unless specifically interacted with.
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2011 thoughtbot, inc.
3
+ Copyright (c) 2010-2012 thoughtbot, inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,5 +1,4 @@
1
- Appraisal
2
- =========
1
+ # Appraisal [![Build Status](https://secure.travis-ci.org/thoughtbot/appraisal.png)](http://travis-ci.org/thoughtbot/appraisal?branch=master)
3
2
 
4
3
  Find out what your Ruby gems are worth.
5
4
 
@@ -8,7 +7,7 @@ Synopsis
8
7
 
9
8
  Appraisal integrates with bundler and rake to test your library against
10
9
  different versions of dependencies in repeatable scenarios called "appraisals."
11
- Appraisal is designed to make is easy to check for regressions in your library
10
+ Appraisal is designed to make it easy to check for regressions in your library
12
11
  without interfering with day-to-day development using bundler.
13
12
 
14
13
  Installation
@@ -108,4 +107,4 @@ The names and logos for thoughtbot are trademarks of thoughtbot, inc.
108
107
  License
109
108
  -------
110
109
 
111
- Appraisal is Copyright © 2011 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
110
+ Appraisal is Copyright © 2010-2012 Joe Ferris and thoughtbot. It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
@@ -10,6 +10,7 @@ Feature: run a rake task through several appraisals
10
10
  | dummy_rake | 0.8.7 |
11
11
  | dummy_rake | 0.9.0 |
12
12
  | dummy_sass | 3.1.0 |
13
+ | dummy_spec | 3.1.9 |
13
14
  When I cd to "projecto"
14
15
  And I write to "Gemfile" with:
15
16
  """
@@ -18,6 +19,9 @@ Feature: run a rake task through several appraisals
18
19
  group :assets do
19
20
  gem 'dummy_sass', " ~> 3.1.0"
20
21
  end
22
+ group :test, :development do
23
+ gem 'dummy_spec', " ~> 3.1.0"
24
+ end
21
25
  """
22
26
  When I add "appraisal" from this project as a dependency
23
27
  And I write to "Appraisals" with:
@@ -32,7 +32,7 @@ Feature: appraisals using an existing gemspec
32
32
  And I write to "Appraisals" with:
33
33
  """
34
34
  appraise "stock" do
35
- gem "shoulda", "2.11.3"
35
+ gem "rake"
36
36
  end
37
37
  """
38
38
  When I write to "Rakefile" with:
@@ -68,3 +68,12 @@ Feature: appraisals using an existing gemspec
68
68
  When I run `bundle exec rake appraisal version --trace`
69
69
  Then the output should contain "Loaded 1.3.0"
70
70
 
71
+ Scenario: run a gem in the gemspec via path
72
+ And I write to "Gemfile" with:
73
+ """
74
+ gemspec :path => './specdir'
75
+ """
76
+ When I add "appraisal" from this project as a dependency
77
+ When I successfully run `bundle exec rake appraisal:install --trace`
78
+ When I run `bundle exec rake appraisal version --trace`
79
+ Then the output should contain "Loaded 1.3.0"
@@ -1,4 +1,4 @@
1
1
  Before do
2
- # Extend the timeout before Aruba will kill the process to 5 minute.
3
- @aruba_timeout_seconds = 18000
2
+ # Extend the timeout before Aruba will kill the process to 5 minutes.
3
+ @aruba_timeout_seconds = 5 * 60 * 60
4
4
  end
@@ -2,4 +2,3 @@ require 'appraisal/version'
2
2
  require 'appraisal/task'
3
3
 
4
4
  Appraisal::Task.new
5
-
@@ -25,7 +25,7 @@ module Appraisal
25
25
  end
26
26
 
27
27
  def install
28
- Command.new("bundle install --gemfile=#{gemfile_path}").run
28
+ Command.new(bundle_command).run
29
29
  end
30
30
 
31
31
  def gemfile_path
@@ -33,7 +33,12 @@ module Appraisal
33
33
  FileUtils.mkdir(gemfile_root)
34
34
  end
35
35
 
36
- ::File.join(gemfile_root, "#{name}.gemfile")
36
+ ::File.join(gemfile_root, "#{clean_name}.gemfile")
37
+ end
38
+
39
+ def bundle_command
40
+ gemfile = "--gemfile='#{gemfile_path}'"
41
+ "bundle check #{gemfile} || bundle install #{gemfile}"
37
42
  end
38
43
 
39
44
  private
@@ -41,6 +46,9 @@ module Appraisal
41
46
  def gemfile_root
42
47
  ::File.join(Dir.pwd, "gemfiles")
43
48
  end
49
+
50
+ def clean_name
51
+ name.gsub(/\s+/, '_').gsub(/[^\w]/, '')
52
+ end
44
53
  end
45
54
  end
46
-
@@ -62,4 +62,3 @@ module Appraisal
62
62
  end
63
63
  end
64
64
  end
65
-
@@ -9,8 +9,7 @@ module Appraisal
9
9
  end
10
10
 
11
11
  def to_s
12
- gem_name = %{gem "#{name}"}
13
- if requirements.nil? || requirements.empty?
12
+ if no_requirements?
14
13
  gem_name
15
14
  else
16
15
  "#{gem_name}, #{inspect_requirements}"
@@ -19,9 +18,16 @@ module Appraisal
19
18
 
20
19
  private
21
20
 
21
+ def gem_name
22
+ %{gem "#{name}"}
23
+ end
24
+
25
+ def no_requirements?
26
+ requirements.nil? || requirements.empty?
27
+ end
28
+
22
29
  def inspect_requirements
23
30
  requirements.map { |requirement| requirement.inspect.gsub(/^\{|\}$/, '') }.join(", ")
24
31
  end
25
32
  end
26
33
  end
27
-
@@ -30,7 +30,7 @@ module Appraisal
30
30
  private
31
31
 
32
32
  def run(definitions)
33
- instance_eval definitions, __FILE__, __LINE__
33
+ instance_eval(definitions, __FILE__, __LINE__)
34
34
  end
35
35
 
36
36
  def path
@@ -24,7 +24,7 @@ module Appraisal
24
24
  @dependencies << Dependency.new(name, requirements)
25
25
  end
26
26
 
27
- def group(name)
27
+ def group(*names)
28
28
  # ignore the group
29
29
  end
30
30
 
@@ -38,7 +38,7 @@ module Appraisal
38
38
 
39
39
  def dup
40
40
  gemfile = Gemfile.new
41
- @sources.each { |source| gemfile.source source }
41
+ @sources.each { |source| gemfile.source(source) }
42
42
  dependencies.each do |dependency|
43
43
  gemfile.gem(dependency.name, *dependency.requirements)
44
44
  end
@@ -14,7 +14,9 @@ module Appraisal
14
14
  end
15
15
 
16
16
  def to_s
17
- "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}" if exists?
17
+ if exists?
18
+ "gemspec #{exported_options.inspect.gsub(/^\{|\}$/, '')}"
19
+ end
18
20
  end
19
21
 
20
22
  private
@@ -47,4 +47,3 @@ module Appraisal
47
47
  end
48
48
  end
49
49
  end
50
-
@@ -1,3 +1,3 @@
1
1
  module Appraisal
2
- VERSION = '0.4.1'.freeze
2
+ VERSION = '0.5.0'.freeze
3
3
  end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+ require 'appraisal/appraisal'
3
+
4
+ describe Appraisal::Appraisal do
5
+ it "creates a proper bundle command" do
6
+ appraisal = Appraisal::Appraisal.new('fake', 'fake')
7
+ appraisal.stub(:gemfile_path).and_return("/home/test/test directory")
8
+
9
+ appraisal.bundle_command.should == "bundle check --gemfile='/home/test/test directory' || bundle install --gemfile='/home/test/test directory'"
10
+ end
11
+
12
+ it "cleans up spaces and punctuation when outputting its gemfile" do
13
+ appraisal = Appraisal::Appraisal.new("This! is my appraisal name.", "Gemfile")
14
+ appraisal.gemfile_path.should =~ /This_is_my_appraisal_name.gemfile/
15
+ end
16
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appraisal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-15 00:00:00.000000000 Z
12
+ date: 2012-10-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70209726945840 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70209726945840
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: bundler
27
- requirement: &70209726945360 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '0'
33
38
  type: :runtime
34
39
  prerelease: false
35
- version_requirements: *70209726945360
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: cucumber
38
- requirement: &70209726944480 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,10 +53,15 @@ dependencies:
43
53
  version: '1.0'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *70209726944480
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: rspec
49
- requirement: &70209726943180 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
@@ -54,10 +69,15 @@ dependencies:
54
69
  version: '2.6'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *70209726943180
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.6'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: aruba
60
- requirement: &70209726942620 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ~>
@@ -65,7 +85,12 @@ dependencies:
65
85
  version: 0.4.2
66
86
  type: :development
67
87
  prerelease: false
68
- version_requirements: *70209726942620
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.4.2
69
94
  description: Appraisal integrates with bundler and rake to test your library against
70
95
  different versions of dependencies in repeatable scenarios called "appraisals."
71
96
  email: jferris@thoughtbot.com
@@ -73,11 +98,12 @@ executables: []
73
98
  extensions: []
74
99
  extra_rdoc_files: []
75
100
  files:
76
- - .bundle/config
77
101
  - .gitignore
78
102
  - .rspec
103
+ - .travis.yml
104
+ - CONTRIBUTING.md
105
+ - GOALS
79
106
  - Gemfile
80
- - Gemfile.lock
81
107
  - MIT-LICENSE
82
108
  - README.md
83
109
  - Rakefile
@@ -96,6 +122,7 @@ files:
96
122
  - lib/appraisal/gemspec.rb
97
123
  - lib/appraisal/task.rb
98
124
  - lib/appraisal/version.rb
125
+ - spec/appraisal/appraisal_spec.rb
99
126
  - spec/appraisal/gemfile_spec.rb
100
127
  - spec/spec_helper.rb
101
128
  homepage: http://github.com/thoughtbot/appraisal
@@ -110,15 +137,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
137
  - - ! '>='
111
138
  - !ruby/object:Gem::Version
112
139
  version: '0'
140
+ segments:
141
+ - 0
142
+ hash: 3878235132907510848
113
143
  required_rubygems_version: !ruby/object:Gem::Requirement
114
144
  none: false
115
145
  requirements:
116
146
  - - ! '>='
117
147
  - !ruby/object:Gem::Version
118
148
  version: '0'
149
+ segments:
150
+ - 0
151
+ hash: 3878235132907510848
119
152
  requirements: []
120
153
  rubyforge_project:
121
- rubygems_version: 1.8.15
154
+ rubygems_version: 1.8.24
122
155
  signing_key:
123
156
  specification_version: 3
124
157
  summary: Find out what your Ruby gems are worth
@@ -128,5 +161,6 @@ test_files:
128
161
  - features/step_definitions/dependency_steps.rb
129
162
  - features/support/aruba.rb
130
163
  - features/support/env.rb
164
+ - spec/appraisal/appraisal_spec.rb
131
165
  - spec/appraisal/gemfile_spec.rb
132
166
  - spec/spec_helper.rb
@@ -1,2 +0,0 @@
1
- --- {}
2
-
@@ -1,53 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- appraisal (0.4.1)
5
- bundler
6
- rake
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- aruba (0.4.5)
12
- bcat (>= 0.6.1)
13
- childprocess (>= 0.1.9)
14
- cucumber (>= 0.10.7)
15
- rdiscount (>= 1.6.8)
16
- rspec (>= 2.6.0)
17
- bcat (0.6.1)
18
- rack (~> 1.0)
19
- builder (3.0.0)
20
- childprocess (0.2.0)
21
- ffi (~> 1.0.6)
22
- cucumber (1.0.2)
23
- builder (>= 2.1.2)
24
- diff-lcs (>= 1.1.2)
25
- gherkin (~> 2.4.5)
26
- json (>= 1.4.6)
27
- term-ansicolor (>= 1.0.5)
28
- diff-lcs (1.1.2)
29
- ffi (1.0.9)
30
- gherkin (2.4.5)
31
- json (>= 1.4.6)
32
- json (1.5.3)
33
- rack (1.3.2)
34
- rake (0.9.2.2)
35
- rdiscount (1.6.8)
36
- rspec (2.6.0)
37
- rspec-core (~> 2.6.0)
38
- rspec-expectations (~> 2.6.0)
39
- rspec-mocks (~> 2.6.0)
40
- rspec-core (2.6.4)
41
- rspec-expectations (2.6.0)
42
- diff-lcs (~> 1.1.2)
43
- rspec-mocks (2.6.0)
44
- term-ansicolor (1.0.6)
45
-
46
- PLATFORMS
47
- ruby
48
-
49
- DEPENDENCIES
50
- appraisal!
51
- aruba (~> 0.4.2)
52
- cucumber (~> 1.0)
53
- rspec (~> 2.6)