Class: Gem::Tasks::Build::Zip

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

Overview

The build:zip 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 {|_self| ... } ⇒ Zip

Initializes the build:zip task.

Yields:

  • (_self)

Yield Parameters:



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

def initialize
  super()

  yield self if block_given?
  define
end

Instance Method Details

#build(path, gemspec) ⇒ Object

Builds the .zip archive.

Parameters:

  • path (String)

    The path for the .zip archive.

  • gemspec (Gem::Specification)

    The gemspec to build the archive from.



41
42
43
# File 'lib/rubygems/tasks/build/zip.rb', line 41

def build(path,gemspec)
  run 'zip', '-q', path, *gemspec.files
end

#defineObject

Defines the build:zip task.



26
27
28
# File 'lib/rubygems/tasks/build/zip.rb', line 26

def define
  build_task :zip
end