appraisal 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 398a456edb84cd58cc28ce0e4f1f48fa71fba9ec
4
- data.tar.gz: f345bc81392798434127f0809c9038f73901822c
2
+ SHA256:
3
+ metadata.gz: 0e5becde2c97891ac7e0d0cb0e8943653ec7b43ca3dcad2f60a8aa7becd9a977
4
+ data.tar.gz: bac9e06f7948cc07025d06572f373f444e8159422ac9c62aa5e29ae6e32f6fdb
5
5
  SHA512:
6
- metadata.gz: 5828d0980b60a878098edb125dcb09582d5328315c0724e50522489e9d3bdd63f7c68b353d372d8442521e98d4dbc84fc2373f32aedf7dafabc5a88a81ecf625
7
- data.tar.gz: a6fc78e3735ed05b871ac0ddb7f1f7dc64b0734985ace8992b0a7198a28eeb2f9dd1910b925a2fe9c2ca3f50cbe46bea4d28d93db5712a9366c2eb9e52a3a207
6
+ metadata.gz: d9b23d137f23b270822cf4e49248cc2f2a3bd229668d96f44feaf3a7d804b7daddca6429ebe2dba8f5782ee5b4f9860da0e0976e9b25e5baf419180e463bb85e
7
+ data.tar.gz: de06629b275c669997f73c5e840458f6de44ca435a4e8a543ff49b8e4d7a6c98d44006dc780df173d37958a4b6e8286184571a135b19d9529465206f7f548d8d
@@ -1,23 +1,18 @@
1
- sudo: false
2
-
3
- before_install: gem install bundler
1
+ ---
2
+ before_install: gem install bundler:2.1.4
4
3
 
5
4
  rvm:
6
- - 1.8.7-head
7
- - 1.9.3-p551
8
- - 2.0.0-p648
9
- - 2.1.10
10
- - 2.2.6
11
- - 2.3.3
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: 2.4.0-preview3
18
+ - rvm: jruby-head
data/Gemfile CHANGED
@@ -4,9 +4,3 @@ gemspec
4
4
 
5
5
  # This here to make sure appraisal works with Rails 3.0.0.
6
6
  gem "thor", "~> 0.14.0"
7
-
8
- if RUBY_VERSION < "1.9"
9
- eval File.read("Gemfile-1.8")
10
- elsif RUBY_VERSION < "2.2"
11
- eval File.read("Gemfile-2.1")
12
- end
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 Gemfile:
22
+ In your package's `.gemspec`:
23
23
 
24
- gem "appraisal"
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
 
@@ -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')
@@ -119,7 +119,11 @@ module Appraisal
119
119
  end
120
120
 
121
121
  def gemfile_root
122
- Pathname.new(File.join(Dir.pwd, "gemfiles"))
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 = OrderedHash.new
17
- @platforms = OrderedHash.new
18
- @gits = OrderedHash.new
19
- @paths = OrderedHash.new
20
- @source_blocks = OrderedHash.new
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] ||= Group.new(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] ||= Platform.new(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] ||= Source.new(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] ||= Git.new(source, options)
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] ||= Path.new(source, options)
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
 
@@ -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
 
@@ -41,9 +41,9 @@ module Appraisal
41
41
  end
42
42
 
43
43
  def ensure_bundler_is_available
44
- unless system %(gem list -q "^bundler$" | grep -q bundler)
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
@@ -1,10 +1,9 @@
1
1
  require 'appraisal/dependency'
2
- require 'appraisal/ordered_hash'
3
2
 
4
3
  module Appraisal
5
4
  class DependencyList
6
5
  def initialize
7
- @dependencies = OrderedHash.new
6
+ @dependencies = Hash.new
8
7
  end
9
8
 
10
9
  def add(name, requirements)
@@ -26,7 +26,7 @@ module Appraisal
26
26
  key = format_string(key, true)
27
27
  value = format_string(value, true)
28
28
 
29
- if RUBY_VERSION >= "1.9" && key.start_with?(":")
29
+ if key.start_with?(":")
30
30
  "#{key.sub(/^:/, "")}: #{value}"
31
31
  else
32
32
  "#{key} => #{value}"
@@ -1,3 +1,3 @@
1
1
  module Appraisal
2
- VERSION = "2.2.0".freeze
2
+ VERSION = "2.3.0".freeze
3
3
  end
@@ -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 "1.8.7"
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 "1.8.7"
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
- it "supports --path option" do
5
- build_gemfile <<-Gemfile
6
- source "https://rubygems.org"
4
+ let(:gem_name) { 'rack' }
5
+ let(:path) { 'vendor/bundle' }
7
6
 
8
- gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
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}/ruby/*/gems/*").
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 'gemfiles/1.0.0.gemfile.lock').not_to include
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
- 'bundle install --gemfile=gemfiles/1.0.0.gemfile --jobs=2'
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
- 'bundle install --gemfile=gemfiles/1.0.0.gemfile')
67
+ "bundle install --gemfile='#{file('gemfiles/1.0.0.gemfile')}' --jobs=0"
68
+ )
64
69
  expect(output).not_to include(
65
- 'bundle install --gemfile=gemfiles/1.0.0.gemfile --jobs=0')
66
- expect(output).not_to include(
67
- 'bundle install --gemfile=gemfiles/1.0.0.gemfile --jobs=1')
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', '1.8.7') }
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", :path => "../")
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", :path => "../../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", :path => "/tmp")
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", :git => "../")
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", :git => "../../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", :git => "/tmp")
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", :git => "git@github.com:bacon/bacon.git")
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 :path => "../")
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', '1.8.7') }
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", :git => "../path/bacon_pancake")
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
- if RUBY_VERSION > "1.9"
7
- it "prints out a nice looking hash without brackets with new syntax" do
8
- hash = { :foo => 'bar' }
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
- hash = { 'baz' => { :ball => 'boo' }}
12
- expect(Appraisal::Utils.format_string(hash)).
13
- to eq('"baz" => { ball: "boo" }')
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', '1.8.7') }
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, :bar => { :baz => "ball" }'
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
- if RUBY_VERSION >= "1.9"
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.2.0
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: 2017-04-19 00:00:00.000000000 Z
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: '0'
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
- rubyforge_project:
171
- rubygems_version: 2.6.8
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:
@@ -1,5 +0,0 @@
1
- # These gems are locked for Ruby 1.8.7 compatibility
2
- gem "i18n", "~> 0.6.0"
3
- gem "activesupport", "~> 3.2.21"
4
- gem "rake", "~> 10.5"
5
- gem "rack", "~> 1.6.5"
@@ -1,3 +0,0 @@
1
- # These gems are locked for Ruby 2.1.0 compatibility
2
- gem "activesupport", "~> 4.2.7"
3
- gem "rack", "~> 1.6.5"
@@ -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