hoe 2.9.6 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/History.txt +12 -0
- data/README.txt +5 -5
- data/lib/hoe.rb +49 -3
- data/lib/hoe/racc.rb +1 -1
- data/test/test_hoe.rb +56 -16
- metadata +8 -8
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 2.10.0 / 2011-06-30
|
2
|
+
|
3
|
+
* 3 minor enhancements:
|
4
|
+
|
5
|
+
* Added parse_urls to deal with array and hash style url lists in README.txt.
|
6
|
+
* Added urls accessor.
|
7
|
+
* Deprecated url accessors.
|
8
|
+
|
9
|
+
* 1 bug fix:
|
10
|
+
|
11
|
+
* Specified wrong version of racc in racc plugin.
|
12
|
+
|
1
13
|
=== 2.9.6 / 2011-06-22
|
2
14
|
|
3
15
|
* 3 bug fixes:
|
data/README.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= Hoe
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
home :: https://github.com/seattlerb/hoe
|
4
|
+
rdoc :: http://seattlerb.rubyforge.org/hoe/
|
5
|
+
doco :: http://seattlerb.rubyforge.org/hoe/Hoe.pdf
|
6
|
+
other :: http://github.com/jbarnette/hoe-plugin-examples
|
7
7
|
|
8
8
|
== DESCRIPTION:
|
9
9
|
|
@@ -284,7 +284,7 @@ We use the bug trackers hosted at: http://rubyforge.org/projects/seattlerb
|
|
284
284
|
|
285
285
|
(The MIT License)
|
286
286
|
|
287
|
-
Copyright (c) Ryan Davis,
|
287
|
+
Copyright (c) Ryan Davis, seattle.rb
|
288
288
|
|
289
289
|
Permission is hereby granted, free of charge, to any person obtaining
|
290
290
|
a copy of this software and associated documentation files (the
|
data/lib/hoe.rb
CHANGED
@@ -67,7 +67,7 @@ class Hoe
|
|
67
67
|
include Rake::DSL if defined?(Rake::DSL)
|
68
68
|
|
69
69
|
# duh
|
70
|
-
VERSION = '2.
|
70
|
+
VERSION = '2.10.0'
|
71
71
|
|
72
72
|
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
|
73
73
|
:publish, :rcov, :gemcutter, :signing, :test]
|
@@ -211,12 +211,22 @@ class Hoe
|
|
211
211
|
attr_accessor :test_globs
|
212
212
|
|
213
213
|
##
|
214
|
-
# Optional: The url(s) of the project. (can be array).
|
214
|
+
# Deprecated: Optional: The url(s) of the project. (can be array).
|
215
215
|
# Auto-populates to a list of urls read from the beginning of
|
216
216
|
# README.txt.
|
217
|
+
#
|
217
218
|
|
218
219
|
attr_accessor :url
|
219
220
|
|
221
|
+
##
|
222
|
+
# Optional: The urls of the project. This can be an array or
|
223
|
+
# (preferably) a hash. Auto-populates to the urls read from the
|
224
|
+
# beginning of README.txt.
|
225
|
+
#
|
226
|
+
# See parse_urls for more details
|
227
|
+
|
228
|
+
attr_accessor :urls
|
229
|
+
|
220
230
|
##
|
221
231
|
# *MANDATORY*: The version. Don't hardcode! use a constant in the project.
|
222
232
|
|
@@ -532,10 +542,19 @@ class Hoe
|
|
532
542
|
}]
|
533
543
|
desc = sections.values_at(*description_sections).join("\n\n")
|
534
544
|
summ = desc.split(/\.\s+/).first(summary_sentences).join(". ")
|
545
|
+
urls = parse_urls(readme[1])
|
535
546
|
|
547
|
+
self.urls ||= urls
|
536
548
|
self.description ||= desc
|
537
549
|
self.summary ||= summ
|
538
|
-
self.url ||=
|
550
|
+
self.url ||= case urls
|
551
|
+
when Hash then
|
552
|
+
urls["home"] || urls["repo"] || urls.values.first
|
553
|
+
when Array then
|
554
|
+
urls
|
555
|
+
else
|
556
|
+
raise "unknown urls format: #{urls.inspect}"
|
557
|
+
end
|
539
558
|
else
|
540
559
|
missing readme_file
|
541
560
|
end
|
@@ -549,6 +568,33 @@ class Hoe
|
|
549
568
|
end
|
550
569
|
end
|
551
570
|
|
571
|
+
##
|
572
|
+
# Parse the urls section of the readme file. Returns a hash or an
|
573
|
+
# array depending on the format of the section.
|
574
|
+
#
|
575
|
+
# label1 :: url1
|
576
|
+
# label2 :: url2
|
577
|
+
# label3 :: url3
|
578
|
+
#
|
579
|
+
# vs:
|
580
|
+
#
|
581
|
+
# * url1
|
582
|
+
# * url2
|
583
|
+
# * url3
|
584
|
+
#
|
585
|
+
# The hash format is preferred as it will be used to populate gem
|
586
|
+
# metadata. The array format will work, but will warn that you
|
587
|
+
# should update the readme.
|
588
|
+
|
589
|
+
def parse_urls text
|
590
|
+
lines = text.gsub(/^\* /, '').split(/\n/).grep(/\S+/)
|
591
|
+
if lines.first =~ /::/ then
|
592
|
+
Hash[lines.map { |line| line.split(/\s*::\s*/) }]
|
593
|
+
else
|
594
|
+
lines
|
595
|
+
end
|
596
|
+
end
|
597
|
+
|
552
598
|
##
|
553
599
|
# Load activated plugins by calling their define tasks method.
|
554
600
|
|
data/lib/hoe/racc.rb
CHANGED
data/test/test_hoe.rb
CHANGED
@@ -11,6 +11,12 @@ end
|
|
11
11
|
$rakefile = nil # shuts up a warning in rdoctask.rb
|
12
12
|
|
13
13
|
class TestHoe < MiniTest::Unit::TestCase
|
14
|
+
def hoe
|
15
|
+
@hoe ||= Hoe.spec("blah") do
|
16
|
+
developer 'author', 'email'
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
14
20
|
def setup
|
15
21
|
Rake.application.clear
|
16
22
|
end
|
@@ -24,10 +30,6 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
24
30
|
end
|
25
31
|
|
26
32
|
def test_activate_plugins
|
27
|
-
hoe = Hoe.spec 'blah' do
|
28
|
-
developer 'author', 'email'
|
29
|
-
end
|
30
|
-
|
31
33
|
initializers = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
|
32
34
|
|
33
35
|
assert_includes initializers, 'initialize_clean'
|
@@ -56,11 +58,7 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
56
58
|
io.write YAML.dump('plugins' => %w[hoerc])
|
57
59
|
end
|
58
60
|
|
59
|
-
|
60
|
-
developer 'author', 'email'
|
61
|
-
end
|
62
|
-
|
63
|
-
methods = spec.methods.grep(/^initialize/).map { |s| s.to_s }
|
61
|
+
methods = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
|
64
62
|
|
65
63
|
assert_includes methods, 'initialize_hoerc'
|
66
64
|
end
|
@@ -90,12 +88,9 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
90
88
|
io.write YAML.dump('plugins' => %w[hoerc])
|
91
89
|
end
|
92
90
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
assert_includes spec.instance_variables.map(&:to_s), '@hoerc_plugin_initialized',
|
98
|
-
"Hoerc plugin wasn't initialized"
|
91
|
+
methods = hoe.instance_variables.map(&:to_s)
|
92
|
+
assert_includes(methods, '@hoerc_plugin_initialized',
|
93
|
+
"Hoerc plugin wasn't initialized")
|
99
94
|
end
|
100
95
|
ensure
|
101
96
|
Hoe.instance_variable_get(:@loaded).delete :hoerc
|
@@ -113,6 +108,38 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
113
108
|
end
|
114
109
|
end
|
115
110
|
|
111
|
+
def test_parse_urls_ary
|
112
|
+
ary = ["* https://github.com/seattlerb/hoe",
|
113
|
+
"* http://seattlerb.rubyforge.org/hoe/",
|
114
|
+
"* http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
|
115
|
+
"* http://github.com/jbarnette/hoe-plugin-examples"].join "\n"
|
116
|
+
|
117
|
+
exp = ["https://github.com/seattlerb/hoe",
|
118
|
+
"http://seattlerb.rubyforge.org/hoe/",
|
119
|
+
"http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
|
120
|
+
"http://github.com/jbarnette/hoe-plugin-examples"]
|
121
|
+
|
122
|
+
assert_equal exp, hoe.parse_urls(ary)
|
123
|
+
end
|
124
|
+
|
125
|
+
def test_parse_urls_hash
|
126
|
+
hash = [
|
127
|
+
"home :: https://github.com/seattlerb/hoe",
|
128
|
+
"rdoc :: http://seattlerb.rubyforge.org/hoe/",
|
129
|
+
"doco :: http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
|
130
|
+
"other :: http://github.com/jbarnette/hoe-plugin-examples",
|
131
|
+
].join "\n"
|
132
|
+
|
133
|
+
exp = {
|
134
|
+
"home" => "https://github.com/seattlerb/hoe",
|
135
|
+
"rdoc" => "http://seattlerb.rubyforge.org/hoe/",
|
136
|
+
"doco" => "http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
|
137
|
+
"other" => "http://github.com/jbarnette/hoe-plugin-examples",
|
138
|
+
}
|
139
|
+
|
140
|
+
assert_equal exp, hoe.parse_urls(hash)
|
141
|
+
end
|
142
|
+
|
116
143
|
def test_possibly_better
|
117
144
|
t = Gem::Specification::TODAY
|
118
145
|
hoe = Hoe.spec("blah") do
|
@@ -124,6 +151,16 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
124
151
|
|
125
152
|
spec = hoe.spec
|
126
153
|
|
154
|
+
urls = {
|
155
|
+
"home" => "https://github.com/seattlerb/hoe",
|
156
|
+
"rdoc" => "http://seattlerb.rubyforge.org/hoe/",
|
157
|
+
"doco" => "http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
|
158
|
+
"other" => "http://github.com/jbarnette/hoe-plugin-examples",
|
159
|
+
}
|
160
|
+
|
161
|
+
assert_equal "https://github.com/seattlerb/hoe", hoe.url
|
162
|
+
assert_equal urls, hoe.urls
|
163
|
+
|
127
164
|
text_files = files.grep(/txt$/).reject { |f| f =~ /template/ }
|
128
165
|
|
129
166
|
assert_equal 'blah', spec.name
|
@@ -137,7 +174,8 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
137
174
|
assert_equal ['sow'], spec.executables
|
138
175
|
assert_equal text_files, spec.extra_rdoc_files
|
139
176
|
assert_equal files, spec.files
|
140
|
-
assert_equal "
|
177
|
+
assert_equal "https://github.com/seattlerb/hoe", spec.homepage
|
178
|
+
# TODO: assert_equal "https://github.com/seattlerb/hoe", spec.metadata
|
141
179
|
assert_equal ['--main', 'README.txt'], spec.rdoc_options
|
142
180
|
assert_equal ['lib'], spec.require_paths
|
143
181
|
assert_equal 'blah', spec.rubyforge_project
|
@@ -155,6 +193,8 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
155
193
|
assert_equal expected, deps.map { |dep|
|
156
194
|
[dep.name, dep.type, dep.requirement.to_s]
|
157
195
|
}
|
196
|
+
|
197
|
+
# flunk "not yet"
|
158
198
|
end
|
159
199
|
|
160
200
|
def test_plugins
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 10
|
9
|
+
- 0
|
10
|
+
version: 2.10.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Davis
|
@@ -36,7 +36,7 @@ cert_chain:
|
|
36
36
|
FBHgymkyj/AOSqKRIpXPhjC6
|
37
37
|
-----END CERTIFICATE-----
|
38
38
|
|
39
|
-
date: 2011-06-
|
39
|
+
date: 2011-06-30 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
@@ -61,12 +61,12 @@ dependencies:
|
|
61
61
|
requirements:
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
hash:
|
64
|
+
hash: 1
|
65
65
|
segments:
|
66
66
|
- 2
|
67
67
|
- 3
|
68
|
-
-
|
69
|
-
version: 2.3.
|
68
|
+
- 1
|
69
|
+
version: 2.3.1
|
70
70
|
type: :development
|
71
71
|
version_requirements: *id002
|
72
72
|
description: |-
|
@@ -129,7 +129,7 @@ files:
|
|
129
129
|
- test/test_hoe_gemcutter.rb
|
130
130
|
- test/test_hoe_test.rb
|
131
131
|
- .gemtest
|
132
|
-
homepage:
|
132
|
+
homepage: https://github.com/seattlerb/hoe
|
133
133
|
licenses: []
|
134
134
|
|
135
135
|
post_install_message:
|
metadata.gz.sig
CHANGED
Binary file
|