appraisal 2.5.0 → 3.0.0.rc1

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.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/dynamic-security.yml +19 -0
  3. data/.github/workflows/main.yml +55 -0
  4. data/.gitignore +1 -0
  5. data/Gemfile +5 -0
  6. data/README.md +14 -5
  7. data/Rakefile +8 -6
  8. data/SECURITY.md +20 -0
  9. data/appraisal.gemspec +14 -17
  10. data/bin/bundle +109 -0
  11. data/bin/rspec +27 -0
  12. data/{bin → exe}/appraisal +6 -4
  13. data/lib/appraisal/appraisal.rb +20 -17
  14. data/lib/appraisal/appraisal_file.rb +8 -6
  15. data/lib/appraisal/bundler_dsl.rb +17 -13
  16. data/lib/appraisal/cli.rb +49 -43
  17. data/lib/appraisal/command.rb +3 -1
  18. data/lib/appraisal/conditional.rb +4 -0
  19. data/lib/appraisal/customize.rb +22 -2
  20. data/lib/appraisal/dependency.rb +4 -2
  21. data/lib/appraisal/dependency_list.rb +4 -2
  22. data/lib/appraisal/errors.rb +2 -0
  23. data/lib/appraisal/gemfile.rb +2 -0
  24. data/lib/appraisal/gemspec.rb +5 -3
  25. data/lib/appraisal/git.rb +3 -1
  26. data/lib/appraisal/group.rb +7 -5
  27. data/lib/appraisal/path.rb +3 -1
  28. data/lib/appraisal/platform.rb +7 -5
  29. data/lib/appraisal/source.rb +7 -5
  30. data/lib/appraisal/task.rb +8 -6
  31. data/lib/appraisal/utils.rb +6 -7
  32. data/lib/appraisal/version.rb +3 -1
  33. data/lib/appraisal.rb +4 -2
  34. data/spec/acceptance/appraisals_file_bundler_dsl_compatibility_spec.rb +55 -24
  35. data/spec/acceptance/bundle_with_custom_path_spec.rb +26 -20
  36. data/spec/acceptance/bundle_without_spec.rb +10 -10
  37. data/spec/acceptance/cli/clean_spec.rb +13 -11
  38. data/spec/acceptance/cli/generate_spec.rb +14 -12
  39. data/spec/acceptance/cli/help_spec.rb +15 -13
  40. data/spec/acceptance/cli/install_spec.rb +33 -47
  41. data/spec/acceptance/cli/list_spec.rb +11 -9
  42. data/spec/acceptance/cli/run_spec.rb +26 -24
  43. data/spec/acceptance/cli/update_spec.rb +20 -18
  44. data/spec/acceptance/cli/version_spec.rb +3 -1
  45. data/spec/acceptance/cli/with_no_arguments_spec.rb +10 -8
  46. data/spec/acceptance/gemfile_dsl_compatibility_spec.rb +38 -36
  47. data/spec/acceptance/gemspec_spec.rb +26 -24
  48. data/spec/appraisal/appraisal_file_spec.rb +66 -4
  49. data/spec/appraisal/appraisal_spec.rb +20 -23
  50. data/spec/appraisal/customize_spec.rb +133 -11
  51. data/spec/appraisal/dependency_list_spec.rb +3 -1
  52. data/spec/appraisal/gemfile_spec.rb +39 -38
  53. data/spec/appraisal/utils_spec.rb +21 -28
  54. data/spec/spec_helper.rb +14 -6
  55. data/spec/support/acceptance_test_helpers.rb +31 -24
  56. data/spec/support/dependency_helpers.rb +29 -15
  57. data/spec/support/stream_helpers.rb +2 -0
  58. metadata +10 -34
  59. data/.rspec +0 -1
data/lib/appraisal/cli.rb CHANGED
@@ -1,52 +1,63 @@
1
- require 'thor'
2
- require 'fileutils'
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+ require "fileutils"
3
5
 
4
6
  module Appraisal
5
7
  class CLI < Thor
6
8
  default_task :install
7
9
  map ["-v", "--version"] => "version"
8
10
 
9
- # Override help command to print out usage
10
- def self.help(shell, subcommand = false)
11
- shell.say strip_heredoc(<<-help)
12
- Appraisal: Find out what your Ruby gems are worth.
11
+ class << self
12
+ # Override help command to print out usage
13
+ def help(shell, subcommand = false)
14
+ shell.say strip_heredoc(<<-HELP)
15
+ Appraisal: Find out what your Ruby gems are worth.
13
16
 
14
- Usage:
15
- appraisal [APPRAISAL_NAME] EXTERNAL_COMMAND
17
+ Usage:
18
+ appraisal [APPRAISAL_NAME] EXTERNAL_COMMAND
16
19
 
17
- If APPRAISAL_NAME is given, only run that EXTERNAL_COMMAND against the given
18
- appraisal, otherwise it runs the EXTERNAL_COMMAND against all appraisals.
19
- help
20
+ If APPRAISAL_NAME is given, only run that EXTERNAL_COMMAND against the given
21
+ appraisal, otherwise it runs the EXTERNAL_COMMAND against all appraisals.
22
+ HELP
20
23
 
21
- if File.exist?('Appraisals')
22
- shell.say
23
- shell.say 'Available Appraisal(s):'
24
+ if File.exist?("Appraisals")
25
+ shell.say
26
+ shell.say "Available Appraisal(s):"
24
27
 
25
- AppraisalFile.each do |appraisal|
26
- shell.say " - #{appraisal.name}"
28
+ AppraisalFile.each do |appraisal|
29
+ shell.say " - #{appraisal.name}"
30
+ end
27
31
  end
32
+
33
+ shell.say
34
+
35
+ super
28
36
  end
29
37
 
30
- shell.say
38
+ def exit_on_failure?
39
+ true
40
+ end
31
41
 
32
- super
33
- end
42
+ private
34
43
 
35
- def self.exit_on_failure?
36
- true
44
+ def strip_heredoc(string)
45
+ indent = string.scan(/^[ \t]*(?=\S)/).min.size || 0
46
+ string.gsub(/^[ \t]{#{indent}}/, "")
47
+ end
37
48
  end
38
49
 
39
- desc 'install', 'Resolve and install dependencies for each appraisal'
40
- method_option 'jobs', :aliases => 'j', :type => :numeric, :default => 1,
41
- :banner => 'SIZE',
42
- :desc => 'Install gems in parallel using the given number of workers.'
43
- method_option 'retry', :type => :numeric, :default => 1,
44
- :desc => 'Retry network and git requests that have failed'
45
- method_option "without", :banner => "GROUP_NAMES",
46
- :desc => "A space-separated list of groups referencing gems to skip " +
50
+ desc "install", "Resolve and install dependencies for each appraisal"
51
+ method_option "jobs", aliases: "j", type: :numeric, default: 1,
52
+ banner: "SIZE",
53
+ desc: "Install gems in parallel using the given number of workers."
54
+ method_option "retry", type: :numeric, default: 1,
55
+ desc: "Retry network and git requests that have failed"
56
+ method_option "without", banner: "GROUP_NAMES",
57
+ desc: "A space-separated list of groups referencing gems to skip " +
47
58
  "during installation. Bundler will remember this option."
48
- method_option "full-index", :type => :boolean,
49
- :desc => "Run bundle install with the " \
59
+ method_option "full-index", type: :boolean,
60
+ desc: "Run bundle install with the " \
50
61
  "full-index argument."
51
62
  method_option "path", type: :string,
52
63
  desc: "Install gems in the specified directory. " \
@@ -61,19 +72,19 @@ module Appraisal
61
72
  end
62
73
  end
63
74
 
64
- desc 'generate', 'Generate a gemfile for each appraisal'
75
+ desc "generate", "Generate a gemfile for each appraisal"
65
76
  def generate
66
77
  AppraisalFile.each do |appraisal|
67
78
  appraisal.write_gemfile
68
79
  end
69
80
  end
70
81
 
71
- desc 'clean', 'Remove all generated gemfiles and lockfiles from gemfiles folder'
82
+ desc "clean", "Remove all generated gemfiles and lockfiles from gemfiles folder"
72
83
  def clean
73
- FileUtils.rm_f Dir['gemfiles/*.{gemfile,gemfile.lock}']
84
+ FileUtils.rm_f Dir["gemfiles/*.{gemfile,gemfile.lock}"]
74
85
  end
75
86
 
76
- desc 'update [LIST_OF_GEMS]', 'Remove all generated gemfiles and lockfiles, resolve, and install dependencies again'
87
+ desc "update [LIST_OF_GEMS]", "Remove all generated gemfiles and lockfiles, resolve, and install dependencies again"
77
88
  def update(*gems)
78
89
  invoke :generate, []
79
90
 
@@ -82,7 +93,7 @@ module Appraisal
82
93
  end
83
94
  end
84
95
 
85
- desc 'list', 'List the names of the defined appraisals'
96
+ desc "list", "List the names of the defined appraisals"
86
97
  def list
87
98
  AppraisalFile.new.appraisals.each { |appraisal| puts appraisal.name }
88
99
  end
@@ -100,17 +111,12 @@ module Appraisal
100
111
  end
101
112
 
102
113
  if matching_appraisal
103
- Command.new(args, :gemfile => matching_appraisal.gemfile_path).run
114
+ Command.new(args, gemfile: matching_appraisal.gemfile_path).run
104
115
  else
105
116
  AppraisalFile.each do |appraisal|
106
- Command.new(ARGV, :gemfile => appraisal.gemfile_path).run
117
+ Command.new(ARGV, gemfile: appraisal.gemfile_path).run
107
118
  end
108
119
  end
109
120
  end
110
-
111
- def self.strip_heredoc(string)
112
- indent = string.scan(/^[ \t]*(?=\S)/).min.size || 0
113
- string.gsub(/^[ \t]{#{indent}}/, '')
114
- end
115
121
  end
116
122
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "shellwords"
2
4
 
3
5
  module Appraisal
@@ -70,7 +72,7 @@ module Appraisal
70
72
  if command_starts_with_bundle?(original_command)
71
73
  original_command
72
74
  else
73
- %w(bundle exec) + original_command
75
+ %w[bundle exec] + original_command
74
76
  end
75
77
  end
76
78
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
4
  require "appraisal/utils"
3
5
 
@@ -14,6 +16,8 @@ module Appraisal
14
16
 
15
17
  # :nodoc:
16
18
  def for_dup
19
+ return unless @condition.is_a?(String)
20
+
17
21
  "install_if #{@condition} do\n#{indent(super)}\nend"
18
22
  end
19
23
  end
@@ -1,16 +1,36 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Appraisal
2
4
  class Customize
3
5
  def initialize(heading: nil, single_quotes: false)
4
- @@heading = heading
6
+ @@heading = heading&.chomp
5
7
  @@single_quotes = single_quotes
6
8
  end
7
9
 
8
- def self.heading
10
+ def self.heading(gemfile)
9
11
  @@heading ||= nil
12
+ customize(@@heading, gemfile)
10
13
  end
11
14
 
12
15
  def self.single_quotes
13
16
  @@single_quotes ||= false
14
17
  end
18
+
19
+ def self.customize(heading, gemfile)
20
+ return nil unless heading
21
+
22
+ format(
23
+ heading.to_s,
24
+ appraisal: gemfile.send("clean_name"),
25
+ gemfile: gemfile.send("gemfile_name"),
26
+ gemfile_path: gemfile.gemfile_path,
27
+ lockfile: "#{gemfile.send('gemfile_name')}.lock",
28
+ lockfile_path: gemfile.send("lockfile_path"),
29
+ relative_gemfile_path: gemfile.relative_gemfile_path,
30
+ relative_lockfile_path: "#{gemfile.relative_gemfile_path}.lock"
31
+ )
32
+ end
33
+
34
+ private_class_method :customize
15
35
  end
16
36
  end
@@ -1,4 +1,6 @@
1
- require 'appraisal/utils'
1
+ # frozen_string_literal: true
2
+
3
+ require "appraisal/utils"
2
4
 
3
5
  module Appraisal
4
6
  # Dependency on a gem and optional version requirements
@@ -43,7 +45,7 @@ module Appraisal
43
45
  end
44
46
 
45
47
  def gem_name
46
- %{gem "#{name}"}
48
+ %(gem "#{name}")
47
49
  end
48
50
 
49
51
  def no_requirements?
@@ -1,10 +1,12 @@
1
- require 'appraisal/dependency'
1
+ # frozen_string_literal: true
2
+
3
+ require "appraisal/dependency"
2
4
  require "set"
3
5
 
4
6
  module Appraisal
5
7
  class DependencyList
6
8
  def initialize
7
- @dependencies = Hash.new
9
+ @dependencies = {}
8
10
  @removed_dependencies = Set.new
9
11
  end
10
12
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Appraisal
2
4
  # Raises when Appraisal is unable to locate Appraisals file in the current directory.
3
5
  class AppraisalsNotFound < StandardError
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
4
 
3
5
  module Appraisal
@@ -1,4 +1,6 @@
1
- require 'appraisal/utils'
1
+ # frozen_string_literal: true
2
+
3
+ require "appraisal/utils"
2
4
 
3
5
  module Appraisal
4
6
  class Gemspec
@@ -6,7 +8,7 @@ module Appraisal
6
8
 
7
9
  def initialize(options = {})
8
10
  @options = options
9
- @options[:path] ||= '.'
11
+ @options[:path] ||= "."
10
12
  end
11
13
 
12
14
  def to_s
@@ -22,7 +24,7 @@ module Appraisal
22
24
 
23
25
  def exported_options
24
26
  @options.merge(
25
- :path => Utils.prefix_path(@options[:path])
27
+ path: Utils.prefix_path(@options[:path])
26
28
  )
27
29
  end
28
30
  end
data/lib/appraisal/git.rb CHANGED
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
- require 'appraisal/utils'
4
+ require "appraisal/utils"
3
5
 
4
6
  module Appraisal
5
7
  class Git < BundlerDSL
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
- require 'appraisal/utils'
4
+ require "appraisal/utils"
3
5
 
4
6
  module Appraisal
5
7
  class Group < BundlerDSL
@@ -20,10 +22,10 @@ module Appraisal
20
22
  private
21
23
 
22
24
  def formatted_output(output_dependencies)
23
- <<-OUTPUT.strip
24
- group #{Utils.format_arguments(@group_names)} do
25
- #{output_dependencies}
26
- end
25
+ <<~OUTPUT.strip
26
+ group #{Utils.format_arguments(@group_names)} do
27
+ #{output_dependencies}
28
+ end
27
29
  OUTPUT
28
30
  end
29
31
  end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
- require 'appraisal/utils'
4
+ require "appraisal/utils"
3
5
 
4
6
  module Appraisal
5
7
  class Path < BundlerDSL
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
- require 'appraisal/utils'
4
+ require "appraisal/utils"
3
5
 
4
6
  module Appraisal
5
7
  class Platform < BundlerDSL
@@ -20,10 +22,10 @@ module Appraisal
20
22
  private
21
23
 
22
24
  def formatted_output(output_dependencies)
23
- <<-OUTPUT.strip
24
- platforms #{Utils.format_arguments(@platform_names)} do
25
- #{output_dependencies}
26
- end
25
+ <<~OUTPUT.strip
26
+ platforms #{Utils.format_arguments(@platform_names)} do
27
+ #{output_dependencies}
28
+ end
27
29
  OUTPUT
28
30
  end
29
31
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "appraisal/bundler_dsl"
2
4
  require "appraisal/utils"
3
5
 
@@ -20,11 +22,11 @@ module Appraisal
20
22
  private
21
23
 
22
24
  def formatted_output(output_dependencies)
23
- <<-OUTPUT.strip
24
- source #{@source.inspect} do
25
- #{output_dependencies}
26
- end
27
- OUTPUT
25
+ <<~OUTPUT.strip
26
+ source #{@source.inspect} do
27
+ #{output_dependencies}
28
+ end
29
+ OUTPUT
28
30
  end
29
31
  end
30
32
  end
@@ -1,5 +1,7 @@
1
- require 'appraisal/appraisal_file'
2
- require 'rake/tasklib'
1
+ # frozen_string_literal: true
2
+
3
+ require "appraisal/appraisal_file"
4
+ require "rake/tasklib"
3
5
 
4
6
  module Appraisal
5
7
  # Defines tasks for installing appraisal dependencies and running other tasks
@@ -11,21 +13,21 @@ module Appraisal
11
13
  task :gemfiles do
12
14
  warn "`rake appraisal:gemfile` task is deprecated and will be removed soon. " +
13
15
  "Please use `appraisal generate`."
14
- exec 'bundle exec appraisal generate'
16
+ exec "bundle exec appraisal generate"
15
17
  end
16
18
 
17
19
  desc "DEPRECATED: Resolve and install dependencies for each appraisal"
18
20
  task :install do
19
21
  warn "`rake appraisal:install` task is deprecated and will be removed soon. " +
20
22
  "Please use `appraisal install`."
21
- exec 'bundle exec appraisal install'
23
+ exec "bundle exec appraisal install"
22
24
  end
23
25
 
24
26
  desc "DEPRECATED: Remove all generated gemfiles from gemfiles/ folder"
25
27
  task :cleanup do
26
28
  warn "`rake appraisal:cleanup` task is deprecated and will be removed soon. " +
27
29
  "Please use `appraisal clean`."
28
- exec 'bundle exec appraisal clean'
30
+ exec "bundle exec appraisal clean"
29
31
  end
30
32
 
31
33
  begin
@@ -48,7 +50,7 @@ module Appraisal
48
50
  end
49
51
 
50
52
  desc "Run the given task for all appraisals"
51
- task :appraisal => "appraisal:all"
53
+ task appraisal: "appraisal:all"
52
54
  end
53
55
  end
54
56
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Appraisal
2
4
  # Contains methods for various operations
3
5
  module Utils
4
6
  def self.support_parallel_installation?
5
- Gem::Version.create(Bundler::VERSION) >= Gem::Version.create('1.4.0.pre.1')
7
+ Gem::Version.create(Bundler::VERSION) >= Gem::Version.create("1.4.0.pre.1")
6
8
  end
7
9
 
8
10
  def self.format_string(object, enclosing_object = false)
@@ -15,7 +17,7 @@ module Appraisal
15
17
  if enclosing_object
16
18
  "{ #{items.join(', ')} }"
17
19
  else
18
- items.join(', ')
20
+ items.join(", ")
19
21
  end
20
22
  else
21
23
  object.inspect
@@ -35,7 +37,7 @@ module Appraisal
35
37
 
36
38
  def self.format_arguments(arguments)
37
39
  unless arguments.empty?
38
- arguments.map { |object| format_string(object, false) }.join(', ')
40
+ arguments.map { |object| format_string(object, false) }.join(", ")
39
41
  end
40
42
  end
41
43
 
@@ -53,10 +55,7 @@ module Appraisal
53
55
  end
54
56
 
55
57
  def self.bundler_version
56
- Gem::Specification.
57
- detect { |spec| spec.name == "bundler" }.
58
- version.
59
- to_s
58
+ Gem::Specification.detect { |spec| spec.name == "bundler" }.version.to_s
60
59
  end
61
60
  end
62
61
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Appraisal
2
- VERSION = "2.5.0".freeze
4
+ VERSION = "3.0.0.rc1"
3
5
  end
data/lib/appraisal.rb CHANGED
@@ -1,4 +1,6 @@
1
- require 'appraisal/version'
2
- require 'appraisal/task'
1
+ # frozen_string_literal: true
2
+
3
+ require "appraisal/version"
4
+ require "appraisal/task"
3
5
 
4
6
  Appraisal::Task.new
@@ -1,24 +1,26 @@
1
- require 'spec_helper'
1
+ # frozen_string_literal: true
2
2
 
3
- describe 'Appraisals file Bundler DSL compatibility' do
4
- it 'supports all Bundler DSL in Appraisals file' do
5
- build_gems %w(bagel orange_juice milk waffle coffee ham
6
- sausage pancake rotten_egg mayonnaise)
7
- build_git_gems %w(egg croissant pain_au_chocolat omelette)
3
+ require "spec_helper"
8
4
 
9
- build_gemfile <<-Gemfile
5
+ RSpec.describe "Appraisals file Bundler DSL compatibility" do
6
+ it "supports all Bundler DSL in Appraisals file" do
7
+ build_gems %w[bagel orange_juice milk waffle coffee ham
8
+ sausage pancake rotten_egg mayonnaise]
9
+ build_git_gems %w[egg croissant pain_au_chocolat omelette]
10
+
11
+ build_gemfile <<-GEMFILE
10
12
  source 'https://rubygems.org'
11
- git_source(:custom_git_source) { |repo| "../gems/\#{repo}" }
13
+ git_source(:custom_git_source) { |repo| "../build/\#{repo}" }
12
14
  ruby RUBY_VERSION
13
15
 
14
16
  gem 'bagel'
15
17
  gem "croissant", :custom_git_source => "croissant"
16
18
 
17
- git '../gems/egg' do
19
+ git '../build/egg' do
18
20
  gem 'egg'
19
21
  end
20
22
 
21
- path '../gems/waffle' do
23
+ path '../build/waffle' do
22
24
  gem 'waffle'
23
25
  end
24
26
 
@@ -45,9 +47,9 @@ describe 'Appraisals file Bundler DSL compatibility' do
45
47
  end
46
48
 
47
49
  gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
48
- Gemfile
50
+ GEMFILE
49
51
 
50
- build_appraisal_file <<-Appraisals
52
+ build_appraisal_file <<-APPRAISALS
51
53
  appraise 'breakfast' do
52
54
  source 'http://some-other-source.com'
53
55
  ruby "2.3.0"
@@ -55,11 +57,11 @@ describe 'Appraisals file Bundler DSL compatibility' do
55
57
  gem 'bread'
56
58
  gem "pain_au_chocolat", :custom_git_source => "pain_au_chocolat"
57
59
 
58
- git '../gems/egg' do
60
+ git '../build/egg' do
59
61
  gem 'porched_egg'
60
62
  end
61
63
 
62
- path '../gems/waffle' do
64
+ path '../build/waffle' do
63
65
  gem 'chocolate_waffle'
64
66
  end
65
67
 
@@ -87,12 +89,12 @@ describe 'Appraisals file Bundler DSL compatibility' do
87
89
  gemspec
88
90
  gemspec :path => "sitepress"
89
91
  end
90
- Appraisals
92
+ APPRAISALS
91
93
 
92
- run 'bundle install --local'
93
- run 'appraisal generate'
94
+ run "bundle install --local"
95
+ run "appraisal generate"
94
96
 
95
- expect(content_of 'gemfiles/breakfast.gemfile').to eq <<-Gemfile.strip_heredoc
97
+ expect(content_of("gemfiles/breakfast.gemfile")).to eq <<-GEMFILE.strip_heredoc
96
98
  # This file was generated by Appraisal
97
99
 
98
100
  source "https://rubygems.org"
@@ -100,25 +102,25 @@ describe 'Appraisals file Bundler DSL compatibility' do
100
102
 
101
103
  ruby "2.3.0"
102
104
 
103
- git "../../gems/egg" do
105
+ git "../../build/egg" do
104
106
  gem "egg"
105
107
  gem "porched_egg"
106
108
  end
107
109
 
108
- path "../../gems/waffle" do
110
+ path "../../build/waffle" do
109
111
  gem "waffle"
110
112
  gem "chocolate_waffle"
111
113
  end
112
114
 
113
115
  gem "bagel"
114
- gem "croissant", :git => "../../gems/croissant"
116
+ gem "croissant", :git => "../../build/croissant"
115
117
  gem "appraisal", :path => #{PROJECT_ROOT.inspect}
116
118
  gem "bread"
117
- gem "pain_au_chocolat", :git => "../../gems/pain_au_chocolat"
119
+ gem "pain_au_chocolat", :git => "../../build/pain_au_chocolat"
118
120
 
119
121
  group :breakfast do
120
122
  gem "orange_juice"
121
- gem "omelette", :git => "../../gems/omelette"
123
+ gem "omelette", :git => "../../build/omelette"
122
124
  gem "bacon"
123
125
 
124
126
  platforms :rbx do
@@ -147,6 +149,35 @@ describe 'Appraisals file Bundler DSL compatibility' do
147
149
 
148
150
  gemspec :path => "../"
149
151
  gemspec :path => "../sitepress"
150
- Gemfile
152
+ GEMFILE
153
+ end
154
+
155
+ it 'supports ruby file: ".ruby-version" DSL' do
156
+ build_gemfile <<-GEMFILE
157
+ source 'https://rubygems.org'
158
+
159
+ ruby RUBY_VERSION
160
+
161
+ gem 'appraisal', :path => #{PROJECT_ROOT.inspect}
162
+ GEMFILE
163
+
164
+ build_appraisal_file <<-APPRAISALS
165
+ appraise 'ruby-version' do
166
+ ruby file: ".ruby-version"
167
+ end
168
+ APPRAISALS
169
+
170
+ run "bundle install --local"
171
+ run "appraisal generate"
172
+
173
+ expect(content_of("gemfiles/ruby_version.gemfile")).to eq <<-GEMFILE.strip_heredoc
174
+ # This file was generated by Appraisal
175
+
176
+ source "https://rubygems.org"
177
+
178
+ ruby({:file=>".ruby-version"})
179
+
180
+ gem "appraisal", :path => #{PROJECT_ROOT.inspect}
181
+ GEMFILE
151
182
  end
152
183
  end