event-reporting-handler 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b8b1093b7a2635891eef96d1ebf225c4756e164
4
- data.tar.gz: 7ad04c62d51fc21bf60b0ca3bb59e48213244a9b
3
+ metadata.gz: 5d5765a39877a792875797aaca1801edeef9c7e2
4
+ data.tar.gz: f65fd0c4149d7d741aeb4a50c2cee6415850352f
5
5
  SHA512:
6
- metadata.gz: d0e3c8060f0b2821ff053111d38a7c34ca446ce911df6bf76bf411dae788d34041d939ce351cc2358d746b862c19418a5101378731c29f5389e221b1a73ede0d
7
- data.tar.gz: 8efb048fb46ffbda573a68b402be8c0962cdd214941be270483b86941e4f3d0125c8f580de2f523a972e329eb9a0c76de991ce06be923b87dacf4a39f4e74bbd
6
+ metadata.gz: c3d8ae76d4f609e95b750e71ad21aad9e08d8524fa15a7b2758c71ddba8a23e2f82e572bf38ca9aada790511e443c1390c1667881553fda3e5080353154359f1
7
+ data.tar.gz: e57d1e8fe8b73cac442f39c0d45e2bdffda0d3aca51f5042d75274fd0f087457351301b3c6d750f6de357f30d58b01c608fc7ebcebdf6180723c7474fd3bca2b
@@ -29,7 +29,7 @@ module BloombergLP
29
29
  end
30
30
 
31
31
  # Called at the end a successful Chef run.
32
- def run_completed(node)
32
+ def run_completed(_node)
33
33
  publish_event(:run_completed)
34
34
  end
35
35
 
@@ -57,7 +57,7 @@ module BloombergLP
57
57
  evt.id
58
58
  end
59
59
 
60
- def publish_event(event, custom_attributes)
60
+ def publish_event(event, custom_attributes = {})
61
61
  json_to_publish = get_json_from_event(event, custom_attributes)
62
62
  uri = URI(@http_url)
63
63
  res = Net::HTTP.start(uri.host, uri.port) do |http|
@@ -72,8 +72,8 @@ module BloombergLP
72
72
  end
73
73
 
74
74
  def get_json_from_event(event, custom_attributes)
75
- event = { deploy_event: { node_fqdn: @node_fqdn, sub_type: event, occurred_at: Time.now.to_s } }
76
- event.merge(custom_attributes).to_json
75
+ deploy_event = { node_fqdn: @node_fqdn, sub_type: event, occurred_at: Time.now.to_s }.merge(custom_attributes)
76
+ { deploy_event: deploy_event }.to_json
77
77
  end
78
78
  end
79
79
  end
@@ -4,6 +4,6 @@
4
4
  #
5
5
  module BloombergLP
6
6
  module EventReportingHandler
7
- VERSION = '0.1.9'
7
+ VERSION = '0.1.10'
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event-reporting-handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shahul Khajamohideen