Class: Wxp::Command

Inherits:
CLAide::Command
  • Object
show all
Defined in:
lib/wxp/command.rb,
lib/wxp/command/op.rb,
lib/wxp/command/say.rb,
lib/wxp/command/op/gems.rb,
lib/wxp/command/op/xcache.rb,
lib/wxp/command/op/gitconf.rb

Overview

< 继承

Direct Known Subclasses

Op, Say

Defined Under Namespace

Classes: Op, Say

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Command

initialize 方法是一个标准的 Ruby 类方法,是类的构造函数



39
40
41
42
43
44
45
46
# File 'lib/wxp/command.rb', line 39

def initialize(argv) 
    super
    
    unless self.ansi_output?
      Colored2.disable!
      String.send(:define_method, :colorize) { |string, _| string }
    end
end

Class Method Details

.optionsObject



27
28
29
30
31
# File 'lib/wxp/command.rb', line 27

def self.options
    [
      ['--silent', 'Show nothing'],
    ].concat(super)
end

.run(argv) ⇒ Object

类方法使用 def self.methodname() 定义



34
35
36
# File 'lib/wxp/command.rb', line 34

def self.run(argv)
    super(argv)
end