Class: CukeCIWorkers::Notifier

Inherits:
Worker
  • Object
show all
Defined in:
lib/cuke_ci_workers/notifier.rb

Instance Attribute Summary

Attributes inherited from Worker

#logger

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server_url, log_file_name, log_level = nil) ⇒ Notifier

Returns a new instance of Notifier.



12
13
14
15
# File 'lib/cuke_ci_workers/notifier.rb', line 12

def initialize(server_url, log_file_name, log_level = nil)
  super(log_file_name, log_level)
  @server_uri = URI.parse(server_url)
end

Class Method Details

.parse!(args) ⇒ Object



75
76
77
# File 'lib/cuke_ci_workers/notifier.rb', line 75

def parse!(args)
  Notifier.new(*args)
end

Instance Method Details

#post_commitObject



17
18
19
20
21
22
# File 'lib/cuke_ci_workers/notifier.rb', line 17

def post_commit
  json = generate_json_for_head
  push_json(json)
rescue Exception => e
  log_exception(e)
end

#post_reveive(before_rev, after_rev, ref) ⇒ Object



24
25
26
27
28
29
# File 'lib/cuke_ci_workers/notifier.rb', line 24

def post_reveive(before_rev, after_rev, ref)
  json = generate_json(before_rev, after_rev, ref)
  push_json(json)
rescue Exception => e
  log_exception(e)
end