hoe-travis 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,15 @@
1
- === 1.0 / 2012-02-15
1
+ === 1.1 / 2012-03-11
2
+
3
+ * Minor enhancement
4
+ * Added after_script support to .travis.yml and a travis:after task to check
5
+ it manually.
6
+
7
+ * Bug fix
8
+ * The check_manifest task is now run separately as an after_script to avoid
9
+ pollution from generated files. Run <tt>rake travis:generate</tt> to
10
+ replace your generated .travis.yml.
11
+
12
+ === 1.0 / 2012-03-02
2
13
 
3
14
  * Major enhancements
4
15
  * Birthday!
@@ -111,7 +111,7 @@ module Hoe::Travis
111
111
  ##
112
112
  # This version of Hoe::Travis
113
113
 
114
- VERSION = '1.0'
114
+ VERSION = '1.1'
115
115
 
116
116
  YAML_EXCEPTIONS = if defined?(Psych) then # :nodoc:
117
117
  if Psych.const_defined? :Exception then
@@ -128,7 +128,10 @@ module Hoe::Travis
128
128
  Hoe::DEFAULT_CONFIG['travis'] = {
129
129
  'before_script' => [
130
130
  'gem install hoe-travis --no-rdoc --no-ri',
131
- 'rake travis:before',
131
+ 'rake travis:before -t',
132
+ ],
133
+ 'after_script' => [
134
+ 'rake travis:after -t',
132
135
  ],
133
136
  'script' => 'rake travis',
134
137
  'token' => 'FIX - See: ri Hoe::Travis',
@@ -148,13 +151,19 @@ module Hoe::Travis
148
151
 
149
152
  def define_travis_tasks
150
153
  desc "Runs your tests for travis"
151
- task :travis => %w[test travis:fake_config check_manifest]
154
+ task :travis => %w[test]
152
155
 
153
156
  namespace :travis do
154
- desc "Run by travis-ci before your running the default checks"
157
+ desc "Run by travis-ci after running the default checks"
158
+ task :after => %w[
159
+ travis:fake_config
160
+ check_manifest
161
+ ]
162
+
163
+ desc "Run by travis-ci before running the default checks"
155
164
  task :before => %w[
156
- check_extra_deps
157
165
  install_plugins
166
+ check_extra_deps
158
167
  ]
159
168
 
160
169
  desc "Runs travis-lint on your .travis.yml"
@@ -207,6 +216,16 @@ module Hoe::Travis
207
216
  end
208
217
  end
209
218
 
219
+ ##
220
+ # Extracts the travis after_script from your .hoerc
221
+
222
+ def travis_after_script
223
+ with_config { |config, _|
224
+ config['travis']['after_script'] or
225
+ Hoe::DEFAULT_CONFIG['travis']['after_script']
226
+ }
227
+ end
228
+
210
229
  ##
211
230
  # Extracts the travis before_script from your .hoerc
212
231
 
@@ -507,6 +526,7 @@ Expected \"git@github.com:[repo].git\" as your remote origin
507
526
 
508
527
  def travis_yml_generate
509
528
  travis_yml = {
529
+ 'after_script' => travis_after_script,
510
530
  'before_script' => travis_before_script,
511
531
  'language' => 'ruby',
512
532
  'notifications' => travis_notifications,
@@ -6,6 +6,8 @@ require 'fileutils'
6
6
  class TestHoeTravis < MiniTest::Unit::TestCase
7
7
 
8
8
  def setup
9
+ Rake.application.clear
10
+
9
11
  @hoe = Hoe.spec "blah" do
10
12
  developer 'author', 'email@example'
11
13
  developer 'silent', ''
@@ -24,10 +26,52 @@ class TestHoeTravis < MiniTest::Unit::TestCase
24
26
  ENV['HOME'] = @home
25
27
  end
26
28
 
29
+ def test_define_travis_tasks
30
+ @hoe.define_travis_tasks
31
+
32
+ travis = Rake::Task['travis']
33
+ assert_equal %w[test], travis.prerequisites
34
+
35
+ after = Rake::Task['travis:after']
36
+ assert_equal %w[travis:fake_config check_manifest], after.prerequisites
37
+
38
+ before = Rake::Task['travis:before']
39
+ assert_equal %w[install_plugins check_extra_deps], before.prerequisites
40
+
41
+ check = Rake::Task['travis:check']
42
+ assert_empty check.prerequisites
43
+
44
+ disable = Rake::Task['travis:disable']
45
+ assert_empty disable.prerequisites
46
+
47
+ edit = Rake::Task['travis:edit']
48
+ assert_empty edit.prerequisites
49
+
50
+ enable = Rake::Task['travis:enable']
51
+ assert_empty enable.prerequisites
52
+
53
+ force = Rake::Task['travis:force']
54
+ assert_empty force.prerequisites
55
+
56
+ fake_config = Rake::Task['travis:fake_config']
57
+ assert_empty fake_config.prerequisites
58
+
59
+ generate = Rake::Task['travis:generate']
60
+ assert_empty generate.prerequisites
61
+ end
62
+
63
+ def test_travis_after_script
64
+ expected = [
65
+ 'rake travis:after -t',
66
+ ]
67
+
68
+ assert_equal expected, @hoe.travis_after_script
69
+ end
70
+
27
71
  def test_travis_before_script
28
72
  expected = [
29
73
  'gem install hoe-travis --no-rdoc --no-ri',
30
- 'rake travis:before',
74
+ 'rake travis:before -t',
31
75
  ]
32
76
 
33
77
  assert_equal expected, @hoe.travis_before_script
@@ -178,9 +222,11 @@ class TestHoeTravis < MiniTest::Unit::TestCase
178
222
 
179
223
  expected = YAML.load <<-TRAVIS_YML
180
224
  ---
225
+ after_script:
226
+ - rake travis:after -t
181
227
  before_script:
182
228
  - gem install hoe-travis --no-rdoc --no-ri
183
- - rake travis:before
229
+ - rake travis:before -t
184
230
  language: ruby
185
231
  notifications:
186
232
  email:
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe-travis
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 0
9
- version: "1.0"
8
+ - 1
9
+ version: "1.1"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Eric Hodel
@@ -36,7 +36,7 @@ cert_chain:
36
36
  U81zGHMUBOvz/VGT6wJwYJ3emS2nfA2NOHFfgA==
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-03-02 00:00:00 Z
39
+ date: 2012-03-11 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: travis-lint
@@ -76,11 +76,11 @@ dependencies:
76
76
  requirements:
77
77
  - - ~>
78
78
  - !ruby/object:Gem::Version
79
- hash: 23
79
+ hash: 21
80
80
  segments:
81
81
  - 2
82
- - 10
83
- version: "2.10"
82
+ - 11
83
+ version: "2.11"
84
84
  type: :development
85
85
  version_requirements: *id003
86
86
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file