hoe 1.5.0 → 1.5.1

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 +15 -0
  2. data/README.txt +21 -22
  3. data/Rakefile +14 -0
  4. data/bin/sow +2 -2
  5. data/lib/hoe.rb +46 -63
  6. data/test/test_hoe.rb +1 -3
  7. metadata +3 -3
@@ -1,3 +1,18 @@
1
+ === 1.5.1 / 2008-03-04
2
+
3
+ * 2 Minor Enhancements:
4
+
5
+ * Removed install/uninstall tasks. Too buggy. Gems do a better job.
6
+ * Added cleaning of rbc files to default list
7
+
8
+ * 5 Bug Fixes:
9
+
10
+ * Correctly deal with errors intuiting history and readme files. Thanks Aaron!
11
+ * Fixed rdoc title. Thanks, Sander!
12
+ * Fixed sow to match new Rakefile and History format. Thanks, me!
13
+ * Moved test/unit to the front for rake test. Fixes use of miniunit.
14
+ * Renamed shadowed variable.
15
+
1
16
  === 1.5.0 / 2008-01-30
2
17
 
3
18
  * 9 Minor Enhancements:
data/README.txt CHANGED
@@ -12,28 +12,27 @@ testing, packaging, and deployment.
12
12
 
13
13
  Tasks Provided:
14
14
 
15
- * announce - Generate email announcement file and post to rubyforge.
16
- * audit - Run ZenTest against the package
17
- * check_manifest - Verify the manifest
18
- * clean - Clean up all the extras
19
- * config_hoe - Create a fresh ~/.hoerc file
20
- * debug_gem - Show information about the gem.
21
- * default - Run the default tasks
22
- * docs - Build the docs HTML Files
23
- * email - Generate email announcement file.
24
- * gem - Build the gem file only.
25
- * install - Install the package. Uses PREFIX and RUBYLIB
26
- * install_gem - Install the package as a gem
27
- * multi - Run the test suite using multiruby
28
- * package - Build all the packages
29
- * post_blog - Post announcement to blog.
30
- * post_news - Post announcement to rubyforge.
31
- * publish_docs - Publish RDoc to RubyForge
32
- * release - Package and upload the release to rubyforge.
33
- * ridocs - Generate ri locally for testing
34
- * test - Run the test suite. Use FILTER to add to the command line.
35
- * test_deps - Show which test files fail when run alone.
36
- * uninstall - Uninstall the package.
15
+ * announce - Create news email file and post to rubyforge.
16
+ * audit - Run ZenTest against the package.
17
+ * check_manifest - Verify the manifest.
18
+ * clean - Clean up all the extras.
19
+ * config_hoe - Create a fresh ~/.hoerc file.
20
+ * debug_gem - Show information about the gem.
21
+ * default - Run the default tasks.
22
+ * docs - Build the docs HTML Files
23
+ * email - Generate email announcement file.
24
+ * gem - Build the gem file hoe-1.5.0.gem
25
+ * generate_key - Generate a key for signing your gems.
26
+ * install_gem - Install the package as a gem.
27
+ * multi - Run the test suite using multiruby.
28
+ * package - Build all the packages
29
+ * post_blog - Post announcement to blog.
30
+ * post_news - Post announcement to rubyforge.
31
+ * publish_docs - Publish RDoc to RubyForge.
32
+ * release - Package and upload the release to rubyforge.
33
+ * ridocs - Generate ri locally for testing.
34
+ * test - Run the test suite.
35
+ * test_deps - Show which test files fail when run alone.
37
36
 
38
37
  See class rdoc for help. Hint: ri Hoe
39
38
 
data/Rakefile CHANGED
@@ -7,4 +7,18 @@ Hoe.new("hoe", Hoe::VERSION) do |hoe|
7
7
  hoe.developer("Ryan Davis", "ryand-ruby@zenspider.com")
8
8
  end
9
9
 
10
+ task :tasks do
11
+ tasks = `rake -T`.scan(/rake (\w+)\s+# (.*)/)
12
+ tasks.reject! { |t,d| t =~ /^(clobber|re(package|docs))/ }
13
+ max = tasks.map { |x,y| x.size }.max
14
+
15
+ tasks.each do |t,d|
16
+ if ENV['RDOC'] then
17
+ puts "# %-#{max+2}s %s" % [t + "::", d]
18
+ else
19
+ puts "* %-#{max}s - %s" % [t, d]
20
+ end
21
+ end
22
+ end
23
+
10
24
  # vim: syntax=Ruby
data/bin/sow CHANGED
@@ -49,13 +49,13 @@ 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",
52
+ "History.txt" => "=== 1.0.0 / #{Time.new.strftime("%Y-%m-%d")}\n\n* 1 major enhancement\n\n * Birthday!\n\n",
53
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",
57
57
  "test/test_#{file_name}.rb" => "",
58
- "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.author = '#{X}'\n # p.email = '#{X}'\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"
58
+ "Rakefile" => "# -*- ruby -*-\n\nrequire 'rubygems'\nrequire 'hoe'\nrequire './lib/#{file_name}.rb'\n\nHoe.new('#{project}', #{klass}::VERSION) do |p|\n # p.rubyforge_name = '#{project}x' # if different than lowercase project name\n # p.developer('#{X}', '#{X}@example.com')\nend\n\n# vim: syntax=Ruby\n"
59
59
  }
60
60
 
61
61
  files["Manifest.txt"] = files.keys.sort.join("\n")
data/lib/hoe.rb CHANGED
@@ -34,28 +34,27 @@ require 'yaml'
34
34
  #
35
35
  # === Tasks Provided:
36
36
  #
37
- # announce:: Generate email announcement file and post to rubyforge.
38
- # audit:: Run ZenTest against the package
39
- # check_manifest:: Verify the manifest
40
- # clean:: Clean up all the extras
41
- # config_hoe:: Create a fresh ~/.hoerc file
37
+ # announce:: Create news email file and post to rubyforge.
38
+ # audit:: Run ZenTest against the package.
39
+ # check_manifest:: Verify the manifest.
40
+ # clean:: Clean up all the extras.
41
+ # config_hoe:: Create a fresh ~/.hoerc file.
42
42
  # debug_gem:: Show information about the gem.
43
- # default:: Run the default tasks
43
+ # default:: Run the default tasks.
44
44
  # docs:: Build the docs HTML Files
45
45
  # email:: Generate email announcement file.
46
- # gem:: Build the gem file only.
47
- # install:: Install the package. Uses PREFIX and RUBYLIB
48
- # install_gem:: Install the package as a gem
49
- # multi:: Run the test suite using multiruby
46
+ # gem:: Build the gem file hoe-1.5.0.gem
47
+ # generate_key:: Generate a key for signing your gems.
48
+ # install_gem:: Install the package as a gem.
49
+ # multi:: Run the test suite using multiruby.
50
50
  # package:: Build all the packages
51
51
  # post_blog:: Post announcement to blog.
52
52
  # post_news:: Post announcement to rubyforge.
53
- # publish_docs:: Publish RDoc to RubyForge
53
+ # publish_docs:: Publish RDoc to RubyForge.
54
54
  # release:: Package and upload the release to rubyforge.
55
- # ridocs:: Generate ri locally for testing
56
- # test:: Run the test suite. Use FILTER to add to the command line.
55
+ # ridocs:: Generate ri locally for testing.
56
+ # test:: Run the test suite.
57
57
  # test_deps:: Show which test files fail when run alone.
58
- # uninstall:: Uninstall the package.
59
58
  #
60
59
  # === Extra Configuration Options:
61
60
  #
@@ -117,7 +116,7 @@ require 'yaml'
117
116
  #
118
117
 
119
118
  class Hoe
120
- VERSION = '1.5.0'
119
+ VERSION = '1.5.1'
121
120
 
122
121
  ruby_prefix = Config::CONFIG['prefix']
123
122
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -296,7 +295,8 @@ class Hoe
296
295
 
297
296
  # Defaults
298
297
  self.author = []
299
- self.clean_globs = %w(diff diff.txt email.txt ri *.gem **/*~)
298
+ self.clean_globs = %w(diff diff.txt email.txt ri
299
+ *.gem *~ **/*~ *.rbc **/*.rbc)
300
300
  self.description_sections = %w(description)
301
301
  self.email = []
302
302
  self.extra_deps = []
@@ -314,17 +314,23 @@ class Hoe
314
314
 
315
315
  # Intuit values:
316
316
 
317
- history = File.read("History.txt").split(/^(===.*)/)
318
317
  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+/)
318
+ unless readme.empty? then
319
+ sections = readme.map { |s|
320
+ s =~ /^=/ ? s.strip.downcase.chomp(':').split.last : s.strip
321
+ }
322
+ sections = Hash[*sections]
323
+ desc = sections.values_at(*description_sections).join("\n\n")
324
+ summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
325
+
326
+ self.description ||= desc
327
+ self.changes ||= File.read("History.txt").split(/^(===.*)/)[1..2].join.strip
328
+ self.summary ||= summ
329
+ self.url ||= readme[1].gsub(/^\* /, '').split(/\n/).grep(/\S+/)
330
+ else
331
+ warn "** README.txt is in the wrong format for auto-intuiting."
332
+ warn " run sow blah and look at it's text files"
333
+ end
328
334
 
329
335
  %w(email author).each do |field|
330
336
  value = self.send(field)
@@ -346,8 +352,8 @@ class Hoe
346
352
  self.extra_deps = Array(extra_deps).map { |o| String === o ? [o] : o }
347
353
 
348
354
  if name == 'hoe' then
349
- hoe_deps.each do |pkg, version|
350
- extra_deps << [pkg, version]
355
+ hoe_deps.each do |pkg, vers|
356
+ extra_deps << [pkg, vers]
351
357
  end
352
358
  else
353
359
  extra_deps << ['hoe', ">= #{VERSION}"] unless hoe_deps.has_key? name
@@ -369,7 +375,7 @@ class Hoe
369
375
  yield(config, rc)
370
376
  end
371
377
 
372
- desc 'Run the default tasks'
378
+ desc 'Run the default tasks.'
373
379
  task :default => :test
374
380
 
375
381
  desc 'Run the test suite. Use FILTER to add to the command line.'
@@ -388,7 +394,7 @@ class Hoe
388
394
  end
389
395
  end
390
396
 
391
- desc 'Run the test suite using multiruby'
397
+ desc 'Run the test suite using multiruby.'
392
398
  task :multi do
393
399
  run_tests :multi
394
400
  end
@@ -507,34 +513,11 @@ class Hoe
507
513
  pkg.need_zip = @need_zip
508
514
  end
509
515
 
510
- desc 'Install the package. Uses PREFIX and RUBYLIB'
511
- task :install do
512
- [
513
- [lib_files + test_files, RUBYLIB, 0444],
514
- [bin_files, File.join(PREFIX, 'bin'), 0555]
515
- ].each do |files, dest, mode|
516
- FileUtils.mkdir_p dest unless test ?d, dest
517
- files.each do |file|
518
- install file, dest, :mode => mode
519
- end
520
- end
521
- end
522
-
523
- desc 'Install the package as a gem'
516
+ desc 'Install the package as a gem.'
524
517
  task :install_gem => [:clean, :package] do
525
518
  sh "#{'sudo ' unless WINDOZE}gem install --local pkg/*.gem"
526
519
  end
527
520
 
528
- desc 'Uninstall the package.'
529
- task :uninstall do
530
- Dir.chdir RUBYLIB do
531
- rm_f((lib_files + test_files).map { |f| File.basename f })
532
- end
533
- Dir.chdir File.join(PREFIX, 'bin') do
534
- rm_f bin_files.map { |f| File.basename f }
535
- end
536
- end
537
-
538
521
  desc 'Package and upload the release to rubyforge.'
539
522
  task :release => [:clean, :package] do |t|
540
523
  v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
@@ -575,17 +558,17 @@ class Hoe
575
558
  rd.rdoc_files.push(*files)
576
559
 
577
560
  title = "#{name}-#{version} Documentation"
578
- title = "#{rubyforge_name}'s " + title if rubyforge_name != title
561
+ title = "#{rubyforge_name}'s " + title if rubyforge_name != name
579
562
 
580
563
  rd.options << "-t #{title}"
581
564
  end
582
565
 
583
- desc "Generate ri locally for testing"
566
+ desc 'Generate ri locally for testing.'
584
567
  task :ridocs => :clean do
585
568
  sh %q{ rdoc --ri -o ri . }
586
569
  end
587
570
 
588
- desc "Publish RDoc to RubyForge"
571
+ desc 'Publish RDoc to RubyForge.'
589
572
  task :publish_docs => [:clean, :docs] do
590
573
  config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
591
574
  host = "#{config["username"]}@rubyforge.org"
@@ -606,13 +589,13 @@ class Hoe
606
589
  ############################################################
607
590
  # Misc/Maintenance:
608
591
 
609
- desc 'Run ZenTest against the package'
592
+ desc 'Run ZenTest against the package.'
610
593
  task :audit do
611
594
  libs = %w(lib test ext).join(File::PATH_SEPARATOR)
612
595
  sh "zentest -I=#{libs} #{spec.files.grep(/^(lib|test)/).join(' ')}"
613
596
  end
614
597
 
615
- desc 'Clean up all the extras'
598
+ desc 'Clean up all the extras.'
616
599
  task :clean => [ :clobber_docs, :clobber_package ] do
617
600
  clean_globs.each do |pattern|
618
601
  files = Dir[pattern]
@@ -620,7 +603,7 @@ class Hoe
620
603
  end
621
604
  end
622
605
 
623
- desc 'Create a fresh ~/.hoerc file'
606
+ desc 'Create a fresh ~/.hoerc file.'
624
607
  task :config_hoe do
625
608
  with_config do |config, path|
626
609
  default_config = {
@@ -701,10 +684,10 @@ class Hoe
701
684
  puts "Posted to rubyforge"
702
685
  end
703
686
 
704
- desc 'Generate email announcement file and post to rubyforge.'
687
+ desc 'Create news email file and post to rubyforge.'
705
688
  task :announce => [:email, :post_news, :post_blog, :publish_on_announce ]
706
689
 
707
- desc "Verify the manifest"
690
+ desc 'Verify the manifest.'
708
691
  task :check_manifest => :clean do
709
692
  f = "Manifest.tmp"
710
693
  require 'find'
@@ -791,7 +774,7 @@ class Hoe
791
774
  cmd = if test ?f, 'test/test_all.rb' then
792
775
  "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
793
776
  else
794
- tests = test_globs.map { |g| Dir.glob(g) }.flatten << 'test/unit'
777
+ tests = ['test/unit'] + test_globs.map { |g| Dir.glob(g) }.flatten
795
778
  tests.map! {|f| %Q(require "#{f}")}
796
779
  "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
797
780
  end
@@ -25,7 +25,6 @@ class TestHoe < Test::Unit::TestCase
25
25
  docs
26
26
  email
27
27
  generate_key
28
- install
29
28
  install_gem
30
29
  multi
31
30
  package
@@ -35,8 +34,7 @@ class TestHoe < Test::Unit::TestCase
35
34
  release
36
35
  ridocs
37
36
  test
38
- test_deps
39
- uninstall)
37
+ test_deps)
40
38
  expected += boring
41
39
 
42
40
  spec = Hoe.new('blah', '1.0.0') do |h|
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.5.0
4
+ version: 1.5.1
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: 2008-01-31 00:00:00 -08:00
12
+ date: 2008-03-04 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  - !ruby/object:Gem::Version
31
31
  version: 0.8.1
32
32
  version:
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"
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 - Create news email 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 hoe-1.5.0.gem * generate_key - Generate a key for signing your gems. * 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. * test_deps - Show which test files fail when run alone. See class rdoc for help. Hint: ri Hoe"
34
34
  email:
35
35
  - ryand-ruby@zenspider.com
36
36
  executables: