Module: GFSM

Defined in:
lib/tools/output.rb,
lib/gfsm.rb,
lib/data/commit.rb,
lib/data/version.rb,
lib/commands/help.rb,
lib/commands/version.rb,
lib/data/change_type.rb,
lib/commands/changelog.rb,
lib/data/configuration.rb,
lib/tools/git_utilities.rb,
lib/tools/version_bumper.rb,
lib/commands/base_command.rb,
lib/tools/commits_subdivider.rb,
lib/tools/current_version_loader.rb

Overview

frozen_stirng_literal: true

Defined Under Namespace

Modules: Commands, Data, Output, Tools

Constant Summary collapse

COMMANDS =

This is the map between each command and its implementation class

{
  'version' => -> { GFSM::Commands::Version },
  'changelog' => -> { GFSM::Commands::Changelog }
}.freeze

Class Method Summary collapse

Class Method Details

.mainObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gfsm.rb', line 29

def self.main
  subcommand = ARGV.shift

  exit(COMMANDS[subcommand].call.new.run(ARGV)) if COMMANDS.key?(subcommand)

  case subcommand
  when /-{0,2}help/, '-h', nil
    GFSM::Commands::Help.new.run(ARGV)
  else
    GFSM::Output.warn "#{subcommand} is not a GFSM command."

    GFSM::Output.info "See 'gfsm help' for more detail."
    false
  end
end