Class: TxghServer::Webhooks::Github::PushHandler
- Inherits:
-
Object
- Object
- TxghServer::Webhooks::Github::PushHandler
- Includes:
- ResponseHelpers
- Defined in:
- lib/txgh-server/webhooks/github/push_handler.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, repo, logger, attributes) ⇒ PushHandler
constructor
A new instance of PushHandler.
Constructor Details
#initialize(project, repo, logger, attributes) ⇒ PushHandler
Returns a new instance of PushHandler.
13 14 15 16 17 18 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 13 def initialize(project, repo, logger, attributes) @project = project @repo = repo @logger = logger @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
11 12 13 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 11 def attributes @attributes end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
11 12 13 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 11 def logger @logger end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
11 12 13 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 11 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
11 12 13 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 11 def repo @repo end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 20 def execute # Check if the branch in the hook data is the configured branch we want logger.info("request github branch: #{branch}") logger.info("config github branch: #{repo.github_config_branch}") if should_process? logger.info('found branch in github request') pusher.push_resources(added_and_modified_resources) do |tx_resource| # block should return categories for the passed-in resource { 'author' => attributes. } end update_github_status end respond_with(200, true) end |