hoe 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/History.txt +14 -0
  2. data/README.txt +2 -2
  3. data/Rakefile +3 -6
  4. data/bin/sow +2 -2
  5. data/lib/hoe.rb +51 -12
  6. data/test/test_hoe.rb +7 -1
  7. metadata +7 -6
@@ -1,3 +1,17 @@
1
+ === 1.5.0 / 2008-01-30
2
+
3
+ * 9 Minor Enhancements:
4
+
5
+ * Added autopopulation of changes from History.txt.
6
+ * Added autopopulation of urls from History.txt.
7
+ * Added autopopulation of description from History.txt
8
+ * Added autopopulation of summary from description.
9
+ * Added description_sections to declare what sections of readme to use.
10
+ * Added summary_sentences to declare how many sentences you want in summary.
11
+ * Added developer(name, email) to cleanly populate both author/email arrays.
12
+ * author and email now default to "doofus".
13
+ * author and email warn that they'll blow up on 2008-04-01.
14
+
1
15
  === 1.4.0 / 2007-12-20
2
16
 
3
17
  * 1 Major Enhancement:
data/README.txt CHANGED
@@ -1,4 +1,4 @@
1
- Hoe
1
+ = Hoe
2
2
 
3
3
  * http://rubyforge.org/projects/seattlerb/
4
4
  * http://seattlerb.rubyforge.org/hoe/
@@ -38,7 +38,7 @@ Tasks Provided:
38
38
  See class rdoc for help. Hint: ri Hoe
39
39
 
40
40
  == FEATURES/PROBLEMS:
41
-
41
+
42
42
  * Provides 'sow' for quick project directory creation.
43
43
  * Make making and maintaining Rakefiles fun and easy.
44
44
 
data/Rakefile CHANGED
@@ -2,12 +2,9 @@
2
2
 
3
3
  require './lib/hoe.rb'
4
4
 
5
- Hoe.new("hoe", Hoe::VERSION) do |p|
6
- p.rubyforge_name = "seattlerb"
7
- p.summary = "Hoe is a way to write Rakefiles much easier and cleaner."
8
- p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
9
- p.url = p.paragraphs_of('README.txt', 1).first.gsub(/^\* /, '').split(/\n/)
10
- p.changes = p.paragraphs_of('History.txt', 0..2).join("\n\n")
5
+ Hoe.new("hoe", Hoe::VERSION) do |hoe|
6
+ hoe.rubyforge_name = "seattlerb"
7
+ hoe.developer("Ryan Davis", "ryand-ruby@zenspider.com")
11
8
  end
12
9
 
13
10
  # vim: syntax=Ruby
data/bin/sow CHANGED
@@ -49,8 +49,8 @@ Dir.chdir project do
49
49
  end
50
50
 
51
51
  files = {
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} (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== SYNOPSIS:\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",
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\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== SYNOPSIS:\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
@@ -117,7 +117,7 @@ require 'yaml'
117
117
  #
118
118
 
119
119
  class Hoe
120
- VERSION = '1.4.0'
120
+ VERSION = '1.5.0'
121
121
 
122
122
  ruby_prefix = Config::CONFIG['prefix']
123
123
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -181,7 +181,7 @@ class Hoe
181
181
  attr_accessor :bin_files # :nodoc:
182
182
 
183
183
  ##
184
- # *Recommended*: A description of the release's latest changes.
184
+ # Optional: A description of the release's latest changes. Auto-populates.
185
185
 
186
186
  attr_accessor :changes
187
187
 
@@ -191,10 +191,15 @@ class Hoe
191
191
  attr_accessor :clean_globs
192
192
 
193
193
  ##
194
- # *Recommended*: A description of the project.
194
+ # Optional: A description of the project. Auto-populates.
195
195
 
196
196
  attr_accessor :description
197
197
 
198
+ ##
199
+ # Optional: What sections from the readme to use for auto-description. Defaults to %w(description).
200
+
201
+ attr_accessor :description_sections
202
+
198
203
  ##
199
204
  # *Recommended*: The author's email address(es). (can be array)
200
205
 
@@ -256,10 +261,15 @@ class Hoe
256
261
  attr_accessor :spec_extras
257
262
 
258
263
  ##
259
- # *Recommended*: A short summary of the project.
264
+ # Optional: A short summary of the project. Auto-populates.
260
265
 
261
266
  attr_accessor :summary
262
267
 
268
+ ##
269
+ # Optional: Number of sentences from description for summary. Defaults to 1.
270
+
271
+ attr_accessor :summary_sentences
272
+
263
273
  ##
264
274
  # Populated automatically from the manifest. List of tests.
265
275
 
@@ -271,7 +281,7 @@ class Hoe
271
281
  attr_accessor :test_globs
272
282
 
273
283
  ##
274
- # *Recommended*: The url(s) of the project. (can be array)
284
+ # Optional: The url(s) of the project. (can be array). Auto-populates.
275
285
 
276
286
  attr_accessor :url
277
287
 
@@ -285,11 +295,10 @@ class Hoe
285
295
  self.version = version
286
296
 
287
297
  # Defaults
288
- self.author = "Ryan Davis"
289
- self.changes = "The author was too lazy to write a changeset"
298
+ self.author = []
290
299
  self.clean_globs = %w(diff diff.txt email.txt ri *.gem **/*~)
291
- self.description = "The author was too lazy to write a description"
292
- self.email = "ryand-ruby@zenspider.com"
300
+ self.description_sections = %w(description)
301
+ self.email = []
293
302
  self.extra_deps = []
294
303
  self.need_tar = true
295
304
  self.need_zip = false
@@ -298,12 +307,37 @@ class Hoe
298
307
  self.rsync_args = '-av --delete'
299
308
  self.rubyforge_name = name.downcase
300
309
  self.spec_extras = {}
301
- self.summary = "The author was too lazy to write a summary"
310
+ self.summary_sentences = 1
302
311
  self.test_globs = ['test/**/test_*.rb']
303
- self.url = "http://www.zenspider.com/ZSS/Products/#{name}/"
304
312
 
305
313
  yield self if block_given?
306
314
 
315
+ # Intuit values:
316
+
317
+ history = File.read("History.txt").split(/^(===.*)/)
318
+ readme = File.read("README.txt").split(/^(=+ .*)$/)[1..-1]
319
+ sections = readme.map { |s| s =~ /^=/ ? s.strip.downcase.chomp(':').split.last : s.strip }
320
+ sections = Hash[*sections]
321
+ desc = sections.values_at(*description_sections).join("\n\n")
322
+ summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
323
+
324
+ self.description ||= desc
325
+ self.changes ||= history[0..2].join.strip
326
+ self.summary ||= summ
327
+ self.url ||= readme[1].gsub(/^\* /, '').split(/\n/).grep(/\S+/)
328
+
329
+ %w(email author).each do |field|
330
+ value = self.send(field)
331
+ if value.nil? or value.empty? then
332
+ if Time.now < Time.local(2008, 4, 1) then
333
+ warn "Hoe #{field} value not set - Fix by 2008-04-01!"
334
+ self.send "#{field}=", "doofus"
335
+ else
336
+ abort "Hoe #{field} value not set"
337
+ end
338
+ end
339
+ end
340
+
307
341
  hoe_deps = {
308
342
  'rake' => ">= #{RAKEVERSION}",
309
343
  'rubyforge' => ">= #{::RubyForge::VERSION}",
@@ -322,6 +356,11 @@ class Hoe
322
356
  define_tasks
323
357
  end
324
358
 
359
+ def developer name, email
360
+ self.author << name
361
+ self.email << email
362
+ end
363
+
325
364
  def define_tasks # :nodoc:
326
365
  def with_config # :nodoc:
327
366
  rc = File.expand_path("~/.hoerc")
@@ -483,7 +522,7 @@ class Hoe
483
522
 
484
523
  desc 'Install the package as a gem'
485
524
  task :install_gem => [:clean, :package] do
486
- sh "#{'sudo ' unless WINDOZE}gem install pkg/*.gem"
525
+ sh "#{'sudo ' unless WINDOZE}gem install --local pkg/*.gem"
487
526
  end
488
527
 
489
528
  desc 'Uninstall the package.'
@@ -39,7 +39,13 @@ class TestHoe < Test::Unit::TestCase
39
39
  uninstall)
40
40
  expected += boring
41
41
 
42
- Hoe.new('blah', '1.0.0')
42
+ spec = Hoe.new('blah', '1.0.0') do |h|
43
+ h.developer("name", "email")
44
+ end
45
+
46
+ assert_equal ["name"], spec.author
47
+ assert_equal ["email"], spec.email
48
+
43
49
  tasks = Rake.application.tasks
44
50
  public_tasks = tasks.reject { |t| t.comment.nil? }.map { |t| t.name }.sort
45
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2007-12-22 00:00:00 -08:00
12
+ date: 2008-01-31 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -28,10 +28,11 @@ dependencies:
28
28
  requirements:
29
29
  - - ">="
30
30
  - !ruby/object:Gem::Version
31
- version: 0.7.3
31
+ version: 0.8.1
32
32
  version:
33
- description: "== 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 * config_hoe - Create a fresh ~/.hoerc file * debug_gem - Show information about the gem. * default - Run the default tasks * docs - Build the docs HTML Files * email - Generate email announcement file. * gem - Build the gem file only. * 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_blog - Post announcement to blog. * 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."
34
- email: ryand-ruby@zenspider.com
33
+ 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 * config_hoe - Create a fresh ~/.hoerc file * debug_gem - Show information about the gem. * default - Run the default tasks * docs - Build the docs HTML Files * email - Generate email announcement file. * gem - Build the gem file only. * 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_blog - Post announcement to blog. * 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"
34
+ email:
35
+ - ryand-ruby@zenspider.com
35
36
  executables:
36
37
  - sow
37
38
  extensions: []
@@ -74,6 +75,6 @@ rubyforge_project: seattlerb
74
75
  rubygems_version: 1.0.1
75
76
  signing_key:
76
77
  specification_version: 2
77
- summary: Hoe is a way to write Rakefiles much easier and cleaner.
78
+ summary: Hoe is a simple rake/rubygems helper for project Rakefiles
78
79
  test_files:
79
80
  - test/test_hoe.rb