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.
11 12 13 14 15 16 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 11 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.
9 10 11 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 9 def attributes @attributes end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
9 10 11 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 9 def logger @logger end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
9 10 11 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 9 def project @project end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
9 10 11 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 9 def repo @repo end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/txgh-server/webhooks/github/push_handler.rb', line 18 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') updater = Txgh::ResourceUpdater.new(project, repo, logger) categories = { 'author' => attributes. } added_and_modified_resources.each do |resource| updater.update_resource(resource, categories) end end respond_with(200, true) end |