multiforecast-client 0.80.0.1 → 0.80.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/VERSION +1 -1
- data/lib/multiforecast/client.rb +2 -1
- data/spec/multiforecast/client_spec.rb +27 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e05fb5d0476e998fd94384fcada44dad95b49c90
|
4
|
+
data.tar.gz: e2c8e233d42d092ebcc31e4fe417c912607202fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dec979c161addb240c65b1b687d0c4c7d9b2adb1b7a4f3daf33342b3832de4cff128dac61297b456c699d3b568efd0b61028b7b60362a66de134cb35c5583b2
|
7
|
+
data.tar.gz: c02f71a74c95572b54bfd1a73a002ba5a7efd10daa98e6af0226e0fe6671bfc71e6808a502289983010ca10cc82efd9b632bd6a800d985bee30f91a6d317bcca
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.80.0.
|
1
|
+
0.80.0.2
|
data/lib/multiforecast/client.rb
CHANGED
@@ -19,7 +19,7 @@ module MultiForecast
|
|
19
19
|
mapping = opts['mapping'] || { '' => 'http://localhost:5125' }
|
20
20
|
# remove heading / of path
|
21
21
|
mapping.each {|key, val| @mapping[lstrip(key, '/')] = val }
|
22
|
-
@short_metrics = opts['short_metrics'] || true
|
22
|
+
@short_metrics = opts['short_metrics'].nil? || opts['short_metrics'] # default true
|
23
23
|
|
24
24
|
@clients = {}
|
25
25
|
@base_uris = {}
|
@@ -31,6 +31,7 @@ module MultiForecast
|
|
31
31
|
@clients[path] = GrowthForecast::Client.new(base_uri)
|
32
32
|
@base_uris[path] = out_uri || base_uri
|
33
33
|
end
|
34
|
+
self.debug_dev = opts['debug_dev'] if opts['debug_dev']
|
34
35
|
end
|
35
36
|
|
36
37
|
# set the `debug_dev` attribute of HTTPClient
|
@@ -20,9 +20,33 @@ describe MultiForecast::Client do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
context "
|
24
|
-
|
25
|
-
|
23
|
+
context "options" do
|
24
|
+
context "debug_dev" do
|
25
|
+
context 'default' do
|
26
|
+
subject { MultiForecast::Client.new('mapping' => {'app1/' => 'http://localhost:5125'}) }
|
27
|
+
it { expect(subject.debug_dev).to be_nil }
|
28
|
+
end
|
29
|
+
|
30
|
+
context 'STDOUT' do
|
31
|
+
subject { MultiForecast::Client.new('mapping' => {'app1/' => 'http://localhost:5125'}, 'debug_dev' => STDOUT) }
|
32
|
+
it { expect(subject.debug_dev).to eql(STDOUT) }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
context "short_metrics" do
|
37
|
+
context 'default' do
|
38
|
+
subject { MultiForecast::Client.new('mapping' => {'app1/' => 'http://localhost:5125'}) }
|
39
|
+
it { expect(subject.short_metrics).to eql(true) }
|
40
|
+
end
|
41
|
+
context 'false' do
|
42
|
+
subject { MultiForecast::Client.new('mapping' => {'app1/' => 'http://localhost:5125'}, 'short_metrics' => false) }
|
43
|
+
it { expect(subject.short_metrics).to eql(false) }
|
44
|
+
end
|
45
|
+
context 'true' do
|
46
|
+
subject { MultiForecast::Client.new('mapping' => {'app1/' => 'http://localhost:5125'}, 'short_metrics' => true) }
|
47
|
+
it { expect(subject.short_metrics).to eql(true) }
|
48
|
+
end
|
49
|
+
end
|
26
50
|
end
|
27
51
|
|
28
52
|
context "#list_graph" do
|