Class: Gem::Commands::LintCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/rubygems/commands/lint_command.rb

Instance Method Summary collapse

Constructor Details

#initializeLintCommand

Returns a new instance of LintCommand.



17
18
19
20
21
22
23
# File 'lib/rubygems/commands/lint_command.rb', line 17

def initialize
  super 'lint', description

  add_option('-d', '--detailed', 'Display detailed output') do |value, opts|
    options[:detailed] = true
  end
end

Instance Method Details

#argumentsObject

:nodoc:



9
10
11
# File 'lib/rubygems/commands/lint_command.rb', line 9

def arguments # :nodoc:
  "GEM       built gem to check"
end

#descriptionObject

:nodoc:



5
6
7
# File 'lib/rubygems/commands/lint_command.rb', line 5

def description # :nodoc:
  'Check a gem file for common mistakes and errors'
end

#executeObject



25
26
27
28
29
30
31
32
33
# File 'lib/rubygems/commands/lint_command.rb', line 25

def execute
  runner = GemLint::Runner.new(get_one_gem_name)

  if options[:detailed]
    detailed_output(runner)
  else
    simple_output(runner)
  end
end

#usageObject

:nodoc:



13
14
15
# File 'lib/rubygems/commands/lint_command.rb', line 13

def usage # :nodoc:
  "#{program_name} GEM"
end