Sha256: 3e90699036d591bd7d13fb36b2bd9e9b8303be159bcfa859518df5147ec50862

Contents?: true

Size: 569 Bytes

Versions: 38

Compression:

Stored size: 569 Bytes

Contents

module Capper
  module Utils
    module Multistage

      def stage(name, &block)
        stages = fetch(:stages, [])

        if stages.include?(name)
          abort "Multiple stages with the same name are not allowed"
        end

        namespace :multistage do
          task(name, {}, &block)
        end

        desc "Set the target stage to `#{name}'."
        task(name) do
          set(:current_stage, name.to_sym)
          find_and_execute_task("multistage:#{name}")
        end

        set(:stages, [stages, name].flatten)
      end

    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
capper-2.0.0.rc2 lib/capper/utils/multistage.rb
capper-2.0.0.rc1 lib/capper/utils/multistage.rb
capper-2.0.0.pre3 lib/capper/utils/multistage.rb
capper-2.0.0.pre2 lib/capper/utils/multistage.rb
capper-2.0.0.pre1 lib/capper/utils/multistage.rb
capper-1.2.4 lib/capper/utils/multistage.rb
capper-1.2.3 lib/capper/utils/multistage.rb
capper-1.2.2 lib/capper/utils/multistage.rb
capper-1.2.1 lib/capper/utils/multistage.rb
capper-1.2.0 lib/capper/utils/multistage.rb
capper-1.1.0 lib/capper/utils/multistage.rb
capper-1.0.1 lib/capper/utils/multistage.rb
capper-1.0.0 lib/capper/utils/multistage.rb
capper-0.9.23 lib/capper/utils/multistage.rb
capper-0.9.22 lib/capper/utils/multistage.rb
capper-0.9.21 lib/capper/utils/multistage.rb
capper-0.9.20 lib/capper/utils/multistage.rb
capper-0.9.19 lib/capper/utils/multistage.rb
capper-0.9.18 lib/capper/utils/multistage.rb
capper-0.9.17 lib/capper/utils/multistage.rb