appraisal 2.2.0 → 2.3.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.
- checksums.yaml +5 -5
- data/.travis.yml +9 -14
- data/Gemfile +0 -6
- data/README.md +17 -11
- data/appraisal.gemspec +2 -0
- data/lib/appraisal/appraisal.rb +11 -1
- data/lib/appraisal/bundler_dsl.rb +15 -11
- data/lib/appraisal/cli.rb +7 -0
- data/lib/appraisal/command.rb +2 -2
- data/lib/appraisal/dependency_list.rb +1 -2
- data/lib/appraisal/utils.rb +1 -1
- data/lib/appraisal/version.rb +1 -1
- data/spec/acceptance/appraisals_file_bundler_dsl_compatibility_spec.rb +5 -3
- data/spec/acceptance/bundle_with_custom_path_spec.rb +20 -38
- data/spec/acceptance/cli/install_spec.rb +50 -8
- data/spec/appraisal/appraisal_spec.rb +14 -0
- data/spec/appraisal/gemfile_spec.rb +11 -11
- data/spec/appraisal/utils_spec.rb +8 -19
- data/spec/support/acceptance_test_helpers.rb +1 -9
- metadata +7 -11
- data/Gemfile-1.8 +0 -5
- data/Gemfile-2.1 +0 -3
- data/lib/appraisal/ordered_hash.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0e5becde2c97891ac7e0d0cb0e8943653ec7b43ca3dcad2f60a8aa7becd9a977
|
4
|
+
data.tar.gz: bac9e06f7948cc07025d06572f373f444e8159422ac9c62aa5e29ae6e32f6fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b23d137f23b270822cf4e49248cc2f2a3bd229668d96f44feaf3a7d804b7daddca6429ebe2dba8f5782ee5b4f9860da0e0976e9b25e5baf419180e463bb85e
|
7
|
+
data.tar.gz: de06629b275c669997f73c5e840458f6de44ca435a4e8a543ff49b8e4d7a6c98d44006dc780df173d37958a4b6e8286184571a135b19d9529465206f7f548d8d
|
data/.travis.yml
CHANGED
@@ -1,23 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
before_install: gem install bundler
|
1
|
+
---
|
2
|
+
before_install: gem install bundler:2.1.4
|
4
3
|
|
5
4
|
rvm:
|
6
|
-
-
|
7
|
-
-
|
8
|
-
- 2.
|
9
|
-
- 2.
|
10
|
-
- 2.
|
11
|
-
- 2.
|
12
|
-
- 2.4.0-preview3
|
13
|
-
- jruby-19mode
|
5
|
+
- 2.3
|
6
|
+
- 2.4
|
7
|
+
- 2.5
|
8
|
+
- 2.6
|
9
|
+
- 2.7
|
10
|
+
- jruby-9.2.9.0
|
14
11
|
- ruby-head
|
15
12
|
- jruby-head
|
16
13
|
|
17
14
|
matrix:
|
18
15
|
fast_finish: true
|
19
16
|
allow_failures:
|
20
|
-
- rvm: jruby-19mode
|
21
|
-
- rvm: jruby-head
|
22
17
|
- rvm: ruby-head
|
23
|
-
- rvm:
|
18
|
+
- rvm: jruby-head
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -19,9 +19,9 @@ without interfering with day-to-day development using Bundler.
|
|
19
19
|
Installation
|
20
20
|
------------
|
21
21
|
|
22
|
-
In your
|
22
|
+
In your package's `.gemspec`:
|
23
23
|
|
24
|
-
|
24
|
+
s.add_development_dependency "appraisal"
|
25
25
|
|
26
26
|
Note that gems must be bundled in the global namespace. Bundling gems to a
|
27
27
|
local location or vendoring plugins is not supported. If you do not want to
|
@@ -52,30 +52,24 @@ your `Gemfile`, so you don't need to repeat anything that's the same for each
|
|
52
52
|
appraisal. If something is specified in both the Gemfile and an appraisal, the
|
53
53
|
version from the appraisal takes precedence.
|
54
54
|
|
55
|
-
It's also recommended that you setup bundler at the very top of your Rakefile,
|
56
|
-
so that you don't need to constantly run bundle exec:
|
57
|
-
|
58
|
-
require "rubygems"
|
59
|
-
require "bundler/setup"
|
60
|
-
|
61
55
|
Usage
|
62
56
|
-----
|
63
57
|
|
64
58
|
Once you've configured the appraisals you want to use, you need to install the
|
65
59
|
dependencies for each appraisal:
|
66
60
|
|
67
|
-
$ appraisal install
|
61
|
+
$ bundle exec appraisal install
|
68
62
|
|
69
63
|
This will resolve, install, and lock the dependencies for that appraisal using
|
70
64
|
bundler. Once you have your dependencies set up, you can run any command in a
|
71
65
|
single appraisal:
|
72
66
|
|
73
|
-
$ appraisal rails-3 rake test
|
67
|
+
$ bundle exec appraisal rails-3 rake test
|
74
68
|
|
75
69
|
This will run `rake test` using the dependencies configured for Rails 3. You can
|
76
70
|
also run each appraisal in turn:
|
77
71
|
|
78
|
-
$ appraisal rake test
|
72
|
+
$ bundle exec appraisal rake test
|
79
73
|
|
80
74
|
If you want to use only the dependencies from your Gemfile, just run `rake
|
81
75
|
test` as normal. This allows you to keep running with the latest versions of
|
@@ -97,6 +91,18 @@ Note that this may conflict with your CI setup if you decide to split the test
|
|
97
91
|
into multiple processes by Appraisal and you are using `rake` to run tests by
|
98
92
|
default. Please see **Travis CI Integration** for more detail.
|
99
93
|
|
94
|
+
### Commands
|
95
|
+
|
96
|
+
```bash
|
97
|
+
appraisal clean # Remove all generated gemfiles and lockfiles from gemfiles folder
|
98
|
+
appraisal generate # Generate a gemfile for each appraisal
|
99
|
+
appraisal help [COMMAND] # Describe available commands or one specific command
|
100
|
+
appraisal install # Resolve and install dependencies for each appraisal
|
101
|
+
appraisal list # List the names of the defined appraisals
|
102
|
+
appraisal update [LIST_OF_GEMS] # Remove all generated gemfiles and lockfiles, resolve, and install dependencies again
|
103
|
+
appraisal version # Display the version and exit
|
104
|
+
```
|
105
|
+
|
100
106
|
Under the hood
|
101
107
|
--------------
|
102
108
|
|
data/appraisal.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
+
s.required_ruby_version = ">= 2.3.0"
|
22
|
+
|
21
23
|
s.add_runtime_dependency('rake')
|
22
24
|
s.add_runtime_dependency('bundler')
|
23
25
|
s.add_runtime_dependency('thor', '>= 0.14.0')
|
data/lib/appraisal/appraisal.rb
CHANGED
@@ -119,7 +119,11 @@ module Appraisal
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def gemfile_root
|
122
|
-
|
122
|
+
project_root + "gemfiles"
|
123
|
+
end
|
124
|
+
|
125
|
+
def project_root
|
126
|
+
Pathname.new(Dir.pwd)
|
123
127
|
end
|
124
128
|
|
125
129
|
def gemfile_name
|
@@ -147,6 +151,12 @@ module Appraisal
|
|
147
151
|
end
|
148
152
|
end
|
149
153
|
|
154
|
+
path = full_options.delete("path")
|
155
|
+
if path
|
156
|
+
relative_path = project_root.join(options["path"])
|
157
|
+
options_strings << "--path #{relative_path}"
|
158
|
+
end
|
159
|
+
|
150
160
|
full_options.each do |flag, val|
|
151
161
|
options_strings << "--#{flag} #{val}"
|
152
162
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require "appraisal/dependency_list"
|
2
|
-
require "appraisal/ordered_hash"
|
3
2
|
|
4
3
|
module Appraisal
|
5
4
|
class BundlerDSL
|
@@ -13,11 +12,11 @@ module Appraisal
|
|
13
12
|
@ruby_version = nil
|
14
13
|
@dependencies = DependencyList.new
|
15
14
|
@gemspecs = []
|
16
|
-
@groups =
|
17
|
-
@platforms =
|
18
|
-
@gits =
|
19
|
-
@paths =
|
20
|
-
@source_blocks =
|
15
|
+
@groups = Hash.new
|
16
|
+
@platforms = Hash.new
|
17
|
+
@gits = Hash.new
|
18
|
+
@paths = Hash.new
|
19
|
+
@source_blocks = Hash.new
|
21
20
|
@git_sources = {}
|
22
21
|
end
|
23
22
|
|
@@ -30,12 +29,14 @@ module Appraisal
|
|
30
29
|
end
|
31
30
|
|
32
31
|
def group(*names, &block)
|
33
|
-
@groups[names] ||=
|
32
|
+
@groups[names] ||=
|
33
|
+
Group.new(names).tap { |g| g.git_sources = @git_sources.dup }
|
34
34
|
@groups[names].run(&block)
|
35
35
|
end
|
36
36
|
|
37
37
|
def platforms(*names, &block)
|
38
|
-
@platforms[names] ||=
|
38
|
+
@platforms[names] ||=
|
39
|
+
Platform.new(names).tap { |g| g.git_sources = @git_sources.dup }
|
39
40
|
@platforms[names].run(&block)
|
40
41
|
end
|
41
42
|
|
@@ -43,7 +44,8 @@ module Appraisal
|
|
43
44
|
|
44
45
|
def source(source, &block)
|
45
46
|
if block_given?
|
46
|
-
@source_blocks[source] ||=
|
47
|
+
@source_blocks[source] ||=
|
48
|
+
Source.new(source).tap { |g| g.git_sources = @git_sources.dup }
|
47
49
|
@source_blocks[source].run(&block)
|
48
50
|
else
|
49
51
|
@sources << source
|
@@ -55,12 +57,14 @@ module Appraisal
|
|
55
57
|
end
|
56
58
|
|
57
59
|
def git(source, options = {}, &block)
|
58
|
-
@gits[source] ||=
|
60
|
+
@gits[source] ||=
|
61
|
+
Git.new(source, options).tap { |g| g.git_sources = @git_sources.dup }
|
59
62
|
@gits[source].run(&block)
|
60
63
|
end
|
61
64
|
|
62
65
|
def path(source, options = {}, &block)
|
63
|
-
@paths[source] ||=
|
66
|
+
@paths[source] ||=
|
67
|
+
Path.new(source, options).tap { |g| g.git_sources = @git_sources.dup }
|
64
68
|
@paths[source].run(&block)
|
65
69
|
end
|
66
70
|
|
data/lib/appraisal/cli.rb
CHANGED
@@ -46,6 +46,13 @@ module Appraisal
|
|
46
46
|
method_option "without", :banner => "GROUP_NAMES",
|
47
47
|
:desc => "A space-separated list of groups referencing gems to skip " +
|
48
48
|
"during installation. Bundler will remember this option."
|
49
|
+
method_option "full-index", :type => :boolean,
|
50
|
+
:desc => "Run bundle install with the " \
|
51
|
+
"full-index argument."
|
52
|
+
method_option "path", type: :string,
|
53
|
+
desc: "Install gems in the specified directory. " \
|
54
|
+
"Bundler will remember this option."
|
55
|
+
|
49
56
|
def install
|
50
57
|
invoke :generate, [], {}
|
51
58
|
|
data/lib/appraisal/command.rb
CHANGED
@@ -41,9 +41,9 @@ module Appraisal
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def ensure_bundler_is_available
|
44
|
-
|
44
|
+
version = Utils.bundler_version
|
45
|
+
unless system %(gem list -i bundler -v #{version})
|
45
46
|
puts ">> Reinstall Bundler into #{ENV["GEM_HOME"]}"
|
46
|
-
version = Utils.bundler_version
|
47
47
|
|
48
48
|
unless system "gem install bundler --version #{version}"
|
49
49
|
puts
|
data/lib/appraisal/utils.rb
CHANGED
data/lib/appraisal/version.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe 'Appraisals file Bundler DSL compatibility' do
|
4
4
|
it 'supports all Bundler DSL in Appraisals file' do
|
5
5
|
build_gems %w(bagel orange_juice milk waffle coffee ham sausage pancake)
|
6
|
-
build_git_gems %w(egg croissant pain_au_chocolat)
|
6
|
+
build_git_gems %w(egg croissant pain_au_chocolat omelette)
|
7
7
|
|
8
8
|
build_gemfile <<-Gemfile
|
9
9
|
source 'https://rubygems.org'
|
@@ -23,6 +23,7 @@ describe 'Appraisals file Bundler DSL compatibility' do
|
|
23
23
|
|
24
24
|
group :breakfast do
|
25
25
|
gem 'orange_juice'
|
26
|
+
gem "omelette", :custom_git_source => "omelette"
|
26
27
|
end
|
27
28
|
|
28
29
|
platforms :ruby, :jruby do
|
@@ -43,7 +44,7 @@ describe 'Appraisals file Bundler DSL compatibility' do
|
|
43
44
|
build_appraisal_file <<-Appraisals
|
44
45
|
appraise 'breakfast' do
|
45
46
|
source 'http://some-other-source.com'
|
46
|
-
ruby "
|
47
|
+
ruby "2.3.0"
|
47
48
|
|
48
49
|
gem 'bread'
|
49
50
|
gem "pain_au_chocolat", :custom_git_source => "pain_au_chocolat"
|
@@ -86,7 +87,7 @@ describe 'Appraisals file Bundler DSL compatibility' do
|
|
86
87
|
source "https://rubygems.org"
|
87
88
|
source "http://some-other-source.com"
|
88
89
|
|
89
|
-
ruby "
|
90
|
+
ruby "2.3.0"
|
90
91
|
|
91
92
|
git "../../gems/egg" do
|
92
93
|
gem "egg"
|
@@ -106,6 +107,7 @@ describe 'Appraisals file Bundler DSL compatibility' do
|
|
106
107
|
|
107
108
|
group :breakfast do
|
108
109
|
gem "orange_juice"
|
110
|
+
gem "omelette", :git => "../../gems/omelette"
|
109
111
|
gem "bacon"
|
110
112
|
|
111
113
|
platforms :rbx do
|
@@ -1,50 +1,16 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe "Bundle with custom path" do
|
4
|
-
|
5
|
-
|
6
|
-
source "https://rubygems.org"
|
4
|
+
let(:gem_name) { 'rack' }
|
5
|
+
let(:path) { 'vendor/bundle' }
|
7
6
|
|
8
|
-
|
9
|
-
Gemfile
|
10
|
-
|
11
|
-
build_appraisal_file <<-Appraisals
|
12
|
-
appraise "breakfast" do
|
13
|
-
end
|
14
|
-
Appraisals
|
15
|
-
|
16
|
-
run %(bundle install --path="vendor/bundle")
|
17
|
-
output = run "appraisal install"
|
18
|
-
|
19
|
-
expect(file "gemfiles/breakfast.gemfile").to be_exists
|
20
|
-
expect(output).to include("Successfully installed bundler")
|
21
|
-
end
|
22
|
-
|
23
|
-
context 'when already installed in vendor/another' do
|
24
|
-
let(:gem_name) { 'rack' }
|
25
|
-
let(:path) { 'vendor/bundle' }
|
26
|
-
|
27
|
-
before do
|
28
|
-
build_gemfile <<-Gemfile
|
29
|
-
source "https://rubygems.org"
|
30
|
-
|
31
|
-
gem '#{gem_name}'
|
32
|
-
Gemfile
|
33
|
-
|
34
|
-
run 'bundle install --path vendor/another'
|
35
|
-
end
|
7
|
+
shared_examples :gemfile_dependencies_are_satisfied do
|
36
8
|
|
37
9
|
it 'installs gems in the --path directory' do
|
38
10
|
build_gemfile <<-Gemfile
|
39
11
|
source "https://rubygems.org"
|
40
12
|
|
41
13
|
gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
|
42
|
-
|
43
|
-
if RUBY_VERSION < "1.9"
|
44
|
-
#{File.read(File.join(PROJECT_ROOT, "Gemfile-1.8"))}
|
45
|
-
elsif RUBY_VERSION < "2.2"
|
46
|
-
#{File.read(File.join(PROJECT_ROOT, "Gemfile-2.1"))}
|
47
|
-
end
|
48
14
|
Gemfile
|
49
15
|
|
50
16
|
build_appraisal_file <<-Appraisals
|
@@ -56,7 +22,7 @@ describe "Bundle with custom path" do
|
|
56
22
|
run %(bundle install --path="#{path}")
|
57
23
|
run 'bundle exec appraisal install'
|
58
24
|
|
59
|
-
installed_gem = Dir.glob("tmp/stage/#{path}
|
25
|
+
installed_gem = Dir.glob("tmp/stage/#{path}/#{Gem.ruby_engine}/*/gems/*").
|
60
26
|
map { |path| path.split('/').last }.
|
61
27
|
select { |gem| gem.include?(gem_name) }
|
62
28
|
expect(installed_gem).not_to be_empty
|
@@ -68,4 +34,20 @@ describe "Bundle with custom path" do
|
|
68
34
|
expect(appraisal_output).to include("The Gemfile's dependencies are satisfied")
|
69
35
|
end
|
70
36
|
end
|
37
|
+
|
38
|
+
include_examples :gemfile_dependencies_are_satisfied
|
39
|
+
|
40
|
+
context 'when already installed in vendor/another' do
|
41
|
+
before do
|
42
|
+
build_gemfile <<-Gemfile
|
43
|
+
source "https://rubygems.org"
|
44
|
+
|
45
|
+
gem '#{gem_name}'
|
46
|
+
Gemfile
|
47
|
+
|
48
|
+
run 'bundle install --path vendor/another'
|
49
|
+
end
|
50
|
+
|
51
|
+
include_examples :gemfile_dependencies_are_satisfied
|
52
|
+
end
|
71
53
|
end
|
@@ -36,8 +36,8 @@ describe 'CLI', 'appraisal install' do
|
|
36
36
|
|
37
37
|
run 'appraisal install'
|
38
38
|
|
39
|
-
expect(content_of
|
40
|
-
current_directory
|
39
|
+
expect(content_of("gemfiles/1.0.0.gemfile.lock")).
|
40
|
+
not_to include(current_directory)
|
41
41
|
end
|
42
42
|
|
43
43
|
context 'with job size', :parallel => true do
|
@@ -52,19 +52,61 @@ describe 'CLI', 'appraisal install' do
|
|
52
52
|
it 'accepts --jobs option to set job size' do
|
53
53
|
output = run 'appraisal install --jobs=2'
|
54
54
|
|
55
|
-
expect(output).to include
|
56
|
-
|
55
|
+
expect(output).to include(
|
56
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=2"
|
57
|
+
)
|
57
58
|
end
|
58
59
|
|
59
60
|
it 'ignores --jobs option if the job size is less than or equal to 1' do
|
60
61
|
output = run 'appraisal install --jobs=0'
|
61
62
|
|
63
|
+
expect(output).to include(
|
64
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}'"
|
65
|
+
)
|
62
66
|
expect(output).not_to include(
|
63
|
-
|
67
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=0"
|
68
|
+
)
|
64
69
|
expect(output).not_to include(
|
65
|
-
|
66
|
-
|
67
|
-
|
70
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=1"
|
71
|
+
)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context "with full-index", :parallel do
|
76
|
+
before do
|
77
|
+
build_appraisal_file <<-APPRAISAL
|
78
|
+
appraise '1.0.0' do
|
79
|
+
gem 'dummy', '1.0.0'
|
80
|
+
end
|
81
|
+
APPRAISAL
|
82
|
+
end
|
83
|
+
|
84
|
+
it "accepts --full-index option to pull the full RubyGems index" do
|
85
|
+
output = run("appraisal install --full-index")
|
86
|
+
|
87
|
+
expect(output).to include(
|
88
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' " \
|
89
|
+
"--retry 1 --full-index true"
|
90
|
+
)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
context "with path", :parallel do
|
95
|
+
before do
|
96
|
+
build_appraisal_file <<-APPRAISAL
|
97
|
+
appraise '1.0.0' do
|
98
|
+
gem 'dummy', '1.0.0'
|
99
|
+
end
|
100
|
+
APPRAISAL
|
101
|
+
end
|
102
|
+
|
103
|
+
it "accepts --path option to specify the location to install gems into" do
|
104
|
+
output = run("appraisal install --path vendor/appraisal")
|
105
|
+
|
106
|
+
expect(output).to include(
|
107
|
+
"bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' " \
|
108
|
+
"--path #{file('vendor/appraisal')} --retry 1",
|
109
|
+
)
|
68
110
|
end
|
69
111
|
end
|
70
112
|
end
|
@@ -34,6 +34,8 @@ describe Appraisal::Appraisal do
|
|
34
34
|
before do
|
35
35
|
@appraisal = Appraisal::Appraisal.new('fake', 'fake')
|
36
36
|
allow(@appraisal).to receive(:gemfile_path).and_return("/home/test/test directory")
|
37
|
+
allow(@appraisal).to receive(:project_root).
|
38
|
+
and_return(Pathname.new("/home/test"))
|
37
39
|
allow(Appraisal::Command).to receive(:new).and_return(double(:run => true))
|
38
40
|
end
|
39
41
|
|
@@ -65,6 +67,13 @@ describe Appraisal::Appraisal do
|
|
65
67
|
with("#{bundle_check_command} || #{bundle_install_command_with_retries}")
|
66
68
|
end
|
67
69
|
|
70
|
+
it "runs install command with path on Bundler" do
|
71
|
+
@appraisal.install("path" => "vendor/appraisal")
|
72
|
+
|
73
|
+
expect(Appraisal::Command).to have_received(:new).
|
74
|
+
with("#{bundle_check_command} || #{bundle_install_command_with_path}")
|
75
|
+
end
|
76
|
+
|
68
77
|
def bundle_check_command
|
69
78
|
"bundle check --gemfile='/home/test/test directory'"
|
70
79
|
end
|
@@ -80,5 +89,10 @@ describe Appraisal::Appraisal do
|
|
80
89
|
def bundle_install_command_with_retries
|
81
90
|
"bundle install --gemfile='/home/test/test directory' --retry 3"
|
82
91
|
end
|
92
|
+
|
93
|
+
def bundle_install_command_with_path
|
94
|
+
"bundle install --gemfile='/home/test/test directory' " \
|
95
|
+
"--path /home/test/vendor/appraisal"
|
96
|
+
end
|
83
97
|
end
|
84
98
|
end
|
@@ -251,28 +251,28 @@ describe Appraisal::Gemfile do
|
|
251
251
|
end
|
252
252
|
|
253
253
|
context "relative path handling" do
|
254
|
-
before { stub_const('RUBY_VERSION', '
|
254
|
+
before { stub_const('RUBY_VERSION', '2.3.0') }
|
255
255
|
|
256
256
|
context "in :path option" do
|
257
257
|
it "handles dot path" do
|
258
258
|
gemfile = Appraisal::Gemfile.new
|
259
259
|
gemfile.gem "bacon", :path => "."
|
260
260
|
|
261
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
261
|
+
expect(gemfile.to_s).to eq %(gem "bacon", path: "../")
|
262
262
|
end
|
263
263
|
|
264
264
|
it "handles relative path" do
|
265
265
|
gemfile = Appraisal::Gemfile.new
|
266
266
|
gemfile.gem "bacon", :path => "../bacon"
|
267
267
|
|
268
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
268
|
+
expect(gemfile.to_s).to eq %(gem "bacon", path: "../../bacon")
|
269
269
|
end
|
270
270
|
|
271
271
|
it "handles absolute path" do
|
272
272
|
gemfile = Appraisal::Gemfile.new
|
273
273
|
gemfile.gem "bacon", :path => "/tmp"
|
274
274
|
|
275
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
275
|
+
expect(gemfile.to_s).to eq %(gem "bacon", path: "/tmp")
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
@@ -281,21 +281,21 @@ describe Appraisal::Gemfile do
|
|
281
281
|
gemfile = Appraisal::Gemfile.new
|
282
282
|
gemfile.gem "bacon", :git => "."
|
283
283
|
|
284
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
284
|
+
expect(gemfile.to_s).to eq %(gem "bacon", git: "../")
|
285
285
|
end
|
286
286
|
|
287
287
|
it "handles relative git path" do
|
288
288
|
gemfile = Appraisal::Gemfile.new
|
289
289
|
gemfile.gem "bacon", :git => "../bacon"
|
290
290
|
|
291
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
291
|
+
expect(gemfile.to_s).to eq %(gem "bacon", git: "../../bacon")
|
292
292
|
end
|
293
293
|
|
294
294
|
it "handles absolute git path" do
|
295
295
|
gemfile = Appraisal::Gemfile.new
|
296
296
|
gemfile.gem "bacon", :git => "/tmp"
|
297
297
|
|
298
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
298
|
+
expect(gemfile.to_s).to eq %(gem "bacon", git: "/tmp")
|
299
299
|
end
|
300
300
|
|
301
301
|
it "handles git uri" do
|
@@ -303,7 +303,7 @@ describe Appraisal::Gemfile do
|
|
303
303
|
gemfile.gem "bacon", :git => "git@github.com:bacon/bacon.git"
|
304
304
|
|
305
305
|
expect(gemfile.to_s).
|
306
|
-
to eq %(gem "bacon", :
|
306
|
+
to eq %(gem "bacon", git: "git@github.com:bacon/bacon.git")
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
@@ -414,20 +414,20 @@ describe Appraisal::Gemfile do
|
|
414
414
|
gemfile = Appraisal::Gemfile.new
|
415
415
|
gemfile.gemspec :path => "."
|
416
416
|
|
417
|
-
expect(gemfile.to_s).to eq %(gemspec :
|
417
|
+
expect(gemfile.to_s).to eq %(gemspec path: "../")
|
418
418
|
end
|
419
419
|
end
|
420
420
|
end
|
421
421
|
|
422
422
|
context "git_source support" do
|
423
|
-
before { stub_const('RUBY_VERSION', '
|
423
|
+
before { stub_const('RUBY_VERSION', '2.3.0') }
|
424
424
|
|
425
425
|
it "stores git_source declaration and apply it as git option" do
|
426
426
|
gemfile = Appraisal::Gemfile.new
|
427
427
|
gemfile.git_source(:custom_source) { |repo| "path/#{repo}" }
|
428
428
|
gemfile.gem "bacon", :custom_source => "bacon_pancake"
|
429
429
|
|
430
|
-
expect(gemfile.to_s).to eq %(gem "bacon", :
|
430
|
+
expect(gemfile.to_s).to eq %(gem "bacon", git: "../path/bacon_pancake")
|
431
431
|
end
|
432
432
|
end
|
433
433
|
end
|
@@ -3,35 +3,24 @@ require 'appraisal/utils'
|
|
3
3
|
|
4
4
|
describe Appraisal::Utils do
|
5
5
|
describe '.format_string' do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
expect(Appraisal::Utils.format_string(hash)).to eq('foo: "bar"')
|
6
|
+
it "prints out a nice looking hash without brackets with new syntax" do
|
7
|
+
hash = { :foo => 'bar' }
|
8
|
+
expect(Appraisal::Utils.format_string(hash)).to eq('foo: "bar"')
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
else
|
16
|
-
it "prints out a nice looking hash without brackets with old syntax" do
|
17
|
-
hash = { :foo => 'bar' }
|
18
|
-
expect(Appraisal::Utils.format_string(hash)).to eq(':foo => "bar"')
|
19
|
-
|
20
|
-
hash = { 'baz' => { :ball => 'boo' }}
|
21
|
-
expect(Appraisal::Utils.format_string(hash)).
|
22
|
-
to eq('"baz" => { :ball => "boo" }')
|
23
|
-
end
|
10
|
+
hash = { 'baz' => { :ball => 'boo' }}
|
11
|
+
expect(Appraisal::Utils.format_string(hash)).
|
12
|
+
to eq('"baz" => { ball: "boo" }')
|
24
13
|
end
|
25
14
|
end
|
26
15
|
|
27
16
|
describe '.format_arguments' do
|
28
|
-
before { stub_const('RUBY_VERSION', '
|
17
|
+
before { stub_const('RUBY_VERSION', '2.3.0') }
|
29
18
|
|
30
19
|
it 'prints out arguments without enclosing square brackets' do
|
31
20
|
arguments = [:foo, { :bar => { :baz => 'ball' }}]
|
32
21
|
|
33
22
|
expect(Appraisal::Utils.format_arguments(arguments)).to eq(
|
34
|
-
':foo, :
|
23
|
+
':foo, bar: { baz: "ball" }'
|
35
24
|
)
|
36
25
|
end
|
37
26
|
|
@@ -87,9 +87,7 @@ module AcceptanceTestHelpers
|
|
87
87
|
|
88
88
|
def content_of(path)
|
89
89
|
file(path).read.tap do |content|
|
90
|
-
|
91
|
-
content.gsub!(/(\S+): /, ":\\1 => ")
|
92
|
-
end
|
90
|
+
content.gsub!(/(\S+): /, ":\\1 => ")
|
93
91
|
end
|
94
92
|
end
|
95
93
|
|
@@ -141,12 +139,6 @@ module AcceptanceTestHelpers
|
|
141
139
|
source 'https://rubygems.org'
|
142
140
|
|
143
141
|
gem 'appraisal', :path => '#{PROJECT_ROOT}'
|
144
|
-
|
145
|
-
if RUBY_VERSION < "1.9"
|
146
|
-
#{File.read(File.join(PROJECT_ROOT, "Gemfile-1.8"))}
|
147
|
-
elsif RUBY_VERSION < "2.2"
|
148
|
-
#{File.read(File.join(PROJECT_ROOT, "Gemfile-2.1"))}
|
149
|
-
end
|
150
142
|
Gemfile
|
151
143
|
|
152
144
|
run "bundle install --binstubs --local"
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appraisal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Ferris
|
8
8
|
- Prem Sichanugrist
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -96,8 +96,6 @@ files:
|
|
96
96
|
- ".travis.yml"
|
97
97
|
- CONTRIBUTING.md
|
98
98
|
- Gemfile
|
99
|
-
- Gemfile-1.8
|
100
|
-
- Gemfile-2.1
|
101
99
|
- MIT-LICENSE
|
102
100
|
- README.md
|
103
101
|
- Rakefile
|
@@ -116,7 +114,6 @@ files:
|
|
116
114
|
- lib/appraisal/gemspec.rb
|
117
115
|
- lib/appraisal/git.rb
|
118
116
|
- lib/appraisal/group.rb
|
119
|
-
- lib/appraisal/ordered_hash.rb
|
120
117
|
- lib/appraisal/path.rb
|
121
118
|
- lib/appraisal/platform.rb
|
122
119
|
- lib/appraisal/source.rb
|
@@ -152,7 +149,7 @@ homepage: http://github.com/thoughtbot/appraisal
|
|
152
149
|
licenses:
|
153
150
|
- MIT
|
154
151
|
metadata: {}
|
155
|
-
post_install_message:
|
152
|
+
post_install_message:
|
156
153
|
rdoc_options: []
|
157
154
|
require_paths:
|
158
155
|
- lib
|
@@ -160,16 +157,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
157
|
requirements:
|
161
158
|
- - ">="
|
162
159
|
- !ruby/object:Gem::Version
|
163
|
-
version:
|
160
|
+
version: 2.3.0
|
164
161
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
162
|
requirements:
|
166
163
|
- - ">="
|
167
164
|
- !ruby/object:Gem::Version
|
168
165
|
version: '0'
|
169
166
|
requirements: []
|
170
|
-
|
171
|
-
|
172
|
-
signing_key:
|
167
|
+
rubygems_version: 3.1.2
|
168
|
+
signing_key:
|
173
169
|
specification_version: 4
|
174
170
|
summary: Find out what your Ruby gems are worth
|
175
171
|
test_files:
|
data/Gemfile-1.8
DELETED
data/Gemfile-2.1
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
module Appraisal
|
2
|
-
# An ordered hash implementation for Ruby 1.8.7 compatibility. This is not
|
3
|
-
# a complete implementation, but it covers Appraisal's specific needs.
|
4
|
-
class OrderedHash < ::Hash
|
5
|
-
# Hashes are ordered in Ruby 1.9.
|
6
|
-
if RUBY_VERSION < '1.9'
|
7
|
-
def initialize(*args, &block)
|
8
|
-
super
|
9
|
-
@keys = []
|
10
|
-
end
|
11
|
-
|
12
|
-
def []=(key, value)
|
13
|
-
@keys << key unless has_key?(key)
|
14
|
-
super
|
15
|
-
end
|
16
|
-
|
17
|
-
def values
|
18
|
-
@keys.collect { |key| self[key] }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|