hoe 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/History.txt +10 -1
  2. data/README.txt +19 -17
  3. data/bin/sow +1 -1
  4. data/lib/hoe.rb +54 -26
  5. data/test/test_hoe.rb +1 -1
  6. metadata +6 -6
@@ -1,4 +1,13 @@
1
- = 1.1.2
1
+ = 1.1.3 2006-11-09
2
+
3
+ * Added test_deps, now you can automatically discover test dependency ommisions.
4
+ * Added ext support! Build C extensions with hoe!
5
+ * Gemspec uses test_all.rb or result of test_globs. Tweak those tests.
6
+ * Now uses https to login to rubyforge. Rubyforge crackers beware!
7
+ * Fixed doco and automated updating of it.
8
+ * Added rdoc_pattern. Go doco go!
9
+
10
+ = 1.1.2 2006-10-22
2
11
 
3
12
  * Added -d and -t flags to sow to make dev or trunk subdirs for p4 and svn projects.
4
13
  * Added install_gem to further test gem builds.
data/README.txt CHANGED
@@ -11,23 +11,25 @@ testing, packaging, and deployment.
11
11
 
12
12
  Tasks Provided:
13
13
 
14
- * announce - Generate email announcement file and post to rubyforge.
15
- * audit - Run ZenTest against the package
16
- * check_manifest - Verify the manifest
17
- * clean - Clean up all the extras
18
- * debug_gem - Show information about the gem.
19
- * default - Run the default tasks
20
- * docs - Build the docs HTML Files
21
- * email - Generate email announcement file.
22
- * install - Install the package. Uses PREFIX and RUBYLIB
23
- * multi - Run the test suite using multiruby
24
- * package - Build all the packages
25
- * post_news - Post announcement to rubyforge.
26
- * publish_docs - Publish RDoc to RubyForge
27
- * release - Package and upload the release to rubyforge.
28
- * ridocs - Generate ri locally for testing
29
- * test - Run the test suite. Use FILTER to add to the command line.
30
- * uninstall - Uninstall the package.
14
+ * announce - Generate email announcement file and post to rubyforge.
15
+ * audit - Run ZenTest against the package
16
+ * check_manifest - Verify the manifest
17
+ * clean - Clean up all the extras
18
+ * debug_gem - Show information about the gem.
19
+ * default - Run the default tasks
20
+ * docs - Build the docs HTML Files
21
+ * email - Generate email announcement file.
22
+ * install - Install the package. Uses PREFIX and RUBYLIB
23
+ * install_gem - Install the package as a gem
24
+ * multi - Run the test suite using multiruby
25
+ * package - Build all the packages
26
+ * post_news - Post announcement to rubyforge.
27
+ * publish_docs - Publish RDoc to RubyForge
28
+ * release - Package and upload the release to rubyforge.
29
+ * ridocs - Generate ri locally for testing
30
+ * test - Run the test suite. Use FILTER to add to the command line.
31
+ * test_deps - Show which test files fail when run alone.
32
+ * uninstall - Uninstall the package.
31
33
 
32
34
  See class rdoc for help. Hint: ri Hoe
33
35
 
data/bin/sow CHANGED
@@ -50,7 +50,7 @@ Dir.chdir project do
50
50
 
51
51
  files = {
52
52
  "History.txt" => "== 1.0.0 / #{Time.new.strftime("%Y-%m-%d")}\n\n* 1 major enhancement\n * Birthday!\n\n",
53
- "README.txt" => "#{project}\n by #{X}\n #{X}\n\n== DESCRIPTION:\n \n#{X}\n\n== FEATURES/PROBLEMS:\n \n* #{X}\n\n== SYNOPSYS:\n\n #{X}\n\n== REQUIREMENTS:\n\n+ #{X}\n\n== INSTALL:\n\n+ #{X}\n\n== LICENSE:\n\n(The MIT License)\n\nCopyright (c) #{Time.new.strftime("%Y")} #{X}\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
53
+ "README.txt" => "#{project}\n by #{X} (your name)\n #{X} (url)\n\n== DESCRIPTION:\n \n#{X} (describe your package)\n\n== FEATURES/PROBLEMS:\n \n* #{X} (list of features or problems)\n\n== SYNOPSYS:\n\n #{X} (code sample of usage)\n\n== REQUIREMENTS:\n\n* #{X} (list of requirements)\n\n== INSTALL:\n\n* #{X} (sudo gem install, anything else)\n\n== LICENSE:\n\n(The MIT License)\n\nCopyright (c) #{Time.new.strftime("%Y")} #{X}\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
54
54
  "Manifest.txt" => "",
55
55
  "bin/#{file_name}" => "",
56
56
  "lib/#{file_name}.rb" => "class #{klass}\n VERSION = '1.0.0'\nend",
data/lib/hoe.rb CHANGED
@@ -32,20 +32,25 @@ require 'rbconfig'
32
32
  #
33
33
  # === Tasks Provided:
34
34
  #
35
- # * audit - Run ZenTest against the package
36
- # * clean - Clean up all the extras
37
- # * debug_gem - Show information about the gem
38
- # * default - Run the default tasks
39
- # * docs - Build the docs HTML Files
40
- # * install - Install the package. Uses PREFIX and RUBYLIB
41
- # * install_gem - Install the package as a gem.
42
- # * multi - Run the test suite using multiruby
43
- # * package - Build all the packages
44
- # * publish_docs - Publish RDoc to RubyForge
45
- # * release - Package and upload the release to RubyForge
46
- # * test - Run the test suite. Use FILTER to add to the command line.
47
- # * uninstall - Uninstall the package.
48
- # * upload - Upload RDoc to RubyForge
35
+ # * announce - Generate email announcement file and post to rubyforge.
36
+ # * audit - Run ZenTest against the package
37
+ # * check_manifest - Verify the manifest
38
+ # * clean - Clean up all the extras
39
+ # * debug_gem - Show information about the gem.
40
+ # * default - Run the default tasks
41
+ # * docs - Build the docs HTML Files
42
+ # * email - Generate email announcement file.
43
+ # * install - Install the package. Uses PREFIX and RUBYLIB
44
+ # * install_gem - Install the package as a gem
45
+ # * multi - Run the test suite using multiruby
46
+ # * package - Build all the packages
47
+ # * post_news - Post announcement to rubyforge.
48
+ # * publish_docs - Publish RDoc to RubyForge
49
+ # * release - Package and upload the release to rubyforge.
50
+ # * ridocs - Generate ri locally for testing
51
+ # * test - Run the test suite. Use FILTER to add to the command line.
52
+ # * test_deps - Show which test files fail when run alone.
53
+ # * uninstall - Uninstall the package.
49
54
  #
50
55
  # === Attributes
51
56
  #
@@ -68,20 +73,21 @@ require 'rbconfig'
68
73
  # ==== Optional
69
74
  #
70
75
  # * clean_globs - An array of file patterns to delete on clean.
71
- # * test_globs - An array of test file patterns [default: test/**/test_*.rb]
72
76
  # * extra_deps - An array of rubygem dependencies.
77
+ # * rdoc_pattern - A regexp to match documentation files against the manifest.
73
78
  # * rubyforge_name - The name of the rubyforge project. [default: name.downcase]
74
79
  # * spec_extras - A hash of extra values to set in the gemspec.
80
+ # * test_globs - An array of test file patterns [default: test/**/test_*.rb]
75
81
  #
76
82
  # === Environment Variables
77
83
  #
84
+ # * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
78
85
  # * PREFIX - Used to specify a custom install location (for rake install).
79
- # * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
80
86
  # * RUBY_DEBUG - Used to add extra flags to RUBY_FLAGS.
81
- # * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
87
+ # * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
82
88
 
83
89
  class Hoe
84
- VERSION = '1.1.2'
90
+ VERSION = '1.1.3'
85
91
 
86
92
  rubyprefix = Config::CONFIG['prefix']
87
93
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -94,11 +100,11 @@ class Hoe
94
100
  end
95
101
  RUBY_DEBUG = ENV['RUBY_DEBUG']
96
102
  RUBY_FLAGS = ENV['RUBY_FLAGS'] ||
97
- "-w -I#{%w(lib bin test).join(File::PATH_SEPARATOR)}" +
103
+ "-w -I#{%w(lib ext bin test).join(File::PATH_SEPARATOR)}" +
98
104
  (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
99
105
  FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
100
106
 
101
- attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :test_globs, :url, :version
107
+ attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :rdoc_pattern, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :test_globs, :url, :version
102
108
 
103
109
  def initialize(name, version)
104
110
  self.name = name
@@ -114,12 +120,13 @@ class Hoe
114
120
  self.changes = "#{author} is too lazy to write a changeset"
115
121
  self.description = "#{author} is too lazy to write a description"
116
122
  self.summary = "#{author} is too lazy to write a summary"
123
+ self.rdoc_pattern = /^(lib|bin)|txt$/
117
124
  self.extra_deps = []
118
125
  self.spec_extras = {}
119
126
 
120
127
  if name == 'hoe' then
121
128
  extra_deps << ['rake']
122
- extra_deps << ['rubyforge', '>= 0.3.0']
129
+ extra_deps << ['rubyforge', '>= 0.3.1']
123
130
  else
124
131
  extra_deps << ['hoe', ">= #{VERSION}"]
125
132
  end
@@ -138,6 +145,17 @@ class Hoe
138
145
  run_tests
139
146
  end
140
147
 
148
+ desc 'Show which test files fail when run alone.'
149
+ task :test_deps do
150
+ tests = Dir["test/**/test_*.rb"] + Dir["test/**/*_test.rb"]
151
+
152
+ tests.each do |test|
153
+ if not system "ruby -Ibin:lib:test #{test} &> /dev/null" then
154
+ puts "Dependency Issues: #{test}"
155
+ end
156
+ end
157
+ end
158
+
141
159
  desc 'Run the test suite using multiruby'
142
160
  task :multi do
143
161
  run_tests :multi
@@ -174,10 +192,15 @@ class Hoe
174
192
  s.executables = s.files.grep(/bin/) { |f| File.basename(f) }
175
193
 
176
194
  s.bindir = "bin"
177
- dirs = Dir['{lib,test}']
195
+ dirs = Dir['{lib,ext,test}']
178
196
  s.require_paths = dirs unless dirs.empty?
179
197
  s.has_rdoc = true
180
- s.test_suite_file = "test/test_all.rb" if test ?f, "test/test_all.rb"
198
+
199
+ if test ?f, "test/test_all.rb" then
200
+ s.test_file = "test/test_all.rb"
201
+ else
202
+ s.test_files = Dir[*test_globs]
203
+ end
181
204
  end
182
205
 
183
206
  desc 'Show information about the gem.'
@@ -187,7 +210,7 @@ class Hoe
187
210
 
188
211
  self.lib_files = spec.files.grep(/^lib/)
189
212
  self.bin_files = spec.files.grep(/^bin/)
190
- self.test_files = %w(test/test_sexp_processor.rb) # for ruby_to_c's tests.
213
+ self.test_files = spec.files.grep(/^test/)
191
214
 
192
215
  Rake::GemPackageTask.new spec do |pkg|
193
216
  pkg.need_tar = true
@@ -260,7 +283,7 @@ class Hoe
260
283
  rd.main = "README.txt"
261
284
  rd.options << '-d' if RUBY_PLATFORM !~ /win32/ and `which dot` =~ /\/dot/
262
285
  rd.rdoc_dir = 'doc'
263
- files = spec.files.grep(/^(lib|bin)|txt$/)
286
+ files = spec.files.grep(rdoc_pattern)
264
287
  files -= ['Manifest.txt']
265
288
  rd.rdoc_files.push(*files)
266
289
 
@@ -371,7 +394,7 @@ class Hoe
371
394
  cmd = if test ?f, 'test/test_all.rb' then
372
395
  "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
373
396
  else
374
- tests = test_globs.map {|g| Dir.glob(g)}.flatten << 'test/unit'
397
+ tests = test_globs.map { |g| Dir.glob(g) }.flatten << 'test/unit'
375
398
  tests.map! {|f| %Q(require "#{f}")}
376
399
  "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
377
400
  end
@@ -394,3 +417,8 @@ end
394
417
  class ::Rake::SshDirPublisher # :nodoc:
395
418
  attr_reader :host, :remote_dir, :local_dir
396
419
  end
420
+
421
+ if $0 == __FILE__ then
422
+ out = `rake -T | egrep -v "redocs|repackage|clobber|trunk"`
423
+ puts out.gsub(/\#/, '-').gsub(/^rake /, '# * ')
424
+ end
@@ -15,7 +15,7 @@ class TestHoe < Test::Unit::TestCase
15
15
 
16
16
  def test_basics
17
17
  boring = %w(clobber clobber_docs clobber_package doc doc/index.html pkg pkg/blah-1.0.0 pkg/blah-1.0.0.gem pkg/blah-1.0.0.tgz redocs repackage)
18
- expected = %w(audit announce check_manifest clean debug_gem default docs email gem install install_gem multi package post_news publish_docs release ridocs test uninstall)
18
+ expected = %w(audit announce check_manifest clean debug_gem default docs email gem install install_gem multi package post_news publish_docs release ridocs test test_deps uninstall)
19
19
  expected += boring
20
20
 
21
21
  Hoe.new('blah', '1.0.0')
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: hoe
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.2
7
- date: 2006-10-22 00:00:00 -06:00
6
+ version: 1.1.3
7
+ date: 2006-11-09 00:00:00 -05:00
8
8
  summary: Hoe is a way to write Rakefiles much easier and cleaner.
9
9
  require_paths:
10
10
  - lib
@@ -12,7 +12,7 @@ require_paths:
12
12
  email: ryand-ruby@zenspider.com
13
13
  homepage: " http://rubyforge.org/projects/seattlerb/"
14
14
  rubyforge_project: seattlerb
15
- description: "Hoe is a simple rake/rubygems helper for project Rakefiles. It generates all the usual tasks for projects including rdoc generation, testing, packaging, and deployment. Tasks Provided: * announce - Generate email announcement file and post to rubyforge. * audit - Run ZenTest against the package * check_manifest - Verify the manifest * clean - Clean up all the extras * debug_gem - Show information about the gem. * default - Run the default tasks * docs - Build the docs HTML Files * email - Generate email announcement file. * install - Install the package. Uses PREFIX and RUBYLIB * multi - Run the test suite using multiruby * package - Build all the packages * post_news - Post announcement to rubyforge. * publish_docs - Publish RDoc to RubyForge * release - Package and upload the release to rubyforge. * ridocs - Generate ri locally for testing * test - Run the test suite. Use FILTER to add to the command line. * uninstall - Uninstall the package. See class rdoc for help. Hint: ri Hoe"
15
+ description: "Hoe is a simple rake/rubygems helper for project Rakefiles. It generates all the usual tasks for projects including rdoc generation, testing, packaging, and deployment. Tasks Provided: * announce - Generate email announcement file and post to rubyforge. * audit - Run ZenTest against the package * check_manifest - Verify the manifest * clean - Clean up all the extras * debug_gem - Show information about the gem. * default - Run the default tasks * docs - Build the docs HTML Files * email - Generate email announcement file. * install - Install the package. Uses PREFIX and RUBYLIB * install_gem - Install the package as a gem * multi - Run the test suite using multiruby * package - Build all the packages * post_news - Post announcement to rubyforge. * publish_docs - Publish RDoc to RubyForge * release - Package and upload the release to rubyforge. * ridocs - Generate ri locally for testing * test - Run the test suite. Use FILTER to add to the command line. * test_deps - Show which test files fail when run alone. * uninstall - Uninstall the package. See class rdoc for help. Hint: ri Hoe"
16
16
  autorequire:
17
17
  default_executable:
18
18
  bindir: bin
@@ -37,8 +37,8 @@ files:
37
37
  - bin/sow
38
38
  - lib/hoe.rb
39
39
  - test/test_hoe.rb
40
- test_files: []
41
-
40
+ test_files:
41
+ - test/test_hoe.rb
42
42
  rdoc_options: []
43
43
 
44
44
  extra_rdoc_files: []
@@ -66,5 +66,5 @@ dependencies:
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.3.0
69
+ version: 0.3.1
70
70
  version: