hoe 2.0.0 → 2.1.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
data/History.txt CHANGED
@@ -1,3 +1,17 @@
1
+ === 2.1.0 / 2009-06-14
2
+
3
+ * 6 minor enhancements:
4
+
5
+ * Added File::read_utf to strip out UTF BOM marker. Fixes nokogiri. (tenderlove)
6
+ * Now using the minitest plugin.
7
+ * Refactored :release task to facilitate other plugins.
8
+ * Version intuiting now only bombs on packaging, allowing check_manifest.
9
+ * release now has prerelease, postrelease deps.
10
+
11
+ * 1 bug fix:
12
+
13
+ * Fixed version intuiting to allow for beta versions (eg, 1.2.3.beta.4)
14
+
1
15
  === 2.0.0 / 2009-06-02
2
16
 
3
17
  * 3 major enhancements:
data/Rakefile CHANGED
@@ -1,20 +1,14 @@
1
1
  # -*- ruby -*-
2
2
 
3
- $: << 'lib'
4
-
5
3
  require './lib/hoe.rb'
6
4
 
7
- # TODO:
8
- # Hoe.plugin :perforce
9
- # Hoe.plugin :minitest
10
-
11
- Hoe.add_include_dirs("../../minitest/dev/lib")
5
+ Hoe.plugin :perforce
6
+ Hoe.plugin :minitest
12
7
 
13
8
  Hoe.spec "hoe" do
14
9
  developer "Ryan Davis", "ryand-ruby@zenspider.com"
15
10
 
16
11
  self.rubyforge_name = "seattlerb"
17
- self.testlib = :minitest
18
12
 
19
13
  blog_categories << "Seattle.rb" << "Ruby"
20
14
 
data/lib/hoe.rb CHANGED
@@ -69,7 +69,7 @@ end
69
69
 
70
70
  class Hoe
71
71
  # duh
72
- VERSION = '2.0.0'
72
+ VERSION = '2.1.0'
73
73
 
74
74
  ##
75
75
  # Used to add extra flags to RUBY_FLAGS.
@@ -219,6 +219,7 @@ class Hoe
219
219
  loaded = {}
220
220
 
221
221
  Gem.find_files("hoe/*.rb").each do |plugin|
222
+ warn plugin if $DEBUG
222
223
  name = File.basename plugin
223
224
  next if loaded[name]
224
225
  begin
@@ -316,7 +317,7 @@ class Hoe
316
317
  s.homepage = Array(url).first
317
318
  s.rubyforge_project = rubyforge_name
318
319
  s.description = description
319
- s.files = File.read("Manifest.txt").split(/\r?\n\r?/)
320
+ s.files = File.read_utf("Manifest.txt").split(/\r?\n\r?/)
320
321
  s.executables = s.files.grep(/^bin/) { |f| File.basename(f) }
321
322
  s.bindir = "bin"
322
323
  s.require_paths = dirs unless dirs.empty?
@@ -360,14 +361,17 @@ class Hoe
360
361
 
361
362
  spec.files.each do |file|
362
363
  next unless File.exist? file
363
- version = File.read(file)[/VERSION = ([\"\'])([\d\.]+)\1/, 2]
364
+ version = File.read(file)[/VERSION = ([\"\'])([\d][\d\w\.]+)\1/, 2]
364
365
  break if version
365
366
  end
366
367
 
367
- spec.version = self.version = version
368
- end
368
+ spec.version = self.version = version if version
369
369
 
370
- raise "Need version" unless self.version
370
+ unless self.version then
371
+ spec.version = self.version = "0.borked"
372
+ warn "Add 'VERSION = \"x.y.z\"' to your code or fix your hoe spec"
373
+ end
374
+ end
371
375
  end
372
376
 
373
377
  ##
@@ -418,7 +422,7 @@ class Hoe
418
422
  # Intuit values from the readme and history files.
419
423
 
420
424
  def intuit_values
421
- readme = File.read(readme_file).split(/^(=+ .*)$/)[1..-1] rescue ''
425
+ readme = File.read_utf(readme_file).split(/^(=+ .*)$/)[1..-1] rescue ''
422
426
  unless readme.empty? then
423
427
  sections = readme.map { |s|
424
428
  s =~ /^=/ ? s.strip.downcase.chomp(':').split.last : s.strip
@@ -435,7 +439,7 @@ class Hoe
435
439
  end
436
440
 
437
441
  self.changes ||= begin
438
- h = File.read(history_file)
442
+ h = File.read_utf(history_file)
439
443
  h.split(/^(===.*)/)[1..2].join.strip
440
444
  rescue
441
445
  missing history_file
@@ -448,6 +452,7 @@ class Hoe
448
452
 
449
453
  def load_plugin_tasks
450
454
  self.class.plugins.each do |plugin|
455
+ warn plugin if $DEBUG
451
456
  send "define_#{plugin}_tasks"
452
457
  end
453
458
  end
@@ -474,7 +479,7 @@ class Hoe
474
479
  # summary, *description = p.paragraphs_of('README.txt', 3, 3..8)
475
480
 
476
481
  def paragraphs_of path, *paragraphs
477
- File.read(path).delete("\r").split(/\n\n+/).values_at(*paragraphs)
482
+ File.read_utf(path).delete("\r").split(/\n\n+/).values_at(*paragraphs)
478
483
  end
479
484
 
480
485
  ##
@@ -530,3 +535,10 @@ class Hoe
530
535
 
531
536
  Hoe.load_plugins
532
537
  end
538
+
539
+ class File
540
+ # Like File::read, but strips out a BOM marker if it exists.
541
+ def self.read_utf path
542
+ File.read(path).sub(/\A\xEF\xBB\xBF/, '')
543
+ end
544
+ end
data/lib/hoe/package.rb CHANGED
@@ -32,6 +32,8 @@ module Hoe::Package
32
32
 
33
33
  def define_package_tasks
34
34
  Rake::GemPackageTask.new spec do |pkg|
35
+ abort "Fix your version before you release" if
36
+ spec.version.version =~ /borked/
35
37
  pkg.need_tar = @need_tar
36
38
  pkg.need_zip = @need_zip
37
39
  end
@@ -41,26 +43,36 @@ module Hoe::Package
41
43
  install_gem Dir['pkg/*.gem'].first
42
44
  end
43
45
 
44
- desc 'Package and upload the release to rubyforge.'
45
- task :release => [:clean, :package] do |t|
46
+ desc 'Package and upload the release.'
47
+ task :release => [:prerelease, :release_to, :postrelease]
48
+
49
+ # no doco, invisible hook
50
+ task :prerelease
51
+
52
+ # no doco, invisible hook
53
+ task :release_to => :release_to_rubyforge
54
+
55
+ # no doco, invisible hook
56
+ task :postrelease
57
+
58
+ desc "Sanity checks for release"
59
+ task :release_sanity do
46
60
  v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
47
61
  abort "Versions don't match #{v} vs #{version}" if v != version
48
- pkg = "pkg/#{name}-#{version}"
49
-
50
- if $DEBUG then
51
- puts "release_id = rf.add_release #{rubyforge_name.inspect}, #{name.inspect}, #{version.inspect}, \"#{pkg}.tgz\""
52
- puts "rf.add_file #{rubyforge_name.inspect}, #{name.inspect}, release_id, \"#{pkg}.gem\""
53
- end
62
+ end
54
63
 
64
+ desc 'Release to rubyforge.'
65
+ task :release_to_rubyforge => [:clean, :package, :release_sanity] do
55
66
  rf = RubyForge.new.configure
56
67
  puts "Logging in"
57
68
  rf.login
58
69
 
59
70
  c = rf.userconfig
60
- c["release_notes"] = description if description
61
- c["release_changes"] = changes if changes
62
- c["preformatted"] = true
71
+ c["release_notes"] = description if description
72
+ c["release_changes"] = changes if changes
73
+ c["preformatted"] = true
63
74
 
75
+ pkg = "pkg/#{name}-#{version}"
64
76
  files = [(@need_tar ? "#{pkg}.tgz" : nil),
65
77
  (@need_zip ? "#{pkg}.zip" : nil),
66
78
  "#{pkg}.gem"].compact
data/test/test_hoe.rb CHANGED
@@ -41,6 +41,8 @@ class TestHoe < MiniTest::Unit::TestCase
41
41
  publish_docs
42
42
  rcov
43
43
  release
44
+ release_sanity
45
+ release_to_rubyforge
44
46
  ridocs
45
47
  test
46
48
  test_deps)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -30,7 +30,7 @@ cert_chain:
30
30
  FBHgymkyj/AOSqKRIpXPhjC6
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-06-02 00:00:00 -07:00
33
+ date: 2009-06-14 00:00:00 -07:00
34
34
  default_executable:
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.4
54
+ version: 0.8.7
55
55
  version:
56
56
  description: |-
57
57
  Hoe is a rake/rubygems helper for project Rakefiles. It helps generate
metadata.gz.sig CHANGED
Binary file