shoe 0.7.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
@@ -1,3 +1,12 @@
1
+ == 0.8.0 -- 2011 February 21
2
+
3
+ * Rubygems 1.5.0 removes <tt>Gem::Validator#unit_test</tt>. Switch to using <tt>testrb</tt> for <tt>Shoe::Tasks::Test</tt>.
4
+ * Shoe is now testable with rubygems-test.
5
+
6
+ == 0.7.1 -- 2010 October 12
7
+
8
+ * Include top-level rdoc files in the shoe gem.
9
+
1
10
  == 0.7.0 -- 2010 October 11
2
11
 
3
12
  * 1.9 compatibility!
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shoe (0.7.1)
4
+ shoe (0.8.0)
5
5
  rake (~> 0.8.7)
6
6
 
7
7
  GEM
@@ -34,6 +34,5 @@ PLATFORMS
34
34
  DEPENDENCIES
35
35
  bundler (~> 1.0.0)
36
36
  cucumber (~> 0.6.4)
37
- rake (~> 0.8.7)
38
37
  ronn (~> 0.5)
39
38
  shoe!
@@ -2,10 +2,9 @@
2
2
 
3
3
  Configuration-free Rake tasks that {read your
4
4
  gemspec}[http://yehudakatz.com/2010/04/02/using-gemspecs-as-intended/] and
5
- re-use
6
- {built-in}[http://rubygems.rubyforge.org/rubygems-update/Gem/Ext/ExtConfBuilder.html]
7
- {Rubygems}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html]
8
- {functionality}[http://rubygems.rubyforge.org/rubygems-update/Gem/Validator.html].
5
+ re-use built-in
6
+ {Rubygems}[http://rubygems.rubyforge.org/rubygems-update/Gem/Ext/ExtConfBuilder.html]
7
+ {functionality}[http://rubygems.rubyforge.org/rubygems-update/Gem/DocManager.html].
9
8
 
10
9
  Shoe works great on both Ruby 1.8 and 1.9.
11
10
 
data/TODO.rdoc CHANGED
@@ -1,6 +1,7 @@
1
1
  = Next Up
2
2
 
3
- * Start running on 1.9: Gem::Validator uses MiniTest::Unit.
3
+ * Re-work for rubygems-test. https://github.com/erikh/rubygems-test
4
+ * Use minitest/pride for colors.
4
5
 
5
6
  = Someday Maybe
6
7
 
@@ -2,6 +2,5 @@ module Shoe
2
2
  module Extensions
3
3
  autoload :DocManager, 'shoe/extensions/doc_manager'
4
4
  autoload :Specification, 'shoe/extensions/specification'
5
- autoload :Validator, 'shoe/extensions/validator'
6
5
  end
7
6
  end
@@ -1,42 +1,39 @@
1
- require 'rubygems/validator'
2
-
3
1
  module Shoe
4
2
  module Tasks
5
3
 
6
4
  # Defines <tt>`rake test`</tt> to run your tests.
7
5
  #
8
- # Uses
9
- # <tt>{Gem::Validator}[http://rubygems.rubyforge.org/rubygems-update/Gem/Validator.html]</tt>,
10
- # so tests are run locally just as they will be with <tt>`{gem
11
- # check}[http://docs.rubygems.org/read/chapter/10#page30] --test
12
- # your_project`</tt>.
6
+ # Uses <tt>testrb</tt> to run your <tt>test_files</tt>.
13
7
  #
14
8
  # To enable and configure, edit the
15
9
  # <tt>test_files[http://docs.rubygems.org/read/chapter/20#test_files]</tt>
16
10
  # in your gemspec.
17
11
  #
12
+ # (You may also want to add a <tt>.gemtest</tt> file to the root of your
13
+ # gem, so that others can run your tests via
14
+ # {rubygems-test}[https://github.com/rubygems/rubygems-test].)
15
+ #
18
16
  # = A Few Precautions
19
17
  #
20
- # * Using <tt>Gem::Validator</tt> means that only <tt>Test::Unit</tt> (all
18
+ # * Using <tt>testrb</tt> means that only <tt>Test::Unit</tt> (all
21
19
  # Rubies) and <tt>MiniTest::Unit</tt> (Ruby 1.9) tests will be run.
22
20
  #
23
21
  # * You'll need to <tt>Bundler.setup(:default, :development)</tt> in your
24
- # <tt>Rakefile</tt> so that the <tt>Gem::Validator</tt> can find your
25
- # code. (If you put this line in your <tt>test_helper</tt> instead,
26
- # you'll break <tt>`gem check --test`</tt> for people who don't have
27
- # Bundler installed.)
28
- #
29
- # * The <tt>test</tt> directory will not be in the <tt>$LOAD_PATH</tt>, so
30
- # you'll have to <tt>require 'test/test_helper'</tt>.
31
- #
32
- # = Pretty Colors
22
+ # <tt>Rakefile</tt> so that <tt>testrb</tt> can find your code.
33
23
  #
34
- # For Ruby 1.8, Shoe patches the <tt>Gem::Validator</tt> to play nicely with
35
- # {redgreen}[http://rubygems.org/gems/redgreen]</tt>.
24
+ # * Your <tt>test_files</tt> need only contain actual tests -- support
25
+ # files, like test_helper, need not be included.
36
26
  #
37
- # For Ruby 1.9, <tt>require 'shoe/util/minitest_colors'</tt> in your
38
- # <tt>test_helper</tt>.
27
+ # * The <tt>LOAD_PATH</tt> will contain all of the immediate parent
28
+ # directories of your <tt>test_files</tt>. You should not count on the
29
+ # top-level project directory being included -- in other words,
30
+ # <tt>"require 'test/test_helper'"</tt> may not work, and <tt>"require
31
+ # 'test_helper'"</tt> will only work if <tt>test_helper</tt> is a sibling
32
+ # of one of your <tt>test_files</tt>.
39
33
  #
34
+ # For further clarification on these guidelines, you may find it helpful to
35
+ # browse {Shoe's own test
36
+ # setup}[https://github.com/matthewtodd/shoe/tree/master/test].
40
37
  class Test < Task
41
38
  def active?
42
39
  !spec.test_files.empty?
@@ -49,8 +46,7 @@ module Shoe
49
46
  END
50
47
 
51
48
  task :test do
52
- Gem::Validator.extend(Extensions::Validator)
53
- Gem::Validator.new.unit_test(spec)
49
+ system 'testrb', *spec.test_files
54
50
  end
55
51
 
56
52
  task :prepare
@@ -1,3 +1,3 @@
1
1
  module Shoe
2
- VERSION = '0.7.1'
2
+ VERSION = '0.8.0'
3
3
  end
data/man/shoe.3 CHANGED
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.5
2
2
  .\" http://github.com/rtomayko/ronn/
3
3
  .
4
- .TH "SHOE" "3" "October 2010" "Matthew Todd" "RubyGems Manual"
4
+ .TH "SHOE" "3" "February 2011" "Matthew Todd" "RubyGems Manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBshoe\fR \-\- standard Rake tasks for your RubyGems project
@@ -48,7 +48,8 @@ be available via \fBgem\-man(1)\fR once your gem is installed.)
48
48
  .
49
49
  .TP
50
50
  \fBrake test\fR
51
- Run tests with RubyGems' built\-in Gem::Validator, which reads the \fBtest_files\fR field in your Gem::Specification to know which tests to run.
51
+ Run tests with Ruby's built\-in testrb, reading the \fBtest_files\fR field in your
52
+ Gem::Specification to know which tests to run.
52
53
  .
53
54
  .P
54
55
  Note these tasks check conditions before defining themselves, so that your \fBrake \-\-tasks\fR list stays relevant and compact. You won't see all the tasks all
@@ -38,8 +38,8 @@ Gem::Specification, and they assume you are using `git(1)`.
38
38
  be available via `gem-man(1)` once your gem is installed.)
39
39
 
40
40
  * `rake test`:
41
- Run tests with RubyGems' built-in Gem::Validator, which reads the
42
- `test_files` field in your Gem::Specification to know which tests to run.
41
+ Run tests with Ruby's built-in testrb, reading the `test_files` field in your
42
+ Gem::Specification to know which tests to run.
43
43
 
44
44
  Note these tasks check conditions before defining themselves, so that your
45
45
  `rake --tasks` list stays relevant and compact. You won't see all the tasks all
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'ronn', '~> 0.5'
23
23
 
24
24
  s.files = `git ls-files`.split("\n")
25
- s.test_files = `git ls-files -- test`.split("\n")
25
+ s.test_files = `git ls-files -- test/*_test.rb`.split("\n")
26
26
  s.extra_rdoc_files = `git ls-files -- {**/,}*.rdoc`.split("\n")
27
27
  s.require_paths = ['lib']
28
28
 
@@ -11,4 +11,10 @@ class Shoe::TestCase < Test::Unit::TestCase
11
11
  end
12
12
  end
13
13
 
14
- Dir['test/support/*.rb'].each { |path| require path }
14
+ require 'support/assertions'
15
+ require 'support/command_runner'
16
+ require 'support/declarative_tests'
17
+ require 'support/example_project'
18
+ require 'support/file_manipulation'
19
+ require 'support/gemspec_manipulation'
20
+ require 'support/project_files'
@@ -1,4 +1,4 @@
1
- require 'test/helper'
1
+ require 'helper'
2
2
 
3
3
  class RakeTest < Shoe::TestCase
4
4
  describe 'rake clean' do
@@ -34,28 +34,26 @@ class RakeTest < Shoe::TestCase
34
34
  end
35
35
 
36
36
  describe 'rake cucumber' do
37
- requires 'cucumber' do
38
- it 'is active only if there are profiles in cucumber.yml' do
39
- add_development_dependency 'cucumber'
40
- assert_task_added 'cucumber', 'cucumber:wip' do
41
- add_files_for_cucumber
42
- end
43
- end
44
-
45
- it 'runs cucumber features' do
46
- add_development_dependency 'cucumber'
37
+ it 'is active only if there are profiles in cucumber.yml' do
38
+ add_development_dependency 'cucumber'
39
+ assert_task_added 'cucumber', 'cucumber:wip' do
47
40
  add_files_for_cucumber
48
- system 'rake cucumber'
49
- assert_match '1 scenario (1 passed)', output
50
41
  end
42
+ end
51
43
 
52
- it 'depends (perhaps indirectly) on rake compile' do
53
- add_development_dependency 'cucumber'
54
- add_files_for_c_extension
55
- add_files_for_cucumber 'require "foo/extension"'
56
- system 'rake cucumber'
57
- assert_match '1 scenario (1 passed)', output
58
- end
44
+ it 'runs cucumber features' do
45
+ add_development_dependency 'cucumber'
46
+ add_files_for_cucumber
47
+ system 'rake cucumber'
48
+ assert_match '1 scenario (1 passed)', output
49
+ end
50
+
51
+ it 'depends (perhaps indirectly) on rake compile' do
52
+ add_development_dependency 'cucumber'
53
+ add_files_for_c_extension
54
+ add_files_for_cucumber 'require "foo/extension"'
55
+ system 'rake cucumber'
56
+ assert_match '1 scenario (1 passed)', output
59
57
  end
60
58
  end
61
59
 
@@ -75,29 +73,27 @@ class RakeTest < Shoe::TestCase
75
73
  end
76
74
 
77
75
  describe 'rake ronn' do
78
- requires 'ronn' do
79
- it 'is enabled if there are ronn files' do
80
- add_development_dependency 'ronn'
81
- assert_task_added 'ronn' do
82
- add_files_for_ronn
83
- end
84
- end
85
-
86
- it 'generates man pages' do
87
- add_development_dependency 'ronn'
76
+ it 'is enabled if there are ronn files' do
77
+ add_development_dependency 'ronn'
78
+ assert_task_added 'ronn' do
88
79
  add_files_for_ronn
89
- system 'MANPAGER=/bin/cat rake ronn'
90
- assert_file 'man/foo.3'
91
- assert_match 'FOO(3)', output
92
80
  end
81
+ end
93
82
 
94
- it 'registers itself as a prerequisite of rake build' do
95
- add_development_dependency 'ronn'
96
- add_files_for_ronn
97
- mask_gemspec_todos
98
- system 'rake build'
99
- assert_file 'man/foo.3'
100
- end
83
+ it 'generates man pages' do
84
+ add_development_dependency 'ronn'
85
+ add_files_for_ronn
86
+ system 'MANPAGER=/bin/cat rake ronn'
87
+ assert_file 'man/foo.3'
88
+ assert_match 'FOO(3)', output
89
+ end
90
+
91
+ it 'registers itself as a prerequisite of rake build' do
92
+ add_development_dependency 'ronn'
93
+ add_files_for_ronn
94
+ mask_gemspec_todos
95
+ system 'rake build'
96
+ assert_file 'man/foo.3'
101
97
  end
102
98
  end
103
99
 
@@ -6,14 +6,6 @@ module DeclarativeTests
6
6
  @context.pop
7
7
  end
8
8
 
9
- def requires(lib, &block)
10
- require lib
11
- rescue LoadError
12
- warn "#{lib} is not available. Skipping some tests."
13
- else
14
- block.call
15
- end
16
-
17
9
  def it(name, &block)
18
10
  describe(name) do
19
11
  define_method("test #{@context.join(' ')}", &block)
@@ -12,6 +12,8 @@ module ExampleProject
12
12
  self.initial_directory = Dir.pwd
13
13
  self.working_directory = Dir.mktmpdir
14
14
 
15
+ ENV['BUNDLE_GEMFILE'] = nil
16
+
15
17
  Dir.chdir working_directory
16
18
  system 'bundle gem foo'
17
19
  Dir.chdir 'foo'
@@ -23,8 +25,6 @@ module ExampleProject
23
25
  require 'shoe'
24
26
  Shoe.install_tasks
25
27
  END
26
-
27
- ENV['BUNDLE_GEMFILE'] = nil
28
28
  end
29
29
 
30
30
  def teardown
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 7
9
- - 1
10
- version: 0.7.1
4
+ prerelease:
5
+ version: 0.8.0
11
6
  platform: ruby
12
7
  authors:
13
8
  - Matthew Todd
@@ -15,72 +10,53 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2010-10-12 00:00:00 +03:00
13
+ date: 2011-02-21 00:00:00 +03:00
19
14
  default_executable:
20
15
  dependencies:
21
16
  - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
17
+ name: rake
18
+ requirement: &id001 !ruby/object:Gem::Requirement
23
19
  none: false
24
20
  requirements:
25
21
  - - ~>
26
22
  - !ruby/object:Gem::Version
27
- hash: 49
28
- segments:
29
- - 0
30
- - 8
31
- - 7
32
23
  version: 0.8.7
33
- requirement: *id001
34
24
  type: :runtime
35
- name: rake
36
25
  prerelease: false
26
+ version_requirements: *id001
37
27
  - !ruby/object:Gem::Dependency
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
28
+ name: bundler
29
+ requirement: &id002 !ruby/object:Gem::Requirement
39
30
  none: false
40
31
  requirements:
41
32
  - - ~>
42
33
  - !ruby/object:Gem::Version
43
- hash: 23
44
- segments:
45
- - 1
46
- - 0
47
- - 0
48
34
  version: 1.0.0
49
- requirement: *id002
50
35
  type: :development
51
- name: bundler
52
36
  prerelease: false
37
+ version_requirements: *id002
53
38
  - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
39
+ name: cucumber
40
+ requirement: &id003 !ruby/object:Gem::Requirement
55
41
  none: false
56
42
  requirements:
57
43
  - - ~>
58
44
  - !ruby/object:Gem::Version
59
- hash: 15
60
- segments:
61
- - 0
62
- - 6
63
- - 4
64
45
  version: 0.6.4
65
- requirement: *id003
66
46
  type: :development
67
- name: cucumber
68
47
  prerelease: false
48
+ version_requirements: *id003
69
49
  - !ruby/object:Gem::Dependency
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
50
+ name: ronn
51
+ requirement: &id004 !ruby/object:Gem::Requirement
71
52
  none: false
72
53
  requirements:
73
54
  - - ~>
74
55
  - !ruby/object:Gem::Version
75
- hash: 1
76
- segments:
77
- - 0
78
- - 5
79
56
  version: "0.5"
80
- requirement: *id004
81
57
  type: :development
82
- name: ronn
83
58
  prerelease: false
59
+ version_requirements: *id004
84
60
  description: Configuration-free Rake tasks that read your gemspec. These tasks re-use built-in Rubygems functionality so you can be confident you're shipping what you think you are.
85
61
  email:
86
62
  - matthew.todd@gmail.com
@@ -93,6 +69,7 @@ extra_rdoc_files:
93
69
  - README.rdoc
94
70
  - TODO.rdoc
95
71
  files:
72
+ - .gemtest
96
73
  - .gitignore
97
74
  - .rvmrc
98
75
  - CHANGELOG.rdoc
@@ -105,7 +82,6 @@ files:
105
82
  - lib/shoe/extensions.rb
106
83
  - lib/shoe/extensions/doc_manager.rb
107
84
  - lib/shoe/extensions/specification.rb
108
- - lib/shoe/extensions/validator.rb
109
85
  - lib/shoe/tasks.rb
110
86
  - lib/shoe/tasks/clean.rb
111
87
  - lib/shoe/tasks/compile.rb
@@ -120,6 +96,7 @@ files:
120
96
  - man/shoe.3.ronn
121
97
  - shoe.gemspec
122
98
  - test/helper.rb
99
+ - test/rake_test.rb
123
100
  - test/support/assertions.rb
124
101
  - test/support/command_runner.rb
125
102
  - test/support/declarative_tests.rb
@@ -127,8 +104,6 @@ files:
127
104
  - test/support/file_manipulation.rb
128
105
  - test/support/gemspec_manipulation.rb
129
106
  - test/support/project_files.rb
130
- - test/support/redgreen.rb
131
- - test/system/rake_test.rb
132
107
  has_rdoc: true
133
108
  homepage: http://github.com/matthewtodd/shoe
134
109
  licenses: []
@@ -138,10 +113,10 @@ rdoc_options:
138
113
  - --main
139
114
  - README.rdoc
140
115
  - --title
141
- - shoe-0.7.1
116
+ - shoe-0.8.0
142
117
  - --inline-source
143
118
  - --webcvs
144
- - http://github.com/matthewtodd/shoe/blob/v0.7.1/
119
+ - http://github.com/matthewtodd/shoe/blob/v0.8.0/
145
120
  require_paths:
146
121
  - lib
147
122
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -149,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
149
124
  requirements:
150
125
  - - ">="
151
126
  - !ruby/object:Gem::Version
152
- hash: 3
127
+ hash: 846404257
153
128
  segments:
154
129
  - 0
155
130
  version: "0"
@@ -158,27 +133,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
133
  requirements:
159
134
  - - ">="
160
135
  - !ruby/object:Gem::Version
161
- hash: 23
162
- segments:
163
- - 1
164
- - 3
165
- - 6
166
136
  version: 1.3.6
167
137
  requirements:
168
138
  - git
169
139
  rubyforge_project: shoe
170
- rubygems_version: 1.3.7
140
+ rubygems_version: 1.5.0
171
141
  signing_key:
172
142
  specification_version: 3
173
143
  summary: Configuration-free Rake tasks that read your gemspec.
174
144
  test_files:
175
- - test/helper.rb
176
- - test/support/assertions.rb
177
- - test/support/command_runner.rb
178
- - test/support/declarative_tests.rb
179
- - test/support/example_project.rb
180
- - test/support/file_manipulation.rb
181
- - test/support/gemspec_manipulation.rb
182
- - test/support/project_files.rb
183
- - test/support/redgreen.rb
184
- - test/system/rake_test.rb
145
+ - test/rake_test.rb
@@ -1,56 +0,0 @@
1
-
2
- module Shoe
3
- module Extensions
4
-
5
- module Validator
6
- def self.extended(base)
7
- if RUBY_VERSION < '1.9'
8
- require 'test/unit'
9
- Test::Unit.run = true
10
- base.send :include, Ruby18::InstanceMethods
11
- base.send :remove_const, :TestRunner
12
- base.send :const_set, :TestRunner, Ruby18::TestRunner
13
- else
14
- require 'minitest/unit'
15
- MiniTest::Unit.class_eval('@@installed_at_exit = true')
16
- end
17
- end
18
-
19
- module Ruby18 #:nodoc:
20
- module InstanceMethods #:nodoc:
21
- def alert_error(*args)
22
- # no-op
23
- end
24
-
25
- def unit_test(*args)
26
- exit(1) unless super.passed?
27
- end
28
- end
29
-
30
- module TestRunner #:nodoc:
31
- # Conforms the normal TestRunner interface to the slightly different form
32
- # called by Gem::Validator.
33
- #
34
- # Note that we use Test::Unit::AutoRunner (rather than going directly for
35
- # Test::Unit::UI::Console::TestRunner) in order to give redgreen a chance
36
- # to register itself, should it have been required in one of the
37
- # test_files.
38
- def self.run(suite, ui)
39
- runner = Test::Unit::AutoRunner.new(false)
40
- runner.collector = lambda { suite }
41
- runner.run.extend(BooleanPassed)
42
- end
43
-
44
- private
45
-
46
- module BooleanPassed #:nodoc:
47
- def passed?
48
- self
49
- end
50
- end
51
- end
52
- end
53
- end
54
-
55
- end
56
- end
@@ -1,6 +0,0 @@
1
- begin
2
- require 'redgreen' if $stdout.tty?
3
- rescue LoadError
4
- # Since we don't have hard gem dependencies for testing, folks can run `gem
5
- # check --test shoe` without installing anything else.
6
- end