Class: Pod::Command::Setup::GitHub

Inherits:
Pod::Command::Setup show all
Defined in:
lib/pod/command/setup/github.rb

Overview

The pod search sort subcommand

Class Method Summary collapse

Instance Method Summary collapse

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

.optionsObject



27
28
29
30
31
# File 'lib/pod/command/setup/github.rb', line 27

def self.options
  [
    ["--token", "GitHub OAuth token"],
  ]
end

Instance Method Details

#runObject



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