Class: Cliffy::Internal::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/cliffy/internal/wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Wrapper

Returns a new instance of Wrapper.



8
9
10
# File 'lib/cliffy/internal/wrapper.rb', line 8

def initialize command
  @command = command
end

Instance Method Details

#command_descriptionObject



16
17
18
# File 'lib/cliffy/internal/wrapper.rb', line 16

def command_description
  @command.description
end

#command_nameObject



12
13
14
# File 'lib/cliffy/internal/wrapper.rb', line 12

def command_name
  @command_name ||= @command.class.to_s.split('::').last.gsub(/([A-Z][a-z]+)([A-Z][a-z]+)/, '\1-\2').downcase
end

#generate_help_data(executable_name) ⇒ Object



24
25
26
# File 'lib/cliffy/internal/wrapper.rb', line 24

def generate_help_data executable_name
  Internal::generate_help_data @command, command_name, executable_name
end

#run(arguments, executable_name) ⇒ Object



28
29
30
# File 'lib/cliffy/internal/wrapper.rb', line 28

def run arguments, executable_name
  Internal::run @command, arguments, command_name, executable_name
end

#validateObject



20
21
22
# File 'lib/cliffy/internal/wrapper.rb', line 20

def validate
  Internal::validate @command
end