Sha256: ec4771d2f0e990df76633fd13f97ac2680ff101082591e0425386d50e2520617

Contents?: true

Size: 908 Bytes

Versions: 20

Compression:

Stored size: 908 Bytes

Contents

require 'lino'
require_relative 'base'
require_relative 'mixins/environment'

module RubyFly
  module Commands
    class GetPipeline < Base
      include Mixins::Environment

      def configure_command(builder, opts)
        builder = super(builder, opts)

        missing_params = [
            :target,
            :pipeline
        ].select { |param| opts[param].nil? }

        unless missing_params.empty?
          description = missing_params.map { |p| "'#{p}'" }.join(', ')
          raise(
              ArgumentError,
              "Error: #{description} required but not provided.")
        end

        target = opts[:target]
        pipeline = opts[:pipeline]

        builder
            .with_subcommand('get-pipeline') do |sub|
              sub = sub.with_option('-t', target)
              sub = sub.with_option('-p', pipeline)
              sub
            end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ruby_fly-0.38.0.pre.2 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.38.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.37.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.36.0.pre.5 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.36.0.pre.4 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.36.0.pre.3 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.36.0.pre.2 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.36.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.35.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.34.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.33.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.32.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.31.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.30.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.29.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.28.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.27.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.26.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.25.0 lib/ruby_fly/commands/get_pipeline.rb
ruby_fly-0.24.0.pre.1 lib/ruby_fly/commands/get_pipeline.rb