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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/coverband-service-client.rb +2 -7
- data/lib/coverband/service/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c222bdf2625345d8c4cf136402c9e2c3731bcfbc4b68f50d34fdd665e92bd733
|
4
|
+
data.tar.gz: 81cc0d890f0d74e54f7d72b338f4fdbb8942b12df5290aea10398a90cf791239
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1e498b08fd591b75f0c9e71efe80bbaa7c866e5e53337e590dd9df1b3bf1b17b600e156fd020b0a72fb923561a3b2e6c21aedc2e2bdde21dc736954dbff8de
|
7
|
+
data.tar.gz: d3ffa21ae79bfc8571e1c5d5fc6b02ecd92e1c90b899a9f856412617fcc7e47f3ec48f746efa54dd4f45cecfbb66d7dfa4dc3a3f029c84f0e44be772a6d41df9
|
data/Gemfile.lock
CHANGED
@@ -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
|
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/#{
|
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: {
|
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
|
+
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-
|
12
|
+
date: 2020-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|