hoe 1.1.7 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. data/History.txt +7 -0
  2. data/README.txt +2 -0
  3. data/lib/hoe.rb +77 -4
  4. data/test/test_hoe.rb +25 -4
  5. metadata +3 -3
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ = 1.2.0 2007-02-13
2
+
3
+ * Added more support for ext dirs.
4
+ * Added a simple config file (yaml). Use 'rake config_hoe' to edit.
5
+ * Added post_blog task (thanks Aaron!), configured via config_hoe.
6
+ * Announce task now posts to your blogs and/or publishes API depending on config.
7
+
1
8
  = 1.1.7 2007-01-10
2
9
 
3
10
  * extra_deps is now self-healing, and ensures no (direct) cycles.
data/README.txt CHANGED
@@ -15,6 +15,7 @@ Tasks Provided:
15
15
  * audit - Run ZenTest against the package
16
16
  * check_manifest - Verify the manifest
17
17
  * clean - Clean up all the extras
18
+ * config_hoe - Create a fresh ~/.hoerc file
18
19
  * debug_gem - Show information about the gem.
19
20
  * default - Run the default tasks
20
21
  * docs - Build the docs HTML Files
@@ -23,6 +24,7 @@ Tasks Provided:
23
24
  * install_gem - Install the package as a gem
24
25
  * multi - Run the test suite using multiruby
25
26
  * package - Build all the packages
27
+ * post_blog - Post announcement to blog.
26
28
  * post_news - Post announcement to rubyforge.
27
29
  * publish_docs - Publish RDoc to RubyForge
28
30
  * release - Package and upload the release to rubyforge.
data/lib/hoe.rb CHANGED
@@ -37,6 +37,7 @@ require 'rubyforge'
37
37
  # * audit - Run ZenTest against the package
38
38
  # * check_manifest - Verify the manifest
39
39
  # * clean - Clean up all the extras
40
+ # * config_hoe - Create a fresh ~/.hoerc file
40
41
  # * debug_gem - Show information about the gem.
41
42
  # * default - Run the default tasks
42
43
  # * docs - Build the docs HTML Files
@@ -45,6 +46,7 @@ require 'rubyforge'
45
46
  # * install_gem - Install the package as a gem
46
47
  # * multi - Run the test suite using multiruby
47
48
  # * package - Build all the packages
49
+ # * post_blog - Post announcement to blog.
48
50
  # * post_news - Post announcement to rubyforge.
49
51
  # * publish_docs - Publish RDoc to RubyForge
50
52
  # * release - Package and upload the release to rubyforge.
@@ -90,7 +92,7 @@ require 'rubyforge'
90
92
  # * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
91
93
 
92
94
  class Hoe
93
- VERSION = '1.1.7'
95
+ VERSION = '1.2.0'
94
96
 
95
97
  rubyprefix = Config::CONFIG['prefix']
96
98
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -228,7 +230,7 @@ class Hoe
228
230
  puts spec.to_ruby
229
231
  end
230
232
 
231
- self.lib_files = spec.files.grep(/^lib/)
233
+ self.lib_files = spec.files.grep(/^(lib|ext)/)
232
234
  self.bin_files = spec.files.grep(/^bin/)
233
235
  self.test_files = spec.files.grep(/^test/)
234
236
 
@@ -324,12 +326,37 @@ class Hoe
324
326
  sh %{rsync -av --delete #{local_dir}/ #{host}:#{remote_dir}}
325
327
  end
326
328
 
329
+ # no doco for this one
330
+ task :publish_on_announce do
331
+ with_config do |rc, path|
332
+ if rc["publish_on_announce"] then
333
+ Rake::Task['publish_docs'].invoke
334
+ end
335
+ end
336
+ end
337
+
327
338
  ############################################################
328
339
  # Misc/Maintenance:
329
340
 
341
+ def with_config(create=false)
342
+ require 'yaml'
343
+ rc = File.expand_path("~/.hoerc")
344
+
345
+ unless create then
346
+ if test ?f, rc then
347
+ config = YAML.load_file(rc)
348
+ yield(config, rc)
349
+ end
350
+ else
351
+ unless test ?f, rc then
352
+ yield(rc)
353
+ end
354
+ end
355
+ end
356
+
330
357
  desc 'Run ZenTest against the package'
331
358
  task :audit do
332
- libs = %w(lib test).join(File::PATH_SEPARATOR)
359
+ libs = %w(lib test ext).join(File::PATH_SEPARATOR)
333
360
  sh "zentest -I=#{libs} #{spec.files.grep(/^(lib|test)/).join(' ')}"
334
361
  end
335
362
 
@@ -341,6 +368,32 @@ class Hoe
341
368
  end
342
369
  end
343
370
 
371
+ desc 'Create a fresh ~/.hoerc file'
372
+ task :config_hoe do
373
+ with_config(:create) do |rc, path|
374
+ blog = {
375
+ "publish_on_announce" => false,
376
+ "blogs" => [ {
377
+ "user" => "user",
378
+ "url" => "url",
379
+ "extra_headers" => {
380
+ "mt_convert_breaks" => "markdown"
381
+ },
382
+ "blog_id" => "blog_id",
383
+ "password"=>"password",
384
+ } ],
385
+ }
386
+ File.open(rc, "w") do |f|
387
+ YAML.dump(blog, f)
388
+ end
389
+ end
390
+
391
+ with_config do |rc, path|
392
+ editor = ENV['EDITOR'] || 'vi'
393
+ system "#{editor} #{path}"
394
+ end
395
+ end
396
+
344
397
  desc 'Generate email announcement file.'
345
398
  task :email do
346
399
  require 'rubyforge'
@@ -360,6 +413,26 @@ class Hoe
360
413
  puts "Created email.txt"
361
414
  end
362
415
 
416
+ desc 'Post announcement to blog.'
417
+ task :post_blog do
418
+ require 'xmlrpc/client'
419
+
420
+ with_config do |config, path|
421
+ subject, title, body, urls = announcement
422
+ config['blogs'].each do |site|
423
+ server = XMLRPC::Client.new2(site['url'])
424
+ content = site['extra_headers'].merge(:title => title,
425
+ :description => body)
426
+ result = server.call('metaWeblog.newPost',
427
+ site['blog_id'],
428
+ site['user'],
429
+ site['password'],
430
+ content,
431
+ true)
432
+ end
433
+ end
434
+ end
435
+
363
436
  desc 'Post announcement to rubyforge.'
364
437
  task :post_news do
365
438
  require 'rubyforge'
@@ -372,7 +445,7 @@ class Hoe
372
445
  end
373
446
 
374
447
  desc 'Generate email announcement file and post to rubyforge.'
375
- task :announce => [:email, :post_news]
448
+ task :announce => [:email, :post_news, :post_blog, :publish_on_announce ]
376
449
 
377
450
  desc "Verify the manifest"
378
451
  task :check_manifest => :clean do
data/test/test_hoe.rb CHANGED
@@ -14,13 +14,34 @@ class TestHoe < Test::Unit::TestCase
14
14
  # everything is forked out.
15
15
 
16
16
  def test_basics
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 test_deps uninstall)
17
+ boring = %w(clobber_docs clobber_package redocs repackage)
18
+ expected = %w(audit
19
+ announce
20
+ check_manifest
21
+ clean
22
+ config_hoe
23
+ debug_gem
24
+ default
25
+ docs
26
+ email
27
+ install
28
+ install_gem
29
+ multi
30
+ package
31
+ post_blog
32
+ post_news
33
+ publish_docs
34
+ release
35
+ ridocs
36
+ test
37
+ test_deps
38
+ uninstall)
19
39
  expected += boring
20
40
 
21
41
  Hoe.new('blah', '1.0.0')
22
- tasks = Rake.application.tasks.map { |t| t.name }.sort
42
+ tasks = Rake.application.tasks
43
+ public_tasks = tasks.reject { |t| t.comment.nil? }.map { |t| t.name }.sort
23
44
 
24
- assert_equal expected.sort, tasks
45
+ assert_equal expected.sort, public_tasks
25
46
  end
26
47
  end
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.0.9
3
3
  specification_version: 1
4
4
  name: hoe
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.7
7
- date: 2007-01-10 00:00:00 -05:00
6
+ version: 1.2.0
7
+ date: 2007-02-13 00:00:00 -08:00
8
8
  summary: Hoe is a way to write Rakefiles much easier and cleaner.
9
9
  require_paths:
10
10
  - lib
11
11
  email: ryand-ruby@zenspider.com
12
12
  homepage: " http://rubyforge.org/projects/seattlerb/"
13
13
  rubyforge_project: seattlerb
14
- 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"
14
+ 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. * 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"
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin