hoe 2.15.0 → 2.16.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,22 @@
1
+ === 2.16.0 / 2012-03-06
2
+
3
+ * 9 minor enhancements:
4
+
5
+ * Added Gem.bin_wrapper to provide API to bin wrapped files.
6
+ * Added check_manifest task to compile_tasks in the compiler plugin.
7
+ * Decoupled from rcov task. Solves isolate/hoe bootstrap issues.
8
+ * Decoupled from rdoc tasks. Solves isolate/hoe bootstrap issues.
9
+ * Updated default exclude config to skip extconf.h and .o files.
10
+ * Updated known 3rd party plugin list in readme.
11
+ * Warn against using system installed rake (eg osx ships their own on 1.8).
12
+ * Removed rcov plugin from the default loaded set.
13
+ * Added dev dependency for rcov when the plugin is loaded.
14
+
15
+ * 2 bug fixes:
16
+
17
+ * Fix Rake::DSL include warnings.
18
+ * Removing check_manifest from prerelease. (should be pushed to the hoe-git plugin)
19
+
1
20
  === 2.15.0 / 2012-02-29
2
21
 
3
22
  * 5 minor enhancements:
@@ -33,5 +33,6 @@ template/bin/file_name.erb
33
33
  template/lib/file_name.rb.erb
34
34
  template/test/test_file_name.rb.erb
35
35
  test/test_hoe.rb
36
+ test/test_hoe_debug.rb
36
37
  test/test_hoe_gemcutter.rb
37
38
  test/test_hoe_test.rb
data/README.txt CHANGED
@@ -171,16 +171,26 @@ Again, this must be done before the Hoe spec, or it won't be useful.
171
171
 
172
172
  === Known 3rd-Party Plugins:
173
173
 
174
- * hoe-bundler - Generates a Gemfile based on a Hoe's declared dependencies.
175
- * hoe-debugging - A Hoe plugin to help you debug your codes.
176
- * hoe-doofus - A Hoe plugin that helps me keep from messing up gem releases.
177
- * hoe-gemcutter - Adds gemcutter release automation to Hoe.
178
- * hoe-gemspec - Generate a prerelease gemspec based on a Hoe spec.
179
- * hoe-git - A set of Hoe plugins for tighter Git integration.
180
- * hoe-mercurial - A Hoe plugin for Mercurial integration.
181
- * hoe-rubygems - A Hoe plugin with additional RubyGems tasks.
182
- * hoe-seattlerb - Minitest, email announcements, release branching.
183
- * hoe-yard - A Hoe plugin for generating YARD documentation.
174
+ * hoe-bundler - Generates a Gemfile based on a Hoe's declared dependencies.
175
+ * hoe-debugging - A Hoe plugin to help you debug your codes.
176
+ * hoe-deveiate - A collection of Rake tasks and utility functions.
177
+ * hoe-doofus - A Hoe plugin that helps me keep from messing up gem releases.
178
+ * hoe-gemcutter - Adds gemcutter release automation to Hoe.
179
+ * hoe-geminabox - Allows you to push your gems to geminabox
180
+ * hoe-gemspec - Generate a prerelease gemspec based on a Hoe spec.
181
+ * hoe-git - A set of Hoe plugins for tighter Git integration.
182
+ * hoe-heroku - Helps you get your stuff on Heroku.
183
+ * hoe-hg - A Hoe plugin for Mercurial integration.
184
+ * hoe-highline - A Hoe plugin for building interactive Rake tasks
185
+ * hoe-manualgen - A manual-generation plugin for Hoe
186
+ * hoe-mercurial - A Hoe plugin for Mercurial integration.
187
+ * hoe-reek - Integrates the reek code smell engine into your hoe projects.
188
+ * hoe-roodi - Integrates the roodi code smell tool into your hoe projects.
189
+ * hoe-rubygems - Additional RubyGems tasks.
190
+ * hoe-seattlerb - Minitest, email announcements, release branching.
191
+ * hoe-telicopter - Provides tasks used by hotelicopter.
192
+ * hoe-travis - Allows your gem to gain maximum benefit from <http://travis-ci.org>.
193
+ * hoe-yard - A Hoe plugin for generating YARD documentation.
184
194
 
185
195
  === Writing Plugins:
186
196
 
data/lib/hoe.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  # -*- mode: ruby; coding: us-ascii; -*-
2
2
 
3
3
  require 'rubygems'
4
+
5
+ begin
6
+ gem 'rake'
7
+ rescue Gem::LoadError
8
+ warn "Using the crusty system installed rake... you probably want to upgrade"
9
+ end
4
10
  require 'rake'
5
11
  require 'rake/testtask'
6
12
  require 'rbconfig'
@@ -68,10 +74,10 @@ class Hoe
68
74
  include Rake::DSL if defined?(Rake::DSL)
69
75
 
70
76
  # duh
71
- VERSION = '2.15.0'
77
+ VERSION = '2.16.0'
72
78
 
73
79
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
74
- :publish, :rcov, :gemcutter, :signing, :test]
80
+ :publish, :gemcutter, :signing, :test]
75
81
 
76
82
  @bad_plugins = []
77
83
 
@@ -93,7 +99,7 @@ class Hoe
93
99
  # this on load.
94
100
 
95
101
  DEFAULT_CONFIG = {
96
- "exclude" => /tmp$|CVS|\.svn|\.log$/,
102
+ "exclude" => /tmp$|CVS|\.svn|TAGS|extconf.h|\.o$|\.log$/,
97
103
  }
98
104
 
99
105
  ##
@@ -815,3 +821,7 @@ class File
815
821
  end
816
822
  end
817
823
  end
824
+
825
+ def Gem.bin_wrapper name # HACK
826
+ File.join Gem.dir, "bin", Gem.default_exec_format % name
827
+ end unless Gem.respond_to? :bin_wrapper
@@ -23,7 +23,7 @@ module Hoe::Compiler
23
23
  # Initialize variables for compiler plugin.
24
24
 
25
25
  def initialize_compiler
26
- self.compile_tasks = [:multi, :test]
26
+ self.compile_tasks = [:multi, :test, :check_manifest]
27
27
  self.spec_extras = { :extensions => ["ext/#{self.name}/extconf.rb"] }
28
28
 
29
29
  clean_globs << "lib/#{self.name}/*.{so,bundle,dll}"
@@ -8,6 +8,9 @@
8
8
  # debug_gem:: Show information about the gem.
9
9
 
10
10
  module Hoe::Debug
11
+
12
+ include Rake::DSL if defined? ::Rake::DSL
13
+
11
14
  Hoe::DEFAULT_CONFIG["exclude"] = /tmp$|CVS|TAGS|\.(svn|git|DS_Store)/
12
15
 
13
16
  # :stopdoc:
@@ -42,27 +45,7 @@ module Hoe::Debug
42
45
 
43
46
  desc 'Verify the manifest.'
44
47
  task :check_manifest => :clean do
45
- f = "Manifest.tmp"
46
- require 'find'
47
- files = []
48
- with_config do |config, _|
49
- exclusions = config["exclude"]
50
- abort "exclude entry missing from .hoerc. Run rake config_hoe." if
51
- exclusions.nil?
52
-
53
- Find.find '.' do |path|
54
- next unless File.file? path
55
- next if path =~ exclusions
56
- files << path[2..-1]
57
- end
58
- files = files.sort.join "\n"
59
- File.open f, 'w' do |fp| fp.puts files end
60
- begin
61
- sh "#{DIFF} -du Manifest.txt #{f}"
62
- ensure
63
- rm f
64
- end
65
- end
48
+ check_manifest
66
49
  end
67
50
 
68
51
  desc 'Show information about the gem.'
@@ -70,4 +53,34 @@ module Hoe::Debug
70
53
  puts spec.to_ruby
71
54
  end
72
55
  end
56
+
57
+ ##
58
+ # Verifies your Manifest.txt against the files in your project.
59
+
60
+ def check_manifest
61
+ f = "Manifest.tmp"
62
+ require 'find'
63
+ files = []
64
+ with_config do |config, _|
65
+ exclusions = config["exclude"]
66
+
67
+ Find.find '.' do |path|
68
+ next unless File.file? path
69
+ next if path =~ exclusions
70
+ files << path[2..-1]
71
+ end
72
+
73
+ files = files.sort.join "\n"
74
+
75
+ File.open f, 'w' do |fp| fp.puts files end
76
+
77
+ verbose = { :verbose => Rake.application.options.verbose }
78
+
79
+ begin
80
+ sh "#{DIFF} -du Manifest.txt #{f}", verbose
81
+ ensure
82
+ rm f, verbose
83
+ end
84
+ end
85
+ end
73
86
  end
@@ -55,7 +55,7 @@ module Hoe::Package
55
55
  task :release => [:prerelease, :release_to, :postrelease]
56
56
 
57
57
  # no doco, invisible hook
58
- task :prerelease => [:check_manifest] do
58
+ task :prerelease do
59
59
  abort "Fix your version before you release" if spec.version =~ /borked/
60
60
  end
61
61
 
@@ -96,6 +96,23 @@ module Hoe::Publish
96
96
  self.rsync_args ||= '-av --delete'
97
97
  end
98
98
 
99
+ def make_rdoc_cmd extra_args = nil
100
+ title = "#{name}-#{version} Documentation"
101
+ title = "#{rubyforge_name}'s #{title}" if rubyforge_name != name
102
+ rdoc = Gem.bin_wrapper "rdoc"
103
+
104
+ cmd = %W[#{rdoc}
105
+ --title "#{title}"
106
+ -o "#{local_rdoc_dir}"
107
+ ] +
108
+ spec.rdoc_options +
109
+ Array(extra_args) +
110
+ spec.require_paths +
111
+ spec.extra_rdoc_files
112
+
113
+ cmd.join " "
114
+ end
115
+
99
116
  ##
100
117
  # Define tasks for plugin.
101
118
 
@@ -103,72 +120,29 @@ module Hoe::Publish
103
120
  if need_rdoc then
104
121
  dependency "rdoc", "~> 3.10", :developer
105
122
 
106
- Rake.application[:isolate].invoke if plugin? :isolate
107
-
108
- unless defined? RDoc::Task then
109
- begin
110
- gem 'rdoc'
111
- rescue Gem::LoadError
112
- warn $!
113
- warn ""
114
- warn "please run: rake check_extra_deps"
115
- end unless Object.const_defined? :RDoc
116
-
117
- begin
118
- require 'rdoc/task'
119
- rescue LoadError
120
- require 'rake/rdoctask'
121
- end
122
- end
123
-
124
- return unless Object.const_defined? :RDoc
125
-
126
- RDoc::Task.new(:docs) do |rd|
127
- rd.main = readme_file
128
- rd.options << '-d' if (`which dot` =~ /\/dot/) unless
129
- ENV['NODOT'] || Hoe::WINDOZE
130
- rd.rdoc_dir = local_rdoc_dir
131
-
132
- rd.rdoc_files += spec.require_paths
133
- rd.rdoc_files += spec.extra_rdoc_files
134
-
135
- title = spec.rdoc_options.grep(/^(-t|--title)=?$/).first
123
+ task :isolate # ensure it exists
136
124
 
137
- if title then
138
- rd.options << title
139
-
140
- unless title =~ /\=/ then # for ['-t', 'title here']
141
- title_index = spec.rdoc_options.index(title)
142
- rd.options << spec.rdoc_options[title_index + 1]
143
- end
144
- else
145
- title = "#{name}-#{version} Documentation"
146
- title = "#{rubyforge_name}'s " + title if rubyforge_name != name
147
- rd.options << '--title' << title
148
- end
125
+ desc "Generate rdoc"
126
+ task :docs => [:clobber_docs, :isolate] do
127
+ ruby make_rdoc_cmd
149
128
  end
150
129
 
151
- desc 'Generate ri locally for testing.'
152
- task :ridocs => :clean do
153
- sh %q{ rdoc --ri -o ri . }
130
+ desc "Generate rdoc coverage report"
131
+ task :dcov => :isolate do
132
+ ruby make_rdoc_cmd '-C'
154
133
  end
155
134
 
156
- RDoc::Task.new(:dcov) do |rd|
157
- rd.options << '-C'
158
- rd.rdoc_files += spec.require_paths
159
- rd.rdoc_files += spec.extra_rdoc_files
135
+ desc "Remove RDoc files"
136
+ task :clobber_docs do
137
+ rm_rf local_rdoc_dir
160
138
  end
161
139
 
162
- task(:redcov).clear # lame
163
- task(:clobber_dcov).clear # lame
140
+ task :clobber => :clobber_docs
164
141
 
165
- task :docs do
166
- Dir.chdir local_rdoc_dir do
167
- sh "chmod -R g+w ."
168
- end
142
+ desc 'Generate ri locally for testing.'
143
+ task :ridocs => [:clean, :isolate] do
144
+ ruby make_rdoc_cmd "--ri -o ri"
169
145
  end
170
-
171
- task :docs => :isolate if plugin? :isolate
172
146
  end
173
147
 
174
148
  desc "Publish RDoc to wherever you want."
@@ -6,29 +6,27 @@
6
6
  # rcov:: Analyze code coverage with tests
7
7
 
8
8
  module Hoe::RCov
9
+ def initialize_rcov
10
+ dependency "rcov", "~> 0.9", :development
11
+ end
12
+
9
13
  ##
10
14
  # Define tasks for plugin.
11
15
 
12
16
  def define_rcov_tasks
13
17
  begin # take a whack at defining rcov tasks
14
- Rake.application[:isolate].invoke if plugin? :isolate
15
-
16
- require 'rcov/rcovtask'
17
-
18
- Rcov::RcovTask.new do |t|
19
- pattern = ENV['PATTERN'] || test_globs
20
-
21
- t.test_files = FileList[pattern]
22
- t.verbose = true
23
- t.libs = %w[lib test .]
24
- t.rcov_opts << Hoe::RUBY_FLAGS
25
- t.rcov_opts << "--no-color"
26
- t.rcov_opts << "--save coverage.info"
27
- t.rcov_opts << "-x ^/"
28
- t.rcov_opts << "-x tmp/isolate"
29
- t.rcov_opts << "--sort coverage --sort-reverse"
18
+ task :isolate # ensure it exists
19
+
20
+ task :rcov => :isolate do
21
+ ruby make_rcov_cmd
22
+ end
23
+
24
+ task :clobber_rcov do
25
+ rm_rf "coverage"
30
26
  end
31
27
 
28
+ task :clobber => :clobber_rcov
29
+
32
30
  # this is for my emacs rcov overlay stuff on emacswiki.
33
31
  task :rcov_overlay do
34
32
  path = ENV["FILE"]
@@ -43,6 +41,25 @@ module Hoe::RCov
43
41
  task :clobber_rcov # in case rcov didn't load
44
42
  end
45
43
  end
44
+
45
+ def make_rcov_cmd extra_args = nil
46
+ rcov = Gem.bin_wrapper "rcov"
47
+ tests = test_globs.sort.map { |g| Dir.glob(g) }.flatten.map(&:inspect)
48
+
49
+ cmd = %W[#{rcov}
50
+ #{Hoe::RUBY_FLAGS}
51
+ --text-report
52
+ --no-color
53
+ --save coverage.info
54
+ -x ^/
55
+ -x tmp/isolate
56
+ --sort coverage
57
+ --sort-reverse
58
+ -o "coverage"
59
+ ] + tests
60
+
61
+ cmd.join " "
62
+ end
46
63
  end
47
64
 
48
65
  task :clean => :clobber_rcov
@@ -20,7 +20,8 @@ class TestHoe < MiniTest::Unit::TestCase
20
20
  def setup
21
21
  Rake.application.clear
22
22
 
23
- Hoe.instance_variable_set :@bad_plugins, []
23
+ Hoe.plugins.clear
24
+ Hoe.bad_plugins.clear
24
25
  Hoe.instance_variable_set :@files, nil
25
26
  Hoe.instance_variable_set :@found, nil
26
27
  Hoe.instance_variable_set :@loaded, nil
@@ -270,13 +271,15 @@ class TestHoe < MiniTest::Unit::TestCase
270
271
  spec = hoe.spec
271
272
 
272
273
  urls = {
273
- "home" => "https://github.com/seattlerb/hoe",
274
+ "home" => "http://www.zenspider.com/projects/hoe.html",
275
+ "code" => "https://github.com/seattlerb/hoe",
276
+ "bugs" => "https://github.com/seattlerb/hoe/issues",
274
277
  "rdoc" => "http://seattlerb.rubyforge.org/hoe/",
275
278
  "doco" => "http://seattlerb.rubyforge.org/hoe/Hoe.pdf",
276
279
  "other" => "http://github.com/jbarnette/hoe-plugin-examples",
277
280
  }
278
281
 
279
- assert_equal "https://github.com/seattlerb/hoe", hoe.url
282
+ assert_equal urls["home"], hoe.url
280
283
  assert_equal urls, hoe.urls
281
284
 
282
285
  text_files = files.grep(/txt$/).reject { |f| f =~ /template/ }
@@ -292,8 +295,7 @@ class TestHoe < MiniTest::Unit::TestCase
292
295
  assert_equal ['sow'], spec.executables
293
296
  assert_equal text_files, spec.extra_rdoc_files
294
297
  assert_equal files, spec.files
295
- assert_equal "https://github.com/seattlerb/hoe", spec.homepage
296
- # TODO: assert_equal "https://github.com/seattlerb/hoe", spec.metadata
298
+ assert_equal urls["home"], spec.homepage
297
299
  assert_equal ['--main', 'README.txt'], spec.rdoc_options
298
300
  assert_equal ['lib'], spec.require_paths
299
301
  assert_equal 'blah', spec.rubyforge_project
@@ -0,0 +1,107 @@
1
+ require 'hoe'
2
+ require File.expand_path 'lib/hoe/debug.rb' # ugh. avoid dupe warnings
3
+ require 'tmpdir'
4
+ require 'tempfile'
5
+ require 'minitest/autorun'
6
+
7
+ class TestHoeDebug < MiniTest::Unit::TestCase
8
+
9
+ include Hoe::Debug
10
+
11
+ attr_accessor :generated_files
12
+
13
+ def setup
14
+ super
15
+
16
+ @generated_files = []
17
+ end
18
+
19
+ def test_check_manifest
20
+ in_tmpdir do
21
+ manifest
22
+
23
+ assert_silent do
24
+ check_manifest
25
+ end
26
+ end
27
+ end
28
+
29
+ def test_check_manifest_generated
30
+ in_tmpdir do
31
+ manifest 'generated.rb'
32
+
33
+ open 'generated.rb', 'w' do |io| io.puts 'generated = true' end
34
+
35
+ assert_silent do
36
+ check_manifest
37
+ end
38
+ end
39
+ end
40
+
41
+ def test_check_manifest_missing
42
+ in_tmpdir do
43
+ manifest
44
+
45
+ open 'missing.rb', 'w' do |io| io.puts 'missing = true' end
46
+
47
+ e = nil
48
+
49
+ out = capture_STDOUT do
50
+ e = assert_raises RuntimeError do
51
+ check_manifest
52
+ end
53
+ end
54
+
55
+ assert_match %r%^Command failed with status%, e.message
56
+
57
+ assert_match %r%^\+missing.rb%, out
58
+ end
59
+ end
60
+
61
+ def capture_STDOUT
62
+ orig_STDOUT = STDOUT.dup
63
+
64
+ Tempfile.open __name__ do |io|
65
+ STDOUT.reopen io
66
+
67
+ yield
68
+
69
+ io.flush
70
+
71
+ return File.read io.path
72
+ end
73
+ ensure
74
+ STDOUT.reopen orig_STDOUT
75
+ end
76
+
77
+ def in_tmpdir
78
+ old_LOAD_PATH = $LOAD_PATH.dup
79
+ $LOAD_PATH.map! { |path| File.expand_path path }
80
+
81
+ Dir.mktmpdir do |path|
82
+ Dir.chdir path do
83
+ yield
84
+ end
85
+ end
86
+ ensure
87
+ $LOAD_PATH.replace old_LOAD_PATH
88
+ end
89
+
90
+ def manifest extra = nil
91
+ open 'Manifest.txt', 'w' do |io| # sorted
92
+ io.puts 'History.txt'
93
+ io.puts 'Manifest.txt'
94
+ io.puts 'README.txt'
95
+ io.puts extra if extra
96
+ end
97
+
98
+ open 'README.txt', 'w' do |io| io.puts '= blah' end
99
+ open 'History.txt', 'w' do |io| io.puts '=== 1.0' end
100
+ end
101
+
102
+ def with_config
103
+ yield({ 'exclude' => [] }, '~/.hoerc')
104
+ end
105
+
106
+ end
107
+
@@ -19,6 +19,8 @@ class TestHoeTest < MiniTest::Unit::TestCase
19
19
  end
20
20
 
21
21
  def test_make_test_cmd_with_different_testlibs
22
+ skip "Using TESTOPTS... skipping" if ENV['TESTOPTS']
23
+
22
24
  expected = ['-w -Ilib:bin:test:. -e \'require "rubygems"; %s',
23
25
  'require "test/test_hoe_test.rb"',
24
26
  "' -- ",
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: 51
4
+ hash: 79
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 15
8
+ - 16
9
9
  - 0
10
- version: 2.15.0
10
+ version: 2.16.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-03-01 00:00:00 Z
39
+ date: 2012-03-07 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
@@ -140,6 +140,7 @@ files:
140
140
  - template/lib/file_name.rb.erb
141
141
  - template/test/test_file_name.rb.erb
142
142
  - test/test_hoe.rb
143
+ - test/test_hoe_debug.rb
143
144
  - test/test_hoe_gemcutter.rb
144
145
  - test/test_hoe_test.rb
145
146
  - .gemtest
@@ -180,5 +181,6 @@ specification_version: 3
180
181
  summary: Hoe is a rake/rubygems helper for project Rakefiles
181
182
  test_files:
182
183
  - test/test_hoe.rb
184
+ - test/test_hoe_debug.rb
183
185
  - test/test_hoe_gemcutter.rb
184
186
  - test/test_hoe_test.rb
metadata.gz.sig CHANGED
Binary file