Class: GithubStats::CLI
- Inherits:
-
Object
- Object
- GithubStats::CLI
- Defined in:
- lib/github_stats/cli.rb
Overview
Main entrance point to the command line tool. Sets defaults and parses options etc.
Defined Under Namespace
Classes: CommaSeperatedLinePerResultResultsView
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#search_string ⇒ Object
Returns the value of attribute search_string.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(remaining_args, options) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(remaining_args, options) ⇒ CLI
Returns a new instance of CLI.
11 12 13 14 15 16 17 |
# File 'lib/github_stats/cli.rb', line 11 def initialize(remaining_args, ) @search_string = remaining_args.join(' ') [:database_url] ||= "sqlite://#{home_dir}/db.sqlite" [:report_type] ||= 'issues_closed_by_week' [:ingest] = true unless .key?(:ingest) @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/github_stats/cli.rb', line 9 def @options end |
#search_string ⇒ Object
Returns the value of attribute search_string.
9 10 11 |
# File 'lib/github_stats/cli.rb', line 9 def search_string @search_string end |
Class Method Details
.run(search_string, options) ⇒ Object
5 6 7 |
# File 'lib/github_stats/cli.rb', line 5 def self.run(search_string, ) new(search_string, ).run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 |
# File 'lib/github_stats/cli.rb', line 19 def run setup_db ingest results end |