Sha256: 7d75e2f60c5968c4373956c2256569ca800412c107ffba6b3abe86d9238394c7

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require 'mattock/tasklib'

module Corundum
  class VersionControl < Mattock::CommandTaskLib
    default_namespace :version_control

    required_fields(:gemspec, :build_finished_file, :gemspec_files, :tag)

    def default_configuration(toolkit)
      super
      self.gemspec =  toolkit.gemspec
      self.build_finished_file =  toolkit.build_file.abspath
      self.gemspec_files = toolkit.files.code + toolkit.files.test
      self.tag =  toolkit.gemspec.version.to_s
    end

    def define
      in_namespace do
        task :not_tagged
        task :gemspec_files_added
        task :workspace_committed
        task :is_checked_in => %w{gemspec_files_added workspace_committed}
        task :tag
        task :check_in => :tag
      end

      task :preflight => in_namespace(:not_tagged)
      task :build => in_namespace(:is_checked_in)
      in_namespace(:tag, :check_in).each do |taskname|
        task taskname => build_finished_file
      end
      task :release => in_namespace(:tag, :check_in)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
corundum-0.5.0 lib/corundum/version_control.rb
corundum-0.4.1 lib/corundum/version_control.rb
corundum-0.4.0 lib/corundum/version_control.rb