Sha256: 8aab7dc440573b96ee85488adebc27553c5402bdf4d857b2006a12fa92bebd40

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 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_extractor'
require 'tools/commits_subdivider'
require 'tools/current_version_loader'
require 'tools/version_bumper'
require 'tools/output'

# 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

5 entries across 5 versions & 1 rubygems

Version Path
gfsm-0.3.0 lib/gfsm.rb
gfsm-0.2.0 lib/gfsm.rb
gfsm-0.1.4 lib/gfsm.rb
gfsm-0.1.3 lib/gfsm.rb
gfsm-0.1.2 lib/gfsm.rb