class Thor::PackageTask
def initialize(gemspec, opts = {})
def initialize(gemspec, opts = {}) super(:package, "build a gem package") @spec = gemspec @opts = {:dir => File.join(Dir.pwd, "pkg")}.merge(opts) end
def run
def run FileUtils.mkdir_p(@opts[:dir]) Gem::Builder.new(spec).build FileUtils.mv(spec.file_name, File.join(@opts[:dir], spec.file_name)) end