Class: Pushpop::Github
- Inherits:
-
Step
- Object
- Step
- Pushpop::Github
- Defined in:
- lib/pushpop-github.rb,
lib/pushpop-github/version.rb
Constant Summary collapse
- PLUGIN_NAME =
'github'- VERSION =
'0.1.1'
Instance Attribute Summary collapse
-
#_repository ⇒ Object
Returns the value of attribute _repository.
-
#_user ⇒ Object
Returns the value of attribute _user.
Instance Method Summary collapse
- #configure(last_response = nil, step_responses = nil) ⇒ Object
- #get_repository_from_api ⇒ Object
- #repository(repository) ⇒ Object
- #run(last_response = nil, step_responses = nil) ⇒ Object
- #user(user) ⇒ Object
Instance Attribute Details
#_repository ⇒ Object
Returns the value of attribute _repository.
13 14 15 |
# File 'lib/pushpop-github.rb', line 13 def _repository @_repository end |
#_user ⇒ Object
Returns the value of attribute _user.
12 13 14 |
# File 'lib/pushpop-github.rb', line 12 def _user @_user end |
Instance Method Details
#configure(last_response = nil, step_responses = nil) ⇒ Object
37 38 39 |
# File 'lib/pushpop-github.rb', line 37 def configure(last_response=nil, step_responses=nil) self.instance_exec(last_response, step_responses, &block) end |
#get_repository_from_api ⇒ Object
33 34 35 |
# File 'lib/pushpop-github.rb', line 33 def get_repository_from_api ::Github::Repos.new(:user => self._user, :repo => self._repository).get end |
#repository(repository) ⇒ Object
29 30 31 |
# File 'lib/pushpop-github.rb', line 29 def repository(repository) self._repository = repository end |
#run(last_response = nil, step_responses = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/pushpop-github.rb', line 15 def run(last_response=nil, step_responses=nil) self.configure(last_response, step_responses) if self._user && self._repository get_repository_from_api else raise 'Please set user and repository fields' end end |
#user(user) ⇒ Object
25 26 27 |
# File 'lib/pushpop-github.rb', line 25 def user(user) self._user = user end |