lib/hoe/travis.rb in hoe-travis-1.0 vs lib/hoe/travis.rb in hoe-travis-1.1
- old
+ new
@@ -109,11 +109,11 @@
module Hoe::Travis
##
# This version of Hoe::Travis
- VERSION = '1.0'
+ VERSION = '1.1'
YAML_EXCEPTIONS = if defined?(Psych) then # :nodoc:
if Psych.const_defined? :Exception then
[Psych::SyntaxError] # Ruby 1.9.2
else
@@ -126,12 +126,15 @@
YAML_EXCEPTIONS << ArgumentError
Hoe::DEFAULT_CONFIG['travis'] = {
'before_script' => [
'gem install hoe-travis --no-rdoc --no-ri',
- 'rake travis:before',
+ 'rake travis:before -t',
],
+ 'after_script' => [
+ 'rake travis:after -t',
+ ],
'script' => 'rake travis',
'token' => 'FIX - See: ri Hoe::Travis',
'versions' => %w[
1.8.7
1.9.2
@@ -146,17 +149,23 @@
##
# Adds travis tasks to rake
def define_travis_tasks
desc "Runs your tests for travis"
- task :travis => %w[test travis:fake_config check_manifest]
+ task :travis => %w[test]
namespace :travis do
- desc "Run by travis-ci before your running the default checks"
+ desc "Run by travis-ci after running the default checks"
+ task :after => %w[
+ travis:fake_config
+ check_manifest
+ ]
+
+ desc "Run by travis-ci before running the default checks"
task :before => %w[
- check_extra_deps
install_plugins
+ check_extra_deps
]
desc "Runs travis-lint on your .travis.yml"
task :check do
abort unless check_travis_yml '.travis.yml'
@@ -206,10 +215,20 @@
end
end
end
##
+ # Extracts the travis after_script from your .hoerc
+
+ def travis_after_script
+ with_config { |config, _|
+ config['travis']['after_script'] or
+ Hoe::DEFAULT_CONFIG['travis']['after_script']
+ }
+ end
+
+ ##
# Extracts the travis before_script from your .hoerc
def travis_before_script
with_config { |config, _|
config['travis']['before_script'] or
@@ -505,9 +524,10 @@
# Generates a travis.yml from .hoerc, the Hoe spec and the default
# configuration.
def travis_yml_generate
travis_yml = {
+ 'after_script' => travis_after_script,
'before_script' => travis_before_script,
'language' => 'ruby',
'notifications' => travis_notifications,
'rvm' => travis_versions,
'script' => travis_script,