Sha256: c4313c083ee1f1908b41428681f17c20cc59c21471f7d5daec8e626eaf66d285

Contents?: true

Size: 933 Bytes

Versions: 6

Compression:

Stored size: 933 Bytes

Contents

require 'rubygems/tasks/build/task'

module Gem
  class Tasks
    module Build
      #
      # The `build:zip` task.
      #
      class Zip < Task

        #
        # Initializes the `build:zip` task.
        #
        # @param [Hash] options
        #   Additional options.
        #
        def initialize(options={})
          super()

          yield self if block_given?
          define
        end

        #
        # Defines the `build:zip` task.
        #
        def define
          build_task :zip
        end

        #
        # Builds the `.zip` archive.
        #
        # @param [String] path
        #   The path for the `.zip` archive.
        #
        # @param [Gem::Specification] gemspec
        #   The gemspec to build the archive from.
        #
        # @api semipublic
        #
        def build(path,gemspec)
          run 'zip', '-q', path, *gemspec.files
        end

      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubygems-tasks-0.2.6 lib/rubygems/tasks/build/zip.rb
rubygems-tasks-0.2.5 lib/rubygems/tasks/build/zip.rb
rubygems-tasks-0.2.4 lib/rubygems/tasks/build/zip.rb
rubygems-tasks-0.2.3 lib/rubygems/tasks/build/zip.rb
rubygems-tasks-0.2.2 lib/rubygems/tasks/build/zip.rb
rubygems-tasks-0.2.1 lib/rubygems/tasks/build/zip.rb