Sha256: a6667ba3d15a255402bcc3d07bd6b7d6be05b0c8eb319977a54f4f5a1e16ebe4

Contents?: true

Size: 930 Bytes

Versions: 7

Compression:

Stored size: 930 Bytes

Contents

require 'rubygems/tasks/build/task'

require 'set'

module Gem
  class Tasks
    module Build
      #
      # The `build:tar` task.
      #
      class Tar < Task

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

          yield self if block_given?
          define
        end

        #
        # Defines the `build:tar` task.
        #
        def define
          build_task :tar, 'tar.gz'
        end

        #
        # Builds a `.tar.gz` archive.
        #
        # @param [String] path
        #   The path for the `.tar.gz` archive.
        #
        # @param [Gem::Specification] gemspec
        #   The gemspec to generate the archive from.
        #
        def build(path,gemspec)
          run 'tar', 'czf', path, *gemspec.files
        end

      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubygems-tasks-0.2.0 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.2 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.1 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.0 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.0.pre3 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.0.pre2 lib/rubygems/tasks/build/tar.rb
rubygems-tasks-0.1.0.pre1 lib/rubygems/tasks/build/tar.rb