Sha256: 5f3baa2d8e77cc51e68d8884a0331fdade4f25fa6c6fa4fc99355518f05d5cf5

Contents?: true

Size: 983 Bytes

Versions: 3

Compression:

Stored size: 983 Bytes

Contents

require 'mattock/tasklib'

module Corundum
  class GemBuilding < Mattock::TaskLib
    setting(:gemspec)
    setting(:package)
    setting(:qa_file)

    def default_configuration(toolkit)
      super
      toolkit.copy_settings_to(self)
    end

    def define
      require 'rubygems/package_task'

      in_namespace do
        package_task = Gem::PackageTask.new(gemspec) do |t|
          t.need_tar_gz = true
          t.need_tar_bz2 = true
          t.package_dir = package.abspath
        end

        task :clobber_package_dir_path do
          rm_rf package_task.package_dir_path
        end

        task :gem => :clobber_package_dir_path
        file package_task.package_dir_path + ".gem" => :clobber_package_dir_path
        file package_task.package_dir_path => :clobber_package_dir_path

        task(:package).prerequisites.each do |package_type|
          file package_type => qa_file
        end
      end

      task :build => in_namespace("gem")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
corundum-0.6.3 lib/corundum/gem_building.rb
corundum-0.6.2 lib/corundum/gem_building.rb
corundum-0.6.1 lib/corundum/gem_building.rb