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-0.9.16 lib/capper/utils/multistage.rb
capper-0.9.15 lib/capper/utils/multistage.rb
capper-0.9.14 lib/capper/utils/multistage.rb
capper-0.9.13 lib/capper/utils/multistage.rb
capper-0.9.12 lib/capper/utils/multistage.rb
capper-0.9.11 lib/capper/utils/multistage.rb
capper-0.9.10 lib/capper/utils/multistage.rb
capper-0.9.9 lib/capper/utils/multistage.rb
capper-0.9.8 lib/capper/utils/multistage.rb
capper-0.9.7 lib/capper/utils/multistage.rb
capper-0.9.6 lib/capper/utils/multistage.rb
capper-0.9.5 lib/capper/utils/multistage.rb
capper-0.9.4 lib/capper/utils/multistage.rb
capper-0.9.3 lib/capper/utils/multistage.rb
capper-0.9.2 lib/capper/utils/multistage.rb
capper-0.9.1 lib/capper/utils/multistage.rb
capper-0.9.0 lib/capper/utils/multistage.rb
capper-0.8.3 lib/capper/utils/multistage.rb