Class: Give::User
Overview
Give::User
Essentially a github user, relies on username and token existing in gitconfig help.github.com/set-your-user-name-email-and-github-token/
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#login ⇒ Object
Returns the value of attribute login.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #configure ⇒ Object
- #github ⇒ Object
- #github_login ⇒ Object
- #github_token ⇒ Object
-
#initialize(endpoint = github) ⇒ User
constructor
A new instance of User.
Methods included from Commands
Constructor Details
#initialize(endpoint = github) ⇒ User
Returns a new instance of User.
114 115 116 117 |
# File 'lib/give.rb', line 114 def initialize(endpoint=github) @login, @token, @endpoint = github_login, github_token, endpoint configure end |
Instance Attribute Details
#endpoint ⇒ Object
Returns the value of attribute endpoint.
113 114 115 |
# File 'lib/give.rb', line 113 def endpoint @endpoint end |
#login ⇒ Object
Returns the value of attribute login.
113 114 115 |
# File 'lib/give.rb', line 113 def login @login end |
#token ⇒ Object
Returns the value of attribute token.
113 114 115 |
# File 'lib/give.rb', line 113 def token @token end |
Instance Method Details
#configure ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/give.rb', line 119 def configure Octokit.configure do |conf| conf.login = login conf.token = token conf.endpoint = endpoint end end |
#github ⇒ Object
127 128 129 |
# File 'lib/give.rb', line 127 def github "https://github.com" end |
#github_login ⇒ Object
131 132 133 |
# File 'lib/give.rb', line 131 def github_login git('config --get-all github.user') end |
#github_token ⇒ Object
135 136 137 |
# File 'lib/give.rb', line 135 def github_token git('config --get-all github.token') end |