Sha256: f7cbd8ce39bf6db29068d75d66ff2157bbdbea18272b9e5c1e66552d5d298fea

Contents?: true

Size: 452 Bytes

Versions: 10

Compression:

Stored size: 452 Bytes

Contents

module SmartMachine
  module Commands
    module GridCommands
      class SubThor < Thor
        def self.banner(command, namespace = nil, subcommand = false)
          "#{basename} grid #{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

10 entries across 10 versions & 1 rubygems

Version Path
smartmachine-1.3.0 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.2.3 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.2.1 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.2.0 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.2.0.dev lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.1.1 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.1.0 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.0.1 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-1.0.0 lib/smart_machine/commands/grid_commands/sub_thor.rb
smartmachine-0.9.0 lib/smart_machine/commands/grid_commands/sub_thor.rb