Class: Pod::Command::Setup::GitHub
- Inherits:
-
Pod::Command::Setup
- Object
- Pod::Command::Setup
- Pod::Command::Setup::GitHub
- Defined in:
- lib/pod/command/setup/github.rb
Overview
The pod search sort subcommand
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ GitHub
constructor
A new instance of GitHub.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ GitHub
Returns a new instance of GitHub.
22 23 24 25 |
# File 'lib/pod/command/setup/github.rb', line 22 def initialize(argv) super @token = argv.option('token') end |
Class Method Details
.options ⇒ Object
27 28 29 30 31 |
# File 'lib/pod/command/setup/github.rb', line 27 def self. [ ["--token", "GitHub OAuth token"], ] end |
Instance Method Details
#run ⇒ Object
38 39 40 41 42 43 |
# File 'lib/pod/command/setup/github.rb', line 38 def run SortedSearch::Credentials.token = @token puts puts SortedSearch::Credentials.token.green + " token saved to OS X keychain".green puts end |
#validate! ⇒ Object
33 34 35 36 |
# File 'lib/pod/command/setup/github.rb', line 33 def validate! help! "GitHub token is required" unless @token super end |