hoe 2.9.4 → 2.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,16 @@
1
+ === 2.9.5 / 2011-06-21
2
+
3
+ * 2 minor enhancements:
4
+
5
+ * Extended #dependency to work post-spec creation in case a task wants to add a dep.
6
+
7
+ * 4 bug fixes:
8
+
9
+ * Fixed dependency for :inline plugin.
10
+ * Fixed minor 1.9.3 warnings.
11
+ * Fixed sow to obey gem naming conventions. It no longer munges - to _.
12
+ * Switched hoe deps from >= to ~>.
13
+
1
14
  === 2.9.4 / 2011-04-01
2
15
 
3
16
  * 1 minor enhancement:
data/bin/sow CHANGED
@@ -20,7 +20,7 @@ def check_subdir option
20
20
  end
21
21
  end
22
22
 
23
- opts = OptionParser.new do |opts|
23
+ op = OptionParser.new do |opts|
24
24
  opts.banner = "Usage: sow [options] project_name"
25
25
 
26
26
  opts.separator "Standard options:"
@@ -45,7 +45,7 @@ opts = OptionParser.new do |opts|
45
45
  end
46
46
  end
47
47
 
48
- opts.parse!
48
+ op.parse!
49
49
 
50
50
  include FileUtils::Verbose
51
51
 
@@ -76,10 +76,10 @@ end
76
76
 
77
77
  project = ARGV.shift
78
78
 
79
- abort opts.to_s unless project
79
+ abort op.to_s unless project
80
80
  abort "Project #{project} seems to exist" if test ?d, project
81
81
 
82
- project, file_name, klass = Hoe.normalize_names project
82
+ _, file_name, klass = Hoe.normalize_names project
83
83
 
84
84
  FileUtils.cp_r template_path, project
85
85
 
@@ -95,13 +95,25 @@ Dir.chdir project do
95
95
 
96
96
  warn "erb: #{path}"
97
97
 
98
- File.open path, "w" do |f|
99
- f.puts ERB.new(file).result(binding)
98
+ File.open path, "w" do |io|
99
+ erb = ERB.new file
100
+ erb.filename = path
101
+ io.puts erb.result(binding)
100
102
  end
101
103
  end
102
104
 
103
105
  paths.grep(/file_name|\.erb$/).each do |file|
104
106
  new_file = file.sub(/file_name/, file_name).sub(/\.erb$/, '')
107
+
108
+ # TODO change template to separate a flat filename from a directory
109
+ # filename
110
+ if file =~ /^(bin|test)/ then
111
+ dir, *rest = new_file.split File::SEPARATOR
112
+
113
+ new_file = File.join dir, rest.join('_')
114
+ end
115
+
116
+ FileUtils.mkdir_p File.dirname new_file
105
117
  FileUtils.mv file, new_file
106
118
  end
107
119
  end
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.9.4'
70
+ VERSION = '2.9.5'
71
71
 
72
72
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
73
73
  :publish, :rcov, :gemcutter, :signing, :test]
@@ -261,14 +261,22 @@ class Hoe
261
261
  end
262
262
 
263
263
  ##
264
- # Normalize a project name into the project, file, and klass cases (?!?).
264
+ # Normalize a project name into the project, file, and klass names that
265
+ # follow Ruby package naming guidelines.
265
266
  #
266
- # no, I have no idea how to describe this. Does the thing with the stuff.
267
+ # Project names are lowercase with _ separating package parts and -
268
+ # separating extension parts.
269
+ #
270
+ # File names are lowercase with _ separating pacagke parts and / separating
271
+ # extension parts. net-http-persistent becomes net/http/persistent.
272
+ #
273
+ # Klass names are CamelCase with :: separating extension parts.
267
274
 
268
275
  def self.normalize_names project # :nodoc:
269
- project = project.tr('-', '_').gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
276
+ project = project.gsub(/([A-Z])/, '_\1').downcase.sub(/^_/, '')
270
277
  klass = project.gsub(/(?:^|_)([a-z])/) { $1.upcase }
271
- file_name = project
278
+ klass = klass. gsub(/(?:^|-)([a-z])/) { "::#{$1.upcase}" }
279
+ file_name = project.gsub(/-/, '/')
272
280
 
273
281
  return project, file_name, klass
274
282
  end
@@ -345,15 +353,27 @@ class Hoe
345
353
  # +type+ for developer dependencies.
346
354
 
347
355
  def dependency name, version, type = :runtime
348
- ary = case type
349
- when :runtime then
350
- extra_deps
351
- when :dev, :development, :developer then
352
- extra_dev_deps
353
- else
354
- raise "Unknown dependency type: #{type}"
355
- end
356
- ary << [name, version]
356
+ raise "Unknown dependency type: #{type}" unless
357
+ [:runtime, :dev, :development, :developer].include? type
358
+
359
+ # spec has already been defined. A task wants to add a dependency after.
360
+ if spec then
361
+ msg = if type == :runtime then
362
+ :add_dependency
363
+ else
364
+ :add_development_dependency
365
+ end
366
+
367
+ spec.send msg, name, version
368
+ else
369
+ ary = if type == :runtime then
370
+ extra_deps
371
+ else
372
+ extra_dev_deps
373
+ end
374
+
375
+ ary << [name, version]
376
+ end
357
377
  end
358
378
 
359
379
  ##
@@ -365,11 +385,11 @@ class Hoe
365
385
 
366
386
  case name
367
387
  when 'hoe' then
368
- extra_deps << ['rake', ">= #{RAKEVERSION}"]
369
- when 'rubyforge', 'rake', 'gemcutter' then
388
+ dependency "rake", "~> #{RAKEVERSION}"
389
+ when 'rake', 'minitest' then
370
390
  # avoid circular dependencies for hoe's (potentially) hoe'd dependencies
371
391
  else
372
- extra_dev_deps << ['hoe', ">= #{VERSION}"]
392
+ dependency "hoe", "~> #{VERSION}", :development
373
393
  end
374
394
  end
375
395
 
@@ -422,7 +442,6 @@ class Hoe
422
442
  s.extra_rdoc_files += s.files.grep(/txt$/)
423
443
  s.extra_rdoc_files.reject! { |f| f =~ %r%^(test|spec|vendor|template|data|tmp)/% }
424
444
  s.extra_rdoc_files += @extra_rdoc_files
425
-
426
445
  end
427
446
 
428
447
  unless self.version then
@@ -546,7 +565,7 @@ class Hoe
546
565
 
547
566
  begin
548
567
  send "define_#{plugin}_tasks"
549
- rescue NoMethodError => e
568
+ rescue NoMethodError
550
569
  warn "warning: couldn't activate the #{plugin} plugin, skipping" if
551
570
  Rake.application.options.trace or $DEBUG
552
571
 
data/lib/hoe/compiler.rb CHANGED
@@ -26,7 +26,7 @@ module Hoe::Compiler
26
26
 
27
27
  clean_globs << "lib/#{self.name}/*.{so,bundle,dll}"
28
28
 
29
- extra_dev_deps << ["rake-compiler", "~> 0.7"]
29
+ dependency "rake-compiler", "~> 0.7", :development
30
30
  end
31
31
 
32
32
  ##
data/lib/hoe/deps.rb CHANGED
@@ -70,8 +70,6 @@ module Hoe::Deps
70
70
 
71
71
  desc "Fetch all the dependent gems of this gem into tarballs"
72
72
  task :fetch do
73
- gems = self.get_gems_by_name
74
- gem = gems[self.name]
75
73
  deps = self.dependent_upon self.name
76
74
 
77
75
  mkdir "deps" unless File.directory? "deps"
data/lib/hoe/gemcutter.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'rake'
2
2
 
3
3
  module Hoe::Gemcutter
4
+ include Rake::DSL if defined?(Rake::DSL)
5
+
4
6
  def define_gemcutter_tasks
5
7
  desc "Push gem to gemcutter."
6
8
  task :release_to_gemcutter => [:clean, :package, :release_sanity] do
data/lib/hoe/inline.rb CHANGED
@@ -18,12 +18,16 @@ require 'rbconfig'
18
18
  # +FORCE_PLATFORM+ (instead of default Gem::Platform::CURRENT)
19
19
 
20
20
  module Hoe::Inline
21
+ def initialize_inline
22
+ dependency "RubyInline", "~> 3.9"
23
+
24
+ clean_globs << File.expand_path("~/.ruby_inline")
25
+ end
26
+
21
27
  ##
22
28
  # Define tasks for plugin.
23
29
 
24
30
  def define_inline_tasks
25
- extra_deps << ['RubyInline', "~> 3.8.4"]
26
- clean_globs << File.expand_path("~/.ruby_inline")
27
31
  task :test => :clean
28
32
 
29
33
  if ENV['INLINE'] then
data/lib/hoe/publish.rb CHANGED
@@ -154,7 +154,7 @@ module Hoe::Publish
154
154
  with_config do |config, path|
155
155
  break unless config['blogs']
156
156
 
157
- subject, title, body, urls = announcement
157
+ _, title, body, urls = announcement
158
158
  body += "\n\n#{urls}"
159
159
 
160
160
  config['blogs'].each do |site|
@@ -163,12 +163,12 @@ module Hoe::Publish
163
163
  :description => body,
164
164
  :categories => blog_categories)
165
165
 
166
- result = server.call('metaWeblog.newPost',
167
- site['blog_id'],
168
- site['user'],
169
- site['password'],
170
- content,
171
- true)
166
+ server.call('metaWeblog.newPost',
167
+ site['blog_id'],
168
+ site['user'],
169
+ site['password'],
170
+ content,
171
+ true)
172
172
  end
173
173
  end
174
174
  end
data/lib/hoe/racc.rb CHANGED
@@ -43,7 +43,7 @@ module Hoe::Racc
43
43
  self.racc_flags ||= "-v -l"
44
44
  self.rex_flags ||= "--independent"
45
45
 
46
- extra_dev_deps << ['racc', '~> 1.4.7']
46
+ dependency 'racc', '~> 1.4.7', :development
47
47
  end
48
48
 
49
49
  ##
@@ -3,6 +3,6 @@ History.txt
3
3
  Manifest.txt
4
4
  README.txt
5
5
  Rakefile
6
- bin/<%= project %>
7
- lib/<%= project %>.rb
8
- test/test_<%= project %>.rb
6
+ bin/<%= file_name %>
7
+ lib/<%= file_name %>.rb
8
+ test/test_<%= file_name %>.rb
data/test/test_hoe.rb CHANGED
@@ -147,7 +147,7 @@ class TestHoe < MiniTest::Unit::TestCase
147
147
 
148
148
  deps = spec.dependencies.sort_by { |dep| dep.name }
149
149
 
150
- expected = [["hoe", :development, ">= #{Hoe::VERSION}"]]
150
+ expected = [["hoe", :development, "~> #{Hoe::VERSION}"]]
151
151
 
152
152
  expected << ["rubyforge", :development, ">= #{::RubyForge::VERSION}"] if
153
153
  defined? ::RubyForge
@@ -170,12 +170,12 @@ class TestHoe < MiniTest::Unit::TestCase
170
170
  def test_rename
171
171
  # project, file_name, klass = Hoe.normalize_names 'project_name'
172
172
 
173
- assert_equal %w( word word Word), Hoe.normalize_names('word')
174
- assert_equal %w( word word Word), Hoe.normalize_names('Word')
175
- assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('TwoWords')
176
- assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('twoWords')
177
- assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('two-words')
178
- assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('two_words')
173
+ assert_equal %w( word word Word), Hoe.normalize_names('word')
174
+ assert_equal %w( word word Word), Hoe.normalize_names('Word')
175
+ assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('TwoWords')
176
+ assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('twoWords')
177
+ assert_equal %w(two-words two/words Two::Words), Hoe.normalize_names('two-words')
178
+ assert_equal %w(two_words two_words TwoWords), Hoe.normalize_names('two_words')
179
179
  end
180
180
 
181
181
  def test_nosudo
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: 35
4
+ hash: 33
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 9
9
- - 4
10
- version: 2.9.4
9
+ - 5
10
+ version: 2.9.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,8 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2011-04-01 00:00:00 -07:00
40
- default_executable:
39
+ date: 2011-06-22 00:00:00 Z
41
40
  dependencies:
42
41
  - !ruby/object:Gem::Dependency
43
42
  name: rake
@@ -45,7 +44,7 @@ dependencies:
45
44
  requirement: &id001 !ruby/object:Gem::Requirement
46
45
  none: false
47
46
  requirements:
48
- - - ">="
47
+ - - ~>
49
48
  - !ruby/object:Gem::Version
50
49
  hash: 49
51
50
  segments:
@@ -63,12 +62,12 @@ dependencies:
63
62
  requirements:
64
63
  - - ">="
65
64
  - !ruby/object:Gem::Version
66
- hash: 11
65
+ hash: 3
67
66
  segments:
68
67
  - 2
68
+ - 3
69
69
  - 0
70
- - 2
71
- version: 2.0.2
70
+ version: 2.3.0
72
71
  type: :development
73
72
  version_requirements: *id002
74
73
  description: |-
@@ -131,7 +130,6 @@ files:
131
130
  - test/test_hoe_gemcutter.rb
132
131
  - test/test_hoe_test.rb
133
132
  - .gemtest
134
- has_rdoc: true
135
133
  homepage: http://rubyforge.org/projects/seattlerb/
136
134
  licenses: []
137
135
 
@@ -163,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
161
  requirements: []
164
162
 
165
163
  rubyforge_project: seattlerb
166
- rubygems_version: 1.6.2
164
+ rubygems_version: 1.8.2
167
165
  signing_key:
168
166
  specification_version: 3
169
167
  summary: Hoe is a rake/rubygems helper for project Rakefiles
metadata.gz.sig CHANGED
@@ -1,3 +1 @@
1
- c:E
2
- ��+���x<����|�r��U�`�# .�z�b9��6
3
- <������*��>�1���f;�<E���HaA:k�o��>ܖ��L"ʐ����Bڧ�?����BI�]�#�;z���c�-��V��}W�������{[a ����;��9�qˢX�8)��R�|�M��{оg=x@�50$ɬ6,� i�f0�� dYfeY:7b���-+ONE��O������L۠S25�i��O>�'Z�o֑z
1
+ R�?ص?����z:%�i->��8(�MKS1�%x.��'H%���