appraisal 2.0.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 +8 -12
- data/Gemfile +2 -7
- data/README.md +53 -23
- data/appraisal.gemspec +3 -1
- data/lib/appraisal/appraisal.rb +53 -24
- data/lib/appraisal/{file.rb → appraisal_file.rb} +2 -2
- data/lib/appraisal/bundler_dsl.rb +62 -33
- data/lib/appraisal/cli.rb +23 -9
- data/lib/appraisal/command.rb +7 -4
- data/lib/appraisal/dependency_list.rb +1 -2
- data/lib/appraisal/gemfile.rb +7 -3
- data/lib/appraisal/{git_source.rb → git.rb} +1 -1
- data/lib/appraisal/{path_source.rb → path.rb} +1 -1
- data/lib/appraisal/source.rb +30 -0
- data/lib/appraisal/task.rb +2 -2
- data/lib/appraisal/travis_ci_helper.rb +14 -10
- data/lib/appraisal/utils.rb +20 -2
- data/lib/appraisal/version.rb +1 -1
- data/spec/acceptance/appraisals_file_bundler_dsl_compatibility_spec.rb +26 -4
- data/spec/acceptance/bundle_with_custom_path_spec.rb +44 -13
- data/spec/acceptance/bundle_without_spec.rb +51 -0
- data/spec/acceptance/cli/install_spec.rb +50 -8
- data/spec/acceptance/cli/update_spec.rb +2 -1
- data/spec/acceptance/gemspec_spec.rb +1 -0
- data/spec/acceptance/travis_ci_integration_spec.rb +3 -3
- data/spec/appraisal/{file_spec.rb → appraisal_file_spec.rb} +4 -3
- data/spec/appraisal/appraisal_spec.rb +27 -2
- data/spec/appraisal/gemfile_spec.rb +22 -8
- data/spec/appraisal/utils_spec.rb +18 -4
- data/spec/support/acceptance_test_helpers.rb +6 -7
- data/spec/support/dependency_helpers.rb +4 -0
- metadata +16 -14
    
        data/lib/appraisal/cli.rb
    CHANGED
    
    | @@ -19,11 +19,11 @@ module Appraisal | |
| 19 19 | 
             
                      appraisal, otherwise it runs the EXTERNAL_COMMAND against all appraisals.
         | 
| 20 20 | 
             
                  help
         | 
| 21 21 |  | 
| 22 | 
            -
                  if  | 
| 22 | 
            +
                  if File.exist?('Appraisals')
         | 
| 23 23 | 
             
                    shell.say
         | 
| 24 24 | 
             
                    shell.say 'Available Appraisal(s):'
         | 
| 25 25 |  | 
| 26 | 
            -
                     | 
| 26 | 
            +
                    AppraisalFile.each do |appraisal|
         | 
| 27 27 | 
             
                      shell.say "  - #{appraisal.name}"
         | 
| 28 28 | 
             
                    end
         | 
| 29 29 | 
             
                  end
         | 
| @@ -41,11 +41,23 @@ module Appraisal | |
| 41 41 | 
             
                method_option 'jobs', :aliases => 'j', :type => :numeric, :default => 1,
         | 
| 42 42 | 
             
                  :banner => 'SIZE',
         | 
| 43 43 | 
             
                  :desc => 'Install gems in parallel using the given number of workers.'
         | 
| 44 | 
            +
                method_option 'retry', :type => :numeric, :default => 1,
         | 
| 45 | 
            +
                  :desc => 'Retry network and git requests that have failed'
         | 
| 46 | 
            +
                method_option "without", :banner => "GROUP_NAMES",
         | 
| 47 | 
            +
                  :desc => "A space-separated list of groups referencing gems to skip " +
         | 
| 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 | 
            +
             | 
| 44 56 | 
             
                def install
         | 
| 45 57 | 
             
                  invoke :generate, [], {}
         | 
| 46 58 |  | 
| 47 | 
            -
                   | 
| 48 | 
            -
                    appraisal.install(options | 
| 59 | 
            +
                  AppraisalFile.each do |appraisal|
         | 
| 60 | 
            +
                    appraisal.install(options)
         | 
| 49 61 | 
             
                    appraisal.relativize
         | 
| 50 62 | 
             
                  end
         | 
| 51 63 | 
             
                end
         | 
| @@ -53,7 +65,7 @@ module Appraisal | |
| 53 65 | 
             
                desc 'generate', 'Generate a gemfile for each appraisal'
         | 
| 54 66 | 
             
                method_option "travis", :type => :boolean, :default => false
         | 
| 55 67 | 
             
                def generate
         | 
| 56 | 
            -
                   | 
| 68 | 
            +
                  AppraisalFile.each do |appraisal|
         | 
| 57 69 | 
             
                    appraisal.write_gemfile
         | 
| 58 70 | 
             
                  end
         | 
| 59 71 |  | 
| @@ -73,14 +85,14 @@ module Appraisal | |
| 73 85 | 
             
                def update(*gems)
         | 
| 74 86 | 
             
                  invoke :generate, []
         | 
| 75 87 |  | 
| 76 | 
            -
                   | 
| 88 | 
            +
                  AppraisalFile.each do |appraisal|
         | 
| 77 89 | 
             
                    appraisal.update(gems)
         | 
| 78 90 | 
             
                  end
         | 
| 79 91 | 
             
                end
         | 
| 80 92 |  | 
| 81 93 | 
             
                desc 'list', 'List the names of the defined appraisals'
         | 
| 82 94 | 
             
                def list
         | 
| 83 | 
            -
                   | 
| 95 | 
            +
                  AppraisalFile.new.appraisals.each { |appraisal| puts appraisal.name }
         | 
| 84 96 | 
             
                end
         | 
| 85 97 |  | 
| 86 98 | 
             
                desc "version", "Display the version and exit"
         | 
| @@ -91,12 +103,14 @@ module Appraisal | |
| 91 103 | 
             
                private
         | 
| 92 104 |  | 
| 93 105 | 
             
                def method_missing(name, *args, &block)
         | 
| 94 | 
            -
                  matching_appraisal =  | 
| 106 | 
            +
                  matching_appraisal = AppraisalFile.new.appraisals.detect do |appraisal|
         | 
| 107 | 
            +
                    appraisal.name == name.to_s
         | 
| 108 | 
            +
                  end
         | 
| 95 109 |  | 
| 96 110 | 
             
                  if matching_appraisal
         | 
| 97 111 | 
             
                    Command.new(args, :gemfile => matching_appraisal.gemfile_path).run
         | 
| 98 112 | 
             
                  else
         | 
| 99 | 
            -
                     | 
| 113 | 
            +
                    AppraisalFile.each do |appraisal|
         | 
| 100 114 | 
             
                      Command.new(ARGV, :gemfile => appraisal.gemfile_path).run
         | 
| 101 115 | 
             
                    end
         | 
| 102 116 | 
             
                  end
         | 
    
        data/lib/appraisal/command.rb
    CHANGED
    
    | @@ -41,14 +41,17 @@ 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 47 |  | 
| 47 | 
            -
                    unless system "gem install bundler"
         | 
| 48 | 
            +
                    unless system "gem install bundler --version #{version}"
         | 
| 48 49 | 
             
                      puts
         | 
| 49 50 | 
             
                      puts <<-ERROR.strip.gsub(/\s+/, " ")
         | 
| 50 | 
            -
                        Bundler installation failed. | 
| 51 | 
            -
                         | 
| 51 | 
            +
                        Bundler installation failed.
         | 
| 52 | 
            +
                        Please try running:
         | 
| 53 | 
            +
                          `GEM_HOME="#{ENV["GEM_HOME"]}" gem install bundler --version #{version}`
         | 
| 54 | 
            +
                        manually.
         | 
| 52 55 | 
             
                      ERROR
         | 
| 53 56 | 
             
                      exit(1)
         | 
| 54 57 | 
             
                    end
         | 
    
        data/lib/appraisal/gemfile.rb
    CHANGED
    
    | @@ -2,15 +2,18 @@ require "appraisal/bundler_dsl" | |
| 2 2 |  | 
| 3 3 | 
             
            module Appraisal
         | 
| 4 4 | 
             
              autoload :Gemspec, "appraisal/gemspec"
         | 
| 5 | 
            -
              autoload : | 
| 6 | 
            -
              autoload :PathSource, "appraisal/path_source"
         | 
| 5 | 
            +
              autoload :Git, "appraisal/git"
         | 
| 7 6 | 
             
              autoload :Group, "appraisal/group"
         | 
| 7 | 
            +
              autoload :Path, "appraisal/path"
         | 
| 8 8 | 
             
              autoload :Platform, "appraisal/platform"
         | 
| 9 | 
            +
              autoload :Source, "appraisal/source"
         | 
| 9 10 |  | 
| 10 11 | 
             
              # Load bundler Gemfiles and merge dependencies
         | 
| 11 12 | 
             
              class Gemfile < BundlerDSL
         | 
| 12 13 | 
             
                def load(path)
         | 
| 13 | 
            -
                   | 
| 14 | 
            +
                  if File.exist?(path)
         | 
| 15 | 
            +
                    run(IO.read(path))
         | 
| 16 | 
            +
                  end
         | 
| 14 17 | 
             
                end
         | 
| 15 18 |  | 
| 16 19 | 
             
                def run(definitions)
         | 
| @@ -19,6 +22,7 @@ module Appraisal | |
| 19 22 |  | 
| 20 23 | 
             
                def dup
         | 
| 21 24 | 
             
                  Gemfile.new.tap do |gemfile|
         | 
| 25 | 
            +
                    gemfile.git_sources = @git_sources
         | 
| 22 26 | 
             
                    gemfile.run(for_dup)
         | 
| 23 27 | 
             
                  end
         | 
| 24 28 | 
             
                end
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            require "appraisal/bundler_dsl"
         | 
| 2 | 
            +
            require "appraisal/utils"
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            module Appraisal
         | 
| 5 | 
            +
              class Source < BundlerDSL
         | 
| 6 | 
            +
                def initialize(source)
         | 
| 7 | 
            +
                  super()
         | 
| 8 | 
            +
                  @source = source
         | 
| 9 | 
            +
                end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                def to_s
         | 
| 12 | 
            +
                  formatted_output indent(super)
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                # :nodoc:
         | 
| 16 | 
            +
                def for_dup
         | 
| 17 | 
            +
                  formatted_output indent(super)
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                private
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                def formatted_output(output_dependencies)
         | 
| 23 | 
            +
                  <<-OUTPUT.strip
         | 
| 24 | 
            +
            source #{@source.inspect} do
         | 
| 25 | 
            +
            #{output_dependencies}
         | 
| 26 | 
            +
            end
         | 
| 27 | 
            +
                    OUTPUT
         | 
| 28 | 
            +
                end
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
            end
         | 
    
        data/lib/appraisal/task.rb
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            require 'appraisal/ | 
| 1 | 
            +
            require 'appraisal/appraisal_file'
         | 
| 2 2 | 
             
            require 'rake/tasklib'
         | 
| 3 3 |  | 
| 4 4 | 
             
            module Appraisal
         | 
| @@ -29,7 +29,7 @@ module Appraisal | |
| 29 29 | 
             
                    end
         | 
| 30 30 |  | 
| 31 31 | 
             
                    begin
         | 
| 32 | 
            -
                       | 
| 32 | 
            +
                      AppraisalFile.each do |appraisal|
         | 
| 33 33 | 
             
                        desc "DEPRECATED: Run the given task for appraisal #{appraisal.name}"
         | 
| 34 34 | 
             
                        task appraisal.name do
         | 
| 35 35 | 
             
                          ARGV.shift
         | 
| @@ -1,10 +1,11 @@ | |
| 1 | 
            -
            require "appraisal/ | 
| 1 | 
            +
            require "appraisal/appraisal_file"
         | 
| 2 2 | 
             
            require "yaml"
         | 
| 3 3 |  | 
| 4 4 | 
             
            module Appraisal
         | 
| 5 5 | 
             
              class TravisCIHelper
         | 
| 6 | 
            -
                NO_CONFIGURATION_WARNING = <<-WARNING.strip
         | 
| 7 | 
            -
                  Note: Run  | 
| 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+/, " ")
         | 
| @@ -12,11 +13,14 @@ module Appraisal | |
| 12 13 | 
             
                  `appraisal generate --travis` to get the correct configuration.
         | 
| 13 14 | 
             
                WARNING
         | 
| 14 15 |  | 
| 16 | 
            +
                # @see http://docs.travis-ci.com/user/languages/ruby/
         | 
| 17 | 
            +
                GEMFILES_CONFIGURATION_KEY = "gemfile".freeze
         | 
| 18 | 
            +
             | 
| 15 19 | 
             
                def self.display_instruction
         | 
| 16 20 | 
             
                  puts "# Put this in your .travis.yml"
         | 
| 17 | 
            -
                  puts " | 
| 21 | 
            +
                  puts "#{GEMFILES_CONFIGURATION_KEY}:"
         | 
| 18 22 |  | 
| 19 | 
            -
                   | 
| 23 | 
            +
                  AppraisalFile.each do |appraisal|
         | 
| 20 24 | 
             
                    puts "  - #{appraisal.relative_gemfile_path}"
         | 
| 21 25 | 
             
                  end
         | 
| 22 26 | 
             
                end
         | 
| @@ -41,18 +45,18 @@ module Appraisal | |
| 41 45 | 
             
                  private
         | 
| 42 46 |  | 
| 43 47 | 
             
                  def has_configuration_file?
         | 
| 44 | 
            -
                     | 
| 48 | 
            +
                    File.exist?(CONFIGURATION_FILE)
         | 
| 45 49 | 
             
                  end
         | 
| 46 50 |  | 
| 47 51 | 
             
                  def has_no_gemfiles_configuration?
         | 
| 48 | 
            -
                    !(configuration && configuration.has_key?( | 
| 52 | 
            +
                    !(configuration && configuration.has_key?(GEMFILES_CONFIGURATION_KEY))
         | 
| 49 53 | 
             
                  end
         | 
| 50 54 |  | 
| 51 55 | 
             
                  def has_invalid_gemfiles_configuration?
         | 
| 52 | 
            -
                    if configuration && configuration[ | 
| 56 | 
            +
                    if configuration && configuration[GEMFILES_CONFIGURATION_KEY]
         | 
| 53 57 | 
             
                      appraisal_paths =
         | 
| 54 | 
            -
                         | 
| 55 | 
            -
                      travis_gemfile_paths = configuration[ | 
| 58 | 
            +
                        AppraisalFile.new.appraisals.map(&:relative_gemfile_path).sort
         | 
| 59 | 
            +
                      travis_gemfile_paths = configuration[GEMFILES_CONFIGURATION_KEY].sort
         | 
| 56 60 | 
             
                      appraisal_paths != travis_gemfile_paths
         | 
| 57 61 | 
             
                    end
         | 
| 58 62 | 
             
                  end
         | 
    
        data/lib/appraisal/utils.rb
    CHANGED
    
    | @@ -9,7 +9,7 @@ module Appraisal | |
| 9 9 | 
             
                  case object
         | 
| 10 10 | 
             
                  when Hash
         | 
| 11 11 | 
             
                    items = object.map do |key, value|
         | 
| 12 | 
            -
                       | 
| 12 | 
            +
                      format_hash_value(key, value)
         | 
| 13 13 | 
             
                    end
         | 
| 14 14 |  | 
| 15 15 | 
             
                    if enclosing_object
         | 
| @@ -22,6 +22,17 @@ module Appraisal | |
| 22 22 | 
             
                  end
         | 
| 23 23 | 
             
                end
         | 
| 24 24 |  | 
| 25 | 
            +
                def self.format_hash_value(key, value)
         | 
| 26 | 
            +
                  key = format_string(key, true)
         | 
| 27 | 
            +
                  value = format_string(value, true)
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                  if key.start_with?(":")
         | 
| 30 | 
            +
                    "#{key.sub(/^:/, "")}: #{value}"
         | 
| 31 | 
            +
                  else
         | 
| 32 | 
            +
                    "#{key} => #{value}"
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
             | 
| 25 36 | 
             
                def self.format_arguments(arguments)
         | 
| 26 37 | 
             
                  unless arguments.empty?
         | 
| 27 38 | 
             
                    arguments.map { |object| format_string(object, false) }.join(', ')
         | 
| @@ -35,10 +46,17 @@ module Appraisal | |
| 35 46 | 
             
                def self.prefix_path(path)
         | 
| 36 47 | 
             
                  if path !~ /^(?:\/|\S:)/ && path !~ /^\S+:\/\// && path !~ /^\S+@\S+:/
         | 
| 37 48 | 
             
                    cleaned_path = path.gsub(/(^|\/)\.(?:\/|$)/, "\\1")
         | 
| 38 | 
            -
                     | 
| 49 | 
            +
                    File.join("..", cleaned_path)
         | 
| 39 50 | 
             
                  else
         | 
| 40 51 | 
             
                    path
         | 
| 41 52 | 
             
                  end
         | 
| 42 53 | 
             
                end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
                def self.bundler_version
         | 
| 56 | 
            +
                  Gem::Specification.
         | 
| 57 | 
            +
                    detect { |spec| spec.name == "bundler" }.
         | 
| 58 | 
            +
                    version.
         | 
| 59 | 
            +
                    to_s
         | 
| 60 | 
            +
                end
         | 
| 43 61 | 
             
              end
         | 
| 44 62 | 
             
            end
         | 
    
        data/lib/appraisal/version.rb
    CHANGED
    
    
| @@ -2,14 +2,16 @@ require 'spec_helper' | |
| 2 2 |  | 
| 3 3 | 
             
            describe 'Appraisals file Bundler DSL compatibility' do
         | 
| 4 4 | 
             
              it 'supports all Bundler DSL in Appraisals file' do
         | 
| 5 | 
            -
                build_gems %w(bagel orange_juice milk waffle coffee ham)
         | 
| 6 | 
            -
                 | 
| 5 | 
            +
                build_gems %w(bagel orange_juice milk waffle coffee ham sausage pancake)
         | 
| 6 | 
            +
                build_git_gems %w(egg croissant pain_au_chocolat omelette)
         | 
| 7 7 |  | 
| 8 8 | 
             
                build_gemfile <<-Gemfile
         | 
| 9 9 | 
             
                  source 'https://rubygems.org'
         | 
| 10 | 
            +
                  git_source(:custom_git_source) { |repo| "../gems/\#{repo}" }
         | 
| 10 11 | 
             
                  ruby RUBY_VERSION
         | 
| 11 12 |  | 
| 12 13 | 
             
                  gem 'bagel'
         | 
| 14 | 
            +
                  gem "croissant", :custom_git_source => "croissant"
         | 
| 13 15 |  | 
| 14 16 | 
             
                  git '../gems/egg' do
         | 
| 15 17 | 
             
                    gem 'egg'
         | 
| @@ -21,6 +23,7 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 21 23 |  | 
| 22 24 | 
             
                  group :breakfast do
         | 
| 23 25 | 
             
                    gem 'orange_juice'
         | 
| 26 | 
            +
                    gem "omelette", :custom_git_source => "omelette"
         | 
| 24 27 | 
             
                  end
         | 
| 25 28 |  | 
| 26 29 | 
             
                  platforms :ruby, :jruby do
         | 
| @@ -31,15 +34,20 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 31 34 | 
             
                    end
         | 
| 32 35 | 
             
                  end
         | 
| 33 36 |  | 
| 37 | 
            +
                  source "https://other-rubygems.org" do
         | 
| 38 | 
            +
                    gem "sausage"
         | 
| 39 | 
            +
                  end
         | 
| 40 | 
            +
             | 
| 34 41 | 
             
                  gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
         | 
| 35 42 | 
             
                Gemfile
         | 
| 36 43 |  | 
| 37 44 | 
             
                build_appraisal_file <<-Appraisals
         | 
| 38 45 | 
             
                  appraise 'breakfast' do
         | 
| 39 46 | 
             
                    source 'http://some-other-source.com'
         | 
| 40 | 
            -
                    ruby " | 
| 47 | 
            +
                    ruby "2.3.0"
         | 
| 41 48 |  | 
| 42 49 | 
             
                    gem 'bread'
         | 
| 50 | 
            +
                    gem "pain_au_chocolat", :custom_git_source => "pain_au_chocolat"
         | 
| 43 51 |  | 
| 44 52 | 
             
                    git '../gems/egg' do
         | 
| 45 53 | 
             
                      gem 'porched_egg'
         | 
| @@ -61,7 +69,12 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 61 69 | 
             
                      gem 'yoghurt'
         | 
| 62 70 | 
             
                    end
         | 
| 63 71 |  | 
| 72 | 
            +
                    source "https://other-rubygems.org" do
         | 
| 73 | 
            +
                      gem "pancake"
         | 
| 74 | 
            +
                    end
         | 
| 75 | 
            +
             | 
| 64 76 | 
             
                    gemspec
         | 
| 77 | 
            +
                    gemspec :path => "sitepress"
         | 
| 65 78 | 
             
                  end
         | 
| 66 79 | 
             
                Appraisals
         | 
| 67 80 |  | 
| @@ -74,7 +87,7 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 74 87 | 
             
                  source "https://rubygems.org"
         | 
| 75 88 | 
             
                  source "http://some-other-source.com"
         | 
| 76 89 |  | 
| 77 | 
            -
                  ruby " | 
| 90 | 
            +
                  ruby "2.3.0"
         | 
| 78 91 |  | 
| 79 92 | 
             
                  git "../../gems/egg" do
         | 
| 80 93 | 
             
                    gem "egg"
         | 
| @@ -87,11 +100,14 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 87 100 | 
             
                  end
         | 
| 88 101 |  | 
| 89 102 | 
             
                  gem "bagel"
         | 
| 103 | 
            +
                  gem "croissant", :git => "../../gems/croissant"
         | 
| 90 104 | 
             
                  gem "appraisal", :path => #{PROJECT_ROOT.inspect}
         | 
| 91 105 | 
             
                  gem "bread"
         | 
| 106 | 
            +
                  gem "pain_au_chocolat", :git => "../../gems/pain_au_chocolat"
         | 
| 92 107 |  | 
| 93 108 | 
             
                  group :breakfast do
         | 
| 94 109 | 
             
                    gem "orange_juice"
         | 
| 110 | 
            +
                    gem "omelette", :git => "../../gems/omelette"
         | 
| 95 111 | 
             
                    gem "bacon"
         | 
| 96 112 |  | 
| 97 113 | 
             
                    platforms :rbx do
         | 
| @@ -108,7 +124,13 @@ describe 'Appraisals file Bundler DSL compatibility' do | |
| 108 124 | 
             
                    end
         | 
| 109 125 | 
             
                  end
         | 
| 110 126 |  | 
| 127 | 
            +
                  source "https://other-rubygems.org" do
         | 
| 128 | 
            +
                    gem "sausage"
         | 
| 129 | 
            +
                    gem "pancake"
         | 
| 130 | 
            +
                  end
         | 
| 131 | 
            +
             | 
| 111 132 | 
             
                  gemspec :path => "../"
         | 
| 133 | 
            +
                  gemspec :path => "../sitepress"
         | 
| 112 134 | 
             
                Gemfile
         | 
| 113 135 | 
             
              end
         | 
| 114 136 | 
             
            end
         | 
| @@ -1,22 +1,53 @@ | |
| 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
         | 
| 7 | 
            +
              shared_examples :gemfile_dependencies_are_satisfied do
         | 
| 10 8 |  | 
| 11 | 
            -
                 | 
| 12 | 
            -
                   | 
| 13 | 
            -
             | 
| 14 | 
            -
                Appraisals
         | 
| 9 | 
            +
                it 'installs gems in the --path directory' do
         | 
| 10 | 
            +
                  build_gemfile <<-Gemfile
         | 
| 11 | 
            +
                    source "https://rubygems.org"
         | 
| 15 12 |  | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 13 | 
            +
                    gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
         | 
| 14 | 
            +
                  Gemfile
         | 
| 18 15 |  | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 16 | 
            +
                  build_appraisal_file <<-Appraisals
         | 
| 17 | 
            +
                    appraise "#{gem_name}" do
         | 
| 18 | 
            +
                      gem '#{gem_name}'
         | 
| 19 | 
            +
                    end
         | 
| 20 | 
            +
                  Appraisals
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                  run %(bundle install --path="#{path}")
         | 
| 23 | 
            +
                  run 'bundle exec appraisal install'
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                  installed_gem = Dir.glob("tmp/stage/#{path}/#{Gem.ruby_engine}/*/gems/*").
         | 
| 26 | 
            +
                                  map    { |path| path.split('/').last }.
         | 
| 27 | 
            +
                                  select { |gem| gem.include?(gem_name) }
         | 
| 28 | 
            +
                  expect(installed_gem).not_to be_empty
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  bundle_output = run 'bundle check'
         | 
| 31 | 
            +
                  expect(bundle_output).to include("The Gemfile's dependencies are satisfied")
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                  appraisal_output = run 'bundle exec appraisal install'
         | 
| 34 | 
            +
                  expect(appraisal_output).to include("The Gemfile's dependencies are satisfied")
         | 
| 35 | 
            +
                end
         | 
| 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
         | 
| 21 52 | 
             
              end
         | 
| 22 53 | 
             
            end
         |