hoe 2.13.1 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +4 -1
- data/History.txt +20 -0
- data/Rakefile +3 -0
- data/lib/hoe.rb +36 -9
- data/lib/hoe/deps.rb +3 -1
- data/lib/hoe/package.rb +9 -3
- data/lib/hoe/publish.rb +7 -1
- data/lib/hoe/test.rb +3 -11
- data/test/test_hoe.rb +103 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
=== 2.14.0 / 2012-02-20
|
2
|
+
|
3
|
+
* 9 minor enhancements:
|
4
|
+
|
5
|
+
* .rdoc files are now automatically added to the extra_rdoc_files list.
|
6
|
+
* Added Hoe#read_manifest
|
7
|
+
* Added check_manifest to the prerelease task to prevent broken releases.
|
8
|
+
* Added extra duplicate dependency checking.
|
9
|
+
* Hoe#with_config merges the local and home configuration atop Hoe::DEFAULT_CONFIG to allow plugins to supply new defaults.
|
10
|
+
* The readme_file and history_file are now automatically guessed from the manifest. This allows "README.rdoc" to be used automatically.
|
11
|
+
* install_gem optionally excludes rdoc/ri generation.
|
12
|
+
* rake check_extra_deps excludes rdoc/ri generation. rake install_gem does not.
|
13
|
+
* rake multi now just reinvokes rake using multiruby to allow hoe plugins to be invoked.
|
14
|
+
|
15
|
+
* 3 bug fixes:
|
16
|
+
|
17
|
+
* Added workaround for check_extra_deps for multi-version dependencies.
|
18
|
+
* The publish plugin no longer raises an exception for missing or ancient versions of rdoc.
|
19
|
+
* rdoc plugin calls isolate if using isolate
|
20
|
+
|
1
21
|
=== 2.13.1 / 2012-02-06
|
2
22
|
|
3
23
|
* 1 minor enhancement:
|
data/Rakefile
CHANGED
@@ -4,6 +4,7 @@ $:.unshift 'lib'
|
|
4
4
|
require './lib/hoe.rb'
|
5
5
|
|
6
6
|
Hoe.plugin :seattlerb
|
7
|
+
Hoe.plugin :isolate
|
7
8
|
|
8
9
|
Hoe.spec "hoe" do
|
9
10
|
developer "Ryan Davis", "ryand-ruby@zenspider.com"
|
@@ -14,6 +15,8 @@ Hoe.spec "hoe" do
|
|
14
15
|
|
15
16
|
pluggable!
|
16
17
|
require_rubygems_version '>= 1.4'
|
18
|
+
|
19
|
+
dependency "rake", "~> 0.8" # FIX: to force it to exist pre-isolate
|
17
20
|
end
|
18
21
|
|
19
22
|
task :plugins do
|
data/lib/hoe.rb
CHANGED
@@ -68,7 +68,7 @@ class Hoe
|
|
68
68
|
include Rake::DSL if defined?(Rake::DSL)
|
69
69
|
|
70
70
|
# duh
|
71
|
-
VERSION = '2.
|
71
|
+
VERSION = '2.14.0'
|
72
72
|
|
73
73
|
@@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
|
74
74
|
:publish, :rcov, :gemcutter, :signing, :test]
|
@@ -396,14 +396,19 @@ class Hoe
|
|
396
396
|
dependency "hoe", "~> #{version}", :development
|
397
397
|
end
|
398
398
|
|
399
|
-
|
400
|
-
extra_dev_deps.reject! { |(name, _)| runtime.include? name }
|
399
|
+
seen = {}
|
401
400
|
|
402
401
|
extra_deps.each do |dep|
|
402
|
+
next if seen[dep.first]
|
403
|
+
seen[dep.first] = true
|
404
|
+
|
403
405
|
spec.add_dependency(*dep)
|
404
406
|
end
|
405
407
|
|
406
408
|
extra_dev_deps.each do |dep|
|
409
|
+
next if seen[dep.first]
|
410
|
+
seen[dep.first] = true
|
411
|
+
|
407
412
|
spec.add_development_dependency(*dep)
|
408
413
|
end
|
409
414
|
end
|
@@ -422,7 +427,7 @@ class Hoe
|
|
422
427
|
self.spec = Gem::Specification.new do |s|
|
423
428
|
dirs = Dir['lib']
|
424
429
|
|
425
|
-
manifest =
|
430
|
+
manifest = read_manifest
|
426
431
|
|
427
432
|
abort [
|
428
433
|
"Manifest is missing or couldn't be read.",
|
@@ -455,7 +460,7 @@ class Hoe
|
|
455
460
|
s.author = author
|
456
461
|
end
|
457
462
|
|
458
|
-
s.extra_rdoc_files += s.files.grep(/txt$/)
|
463
|
+
s.extra_rdoc_files += s.files.grep(/(txt|rdoc)$/)
|
459
464
|
s.extra_rdoc_files.reject! { |f| f =~ %r%^(test|spec|vendor|template|data|tmp)/% }
|
460
465
|
s.extra_rdoc_files += @extra_rdoc_files
|
461
466
|
end
|
@@ -516,9 +521,7 @@ class Hoe
|
|
516
521
|
self.extra_deps = []
|
517
522
|
self.extra_dev_deps = []
|
518
523
|
self.extra_rdoc_files = []
|
519
|
-
self.history_file = "History.txt"
|
520
524
|
self.post_install_message = nil
|
521
|
-
self.readme_file = "README.txt"
|
522
525
|
self.rubyforge_name = name.downcase
|
523
526
|
self.spec = nil
|
524
527
|
self.spec_extras = {}
|
@@ -527,6 +530,14 @@ class Hoe
|
|
527
530
|
self.test_globs = ['test/**/test_*.rb']
|
528
531
|
self.url = nil
|
529
532
|
|
533
|
+
if manifest = read_manifest then
|
534
|
+
self.readme_file = manifest.grep(/^README\./).first
|
535
|
+
self.history_file = manifest.grep(/^History\./).first
|
536
|
+
end
|
537
|
+
|
538
|
+
self.history_file ||= "History.txt"
|
539
|
+
self.readme_file ||= "README.txt"
|
540
|
+
|
530
541
|
if block_given? then
|
531
542
|
warn "Hoe.new {...} deprecated. Switch to Hoe.spec."
|
532
543
|
Hoe.load_plugins
|
@@ -699,6 +710,15 @@ class Hoe
|
|
699
710
|
add_dependencies
|
700
711
|
end
|
701
712
|
|
713
|
+
##
|
714
|
+
# Reads Manifest.txt and returns an Array of lines in the manifest.
|
715
|
+
#
|
716
|
+
# Returns nil if no manifest was found.
|
717
|
+
|
718
|
+
def read_manifest
|
719
|
+
File.read_utf("Manifest.txt").split(/\r?\n\r?/) rescue nil
|
720
|
+
end
|
721
|
+
|
702
722
|
##
|
703
723
|
# Declare that your gem requires a specific rubygems version. Last one wins.
|
704
724
|
|
@@ -741,14 +761,21 @@ class Hoe
|
|
741
761
|
# any) and yields the configuration and its path
|
742
762
|
|
743
763
|
def with_config
|
764
|
+
config = Hoe::DEFAULT_CONFIG
|
765
|
+
|
744
766
|
rc = File.expand_path("~/.hoerc")
|
745
767
|
exists = File.exist? rc
|
746
|
-
|
768
|
+
homeconfig = exists ? YAML.load_file(rc) : {}
|
769
|
+
|
770
|
+
config = config.merge homeconfig
|
771
|
+
|
747
772
|
localrc = File.join Dir.pwd, '.hoerc'
|
748
773
|
exists = File.exist? localrc
|
749
774
|
localconfig = exists ? YAML.load_file(localrc) : {}
|
750
775
|
|
751
|
-
|
776
|
+
config = config.merge localconfig
|
777
|
+
|
778
|
+
yield config, rc
|
752
779
|
end
|
753
780
|
end
|
754
781
|
|
data/lib/hoe/deps.rb
CHANGED
data/lib/hoe/package.rb
CHANGED
@@ -12,6 +12,8 @@ end
|
|
12
12
|
# === Tasks Provided:
|
13
13
|
#
|
14
14
|
# install_gem:: Install the package as a gem.
|
15
|
+
# prerelease:: Hook for pre-release actions like sanity checks.
|
16
|
+
# postrelease:: Hook for post-release actions like release announcements.
|
15
17
|
# release:: Package and upload the release.
|
16
18
|
|
17
19
|
module Hoe::Package
|
@@ -53,7 +55,7 @@ module Hoe::Package
|
|
53
55
|
task :release => [:prerelease, :release_to, :postrelease]
|
54
56
|
|
55
57
|
# no doco, invisible hook
|
56
|
-
task :prerelease do
|
58
|
+
task :prerelease => [:check_manifest] do
|
57
59
|
abort "Fix your version before you release" if spec.version =~ /borked/
|
58
60
|
end
|
59
61
|
|
@@ -85,14 +87,18 @@ module Hoe::Package
|
|
85
87
|
##
|
86
88
|
# Install the named gem.
|
87
89
|
|
88
|
-
def install_gem name, version = nil
|
90
|
+
def install_gem name, version = nil, rdoc=true
|
89
91
|
should_not_sudo = Hoe::WINDOZE || ENV["NOSUDO"] || File.writable?(Gem.dir)
|
90
92
|
|
91
93
|
gem_cmd = Gem.default_exec_format % 'gem'
|
92
94
|
sudo = 'sudo ' unless should_not_sudo
|
93
95
|
local = '--local' unless version
|
94
96
|
version = "--version '#{version}'" if version
|
95
|
-
|
97
|
+
|
98
|
+
cmd = "#{sudo}#{gem_cmd} install #{local} #{name} #{version}"
|
99
|
+
cmd += " --no-rdoc --no-ri" unless rdoc
|
100
|
+
|
101
|
+
sh cmd
|
96
102
|
end
|
97
103
|
|
98
104
|
def prerelease_version # :nodoc:
|
data/lib/hoe/publish.rb
CHANGED
@@ -89,11 +89,15 @@ module Hoe::Publish
|
|
89
89
|
if need_rdoc then
|
90
90
|
dependency "rdoc", "~> 3.10", :developer
|
91
91
|
|
92
|
+
Rake.application[:isolate].invoke if plugin? :isolate
|
93
|
+
|
92
94
|
unless defined? RDoc::Task then
|
93
95
|
begin
|
94
96
|
gem 'rdoc'
|
95
97
|
rescue Gem::LoadError
|
96
|
-
|
98
|
+
warn $!
|
99
|
+
warn ""
|
100
|
+
warn "please run: rake check_extra_deps"
|
97
101
|
end unless Object.const_defined? :RDoc
|
98
102
|
|
99
103
|
begin
|
@@ -103,6 +107,8 @@ module Hoe::Publish
|
|
103
107
|
end
|
104
108
|
end
|
105
109
|
|
110
|
+
return unless Object.const_defined? :RDoc
|
111
|
+
|
106
112
|
RDoc::Task.new(:docs) do |rd|
|
107
113
|
rd.main = readme_file
|
108
114
|
rd.options << '-d' if (`which dot` =~ /\/dot/) unless
|
data/lib/hoe/test.rb
CHANGED
@@ -77,7 +77,7 @@ module Hoe::Test
|
|
77
77
|
|
78
78
|
desc 'Run the test suite using multiruby.'
|
79
79
|
task :multi do
|
80
|
-
|
80
|
+
system "multiruby -S rake"
|
81
81
|
end
|
82
82
|
|
83
83
|
desc 'Show which test files fail when run alone.'
|
@@ -143,7 +143,7 @@ module Hoe::Test
|
|
143
143
|
##
|
144
144
|
# Generate the test command-line.
|
145
145
|
|
146
|
-
def make_test_cmd
|
146
|
+
def make_test_cmd
|
147
147
|
unless SUPPORTED_TEST_FRAMEWORKS.has_key?(testlib)
|
148
148
|
raise "unsupported test framework #{testlib}"
|
149
149
|
end
|
@@ -158,15 +158,7 @@ module Hoe::Test
|
|
158
158
|
|
159
159
|
tests.insert 1, test_prelude if test_prelude
|
160
160
|
|
161
|
-
|
162
|
-
|
163
|
-
if multi then
|
164
|
-
multiruby_skip << "mri_trunk" if multiruby_skip.include? "1.9"
|
165
|
-
ENV['EXCLUDED_VERSIONS'] = multiruby_skip.join ":"
|
166
|
-
cmd = "-S multiruby #{cmd}"
|
167
|
-
end
|
168
|
-
|
169
|
-
cmd
|
161
|
+
"#{Hoe::RUBY_FLAGS} -e '#{tests.join("; ")}' -- #{FILTER}"
|
170
162
|
end
|
171
163
|
|
172
164
|
##
|
data/test/test_hoe.rb
CHANGED
@@ -141,6 +141,54 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
141
141
|
ENV['HOME'] = home
|
142
142
|
end
|
143
143
|
|
144
|
+
def test_initialize_intuit
|
145
|
+
Dir.mktmpdir do |path|
|
146
|
+
Dir.chdir path do
|
147
|
+
open 'Manifest.txt', 'w' do |io| # sorted
|
148
|
+
io.puts 'FAQ.rdoc'
|
149
|
+
io.puts 'History.rdoc'
|
150
|
+
io.puts 'README.rdoc'
|
151
|
+
end
|
152
|
+
|
153
|
+
open 'README.rdoc', 'w' do |io| io.puts '= blah' end
|
154
|
+
open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
|
155
|
+
|
156
|
+
hoe = Hoe.spec 'blah' do
|
157
|
+
self.version = '1.0'
|
158
|
+
developer 'nobody', 'nobody@example'
|
159
|
+
end
|
160
|
+
|
161
|
+
assert_equal 'History.rdoc', hoe.history_file
|
162
|
+
assert_equal 'README.rdoc', hoe.readme_file
|
163
|
+
assert_equal %w[FAQ.rdoc History.rdoc README.rdoc],
|
164
|
+
hoe.spec.extra_rdoc_files
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
def test_initialize_intuit_ambiguous
|
170
|
+
Dir.mktmpdir do |path|
|
171
|
+
Dir.chdir path do
|
172
|
+
open 'Manifest.txt', 'w' do |io|
|
173
|
+
io.puts 'History.rdoc' # sorted
|
174
|
+
io.puts 'README.ja.rdoc'
|
175
|
+
io.puts 'README.rdoc'
|
176
|
+
end
|
177
|
+
|
178
|
+
open 'README.rdoc', 'w' do |io| io.puts '= blah' end
|
179
|
+
open 'README.ja.rdoc', 'w' do |io| io.puts '= blah' end
|
180
|
+
open 'History.rdoc', 'w' do |io| io.puts '=== 1.0' end
|
181
|
+
|
182
|
+
hoe = Hoe.spec 'blah' do
|
183
|
+
self.version = '1.0'
|
184
|
+
developer 'nobody', 'nobody@example'
|
185
|
+
end
|
186
|
+
|
187
|
+
assert_equal 'README.ja.rdoc', hoe.readme_file
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
144
192
|
def test_file_read_utf
|
145
193
|
Tempfile.open 'BOM' do |io|
|
146
194
|
io.write "\xEF\xBB\xBFBOM"
|
@@ -257,6 +305,16 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
257
305
|
Hoe.plugins.replace before
|
258
306
|
end
|
259
307
|
|
308
|
+
def test_read_manifest
|
309
|
+
hoe = Hoe.spec 'blah' do
|
310
|
+
developer 'author', 'email'
|
311
|
+
end
|
312
|
+
|
313
|
+
expected = File.read_utf('Manifest.txt').split
|
314
|
+
|
315
|
+
assert_equal expected, hoe.read_manifest
|
316
|
+
end
|
317
|
+
|
260
318
|
def test_rename
|
261
319
|
# project, file_name, klass = Hoe.normalize_names 'project_name'
|
262
320
|
|
@@ -284,4 +342,49 @@ class TestHoe < MiniTest::Unit::TestCase
|
|
284
342
|
ensure
|
285
343
|
ENV.delete "NOSUDO"
|
286
344
|
end
|
345
|
+
|
346
|
+
def test_with_config_default
|
347
|
+
home = ENV['HOME']
|
348
|
+
Hoe.files = nil
|
349
|
+
|
350
|
+
Dir.mktmpdir do |path|
|
351
|
+
ENV['HOME'] = path
|
352
|
+
|
353
|
+
hoeconfig = hoe.with_config {|config, _| config }
|
354
|
+
|
355
|
+
assert_equal Hoe::DEFAULT_CONFIG, hoeconfig
|
356
|
+
end
|
357
|
+
ensure
|
358
|
+
ENV['HOME'] = home
|
359
|
+
end
|
360
|
+
|
361
|
+
def test_with_config_overrides
|
362
|
+
overrides = {
|
363
|
+
'exclude' => Regexp.union( Hoe::DEFAULT_CONFIG["exclude"], /\.hg/ ),
|
364
|
+
'plugins' => ['tweedledee', 'tweedledum']
|
365
|
+
}
|
366
|
+
overrides_rcfile = File.join(Dir.pwd, '.hoerc')
|
367
|
+
|
368
|
+
home = ENV['HOME']
|
369
|
+
Hoe.files = nil
|
370
|
+
|
371
|
+
Dir.mktmpdir do |path|
|
372
|
+
ENV['HOME'] = path
|
373
|
+
|
374
|
+
open File.join(path, '.hoerc'), 'w' do |io|
|
375
|
+
io.write YAML.dump( Hoe::DEFAULT_CONFIG )
|
376
|
+
end
|
377
|
+
open overrides_rcfile, File::CREAT|File::EXCL|File::WRONLY do |io|
|
378
|
+
io.write YAML.dump( overrides )
|
379
|
+
end
|
380
|
+
|
381
|
+
hoeconfig = hoe.with_config {|config, _| config }
|
382
|
+
|
383
|
+
assert_equal Hoe::DEFAULT_CONFIG.merge(overrides), hoeconfig
|
384
|
+
end
|
385
|
+
ensure
|
386
|
+
File.delete overrides_rcfile if File.exist?( overrides_rcfile )
|
387
|
+
ENV['HOME'] = home
|
388
|
+
end
|
389
|
+
|
287
390
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 55
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 2.
|
8
|
+
- 14
|
9
|
+
- 0
|
10
|
+
version: 2.14.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: 2012-02-
|
39
|
+
date: 2012-02-21 00:00:00 Z
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|