Sha256: 1c974bc685dbc2e97aaf736a06bd07aeb9eb7fd6d20b70d2fad5273f71be7745

Contents?: true

Size: 578 Bytes

Versions: 5

Compression:

Stored size: 578 Bytes

Contents

module GemRelease
  module CommandOptions
    def initialize(*args)
      @arguments = ''
      super
    end

    def option(key, short, description)
      options = self.class::OPTIONS
      default = options[key]

      if String === default
        long = "--#{key} #{key.to_s.upcase}"
        args = [short, long, String, "#{description} (defaults to #{default})"]
      else
        long = "--[no-]#{key}"
        args = [short, long, "#{description} (defaults to #{default})"]
      end

      add_option(*args) { |value, options| options[key] = value }
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gem-release-0.0.13 lib/gem_release/command_options.rb
gem-release-0.0.12 lib/gem_release/command_options.rb
gem-release-0.0.11 lib/gem_release/command_options.rb
gem-release-0.0.10 lib/gem_release/command_options.rb
gem-release-0.0.9 lib/gem_release/command_options.rb