lib/appraisal/travis_ci_helper.rb in appraisal-2.0.0 vs lib/appraisal/travis_ci_helper.rb in appraisal-2.0.1
- old
+ new
@@ -10,13 +10,16 @@
INVALID_CONFIGURATION_WARNING = <<-WARNING.strip.gsub(/\s+/, " ")
Warning: Your gemfiles directive in .travis.yml is incorrect. Run
`appraisal generate --travis` to get the correct configuration.
WARNING
+ # @see http://docs.travis-ci.com/user/languages/ruby/
+ GEMFILES_CONFIGURATION_KEY = "gemfile".freeze
+
def self.display_instruction
puts "# Put this in your .travis.yml"
- puts "gemfiles:"
+ puts "#{GEMFILES_CONFIGURATION_KEY}:"
File.each do |appraisal|
puts " - #{appraisal.relative_gemfile_path}"
end
end
@@ -43,17 +46,17 @@
def has_configuration_file?
::File.exist?(CONFIGURATION_FILE)
end
def has_no_gemfiles_configuration?
- !(configuration && configuration.has_key?("gemfiles"))
+ !(configuration && configuration.has_key?(GEMFILES_CONFIGURATION_KEY))
end
def has_invalid_gemfiles_configuration?
- if configuration && configuration["gemfiles"]
+ if configuration && configuration[GEMFILES_CONFIGURATION_KEY]
appraisal_paths =
File.new.appraisals.map(&:relative_gemfile_path).sort
- travis_gemfile_paths = configuration["gemfiles"].sort
+ travis_gemfile_paths = configuration[GEMFILES_CONFIGURATION_KEY].sort
appraisal_paths != travis_gemfile_paths
end
end
def configuration