Module: CreateRubyGem::Options::Catalog

Defined in:
lib/create_ruby_gem/options/catalog.rb

Overview

Registry of every bundle gem option create-ruby-gem knows about.

Each entry in DEFINITIONS describes the option’s type and CLI flags. ORDER controls the sequence in which the wizard presents options.

See Also:

Constant Summary collapse

DEFINITIONS =

Option definitions keyed by symbolic name.

Each value is a Hash with :type and the relevant flag keys (:on/:off for toggles, :flag for enums/strings, etc.).

Returns:

  • (Hash{Symbol => Hash})
{
  exe: { type: :toggle, on: '--exe', off: '--no-exe' },
  coc: { type: :toggle, on: '--coc', off: '--no-coc' },
  changelog: { type: :toggle, on: '--changelog', off: '--no-changelog' },
  ext: { type: :enum, flag: '--ext', none: '--no-ext', values: %w[c go rust] },
  git: { type: :flag, on: '--git' },
  github_username: { type: :string, flag: '--github-username' },
  mit: { type: :toggle, on: '--mit', off: '--no-mit' },
  test: { type: :enum, flag: '--test', none: '--no-test', values: %w[minitest rspec test-unit] },
  ci: { type: :enum, flag: '--ci', none: '--no-ci', values: %w[circle github gitlab] },
  linter: { type: :enum, flag: '--linter', none: '--no-linter', values: %w[rubocop standard] },
  edit: { type: :string, flag: '--edit' },
  bundle_install: { type: :toggle, on: '--bundle', off: '--no-bundle' }
}.freeze
ORDER =

Wizard step order — matches the sequence users see.

Returns:

  • (Array<Symbol>)
DEFINITIONS.keys.freeze

Class Method Summary collapse

Class Method Details

.fetch(key) ⇒ Hash

Fetches the definition for a given option key.

Parameters:

  • key (Symbol, String)

Returns:

  • (Hash)

    the option definition

Raises:

  • (KeyError)

    if the key is unknown



44
45
46
# File 'lib/create_ruby_gem/options/catalog.rb', line 44

def self.fetch(key)
  DEFINITIONS.fetch(key.to_sym)
end