Class: GitHealthCheck::Cli::Application
- Inherits:
-
Object
- Object
- GitHealthCheck::Cli::Application
- Defined in:
- lib/git-health-check/cli/application.rb
Constant Summary collapse
- SUCCESS =
0
- ERROR =
1
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv) ⇒ Application
constructor
A new instance of Application.
- #output(text) ⇒ Object
- #report_success ⇒ Object
Constructor Details
#initialize(argv) ⇒ Application
Returns a new instance of Application.
9 10 11 12 |
# File 'lib/git-health-check/cli/application.rb', line 9 def initialize(argv) @options = GitHealthCheck::Cli::Options.new(argv) @status = SUCCESS end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/git-health-check/cli/application.rb', line 14 def execute begin cmd = @options.parse cmd.execute(self) rescue Exception => error $stderr.puts "Error: #{error}" @status = ERROR end @status end |
#output(text) ⇒ Object
25 26 27 |
# File 'lib/git-health-check/cli/application.rb', line 25 def output(text) print text end |
#report_success ⇒ Object
29 30 31 |
# File 'lib/git-health-check/cli/application.rb', line 29 def report_success @status end |