hoe 1.1.1 → 1.1.2

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 +13 -0
  2. data/bin/sow +20 -1
  3. data/lib/hoe.rb +14 -7
  4. data/test/test_hoe.rb +1 -1
  5. metadata +2 -2
@@ -1,3 +1,16 @@
1
+ = 1.1.2
2
+
3
+ * Added -d and -t flags to sow to make dev or trunk subdirs for p4 and svn projects.
4
+ * Added install_gem to further test gem builds.
5
+ * Added test_globs to customize your test file list.
6
+ * Removed demo.rb from clean_globs. I'm torn on this one.
7
+ * Fixed bug in install rule.
8
+
9
+ = 1.1.1 2006-10-11
10
+
11
+ * Fixed minor problem with subject of email.
12
+ * Fixed problem in test.
13
+
1
14
  = 1.1.0 2006-10-04
2
15
 
3
16
  * Added sow, a command-line tool for quickly creating new projects.
data/bin/sow CHANGED
@@ -1,4 +1,15 @@
1
- #!/usr/bin/env ruby -w
1
+ #!/usr/bin/env ruby -ws
2
+
3
+ $t ||= false
4
+ $d ||= false
5
+
6
+ if defined? $h then
7
+ puts "usage: #{File.dirname($0)} [-d|-t] [group] project"
8
+ puts " -t = add project to subdir under 'trunk'"
9
+ puts " -d = add project to subdir under 'dev'"
10
+ end
11
+
12
+ abort "You must specify only one of -t or -d" if $t and $d
2
13
 
3
14
  group = ARGV.shift
4
15
  project = ARGV.shift
@@ -25,6 +36,14 @@ end
25
36
  Dir.mkdir project
26
37
  Dir.chdir project do
27
38
 
39
+ if $d then
40
+ Dir.mkdir "dev"
41
+ Dir.chdir "dev"
42
+ elsif $t then
43
+ Dir.mkdir "trunk"
44
+ Dir.chdir "trunk"
45
+ end
46
+
28
47
  %w(bin lib test).each do |path|
29
48
  Dir.mkdir path
30
49
  end
data/lib/hoe.rb CHANGED
@@ -38,6 +38,7 @@ require 'rbconfig'
38
38
  # * default - Run the default tasks
39
39
  # * docs - Build the docs HTML Files
40
40
  # * install - Install the package. Uses PREFIX and RUBYLIB
41
+ # * install_gem - Install the package as a gem.
41
42
  # * multi - Run the test suite using multiruby
42
43
  # * package - Build all the packages
43
44
  # * publish_docs - Publish RDoc to RubyForge
@@ -67,6 +68,7 @@ require 'rbconfig'
67
68
  # ==== Optional
68
69
  #
69
70
  # * clean_globs - An array of file patterns to delete on clean.
71
+ # * test_globs - An array of test file patterns [default: test/**/test_*.rb]
70
72
  # * extra_deps - An array of rubygem dependencies.
71
73
  # * rubyforge_name - The name of the rubyforge project. [default: name.downcase]
72
74
  # * spec_extras - A hash of extra values to set in the gemspec.
@@ -79,7 +81,7 @@ require 'rbconfig'
79
81
  # * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
80
82
 
81
83
  class Hoe
82
- VERSION = '1.1.1'
84
+ VERSION = '1.1.2'
83
85
 
84
86
  rubyprefix = Config::CONFIG['prefix']
85
87
  sitelibdir = Config::CONFIG['sitelibdir']
@@ -96,7 +98,7 @@ class Hoe
96
98
  (RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
97
99
  FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
98
100
 
99
- attr_accessor :author, :bin_files, :changes, :clean_globs, :description, :email, :extra_deps, :lib_files, :name, :rubyforge_name, :spec, :spec_extras, :summary, :test_files, :url, :version
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
100
102
 
101
103
  def initialize(name, version)
102
104
  self.name = name
@@ -107,7 +109,8 @@ class Hoe
107
109
  self.url = "http://www.zenspider.com/ZSS/Products/#{name}/"
108
110
  self.author = "Ryan Davis"
109
111
  self.email = "ryand-ruby@zenspider.com"
110
- self.clean_globs = %w(diff diff.txt demo.rb email.txt ri *.gem **/*~)
112
+ self.clean_globs = %w(diff diff.txt email.txt ri *.gem **/*~)
113
+ self.test_globs = ['test/**/test_*.rb']
111
114
  self.changes = "#{author} is too lazy to write a changeset"
112
115
  self.description = "#{author} is too lazy to write a description"
113
116
  self.summary = "#{author} is too lazy to write a summary"
@@ -194,7 +197,7 @@ class Hoe
194
197
  task :install do
195
198
  [
196
199
  [lib_files + test_files, RUBYLIB, 0444],
197
- [bin_files, file.join(PREFIX, 'bin'), 0555]
200
+ [bin_files, File.join(PREFIX, 'bin'), 0555]
198
201
  ].each do |files, dest, mode|
199
202
  FileUtils.mkdir_p dest unless test ?d, dest
200
203
  files.each do |file|
@@ -203,6 +206,11 @@ class Hoe
203
206
  end
204
207
  end
205
208
 
209
+ desc 'Install the package as a gem'
210
+ task :install_gem => [:clean, :package] do
211
+ sh "sudo gem install pkg/*.gem"
212
+ end
213
+
206
214
  desc 'Uninstall the package.'
207
215
  task :uninstall do
208
216
  Dir.chdir RUBYLIB do
@@ -363,9 +371,8 @@ class Hoe
363
371
  cmd = if test ?f, 'test/test_all.rb' then
364
372
  "#{RUBY_FLAGS} test/test_all.rb #{FILTER}"
365
373
  else
366
- tests = ((Dir.glob("test/**/test_*.rb") + ['test/unit']).map { |f|
367
- "require \"#{f}\""
368
- })
374
+ tests = test_globs.map {|g| Dir.glob(g)}.flatten << 'test/unit'
375
+ tests.map! {|f| %Q(require "#{f}")}
369
376
  "#{RUBY_FLAGS} -e '#{tests.join("; ")}' #{FILTER}"
370
377
  end
371
378
  cmd = "multiruby #{cmd}" if multi
@@ -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 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 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.1
7
- date: 2006-10-11 00:00:00 -07:00
6
+ version: 1.1.2
7
+ date: 2006-10-22 00:00:00 -06:00
8
8
  summary: Hoe is a way to write Rakefiles much easier and cleaner.
9
9
  require_paths:
10
10
  - lib