Class: Thin::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/thin/command.rb

Overview

A command that can be runned from a command line script.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(non_options, options) ⇒ Command

Returns a new instance of Command.



21
22
23
24
25
26
27
# File 'lib/thin/command.rb', line 21

def initialize(non_options, options)
  @args = non_options

  options.each do |option, value|
    self.send("#{option}=", value)
  end
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



19
20
21
# File 'lib/thin/command.rb', line 19

def args
  @args
end

Class Method Details

.command_nameObject



29
30
31
# File 'lib/thin/command.rb', line 29

def self.command_name
  self.name.match(/::(\w+)$/)[1].downcase
end

.detailed_helpObject



33
34
35
36
37
38
39
# File 'lib/thin/command.rb', line 33

def self.detailed_help
  <<-EOF
usage: #{File.basename($PROGRAM_NAME)} #{command_name}

#{help}
EOF
end