Class: Pedant::CommandTest

Inherits:
Command
  • Object
show all
Defined in:
lib/pedant/commands/test.rb

Class Method Summary collapse

Methods inherited from Command

all, banner, find, inherited, initialize!, list, run, usage

Class Method Details

.bindingObject



29
30
31
# File 'lib/pedant/commands/test.rb', line 29

def self.binding
  'test'
end

.helpObject



33
34
35
# File 'lib/pedant/commands/test.rb', line 33

def self.help
  @@optparse.to_s
end

.optparse(options, args) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/pedant/commands/test.rb', line 37

def self.optparse(options, args)
  @@optparse = OptionParser.new do |opts|
    opts.banner = "Usage: pedant [global-options] #{binding} [command-options] [args]"

    opts.separator ""
    opts.separator "Common operations:"

    opts.on('-h', '--help', 'Display this help screen.') do
      puts opts
      exit 1
    end
  end

  @@optparse.order!(args)

  return options, args
end

.run_all(opts, args) ⇒ Object



55
56
57
# File 'lib/pedant/commands/test.rb', line 55

def self.run_all(opts, args)
  Test.initialize!(args)
end