coverband-service-client 0.0.4 → 0.0.5

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
  SHA256:
3
- metadata.gz: cdf5d966461a5a4d802eac4a5923da9788eb8e0cbdbbd173fd33515752c20beb
4
- data.tar.gz: 664829dde80d6db2fc0f174f96ef774141763b38840182e36c1833deb43725f6
3
+ metadata.gz: c222bdf2625345d8c4cf136402c9e2c3731bcfbc4b68f50d34fdd665e92bd733
4
+ data.tar.gz: 81cc0d890f0d74e54f7d72b338f4fdbb8942b12df5290aea10398a90cf791239
5
5
  SHA512:
6
- metadata.gz: 10551756a797a324765787d8cc3bd280a457b61aa51df74b1ed7f8a358082c5100980d37d9e05b8bdd2bf7aa04db930093029cc2954655977d576b78844a1f4a
7
- data.tar.gz: 55120412d18bfe113f6cffa4977888e4967a05e38937301c4383adbd9d3a0b39095b54e7d3b6d803c5be4d405fb4826e0fd81b055b381a6fb2f449068cd10d0c
6
+ metadata.gz: 9b1e498b08fd591b75f0c9e71efe80bbaa7c866e5e53337e590dd9df1b3bf1b17b600e156fd020b0a72fb923561a3b2e6c21aedc2e2bdde21dc736954dbff8de
7
+ data.tar.gz: d3ffa21ae79bfc8571e1c5d5fc6b02ecd92e1c90b899a9f856412617fcc7e47f3ec48f746efa54dd4f45cecfbb66d7dfa4dc3a3f029c84f0e44be772a6d41df9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coverband-service-client (0.0.4)
4
+ coverband-service-client (0.0.5)
5
5
  coverband (~> 4.2.4)
6
6
 
7
7
  GEM
@@ -6,8 +6,6 @@ require 'securerandom'
6
6
  COVERBAND_ENV = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || (defined?(Rails) ? Rails.env : 'unknown')
7
7
  COVERBAND_SERVICE_URL = ENV['COVERBAND_URL'] ||
8
8
  ((COVERBAND_ENV == 'development') ? 'http://127.0.0.1:3456' : 'https://coverband-service.herokuapp.com')
9
- # TODO: This id is still hard coded
10
- COVERBAND_ID = ENV['COVERBAND_ID'] || 'error/set_COVERBAND_ID'
11
9
 
12
10
  module Coverband
13
11
 
@@ -26,14 +24,13 @@ module Coverband
26
24
  # * currently JSON, but likely better to move to something simpler / faster
27
25
  ###
28
26
  class Service < Base
29
- attr_reader :coverband_url, :process_type, :runtime_env, :coverband_id
27
+ attr_reader :coverband_url, :process_type, :runtime_env
30
28
 
31
29
  def initialize(coverband_url, opts = {})
32
30
  super()
33
31
  @coverband_url = coverband_url
34
32
  @process_type = opts.fetch(:process_type) { 'unknown' }
35
33
  @runtime_env = opts.fetch(:runtime_env) { COVERBAND_ENV }
36
- @coverband_id = opts.fetch(:coverband_id) { COVERBAND_ID }
37
34
  end
38
35
 
39
36
  def clear!
@@ -52,7 +49,7 @@ module Coverband
52
49
  # TODO: no longer get by type just get both reports in a single request
53
50
  def coverage(local_type = nil, opts = {})
54
51
  local_type ||= opts.key?(:override_type) ? opts[:override_type] : type
55
- uri = URI("#{coverband_url}/api/coverage/#{coverband_id}?type=#{local_type}")
52
+ uri = URI("#{coverband_url}/api/coverage/#{ENV['COVERBAND_ID']}?type=#{local_type}")
56
53
  req = Net::HTTP::Get.new(uri, 'Content-Type' => 'application/json', 'Coverband-Token' => ENV['COVERBAND_API_KEY'])
57
54
  res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
58
55
  http.request(req)
@@ -73,7 +70,6 @@ module Coverband
73
70
  # TODO: remove timestamps, server will track first_seen
74
71
  data = expand_report(report.dup)
75
72
  full_package = {
76
- coverband_id: coverband_id,
77
73
  collection_type: 'coverage_delta',
78
74
  collection_data: {
79
75
  tags: {
@@ -145,7 +141,6 @@ module Coverband
145
141
  uri = URI("#{COVERBAND_SERVICE_URL}/api/collector")
146
142
  req = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json', 'Coverband-Token' => ENV['COVERBAND_API_KEY'])
147
143
  data = {
148
- coverband_id: COVERBAND_ID,
149
144
  collection_type: 'view_tracker_delta',
150
145
  collection_data: {
151
146
  tags: {
@@ -1,7 +1,7 @@
1
1
  module Coverband
2
2
  module Service
3
3
  module Client
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coverband-service-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mayer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-02-20 00:00:00.000000000 Z
12
+ date: 2020-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler