appraisal 2.0.1 → 2.0.2

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
2
  SHA1:
3
- metadata.gz: 3ab623ad895ec0d2c27cd4a0865a476ca268c355
4
- data.tar.gz: 7525addf1bd53d5b424bcb314390b620ddee77e5
3
+ metadata.gz: 3e62486edd88ce962fe2bfa9385aaee5f7a18a3d
4
+ data.tar.gz: 87e7f4913a92cef3083029622223544ea4de2701
5
5
  SHA512:
6
- metadata.gz: 564306857e229c592407c8f1c027d7da3a1b34ed62c49e51b4d3186a39346e1d68d6d14e0bad0887a15241dd4cb5597e7f0fea69125bdd4980ef0a3b9db6caa3
7
- data.tar.gz: e24f07952fc90e2c088a2932dcd827d1a4590faa63469ae45168a1a870d6af48c65bd302eb8c75ca0dbd134977820c37b1c167afe4a12a10978f5d883537b6df
6
+ metadata.gz: 39c0aefe135188fb147aef623f10ff609e478daca8836855767c1260dc18576fc364c83dea9ee76aee39c84fc9afce5802a3c26b5a666c97e32b67b63a25a733
7
+ data.tar.gz: c80f38736122daa41bfc7f7c1773b2cc49e6b931707157d9c3dbca01ab4c35d30291ee858b29251a72f1506744d1fde3321f16447d4f370afbc097b3c0a93db7
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_runtime_dependency('rake')
22
22
  s.add_runtime_dependency('bundler')
23
23
  s.add_runtime_dependency('thor', '>= 0.14.0')
24
- s.add_runtime_dependency("activesupport", ">= 3.2.21")
25
24
 
25
+ s.add_development_dependency("activesupport", ">= 3.2.21")
26
26
  s.add_development_dependency('rspec', '~> 3.0')
27
27
  end
@@ -60,7 +60,12 @@ module Appraisal
60
60
  install_command(job_size)
61
61
  ].flatten.join(" ")
62
62
 
63
- Command.new(command).run
63
+ if Bundler.settings[:path]
64
+ env = { 'BUNDLE_DISABLE_SHARED_GEMS' => '1' }
65
+ Command.new(command, :env => env).run
66
+ else
67
+ Command.new(command).run
68
+ end
64
69
  end
65
70
 
66
71
  def update(gems = [])
@@ -1,5 +1,5 @@
1
1
  require "appraisal/dependency_list"
2
- require "active_support/ordered_hash"
2
+ require "appraisal/ordered_hash"
3
3
 
4
4
  module Appraisal
5
5
  class BundlerDSL
@@ -13,10 +13,10 @@ module Appraisal
13
13
  @ruby_version = nil
14
14
  @dependencies = DependencyList.new
15
15
  @gemspec = nil
16
- @groups = ActiveSupport::OrderedHash.new
17
- @platforms = ActiveSupport::OrderedHash.new
18
- @git_sources = ActiveSupport::OrderedHash.new
19
- @path_sources = ActiveSupport::OrderedHash.new
16
+ @groups = OrderedHash.new
17
+ @platforms = OrderedHash.new
18
+ @git_sources = OrderedHash.new
19
+ @path_sources = OrderedHash.new
20
20
  end
21
21
 
22
22
  def run(&block)
@@ -1,10 +1,10 @@
1
1
  require 'appraisal/dependency'
2
- require "active_support/ordered_hash"
2
+ require 'appraisal/ordered_hash'
3
3
 
4
4
  module Appraisal
5
5
  class DependencyList
6
6
  def initialize
7
- @dependencies = ActiveSupport::OrderedHash.new
7
+ @dependencies = OrderedHash.new
8
8
  end
9
9
 
10
10
  def add(name, requirements)
@@ -10,7 +10,9 @@ module Appraisal
10
10
  # Load bundler Gemfiles and merge dependencies
11
11
  class Gemfile < BundlerDSL
12
12
  def load(path)
13
- run(IO.read(path))
13
+ if ::File.exist?(path)
14
+ run(IO.read(path))
15
+ end
14
16
  end
15
17
 
16
18
  def run(definitions)
@@ -0,0 +1,22 @@
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
@@ -3,8 +3,9 @@ require "yaml"
3
3
 
4
4
  module Appraisal
5
5
  class TravisCIHelper
6
- NO_CONFIGURATION_WARNING = <<-WARNING.strip
7
- Note: Run with --travis to generate Travis CI configuration.
6
+ NO_CONFIGURATION_WARNING = <<-WARNING.strip.gsub(/\s+/, " ")
7
+ Note: Run `appraisal generate --travis` to generate Travis CI
8
+ configuration.
8
9
  WARNING
9
10
 
10
11
  INVALID_CONFIGURATION_WARNING = <<-WARNING.strip.gsub(/\s+/, " ")
@@ -1,3 +1,3 @@
1
1
  module Appraisal
2
- VERSION = '2.0.1'.freeze
2
+ VERSION = "2.0.2".freeze
3
3
  end
@@ -19,4 +19,52 @@ describe "Bundle with custom path" do
19
19
  expect(file "gemfiles/breakfast.gemfile").to be_exists
20
20
  expect(output).to include("Successfully installed bundler")
21
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
36
+
37
+ it 'installs gems in the --path directory' do
38
+ build_gemfile <<-Gemfile
39
+ source "https://rubygems.org"
40
+
41
+ gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
42
+
43
+ if RUBY_VERSION < "1.9"
44
+ gem "i18n", "~> 0.6.0"
45
+ gem "activesupport", "~> 3.2.21"
46
+ end
47
+ Gemfile
48
+
49
+ build_appraisal_file <<-Appraisals
50
+ appraise "#{gem_name}" do
51
+ gem '#{gem_name}'
52
+ end
53
+ Appraisals
54
+
55
+ run %(bundle install --path="#{path}")
56
+ run 'bundle exec appraisal install'
57
+
58
+ installed_gem = Dir.glob("tmp/stage/#{path}/ruby/*/gems/*").
59
+ map { |path| path.split('/').last }.
60
+ select { |gem| gem.include?(gem_name) }
61
+ expect(installed_gem).not_to be_empty
62
+
63
+ bundle_output = run 'bundle check'
64
+ expect(bundle_output).to include("The Gemfile's dependencies are satisfied")
65
+
66
+ appraisal_output = run 'bundle exec appraisal install'
67
+ expect(appraisal_output).to include("The Gemfile's dependencies are satisfied")
68
+ end
69
+ end
22
70
  end
@@ -7,6 +7,7 @@ require 'rspec/matchers/built_in/raise_error'
7
7
 
8
8
  describe Appraisal::File do
9
9
  it "complains when no Appraisals file is found" do
10
+ allow(::File).to receive(:exist?).with(/Gemfile/).and_return(true)
10
11
  allow(::File).to receive(:exist?).with("Appraisals").and_return(false)
11
12
  expect { described_class.new }.to raise_error(Appraisal::AppraisalsNotFound)
12
13
  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: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Ferris
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-14 00:00:00.000000000 Z
12
+ date: 2015-06-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -60,7 +60,7 @@ dependencies:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: 3.2.21
63
- type: :runtime
63
+ type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
@@ -114,6 +114,7 @@ files:
114
114
  - lib/appraisal/gemspec.rb
115
115
  - lib/appraisal/git_source.rb
116
116
  - lib/appraisal/group.rb
117
+ - lib/appraisal/ordered_hash.rb
117
118
  - lib/appraisal/path_source.rb
118
119
  - lib/appraisal/platform.rb
119
120
  - lib/appraisal/task.rb
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  version: '0'
164
165
  requirements: []
165
166
  rubyforge_project:
166
- rubygems_version: 2.4.6
167
+ rubygems_version: 2.4.8
167
168
  signing_key:
168
169
  specification_version: 4
169
170
  summary: Find out what your Ruby gems are worth