Hoe::Package

Package plugin for hoe.

Tasks Provided:

install_gem

Install the package as a gem.

release

Package and upload the release.

Attributes

need_tar[RW]

Optional: Should package create a tarball? [default: true]

need_zip[RW]

Optional: Should package create a zipfile? [default: false]

Public Instance Methods

define_package_tasks() click to toggle source

Define tasks for plugin.

    # File lib/hoe/package.rb, line 39
39:   def define_package_tasks
40:     Gem::PackageTask.new spec do |pkg|
41:       pkg.need_tar = @need_tar
42:       pkg.need_zip = @need_zip
43:     end
44: 
45:     desc 'Install the package as a gem.'
46:     task :install_gem => [:clean, :package, :check_extra_deps] do
47:       install_gem Dir['pkg/*.gem'].first
48:     end
49: 
50:     desc 'Package and upload the release.'
51:     task :release => [:prerelease, :release_to, :postrelease]
52: 
53:     # no doco, invisible hook
54:     task :prerelease do
55:       abort "Fix your version before you release" if
56:         spec.version.version =~ /borked/
57:     end
58: 
59:     # no doco, invisible hook
60:     task :release_to
61: 
62:     # no doco, invisible hook
63:     task :postrelease
64: 
65:     desc "Sanity checks for release"
66:     task :release_sanity do
67:       v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
68:       abort "Versions don't match #{v} vs #{version}" if v != version
69:     end
70:   end
initialize_package() click to toggle source

Initialize variables for plugin.

    # File lib/hoe/package.rb, line 31
31:   def initialize_package
32:     self.need_tar ||= true
33:     self.need_zip ||= false
34:   end
install_gem(name, version = nil) click to toggle source

Install the named gem.

    # File lib/hoe/package.rb, line 75
75:   def install_gem name, version = nil
76:     gem_cmd = Gem.default_exec_format % 'gem'
77:     sudo    = 'sudo '                  unless Hoe::WINDOZE
78:     local   = '--local'                unless version
79:     version = "--version '#{version}'" if     version
80:     sh "#{sudo}#{gem_cmd} install #{local} #{name} #{version}"
81:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.