Class: Docspec::CLI
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
readonly
Returns the value of attribute exit_code.
-
#failed_examples ⇒ Object
readonly
Returns the value of attribute failed_examples.
-
#targets ⇒ Object
readonly
Returns the value of attribute targets.
-
#total_examples ⇒ Object
readonly
Returns the value of attribute total_examples.
Instance Method Summary collapse
-
#initialize(*targets) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(*targets) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 |
# File 'lib/docspec/cli.rb', line 9 def initialize(*targets) targets = ['README.md'] if targets.empty? @targets = targets end |
Instance Attribute Details
#exit_code ⇒ Object (readonly)
Returns the value of attribute exit_code.
7 8 9 |
# File 'lib/docspec/cli.rb', line 7 def exit_code @exit_code end |
#failed_examples ⇒ Object (readonly)
Returns the value of attribute failed_examples.
7 8 9 |
# File 'lib/docspec/cli.rb', line 7 def failed_examples @failed_examples end |
#targets ⇒ Object (readonly)
Returns the value of attribute targets.
7 8 9 |
# File 'lib/docspec/cli.rb', line 7 def targets @targets end |
#total_examples ⇒ Object (readonly)
Returns the value of attribute total_examples.
7 8 9 |
# File 'lib/docspec/cli.rb', line 7 def total_examples @total_examples end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/docspec/cli.rb', line 14 def run @exit_code = 0 @total_examples = 0 @failed_examples = 0 targets.each { |target| run_target target } end |