hoe 1.0.2 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +17 -0
- data/README.txt +32 -39
- data/lib/hoe.rb +113 -13
- data/test/test_hoe.rb +6 -2
- metadata +11 -2
data/History.txt
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
= 1.0.4 2006-09-23
|
2
|
+
|
3
|
+
* Damnit... I messed up. There is no rubygems gem to be dependent upon. Duh.
|
4
|
+
|
5
|
+
= 1.0.3 2006-09-23
|
6
|
+
|
7
|
+
* Added debug_gem rule.
|
8
|
+
* Added lots of doco.
|
9
|
+
* Added proper deps to hoe for other's gems, and rake/rubyforge/rubygems for hoe.
|
10
|
+
* Added ridocs to generate ri locally for testing.
|
11
|
+
* Added support for multiple authors.
|
12
|
+
* Fixed include paths.
|
13
|
+
* Rdoc now includes any top level .txt files.
|
14
|
+
* Renamed deploy to release.
|
15
|
+
* Renamed upload to publish_docs.
|
16
|
+
* publish_docs is now smart about subprojects and missing subdirectories.
|
17
|
+
|
1
18
|
= 1.0.2 2006-09-20
|
2
19
|
|
3
20
|
* Wee little tests.
|
data/README.txt
CHANGED
@@ -1,47 +1,39 @@
|
|
1
1
|
Hoe
|
2
2
|
http://rubyforge.org/projects/seattlerb/
|
3
|
+
http://seattlerb.rubyforge.org/hoe/
|
3
4
|
ryand-ruby@zenspider.com
|
4
5
|
|
5
|
-
|
6
|
+
== DESCRIPTION:
|
6
7
|
|
7
8
|
Hoe is a simple rake/rubygems helper for project Rakefiles. It
|
8
9
|
generates all the usual tasks for projects including rdoc generation,
|
9
10
|
testing, packaging, and deployment.
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
rake multi # Run the test suite using multiruby
|
31
|
-
rake package # Build all the packages
|
32
|
-
rake redocs # Force a rebuild of the RDOC files
|
33
|
-
rake repackage # Force a rebuild of the package files
|
34
|
-
rake test # Run the test suite. Use FILTER to add to the command line.
|
35
|
-
rake uninstall # Uninstall the package.
|
36
|
-
rake upload # Upload RDoc to RubyForge
|
37
|
-
|
38
|
-
** FEATURES/PROBLEMS:
|
12
|
+
Tasks Provided:
|
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
|
27
|
+
|
28
|
+
See class rdoc for help. Hint: ri Hoe
|
29
|
+
|
30
|
+
== FEATURES/PROBLEMS:
|
39
31
|
|
40
|
-
|
41
|
-
|
42
|
-
|
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.
|
43
35
|
|
44
|
-
|
36
|
+
== SYNOPSYS:
|
45
37
|
|
46
38
|
require './lib/hoe.rb'
|
47
39
|
|
@@ -51,16 +43,17 @@ generates:
|
|
51
43
|
|
52
44
|
# ... project specific tasks ...
|
53
45
|
|
54
|
-
|
46
|
+
== REQUIREMENTS:
|
55
47
|
|
56
|
-
|
57
|
-
|
48
|
+
* rake
|
49
|
+
* rubyforge
|
50
|
+
* rubygems
|
58
51
|
|
59
|
-
|
52
|
+
== INSTALL:
|
60
53
|
|
61
|
-
|
54
|
+
* sudo gem install hoe
|
62
55
|
|
63
|
-
|
56
|
+
== LICENSE:
|
64
57
|
|
65
58
|
(The MIT License)
|
66
59
|
|
data/lib/hoe.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
|
-
|
3
|
+
require 'rubygems'
|
4
4
|
require 'rake'
|
5
5
|
require 'rake/contrib/sshpublisher'
|
6
6
|
require 'rake/gempackagetask'
|
@@ -8,8 +8,73 @@ require 'rake/rdoctask'
|
|
8
8
|
require 'rake/testtask'
|
9
9
|
require 'rbconfig'
|
10
10
|
|
11
|
+
##
|
12
|
+
# hoe - a tool to help rake
|
13
|
+
#
|
14
|
+
# Hoe is a simple rake/rubygems helper for project Rakefiles. It
|
15
|
+
# generates all the usual tasks for projects including rdoc generation,
|
16
|
+
# testing, packaging, and deployment.
|
17
|
+
#
|
18
|
+
# == Using Hoe
|
19
|
+
#
|
20
|
+
# === Basics
|
21
|
+
#
|
22
|
+
# Use this as a minimal starting point:
|
23
|
+
#
|
24
|
+
# require 'hoe'
|
25
|
+
#
|
26
|
+
# Hoe.new("project_name", '1.0.0') do |p|
|
27
|
+
# p.rubyforge_name = "rf_project"
|
28
|
+
# # add other details here
|
29
|
+
# end
|
30
|
+
#
|
31
|
+
# # add other tasks here
|
32
|
+
#
|
33
|
+
# === Tasks Provided:
|
34
|
+
#
|
35
|
+
# * audit - Run ZenTest against the package
|
36
|
+
# * clean - Clean up all the extras
|
37
|
+
# * debug_gem - Show information about the gem
|
38
|
+
# * default - Run the default tasks
|
39
|
+
# * docs - Build the docs HTML Files
|
40
|
+
# * install - Install the package. Uses PREFIX and RUBYLIB
|
41
|
+
# * multi - Run the test suite using multiruby
|
42
|
+
# * package - Build all the packages
|
43
|
+
# * publish_docs - Publish RDoc to RubyForge
|
44
|
+
# * release - Package and upload the release to RubyForge
|
45
|
+
# * test - Run the test suite. Use FILTER to add to the command line.
|
46
|
+
# * uninstall - Uninstall the package.
|
47
|
+
# * upload - Upload RDoc to RubyForge
|
48
|
+
#
|
49
|
+
# === Attributes
|
50
|
+
#
|
51
|
+
# The attributes that you can provide inside the new block above are:
|
52
|
+
#
|
53
|
+
# ==== Mandatory (or damn good to set)
|
54
|
+
#
|
55
|
+
# * author - The author of the package. (can be array of authors)
|
56
|
+
# * description - A description of the project.
|
57
|
+
# * email - The author's email address.
|
58
|
+
# * name - The name of the release.
|
59
|
+
# * summary - A short summary of the project.
|
60
|
+
# * url - The url of the project.
|
61
|
+
# * version - The version. Don't hardcode! use a constant in the project.
|
62
|
+
#
|
63
|
+
# ==== Optional
|
64
|
+
#
|
65
|
+
# * clean_globs - An array of file patterns to delete on clean.
|
66
|
+
# * extra_deps - An array of rubygem dependencies.
|
67
|
+
# * rubyforge_name - The name of the rubyforge project. [default: name.downcase]
|
68
|
+
#
|
69
|
+
# === Environment Variables
|
70
|
+
#
|
71
|
+
# * PREFIX - Used to specify a custom install location (for rake install).
|
72
|
+
# * RUBY_FLAGS - Used to specify flags to ruby [has smart default].
|
73
|
+
# * RUBY_DEBUG - Used to add extra flags to RUBY_FLAGS.
|
74
|
+
# * FILTER - Used to add flags to test_unit (e.g., -n test_borked)
|
75
|
+
|
11
76
|
class Hoe
|
12
|
-
VERSION = '1.0.
|
77
|
+
VERSION = '1.0.4'
|
13
78
|
|
14
79
|
rubyprefix = Config::CONFIG['prefix']
|
15
80
|
sitelibdir = Config::CONFIG['sitelibdir']
|
@@ -22,7 +87,7 @@ class Hoe
|
|
22
87
|
end
|
23
88
|
RUBY_DEBUG = ENV['RUBY_DEBUG']
|
24
89
|
RUBY_FLAGS = ENV['RUBY_FLAGS'] ||
|
25
|
-
"-w -I#{%w(lib bin
|
90
|
+
"-w -I#{%w(lib bin test).join(File::PATH_SEPARATOR)}" +
|
26
91
|
(RUBY_DEBUG ? " #{RUBY_DEBUG}" : '')
|
27
92
|
FILTER = ENV['FILTER'] # for tests (eg FILTER="-n test_blah")
|
28
93
|
|
@@ -37,10 +102,17 @@ class Hoe
|
|
37
102
|
self.url = "http://www.zenspider.com/ZSS/Products/#{name}/"
|
38
103
|
self.author = "Ryan Davis"
|
39
104
|
self.email = "ryand-ruby@zenspider.com"
|
40
|
-
self.clean_globs = %w(diff diff.txt demo.rb *.gem **/*~)
|
105
|
+
self.clean_globs = %w(diff diff.txt demo.rb ri *.gem **/*~)
|
41
106
|
self.description = "#{author} is too lazy to write a description"
|
42
107
|
self.summary = "#{author} is too lazy to write a summary"
|
43
|
-
self.extra_deps = [
|
108
|
+
self.extra_deps = []
|
109
|
+
|
110
|
+
if name == 'hoe' then
|
111
|
+
extra_deps << ['rake']
|
112
|
+
extra_deps << ['rubyforge']
|
113
|
+
else
|
114
|
+
extra_deps << ['hoe']
|
115
|
+
end
|
44
116
|
|
45
117
|
yield self if block_given?
|
46
118
|
|
@@ -68,7 +140,12 @@ class Hoe
|
|
68
140
|
s.name = name
|
69
141
|
s.version = version
|
70
142
|
s.summary = summary
|
71
|
-
|
143
|
+
case author
|
144
|
+
when Array
|
145
|
+
s.authors = author
|
146
|
+
else
|
147
|
+
s.author = author
|
148
|
+
end
|
72
149
|
s.email = email
|
73
150
|
s.homepage = url
|
74
151
|
s.rubyforge_project = rubyforge_name
|
@@ -86,8 +163,11 @@ class Hoe
|
|
86
163
|
s.require_paths = Dir['{lib,test}']
|
87
164
|
s.has_rdoc = true
|
88
165
|
s.test_suite_file = "test/test_all.rb" if test ?f, "test/test_all.rb"
|
166
|
+
end
|
89
167
|
|
90
|
-
|
168
|
+
desc 'Show information about the gem.'
|
169
|
+
task :debug_gem do
|
170
|
+
puts spec.to_ruby
|
91
171
|
end
|
92
172
|
|
93
173
|
self.lib_files = spec.files.grep(/^lib/)
|
@@ -121,8 +201,8 @@ class Hoe
|
|
121
201
|
end
|
122
202
|
end
|
123
203
|
|
124
|
-
desc '
|
125
|
-
task :
|
204
|
+
desc 'Package and upload the release to rubyforge.'
|
205
|
+
task :release => [:clean, :package] do |t|
|
126
206
|
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
127
207
|
abort "Versions don't match #{v} vs #{version}" if v != version
|
128
208
|
require 'rubyforge'
|
@@ -154,16 +234,32 @@ class Hoe
|
|
154
234
|
rd.main = "README.txt"
|
155
235
|
rd.options << '-d' if `which dot` =~ /\/dot/ and RUBY_PLATFORM !~ /win32/
|
156
236
|
rd.rdoc_dir = 'doc'
|
157
|
-
rd.rdoc_files.push(*spec.files.grep(/^(lib|bin|
|
237
|
+
rd.rdoc_files.push(*spec.files.grep(/^(lib|bin)|txt$/))
|
158
238
|
end
|
159
239
|
|
160
|
-
desc
|
161
|
-
task :
|
240
|
+
desc "Generate ri locally for testing"
|
241
|
+
task :ridocs => :clean do
|
242
|
+
sh %q{ rdoc --ri -o ri . }
|
243
|
+
end
|
244
|
+
|
245
|
+
desc 'Publish RDoc to RubyForge'
|
246
|
+
task :publish_docs => [:clean, :docs] do
|
162
247
|
config = YAML.load(File.read(File.expand_path("~/.rubyforge/config.yml")))
|
163
|
-
user = "#{config["username"]}rubyforge.org"
|
248
|
+
user = "#{config["username"]}@rubyforge.org"
|
164
249
|
project = "/var/www/gforge-projects/#{rubyforge_name}"
|
250
|
+
project += "/#{name}" if rubyforge_name != name
|
165
251
|
local_dir = 'doc'
|
166
252
|
pub = Rake::SshDirPublisher.new user, project, local_dir
|
253
|
+
if rubyforge_name != name then
|
254
|
+
def pub.upload
|
255
|
+
begin
|
256
|
+
super
|
257
|
+
rescue
|
258
|
+
# project directory probably doesn't exist, transfer as a whole
|
259
|
+
sh %{scp -qr #{local_dir} #{host}:#{remote_dir}}
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
167
263
|
pub.upload
|
168
264
|
end
|
169
265
|
|
@@ -199,3 +295,7 @@ class Hoe
|
|
199
295
|
send msg, cmd
|
200
296
|
end
|
201
297
|
end
|
298
|
+
|
299
|
+
class ::Rake::SshDirPublisher # :nodoc:
|
300
|
+
attr_reader :host, :remote_dir, :local_dir
|
301
|
+
end
|
data/test/test_hoe.rb
CHANGED
@@ -10,9 +10,13 @@ class TestHoe < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_basics
|
13
|
+
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)
|
14
|
+
expected = %w(audit clean debug_gem default docs gem install multi package publish_docs release ridocs test uninstall)
|
15
|
+
expected += boring
|
16
|
+
|
13
17
|
Hoe.new('blah', '1.0.0')
|
14
18
|
tasks = Rake.application.tasks.map { |t| t.name }.sort
|
15
|
-
|
16
|
-
assert_equal expected, tasks
|
19
|
+
|
20
|
+
assert_equal expected.sort, tasks
|
17
21
|
end
|
18
22
|
end
|
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.
|
7
|
-
date: 2006-09-
|
6
|
+
version: 1.0.4
|
7
|
+
date: 2006-09-23 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
|
@@ -58,3 +58,12 @@ dependencies:
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: 0.0.0
|
60
60
|
version:
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rubyforge
|
63
|
+
version_requirement:
|
64
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.0.0
|
69
|
+
version:
|