Sha256: b63e320b2456f1b604d39d8d105d98699770682e12b8000bc0c6283ed7759133

Contents?: true

Size: 458 Bytes

Versions: 5

Compression:

Stored size: 458 Bytes

Contents

module SmartMachine
  module Commands
    module MachineCommands
      class SubThor < Thor
        def self.banner(command, namespace = nil, subcommand = false)
          "#{basename} machine #{subcommand_prefix} #{command.usage}"
        end

        def self.subcommand_prefix
          self.name.gsub(%r{.*::}, '').gsub(%r{^[A-Z]}) { |match| match[0].downcase }.gsub(%r{[A-Z]}) { |match| "-#{match[0].downcase}" }
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
smartmachine-1.3.0 lib/smart_machine/commands/machine_commands/sub_thor.rb
smartmachine-1.2.3 lib/smart_machine/commands/machine_commands/sub_thor.rb
smartmachine-1.2.1 lib/smart_machine/commands/machine_commands/sub_thor.rb
smartmachine-1.2.0 lib/smart_machine/commands/machine_commands/sub_thor.rb
smartmachine-1.2.0.dev lib/smart_machine/commands/machine_commands/sub_thor.rb