Sha256: 356d43330a8cd2091047d66826e2fba9d0f7ca1339fa219efb941e374669559c

Contents?: true

Size: 935 Bytes

Versions: 36

Compression:

Stored size: 935 Bytes

Contents

class Ufo::CLI
  class Opts
    def initialize(cli)
      @cli = cli
    end

    def yes
      with_cli_scope do
        option :yes, aliases: :y, type: :boolean, desc: "Bypass are you sure prompt"
      end
    end

    def docker
      with_cli_scope do
        option :docker, type: :boolean, default: true, desc: "Skip docker build"
      end
    end

    # Based on https://github.com/rails/thor/blob/ab3b5be455791f4efb79f0efb4f88cc6b59c8ccf/lib/thor/actions.rb#L48
    def runtime_options
      with_cli_scope do
        option :force, :type => :boolean, :aliases => "-f", :group => :runtime,
                             :desc => "Overwrite files that already exist"

        option :skip, :type => :boolean, :aliases => "-s", :group => :runtime,
                            :desc => "Skip files that already exist"
      end
    end

  private
    def with_cli_scope(&block)
      @cli.instance_eval(&block)
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ufo-6.3.13 lib/ufo/cli/opts.rb
ufo-6.3.12 lib/ufo/cli/opts.rb
ufo-6.3.11 lib/ufo/cli/opts.rb
ufo-6.3.10 lib/ufo/cli/opts.rb
ufo-6.3.9 lib/ufo/cli/opts.rb
ufo-6.3.8 lib/ufo/cli/opts.rb
ufo-6.3.7 lib/ufo/cli/opts.rb
ufo-6.3.6 lib/ufo/cli/opts.rb
ufo-6.3.5 lib/ufo/cli/opts.rb
ufo-6.3.4 lib/ufo/cli/opts.rb
ufo-6.3.3 lib/ufo/cli/opts.rb
ufo-6.3.2 lib/ufo/cli/opts.rb
ufo-6.3.1 lib/ufo/cli/opts.rb
ufo-6.3.0 lib/ufo/cli/opts.rb
ufo-6.2.5 lib/ufo/cli/opts.rb
ufo-6.2.4 lib/ufo/cli/opts.rb
ufo-6.2.3 lib/ufo/cli/opts.rb
ufo-6.2.2 lib/ufo/cli/opts.rb
ufo-6.2.1 lib/ufo/cli/opts.rb
ufo-6.2.0 lib/ufo/cli/opts.rb