hoe 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -1,3 +1,14 @@
1
+ === 2.8.0 / 2010-12-08
2
+
3
+ * 6 minor enhancements:
4
+
5
+ * Added PRE=a.1 variable to package and release tasks. (ged)
6
+ * Added compiler plugin to support rake-compiler. (tenderlove)
7
+ * Added known_plugins task and updated included and 3rd party plugins doco
8
+ * Added racc/rex plugin!
9
+ * Extended sow's Rakefile template to dynamically include installed plugins
10
+ * Turned off rubyforge plugin by default. (tenderlove's whining)
11
+
1
12
  === 2.7.0 / 2010-11-15
2
13
 
3
14
  * 2 minor enhancements:
@@ -7,6 +7,7 @@ Rakefile
7
7
  bin/sow
8
8
  lib/hoe.rb
9
9
  lib/hoe/clean.rb
10
+ lib/hoe/compiler.rb
10
11
  lib/hoe/debug.rb
11
12
  lib/hoe/deps.rb
12
13
  lib/hoe/flay.rb
@@ -17,6 +18,7 @@ lib/hoe/inline.rb
17
18
  lib/hoe/newb.rb
18
19
  lib/hoe/package.rb
19
20
  lib/hoe/publish.rb
21
+ lib/hoe/racc.rb
20
22
  lib/hoe/rake.rb
21
23
  lib/hoe/rcov.rb
22
24
  lib/hoe/rubyforge.rb
data/README.txt CHANGED
@@ -150,15 +150,18 @@ Again, this must be done before the Hoe spec, or it won't be useful.
150
150
  === Plug-ins Provided:
151
151
 
152
152
  * Hoe::Clean
153
+ * Hoe::Compiler
153
154
  * Hoe::Debug
154
155
  * Hoe::Deps
155
156
  * Hoe::Flay
156
157
  * Hoe::Flog
158
+ * Hoe::GemPreludeSucks
157
159
  * Hoe::Gemcutter
158
160
  * Hoe::Inline
159
161
  * Hoe::Newb
160
162
  * Hoe::Package
161
163
  * Hoe::Publish
164
+ * Hoe::Racc
162
165
  * Hoe::RCov
163
166
  * Hoe::RubyForge
164
167
  * Hoe::Signing
@@ -166,10 +169,16 @@ Again, this must be done before the Hoe spec, or it won't be useful.
166
169
 
167
170
  === Known 3rd-Party Plugins:
168
171
 
169
- * Hoe::Seattlerb - minitest support, email announcements & perforce branching/validation on release.
170
- * Hoe::Git - git tagging on release, changelogs, and manifest creation.
171
- * Hoe::Doofus - release checklist.
172
- * Hoe::Debugging - for extensions, run your tests with GDB and Valgrind
172
+ * hoe-bundler - Generates a Gemfile based on a Hoe's declared dependencies.
173
+ * hoe-debugging - A Hoe plugin to help you debug your codes.
174
+ * hoe-doofus - A Hoe plugin that helps me keep from messing up gem releases.
175
+ * hoe-gemcutter - Adds gemcutter release automation to Hoe.
176
+ * hoe-gemspec - Generate a prerelease gemspec based on a Hoe spec.
177
+ * hoe-git - A set of Hoe plugins for tighter Git integration.
178
+ * hoe-hg - A Hoe plugin for Mercurial integration.
179
+ * hoe-rubygems - A Hoe plugin with additional RubyGems tasks.
180
+ * hoe-seattlerb - Minitest, email announcements, release branching.
181
+ * hoe-yard - A Hoe plugin for generating YARD documentation.
173
182
 
174
183
  === Writing Plugins:
175
184
 
data/Rakefile CHANGED
@@ -24,6 +24,19 @@ task :plugins do
24
24
  gsub(/module/, '*')
25
25
  end
26
26
 
27
+ task :known_plugins do
28
+ dep = Gem::Dependency.new(/^hoe-/, Gem::Requirement.default)
29
+ fetcher = Gem::SpecFetcher.fetcher
30
+ spec_tuples = fetcher.find_matching dep
31
+
32
+ max = spec_tuples.map { |(tuple, source)| tuple.first.size }.max
33
+
34
+ spec_tuples.each do |(tuple, source)|
35
+ spec = Gem::SpecFetcher.fetcher.fetch_spec(tuple, URI.parse(source))
36
+ puts "* %-#{max}s - %s (%s)" % [spec.name, spec.summary, spec.authors.first]
37
+ end
38
+ end
39
+
27
40
  [:redocs, :docs].each do |t|
28
41
  task t do
29
42
  cp "Hoe.pdf", "doc"
data/lib/hoe.rb CHANGED
@@ -41,10 +41,10 @@ require 'hoe/rake'
41
41
  # == Extending Hoe
42
42
  #
43
43
  # Hoe can be extended via its plugin system. Hoe searches out all
44
- # installed files matching <tt>'hoe/*.rb'</tt> and loads them. Those files are
45
- # expected to define a module matching the file name. The module must
46
- # define a define task method and can optionally define an initialize
47
- # method. Both methods must be named to match the file. eg
44
+ # installed files matching <tt>'hoe/*.rb'</tt> and loads them. Those
45
+ # files are expected to define a module matching the file name. The
46
+ # module must define a define task method and can optionally define an
47
+ # initialize method. Both methods must be named to match the file. eg
48
48
  #
49
49
  # module Hoe::Blah
50
50
  # def initialize_blah # optional
@@ -58,10 +58,10 @@ require 'hoe/rake'
58
58
 
59
59
  class Hoe
60
60
  # duh
61
- VERSION = '2.7.0'
61
+ VERSION = '2.8.0'
62
62
 
63
63
  @@plugins = [:clean, :debug, :deps, :flay, :flog, :newb, :package,
64
- :publish, :rcov, :rubyforge, :gemcutter, :signing, :test]
64
+ :publish, :rcov, :gemcutter, :signing, :test]
65
65
 
66
66
  ##
67
67
  # Used to add extra flags to RUBY_FLAGS.
@@ -0,0 +1,44 @@
1
+ ##
2
+ # rake-compiler plugin for hoe c-extensions.
3
+ #
4
+ # This plugin is for extconf.rb based projects that want to use
5
+ # rake-compiler to deal with packaging binary gems. It expects a
6
+ # standard extconf setup, namely that your extconf.rb and c source is
7
+ # located in: ext/project-name.
8
+ #
9
+ # === Tasks Provided:
10
+ #
11
+ # compile:: Compile your c-extension.
12
+
13
+ module Hoe::Compiler
14
+
15
+ ##
16
+ # Optional: Defines what tasks need to be compile first. [default: test]
17
+
18
+ attr_accessor :compile_tasks
19
+
20
+ ##
21
+ # Initialize variables for compiler plugin.
22
+
23
+ def initialize_compiler
24
+ self.compile_tasks = [:multi, :test]
25
+ self.spec_extras = { :extensions => ["ext/#{self.name}/extconf.rb"] }
26
+
27
+ extra_dev_deps << ["rake-compiler", "~> 0.7"]
28
+ end
29
+
30
+ ##
31
+ # Define tasks for compiler plugin.
32
+
33
+ def define_compiler_tasks
34
+ require "rake/extensiontask"
35
+
36
+ Rake::ExtensionTask.new self.name, spec do |ext|
37
+ ext.lib_dir = File.join(*["lib", self.name, ENV["FAT_DIR"]].compact)
38
+ end
39
+
40
+ compile_tasks.each do |t|
41
+ task t => :compile
42
+ end
43
+ end
44
+ end
File without changes
@@ -38,6 +38,8 @@ module Hoe::Package
38
38
 
39
39
  def define_package_tasks
40
40
  Gem::PackageTask.new spec do |pkg|
41
+ prerelease_version
42
+
41
43
  pkg.need_tar = @need_tar
42
44
  pkg.need_zip = @need_zip
43
45
  end
@@ -47,13 +49,14 @@ module Hoe::Package
47
49
  install_gem Dir['pkg/*.gem'].first
48
50
  end
49
51
 
50
- desc 'Package and upload the release.'
52
+ desc 'Package and upload; Requires VERSION=x.y.z (optional PRE=a.1)'
51
53
  task :release => [:prerelease, :release_to, :postrelease]
52
54
 
53
55
  # no doco, invisible hook
54
56
  task :prerelease do
55
- abort "Fix your version before you release" if
56
- spec.version.version =~ /borked/
57
+ prerelease_version
58
+
59
+ abort "Fix your version before you release" if spec.version =~ /borked/
57
60
  end
58
61
 
59
62
  # no doco, invisible hook
@@ -79,4 +82,15 @@ module Hoe::Package
79
82
  version = "--version '#{version}'" if version
80
83
  sh "#{sudo}#{gem_cmd} install #{local} #{name} #{version}"
81
84
  end
85
+
86
+ def prerelease_version # :nodoc:
87
+ pre = ENV['PRERELEASE'] || ENV['PRE']
88
+ if pre then
89
+ spec.version.version << "." << pre if pre
90
+
91
+ abort "ERROR: You should format PRE like pre or alpha.1 or something" if
92
+ (Gem::VERSION < "1.4" and pre !~ /^[a-z]+(\.\d+)?$/) or
93
+ (Gem::VERSION >= "1.4" and pre !~ /^[a-z]+(\.?\d+)?$/)
94
+ end
95
+ end
82
96
  end
@@ -0,0 +1,91 @@
1
+ ##
2
+ # Racc plugin for hoe.
3
+ #
4
+ # === Tasks Provided:
5
+ #
6
+ # lexer :: Generate lexers for all .rex files in your Manifest.txt.
7
+ # parser :: Generate parsers for all .y files in your Manifest.txt.
8
+ # .y -> .rb rule :: Generate a parser using racc.
9
+ # .rex -> .rb rule :: Generate a lexer using rexical.
10
+
11
+ module Hoe::Racc
12
+
13
+ ##
14
+ # Optional: Defines what tasks need to generate parsers/lexers first.
15
+ #
16
+ # Defaults to [:multi, :test, :check_manifest]
17
+ #
18
+ # If you have extra tasks that require your parser/lexer to be
19
+ # built, add their names here in your hoe spec. eg:
20
+ #
21
+ # racc_tasks << :debug
22
+
23
+ attr_accessor :racc_tasks
24
+
25
+ ##
26
+ # Optional: Defines what flags to use for racc. default: "-v -l"
27
+
28
+ attr_accessor :racc_flags
29
+
30
+ ##
31
+ # Optional: Defines what flags to use for rex. default: "--independent"
32
+
33
+ attr_accessor :rex_flags
34
+
35
+ ##
36
+ # Initialize variables for racc plugin.
37
+
38
+ def initialize_racc
39
+ self.racc_tasks = [:multi, :test, :check_manifest]
40
+
41
+ # -v = verbose
42
+ # -l = no-line-convert (they don't ever line up anyhow)
43
+ self.racc_flags ||= "-v -l"
44
+ self.rex_flags ||= "--independent"
45
+
46
+ extra_dev_deps << ['racc', '~> 1.4.7']
47
+ end
48
+
49
+ ##
50
+ # Define tasks for racc plugin
51
+
52
+ def define_racc_tasks
53
+ racc_files = self.spec.files.find_all { |f| f =~ /\.y$/ }
54
+ rex_files = self.spec.files.find_all { |f| f =~ /\.rex$/ }
55
+
56
+ parser_files = racc_files.map { |f| f.sub(/\.y$/, ".rb") }
57
+ lexer_files = rex_files.map { |f| f.sub(/\.rex$/, ".rb") }
58
+
59
+ self.clean_globs += parser_files
60
+ self.clean_globs += lexer_files
61
+
62
+ rule ".rb" => ".y" do |t|
63
+ begin
64
+ sh "racc #{racc_flags} -o #{t.name} #{t.source}"
65
+ rescue
66
+ abort "need racc, sudo gem install racc"
67
+ end
68
+ end
69
+
70
+ rule ".rb" => ".rex" do |t|
71
+ begin
72
+ sh "rex #{rex_flags} -o #{t.name} #{t.source}"
73
+ rescue
74
+ abort "need rexical, sudo gem install rexical"
75
+ end
76
+ end
77
+
78
+ desc "build the parser" unless parser_files.empty?
79
+ task :parser
80
+
81
+ desc "build the lexer" unless lexer_files.empty?
82
+ task :lexer
83
+
84
+ task :parser => parser_files
85
+ task :lexer => lexer_files
86
+
87
+ racc_tasks.each do |t|
88
+ task t => [:parser, :lexer]
89
+ end
90
+ end
91
+ end
@@ -1,5 +1,3 @@
1
- require 'rubyforge'
2
-
3
1
  ##
4
2
  # RubyForge plugin for hoe.
5
3
  #
@@ -21,6 +19,8 @@ module Hoe::RubyForge
21
19
 
22
20
  desc 'Release to rubyforge.'
23
21
  task :release_to_rubyforge => [:clean, :package, :release_sanity] do
22
+ require 'rubyforge'
23
+
24
24
  rf = RubyForge.new.configure
25
25
  puts "Logging in"
26
26
  rf.login
@@ -3,7 +3,17 @@
3
3
  require 'rubygems'
4
4
  require 'hoe'
5
5
 
6
+ <%=
7
+ found = Gem.find_files("hoe/*.rb").map { |f| File.basename(f, ".rb").to_sym }
8
+ extra = found - Hoe.plugins - [:rake]
9
+ extra.map { |name| "# Hoe.plugin #{name.inspect}" }.sort.join("\n")
10
+ %>
11
+
6
12
  Hoe.spec '<%= project %>' do
13
+ # HEY! If you fill these out in ~/.hoe_template/Rakefile.erb then
14
+ # you'll never have to touch them again!
15
+ # (delete this comment too, of course)
16
+
7
17
  # developer('<%= XIF %>', '<%= XIF %>@example.com')
8
18
 
9
19
  # self.rubyforge_name = '<%= project %>x' # if different than '<%= project %>'
metadata CHANGED
@@ -4,37 +4,44 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 2
7
- - 7
7
+ - 8
8
8
  - 0
9
- version: 2.7.0
9
+ version: 2.8.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ryan Davis
13
13
  autorequire:
14
14
  bindir: bin
15
- cert_chain: []
15
+ cert_chain:
16
+ - |
17
+ -----BEGIN CERTIFICATE-----
18
+ MIIDPjCCAiagAwIBAgIBADANBgkqhkiG9w0BAQUFADBFMRMwEQYDVQQDDApyeWFu
19
+ ZC1ydWJ5MRkwFwYKCZImiZPyLGQBGRYJemVuc3BpZGVyMRMwEQYKCZImiZPyLGQB
20
+ GRYDY29tMB4XDTA5MDMwNjE4NTMxNVoXDTEwMDMwNjE4NTMxNVowRTETMBEGA1UE
21
+ AwwKcnlhbmQtcnVieTEZMBcGCgmSJomT8ixkARkWCXplbnNwaWRlcjETMBEGCgmS
22
+ JomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALda
23
+ b9DCgK+627gPJkB6XfjZ1itoOQvpqH1EXScSaba9/S2VF22VYQbXU1xQXL/WzCkx
24
+ taCPaLmfYIaFcHHCSY4hYDJijRQkLxPeB3xbOfzfLoBDbjvx5JxgJxUjmGa7xhcT
25
+ oOvjtt5P8+GSK9zLzxQP0gVLS/D0FmoE44XuDr3iQkVS2ujU5zZL84mMNqNB1znh
26
+ GiadM9GHRaDiaxuX0cIUBj19T01mVE2iymf9I6bEsiayK/n6QujtyCbTWsAS9Rqt
27
+ qhtV7HJxNKuPj/JFH0D2cswvzznE/a5FOYO68g+YCuFi5L8wZuuM8zzdwjrWHqSV
28
+ gBEfoTEGr7Zii72cx+sCAwEAAaM5MDcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAw
29
+ HQYDVR0OBBYEFEfFe9md/r/tj/Wmwpy+MI8d9k/hMA0GCSqGSIb3DQEBBQUAA4IB
30
+ AQAY59gYvDxqSqgC92nAP9P8dnGgfZgLxP237xS6XxFGJSghdz/nI6pusfCWKM8m
31
+ vzjjH2wUMSSf3tNudQ3rCGLf2epkcU13/rguI88wO6MrE0wi4ZqLQX+eZQFskJb/
32
+ w6x9W1ur8eR01s397LSMexySDBrJOh34cm2AlfKr/jokKCTwcM0OvVZnAutaovC0
33
+ l1SVZ0ecg88bsWHA0Yhh7NFxK1utWoIhtB6AFC/+trM0FQEB/jZkIS8SaNzn96Rl
34
+ n0sZEf77FLf5peR8TP/PtmIg7Cyqz23sLM4mCOoTGIy5OcZ8TdyiyINUHtb5ej/T
35
+ FBHgymkyj/AOSqKRIpXPhjC6
36
+ -----END CERTIFICATE-----
16
37
 
17
- date: 2010-11-15 00:00:00 -08:00
38
+ date: 2010-12-08 00:00:00 -08:00
18
39
  default_executable:
19
40
  dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rubyforge
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 2
29
- - 0
30
- - 4
31
- version: 2.0.4
32
- type: :runtime
33
- version_requirements: *id001
34
41
  - !ruby/object:Gem::Dependency
35
42
  name: rake
36
43
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
44
+ requirement: &id001 !ruby/object:Gem::Requirement
38
45
  requirements:
39
46
  - - ">="
40
47
  - !ruby/object:Gem::Version
@@ -44,11 +51,11 @@ dependencies:
44
51
  - 7
45
52
  version: 0.8.7
46
53
  type: :runtime
47
- version_requirements: *id002
54
+ version_requirements: *id001
48
55
  - !ruby/object:Gem::Dependency
49
56
  name: minitest
50
57
  prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
58
+ requirement: &id002 !ruby/object:Gem::Requirement
52
59
  requirements:
53
60
  - - ">="
54
61
  - !ruby/object:Gem::Version
@@ -58,7 +65,7 @@ dependencies:
58
65
  - 0
59
66
  version: 2.0.0
60
67
  type: :development
61
- version_requirements: *id003
68
+ version_requirements: *id002
62
69
  description: |-
63
70
  Hoe is a rake/rubygems helper for project Rakefiles. It helps you
64
71
  manage and maintain, and release your project and includes a dynamic
@@ -90,6 +97,7 @@ files:
90
97
  - bin/sow
91
98
  - lib/hoe.rb
92
99
  - lib/hoe/clean.rb
100
+ - lib/hoe/compiler.rb
93
101
  - lib/hoe/debug.rb
94
102
  - lib/hoe/deps.rb
95
103
  - lib/hoe/flay.rb
@@ -100,6 +108,7 @@ files:
100
108
  - lib/hoe/newb.rb
101
109
  - lib/hoe/package.rb
102
110
  - lib/hoe/publish.rb
111
+ - lib/hoe/racc.rb
103
112
  - lib/hoe/rake.rb
104
113
  - lib/hoe/rcov.rb
105
114
  - lib/hoe/rubyforge.rb
@@ -0,0 +1 @@
1
+ #