Sha256: d09672d8e5bb05c693b1d0e02127679afb3c9503553635efa58159158d503dcf

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

# Load the data
require 'data/change_type'
require 'data/commit'
require 'data/configuration'
require 'data/version'

# Load the tools
require 'tools/commits_subdivider'
require 'tools/current_version_loader'
require 'tools/git_utilities'
require 'tools/output'
require 'tools/version_bumper'

# Load the commands
require 'commands/base_command'
require 'commands/changelog'
require 'commands/version'
require 'commands/help'

module GFSM
  # This is the map between each command and its implementation class
  COMMANDS = {
    'version' => -> { GFSM::Commands::Version },
    'changelog' => -> { GFSM::Commands::Changelog }
  }.freeze

  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
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gfsm-0.8.0 lib/gfsm.rb
gfsm-0.7.0 lib/gfsm.rb
gfsm-0.6.0 lib/gfsm.rb
gfsm-0.5.1 lib/gfsm.rb
gfsm-0.5.0 lib/gfsm.rb
gfsm-0.4.1 lib/gfsm.rb
gfsm-0.4.0 lib/gfsm.rb
gfsm-0.3.2 lib/gfsm.rb
gfsm-0.3.1 lib/gfsm.rb