hoe 2.14.0 → 2.15.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,13 @@
1
+ === 2.15.0 / 2012-02-29
2
+
3
+ * 5 minor enhancements:
4
+
5
+ * Added Hoe::bad_plugins which returns plugins that could not be found
6
+ * Added post_blog_zenweb to post releases to my blog's jekyll-like format
7
+ * Added the install_plugins task
8
+ * Documented the blogs .hoerc entry.
9
+ * Revamped post_blog task to allow for local file based blogs.
10
+
1
11
  === 2.14.0 / 2012-02-20
2
12
 
3
13
  * 9 minor enhancements:
data/README.txt CHANGED
@@ -1,6 +1,8 @@
1
1
  = Hoe
2
2
 
3
- home :: https://github.com/seattlerb/hoe
3
+ home :: http://www.zenspider.com/projects/hoe.html
4
+ code :: https://github.com/seattlerb/hoe
5
+ bugs :: https://github.com/seattlerb/hoe/issues
4
6
  rdoc :: http://seattlerb.rubyforge.org/hoe/
5
7
  doco :: http://seattlerb.rubyforge.org/hoe/Hoe.pdf
6
8
  other :: http://github.com/jbarnette/hoe-plugin-examples
@@ -8,10 +10,10 @@ other :: http://github.com/jbarnette/hoe-plugin-examples
8
10
  == DESCRIPTION:
9
11
 
10
12
  Hoe is a rake/rubygems helper for project Rakefiles. It helps you
11
- manage and maintain, and release your project and includes a dynamic
13
+ manage, maintain, and release your project and includes a dynamic
12
14
  plug-in system allowing for easy extensibility. Hoe ships with
13
15
  plug-ins for all your usual project tasks including rdoc generation,
14
- testing, packaging, and deployment.
16
+ testing, packaging, deployment, and announcement..
15
17
 
16
18
  See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed
17
19
  below.
@@ -249,27 +251,6 @@ Finally, once the user's hoe-spec has been evaluated, all activated plugins
249
251
  have their `define_#{plugin}_tasks` method called. This method must be defined
250
252
  and it is here that you'll define all your tasks.
251
253
 
252
- == HOW TO CONTRIBUTE OR GET SUPPORT:
253
-
254
- === Mailing List
255
-
256
- A mailing list for hoe is hosted at: http://rubyforge.org/projects/seattlerb
257
-
258
- === Bugs & Feature Requests:
259
-
260
- We use the bug trackers hosted at: http://rubyforge.org/projects/seattlerb
261
-
262
- === Patches:
263
-
264
- * If you have a bug fix or enhancement to hoe that you'd like to
265
- contribute, please provide a unified diff and file it in a ticket in
266
- the bug tracker listed above.
267
- * You can check out hoe:
268
- * With git via github: http://github.com/seattlerb/hoe
269
- * With svn via rubyforge: http://rubyforge.org/projects/seattlerb
270
- * Or via perforce if you'd like to directly contribute:
271
- http://www.zenspider.com/ZSS/Process/Perforce.html
272
-
273
254
  == REQUIREMENTS:
274
255
 
275
256
  * rake
data/lib/hoe.rb CHANGED
@@ -68,11 +68,13 @@ class Hoe
68
68
  include Rake::DSL if defined?(Rake::DSL)
69
69
 
70
70
  # duh
71
- VERSION = '2.14.0'
71
+ VERSION = '2.15.0'
72
72
 
73
73
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
74
74
  :publish, :rcov, :gemcutter, :signing, :test]
75
75
 
76
+ @bad_plugins = []
77
+
76
78
  ##
77
79
  # Used to add extra flags to RUBY_FLAGS.
78
80
 
@@ -243,6 +245,13 @@ class Hoe
243
245
  RUBY_FLAGS.sub!(/-I/, "-I#{dirs.join(s)}#{s}")
244
246
  end
245
247
 
248
+ ##
249
+ # Returns plugins that could not be loaded by Hoe.load_plugins.
250
+
251
+ def self.bad_plugins
252
+ @bad_plugins
253
+ end
254
+
246
255
  ##
247
256
  # Find and load all plugin files.
248
257
  #
@@ -273,6 +282,9 @@ class Hoe
273
282
  plugins.delete bad_plugin
274
283
  end
275
284
 
285
+ @bad_plugins.concat bad_plugins
286
+ @bad_plugins.uniq!
287
+
276
288
  return @loaded, @found
277
289
  end
278
290
 
@@ -504,6 +516,15 @@ class Hoe
504
516
  self.email << email
505
517
  end
506
518
 
519
+ ##
520
+ # Returns true if the gem +name+ is installed.
521
+
522
+ def have_gem? name
523
+ Gem::Specification.find_by_name name
524
+ rescue Gem::LoadError
525
+ false
526
+ end
527
+
507
528
  ##
508
529
  # Create a newly initialized hoe spec. If a block is given, yield on
509
530
  # it and finish post_initialize steps. This is deprecated behavior
@@ -119,6 +119,11 @@ module Hoe::Deps
119
119
  end
120
120
  end
121
121
  end
122
+
123
+ desc 'Install missing plugins.'
124
+ task :install_plugins do
125
+ install_missing_plugins
126
+ end
122
127
  end
123
128
 
124
129
  ##
@@ -170,6 +175,26 @@ module Hoe::Deps
170
175
  }.flatten]
171
176
  end
172
177
 
178
+ ##
179
+ # Installs plugins that aren't currently installed
180
+
181
+ def install_missing_plugins plugins = Hoe.bad_plugins
182
+ version = '>= 0'
183
+
184
+ plugins.each do |name|
185
+ dash_name = name.to_s.gsub '_', '-'
186
+
187
+ next if have_gem?(name) or
188
+ have_gem?("hoe-#{name}") or
189
+ have_gem?("hoe-#{dash_name}")
190
+
191
+ install_gem("hoe-#{name}", version, false) or
192
+ install_gem(name, version, false) or
193
+ install_gem(dash_name, version, false) or
194
+ warn "could not install gem for #{name} plugin"
195
+ end
196
+ end
197
+
173
198
  ##
174
199
  # Return all the dependencies on the named rubygem.
175
200
 
@@ -89,6 +89,7 @@ module Hoe::Package
89
89
 
90
90
  def install_gem name, version = nil, rdoc=true
91
91
  should_not_sudo = Hoe::WINDOZE || ENV["NOSUDO"] || File.writable?(Gem.dir)
92
+ null_dev = Hoe::WINDOZE ? '> NUL 2>&1' : '&> /dev/null'
92
93
 
93
94
  gem_cmd = Gem.default_exec_format % 'gem'
94
95
  sudo = 'sudo ' unless should_not_sudo
@@ -97,8 +98,10 @@ module Hoe::Package
97
98
 
98
99
  cmd = "#{sudo}#{gem_cmd} install #{local} #{name} #{version}"
99
100
  cmd += " --no-rdoc --no-ri" unless rdoc
101
+ cmd += " #{null_dev}" unless Rake.application.options.trace
100
102
 
101
- sh cmd
103
+ puts cmd if Rake.application.options.trace
104
+ system cmd
102
105
  end
103
106
 
104
107
  def prerelease_version # :nodoc:
@@ -16,6 +16,20 @@ require "hoe/rake"
16
16
  #
17
17
  # publish_on_announce:: Run +publish_docs+ when you run +release+.
18
18
  # blogs:: An array of hashes of blog settings.
19
+ #
20
+ # The blogs entry can either look like:
21
+ #
22
+ # - path: ~/Work/p4/zss/www/blog.zenspider.com/releases
23
+ # type: zenweb
24
+ #
25
+ # or:
26
+ #
27
+ # - url: http://example.com/cgi-bin/blog.cgi
28
+ # blog_id: 1
29
+ # user: username
30
+ # password: passwd
31
+ # extra_headers:
32
+ # blah: whatever
19
33
 
20
34
  module Hoe::Publish
21
35
  ##
@@ -177,28 +191,33 @@ module Hoe::Publish
177
191
  puts generate_email
178
192
  end
179
193
 
180
- desc 'Post announcement to blog.'
194
+ desc 'Post announcement to blog. Uses the "blogs" array in your hoerc.'
181
195
  task :post_blog do
182
- require 'xmlrpc/client'
183
-
184
196
  with_config do |config, path|
185
197
  break unless config['blogs']
186
198
 
187
- _, title, body, urls = announcement
188
- body += "\n\n#{urls}"
189
-
190
199
  config['blogs'].each do |site|
191
- server = XMLRPC::Client.new2(site['url'])
192
- content = site['extra_headers'].merge(:title => title,
193
- :description => body,
194
- :categories => blog_categories)
195
-
196
- server.call('metaWeblog.newPost',
197
- site['blog_id'],
198
- site['user'],
199
- site['password'],
200
- content,
201
- true)
200
+ if site['path'] then
201
+ msg = "post_blog_#{site['type']}"
202
+ send msg, site
203
+ else
204
+ require 'xmlrpc/client'
205
+
206
+ _, title, body, urls = announcement
207
+ body += "\n\n#{urls}"
208
+
209
+ server = XMLRPC::Client.new2(site['url'])
210
+ content = site['extra_headers'].merge(:title => title,
211
+ :description => body,
212
+ :categories => blog_categories)
213
+
214
+ server.call('metaWeblog.newPost',
215
+ site['blog_id'],
216
+ site['user'],
217
+ site['password'],
218
+ content,
219
+ true)
220
+ end
202
221
  end
203
222
  end
204
223
  end
@@ -207,6 +226,33 @@ module Hoe::Publish
207
226
  task :announce => [:post_blog, :publish_on_announce ]
208
227
  end
209
228
 
229
+ def post_blog_zenweb site
230
+ dir = site["path"]
231
+
232
+ _, title, body, urls = announcement
233
+ body += "\n\n#{urls}"
234
+
235
+ Dir.chdir File.expand_path dir do
236
+ time = Time.at Time.now.to_i # nukes fractions
237
+ path = [time.strftime("%Y-%m-%d-"),
238
+ title.sub(/\W+$/, '').gsub(/\W+/, '-'),
239
+ ".html.md"].join
240
+
241
+ header = {
242
+ "title" => title,
243
+ "categories" => blog_categories,
244
+ "date" => time,
245
+ }
246
+
247
+ File.open path, "w" do |f|
248
+ f.puts header.to_yaml.gsub(/\s$/, '')
249
+ f.puts "..."
250
+ f.puts
251
+ f.puts body
252
+ end
253
+ end
254
+ end
255
+
210
256
  def generate_email full = nil
211
257
  require 'time'
212
258
 
@@ -19,22 +19,40 @@ class TestHoe < MiniTest::Unit::TestCase
19
19
 
20
20
  def setup
21
21
  Rake.application.clear
22
+
23
+ Hoe.instance_variable_set :@bad_plugins, []
24
+ Hoe.instance_variable_set :@files, nil
25
+ Hoe.instance_variable_set :@found, nil
26
+ Hoe.instance_variable_set :@loaded, nil
27
+
28
+ Hoe.plugin :package
29
+ Hoe.plugin :publish
30
+ Hoe.plugin :test
31
+ end
32
+
33
+ def test_class_bad_plugins
34
+ Hoe.plugin :bogus
35
+
36
+ Hoe.load_plugins
37
+
38
+ assert_equal [:bogus], Hoe.bad_plugins
39
+
40
+ Hoe.load_plugins
41
+
42
+ assert_equal [:bogus], Hoe.bad_plugins
22
43
  end
23
44
 
24
45
  def test_class_load_plugins
25
46
  loaded, = Hoe.load_plugins
26
47
 
27
- assert_includes loaded.keys, :clean
28
- assert_includes loaded.keys, :debug
29
- assert_includes loaded.keys, :deps
48
+ assert_includes loaded.keys, :package
49
+ assert_includes loaded.keys, :publish
50
+ assert_includes loaded.keys, :test
30
51
  end
31
52
 
32
53
  def test_activate_plugins
33
54
  initializers = hoe.methods.grep(/^initialize/).map { |s| s.to_s }
34
55
 
35
- assert_includes initializers, 'initialize_clean'
36
- assert_includes initializers, 'initialize_flay'
37
- assert_includes initializers, 'initialize_flog'
38
56
  assert_includes initializers, 'initialize_package'
39
57
  assert_includes initializers, 'initialize_publish'
40
58
  assert_includes initializers, 'initialize_test'
@@ -105,6 +123,11 @@ class TestHoe < MiniTest::Unit::TestCase
105
123
  ENV['HOME'] = home
106
124
  end
107
125
 
126
+ def test_have_gem_eh
127
+ assert hoe.have_gem? 'rake'
128
+ refute hoe.have_gem? 'nonexistent'
129
+ end
130
+
108
131
  def test_initialize_plugins_hoerc
109
132
  home = ENV['HOME']
110
133
  load_path = $LOAD_PATH.dup
@@ -297,12 +320,12 @@ class TestHoe < MiniTest::Unit::TestCase
297
320
 
298
321
  def test_plugins
299
322
  before = Hoe.plugins.dup
323
+
300
324
  Hoe.plugin :first, :second
301
325
  assert_equal before + [:first, :second], Hoe.plugins
326
+
302
327
  Hoe.plugin :first, :second
303
328
  assert_equal before + [:first, :second], Hoe.plugins
304
- ensure
305
- Hoe.plugins.replace before
306
329
  end
307
330
 
308
331
  def test_read_manifest
@@ -331,7 +354,7 @@ class TestHoe < MiniTest::Unit::TestCase
331
354
  self.version = '1.2.3'
332
355
  developer 'author', 'email'
333
356
 
334
- def sh cmd
357
+ def system cmd
335
358
  cmd
336
359
  end
337
360
  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: 55
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
- - 14
8
+ - 15
9
9
  - 0
10
- version: 2.14.0
10
+ version: 2.15.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-21 00:00:00 Z
39
+ date: 2012-03-01 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
@@ -85,10 +85,10 @@ dependencies:
85
85
  version_requirements: *id003
86
86
  description: |-
87
87
  Hoe is a rake/rubygems helper for project Rakefiles. It helps you
88
- manage and maintain, and release your project and includes a dynamic
88
+ manage, maintain, and release your project and includes a dynamic
89
89
  plug-in system allowing for easy extensibility. Hoe ships with
90
90
  plug-ins for all your usual project tasks including rdoc generation,
91
- testing, packaging, and deployment.
91
+ testing, packaging, deployment, and announcement..
92
92
 
93
93
  See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed
94
94
  below.
@@ -143,7 +143,7 @@ files:
143
143
  - test/test_hoe_gemcutter.rb
144
144
  - test/test_hoe_test.rb
145
145
  - .gemtest
146
- homepage: https://github.com/seattlerb/hoe
146
+ homepage: http://www.zenspider.com/projects/hoe.html
147
147
  licenses: []
148
148
 
149
149
  post_install_message:
metadata.gz.sig CHANGED
Binary file