Sha256: a60cb9e2ab83621ed0a3a7d243470949e1a71497877da9db4414cf3e9e12a5ee

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

module Spline

  require 'thor'
  Dir["#{File.dirname(__FILE__)}/commands/concrete_commands/*.rb"].each { |file| require_relative file }

  class SplineCli < Thor

    # register(class_name, subcommand_alias, usage_list_string, description_string)

    commands = Spline.constants.select { |c| c.match(/\w+Command/) && Spline.const_get(c).is_a?(Class) }
    commands.each do |command|
      commandClass = Spline.const_get(command)
      register(commandClass, commandClass.alias, commandClass.usage_tip, commandClass.description)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spline-0.0.16 lib/spline/spline_cli.rb