hoe 1.0.5 → 1.1.0

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 +5 -0
  2. data/Manifest.txt +1 -0
  3. data/README.txt +23 -16
  4. data/bin/sow +52 -0
  5. data/lib/hoe.rb +9 -1
  6. metadata +6 -5
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ = 1.1.0 2006-10-04
2
+
3
+ * Added sow, a command-line tool for quickly creating new projects.
4
+ * Added check_manifest task
5
+
1
6
  = 1.0.5 2006-10-03
2
7
 
3
8
  * Doco cleanup.
data/Manifest.txt CHANGED
@@ -2,5 +2,6 @@ History.txt
2
2
  Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
+ bin/sow
5
6
  lib/hoe.rb
6
7
  test/test_hoe.rb
data/README.txt CHANGED
@@ -11,30 +11,37 @@ testing, packaging, and deployment.
11
11
 
12
12
  Tasks Provided:
13
13
 
14
- * audit - Run ZenTest against the package
15
- * clean - Clean up all the extras
16
- * debug_gem - Show information about the gem
17
- * default - Run the default tasks
18
- * docs - Build the docs HTML Files
19
- * install - Install the package. Uses PREFIX and RUBYLIB
20
- * multi - Run the test suite using multiruby
21
- * package - Build all the packages
22
- * publish_docs - Publish RDoc to RubyForge
23
- * release - Package and upload the release to RubyForge
24
- * test - Run the test suite. Use FILTER to add to the command line.
25
- * uninstall - Uninstall the package.
26
- * upload - Upload RDoc to RubyForge
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.
27
31
 
28
32
  See class rdoc for help. Hint: ri Hoe
29
33
 
30
34
  == FEATURES/PROBLEMS:
31
35
 
32
- * Really basic and rather specific to Seattle.rb/ZenSpider projects
33
- * Will become cleaner/better very quickly.
34
- * At some point it will have real tests and stuff.
36
+ * Provides 'sow' for quick project directory creation.
37
+ * Make making and maintaining Rakefiles fun and easy.
35
38
 
36
39
  == SYNOPSYS:
37
40
 
41
+ % sow [group] project
42
+
43
+ or
44
+
38
45
  require 'hoe'
39
46
 
40
47
  Hoe.new(projectname, version) do |p|
data/bin/sow ADDED
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env ruby -w
2
+
3
+ group = ARGV.shift
4
+ project = ARGV.shift
5
+
6
+ project ||= group
7
+
8
+ # prevents false positives on my tag reporter
9
+ X = 'FI' + 'X'
10
+
11
+ abort "You must supply a project name on the commandline" unless project
12
+ abort "Project #{project} seems to exist" if test ?d, project
13
+ puts "creating project #{project}"
14
+
15
+ case project
16
+ when /_/ then
17
+ file_name = project
18
+ project = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
19
+ klass = project
20
+ else
21
+ file_name = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
22
+ klass = project.capitalize.gsub(/_([a-z])/) {$1.upcase}
23
+ end
24
+
25
+ Dir.mkdir project
26
+ Dir.chdir project do
27
+
28
+ %w(bin lib test).each do |path|
29
+ Dir.mkdir path
30
+ end
31
+
32
+ files = {
33
+ "History.txt" => "== 1.0.0 / #{Time.new.strftime("%Y-%m-%d")}\n\n* 1 major enhancement\n * Birthday!\n\n",
34
+ "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",
35
+ "Manifest.txt" => "",
36
+ "bin/#{file_name}" => "",
37
+ "lib/#{file_name}.rb" => "class #{klass}\n VERSION = '1.0.0'\nend",
38
+ "test/test_#{file_name}.rb" => "",
39
+ "Rakefile" => "# -*- ruby -*-\n\nrequire 'rubygems'\nrequire 'hoe'\nrequire './lib/#{file_name}.rb'\n\nHoe.new('#{project}', #{klass}::VERSION) do |p|\n p.rubyforge_name = \'#{group}\'\n # p.summary = '#{X}'\n # p.description = p.paragraphs_of('README.txt', 2..5).join(\"\\n\\n\")\n # p.url = p.paragraphs_of('README.txt', 0).first.split(/\\n/)[1..-1]\n p.changes = p.paragraphs_of('History.txt', 0..1).join(\"\\n\\n\")\nend\n\n# vim: syntax=Ruby\n"
40
+ }
41
+
42
+ files["Manifest.txt"] = files.keys.sort.join("\n")
43
+
44
+ files.each do |file, content|
45
+ File.open(file, "w") do |f|
46
+ f.write content
47
+ end
48
+ end
49
+ end
50
+
51
+ puts "... done, now go fix all occurances of '#{X}'"
52
+ puts `find #{project} -type f | xargs grep -n #{X}`.gsub(/\A|\n/, "\n ")
data/lib/hoe.rb CHANGED
@@ -79,7 +79,7 @@ require 'rbconfig'
79
79
  # * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
80
80
 
81
81
  class Hoe
82
- VERSION = '1.0.5'
82
+ VERSION = '1.1.0'
83
83
 
84
84
  rubyprefix = Config::CONFIG['prefix']
85
85
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -331,6 +331,14 @@ class Hoe
331
331
  desc 'Generate email announcement file and post to rubyforge.'
332
332
  task :announce => [:email, :post_news]
333
333
 
334
+ desc "Verify the manifest"
335
+ task :check_manifest => :clean do
336
+ f = "Manifest.tmp"
337
+ system "find . -type f | egrep -v 'svn|tmp$' | cut -c3- | sort > #{f}"
338
+ system "diff -du Manifest.txt #{f}"
339
+ rm f
340
+ end
341
+
334
342
  end # end define
335
343
 
336
344
  def announcement
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.0.5
7
- date: 2006-10-03 00:00:00 -07:00
6
+ version: 1.1.0
7
+ date: 2006-10-04 00:00:00 -07: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: * audit - Run ZenTest against the package * clean - Clean up all the extras * debug_gem - Show information about the gem * default - Run the default tasks * docs - Build the docs HTML Files * install - Install the package. Uses PREFIX and RUBYLIB * multi - Run the test suite using multiruby * package - Build all the packages * publish_docs - Publish RDoc to RubyForge * release - Package and upload the release to RubyForge * test - Run the test suite. Use FILTER to add to the command line. * uninstall - Uninstall the package. * upload - Upload RDoc to RubyForge 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 * 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"
16
16
  autorequire:
17
17
  default_executable:
18
18
  bindir: bin
@@ -34,6 +34,7 @@ files:
34
34
  - Manifest.txt
35
35
  - README.txt
36
36
  - Rakefile
37
+ - bin/sow
37
38
  - lib/hoe.rb
38
39
  - test/test_hoe.rb
39
40
  test_files: []
@@ -42,8 +43,8 @@ rdoc_options: []
42
43
 
43
44
  extra_rdoc_files: []
44
45
 
45
- executables: []
46
-
46
+ executables:
47
+ - sow
47
48
  extensions: []
48
49
 
49
50
  requirements: []