Class: Gem::Tasks::Release

Inherits:
Task
  • Object
show all
Defined in:
lib/rubygems/tasks/release.rb

Overview

The release task.

Constant Summary

Constants included from Printing

Printing::ANSI_BRIGHT, Printing::ANSI_CLEAR, Printing::ANSI_GREEN, Printing::ANSI_RED, Printing::ANSI_YELLOW, Printing::DEBUG_PREFIX, Printing::ERROR_PREFIX, Printing::STATUS_PREFIX

Instance Attribute Summary

Attributes inherited from Task

#project

Instance Method Summary collapse

Methods inherited from Task

#bundle, #gem, #gemspec_tasks, #invoke, #namespaced_tasks, #run, #task?

Methods included from Printing

#debug, #error, #status

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Release

Initializes the release task.

Parameters:

  • options (Hash) (defaults to: {})

    Additional options for the release task.

Yields:

  • (_self)

Yield Parameters:



16
17
18
19
20
21
# File 'lib/rubygems/tasks/release.rb', line 16

def initialize(options={})
  super()

  yield self if block_given?
  define
end

Instance Method Details

#defineObject

Defines the release task.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/rubygems/tasks/release.rb', line 26

def define
  @project.gemspecs.each_key do |name|
    task :release => [
      "build:#{name}",
      'scm:tag',
      'scm:push',
      "push:#{name}",
      "sign:#{name}"
    ].select { |name| task?(name) }
  end

  desc "Performs a release"
  task :release => [
    :build,
    'scm:tag',
    'scm:push',
    :push,
    :sign
  ].select { |name| task?(name) }
end