Class: Unixoid::Github
- Inherits:
-
Object
- Object
- Unixoid::Github
- Defined in:
- lib/unixoid/github.rb
Constant Summary collapse
- GITHUB_URL =
'https://api.github.com/user/repos'
- REPO_NAME =
'unixoid_submission'
Class Method Summary collapse
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
- #create_repo ⇒ Object
-
#initialize ⇒ Github
constructor
A new instance of Github.
- #password ⇒ Object
- #username ⇒ Object
Constructor Details
Class Method Details
.create_repo ⇒ Object
15 16 17 |
# File 'lib/unixoid/github.rb', line 15 def self.create_repo new.create_repo end |
Instance Method Details
#authenticated? ⇒ Boolean
32 33 34 |
# File 'lib/unixoid/github.rb', line 32 def authenticated? @response && @response['message'] != "Bad credentials" end |
#create_repo ⇒ Object
19 20 21 22 |
# File 'lib/unixoid/github.rb', line 19 def create_repo parse @runner.run(command, params: {username: username, password: password}) self end |
#password ⇒ Object
28 29 30 |
# File 'lib/unixoid/github.rb', line 28 def password @password ||= ask_for_password end |
#username ⇒ Object
24 25 26 |
# File 'lib/unixoid/github.rb', line 24 def username @username ||= ask_for_username end |