Class: GithubPolyglot::CLI
- Inherits:
-
Object
- Object
- GithubPolyglot::CLI
- Defined in:
- lib/github_polyglot/cli.rb
Overview
Class for the command-line interface
Constant Summary collapse
- FORMAT_OPTIONS =
%i[print json pretty-json svg].freeze
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
-
#run ⇒ Object
Runs the CLI.
Constructor Details
#initialize ⇒ CLI
Returns a new instance of CLI.
11 12 13 |
# File 'lib/github_polyglot/cli.rb', line 11 def initialize parser.parse! end |
Instance Method Details
#run ⇒ Object
Runs the CLI
16 17 18 19 20 21 22 23 |
# File 'lib/github_polyglot/cli.rb', line 16 def run Dotenv.load token = ENV.fetch(GithubPolyglot::TOKEN_ENV_VAR, nil) token = nil if token&.empty? @polyglot = GithubPolyglot.new(username: @username, token: token) output_format end |