Class: GithubHook::Updater
- Inherits:
-
Object
- Object
- GithubHook::Updater
- Defined in:
- app/services/github_hook/updater.rb
Constant Summary collapse
- GIT_BIN =
Redmine::Configuration['scm_git_command'] || "git"
Instance Attribute Summary collapse
-
#logger ⇒ Object
writeonly
Sets the attribute logger.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(payload, params = {}) ⇒ Updater
constructor
A new instance of Updater.
Constructor Details
#initialize(payload, params = {}) ⇒ Updater
Returns a new instance of Updater.
7 8 9 10 |
# File 'app/services/github_hook/updater.rb', line 7 def initialize(payload, params = {}) @payload = payload @params = params end |
Instance Attribute Details
#logger=(value) ⇒ Object
Sets the attribute logger
5 6 7 |
# File 'app/services/github_hook/updater.rb', line 5 def logger=(value) @logger = value end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/services/github_hook/updater.rb', line 12 def call repositories = find_repositories repositories.each do |repository| tg1 = Time.now # Fetch the changes from Github update_repository(repository) tg2 = Time.now tr1 = Time.now # Fetch the new changesets into Redmine repository.fetch_changesets tr2 = Time.now logger.info { " GithubHook: Redmine repository updated: #{repository.identifier} (Git: #{time_diff_milli(tg1,tg2)}ms, Redmine: #{time_diff_milli(tr1,tr2)}ms)" } end end |