timberline 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/lib/timberline/config.rb +2 -2
- data/lib/timberline/version.rb +1 -1
- data/spec/config/test_config.yaml +2 -0
- data/spec/lib/timberline/config_spec.rb +17 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e1df2f3cc18ce504f11aec22b955a5ff6b92884
|
4
|
+
data.tar.gz: 94879a8342807a14a3ac4d5072c90eaa7c6f4f88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b8859df734695a2c6550b8130a1a79df7c47eb50b412b85800a112231f44844b40c370a4dd9413fdf4c566ae7540c2bbf0411289deb908f41a574f008f27f62
|
7
|
+
data.tar.gz: 5c03733de228b0a3f5573ab32fdf2442d6a689e2de8e041f14e92c8e6aa10d30f8a185794f803d87f107eaf94c70b827eecec75365aa6d8dd2d8696b7c09df4e
|
data/CHANGELOG
CHANGED
data/lib/timberline/config.rb
CHANGED
@@ -105,7 +105,7 @@ class Timberline
|
|
105
105
|
@password = uri.password
|
106
106
|
|
107
107
|
params = uri.query.nil? ? {} : CGI.parse(uri.query)
|
108
|
-
%w(timeout namespace).each do |setting|
|
108
|
+
%w(timeout namespace stat_timeout max_retries).each do |setting|
|
109
109
|
next unless params.key?(setting)
|
110
110
|
instance_variable_set("@#{setting}", convert_if_int(params[setting][0]))
|
111
111
|
end
|
@@ -119,7 +119,7 @@ class Timberline
|
|
119
119
|
|
120
120
|
def load_from_yaml(yaml_config)
|
121
121
|
fail "Missing yaml configs!" if yaml_config.nil?
|
122
|
-
%w(database host port timeout password namespace sentinels).each do |setting|
|
122
|
+
%w(database host port timeout password namespace sentinels stat_timeout max_retries).each do |setting|
|
123
123
|
instance_variable_set("@#{setting}", yaml_config[setting])
|
124
124
|
end
|
125
125
|
end
|
data/lib/timberline/version.rb
CHANGED
@@ -4,7 +4,7 @@ describe Timberline::Config do
|
|
4
4
|
describe "newly created" do
|
5
5
|
context "when the TIMBERLINE_URL env var is defined" do
|
6
6
|
before do
|
7
|
-
ENV["TIMBERLINE_URL"] = "redis://:apassword@ahostname:9000/3?timeout=666&namespace=foobar&sentinel=sentinel1:1&sentinel=sentinel2:2"
|
7
|
+
ENV["TIMBERLINE_URL"] = "redis://:apassword@ahostname:9000/3?timeout=666&namespace=foobar&sentinel=sentinel1:1&sentinel=sentinel2:2&max_retries=99&stat_timeout=12"
|
8
8
|
end
|
9
9
|
|
10
10
|
after do
|
@@ -35,6 +35,14 @@ describe Timberline::Config do
|
|
35
35
|
expect(subject.namespace).to eq("foobar")
|
36
36
|
end
|
37
37
|
|
38
|
+
it "loads the stat_timeout from the env var" do
|
39
|
+
expect(subject.stat_timeout).to eq(12)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "loads the max_retries from the env var" do
|
43
|
+
expect(subject.max_retries).to eq(99)
|
44
|
+
end
|
45
|
+
|
38
46
|
it "loads the sentinel servers" do
|
39
47
|
expect(subject.sentinels).to eq([
|
40
48
|
{ "host" => "sentinel1", "port" => 1 },
|
@@ -69,6 +77,14 @@ describe Timberline::Config do
|
|
69
77
|
expect(subject.password).to eq("foo")
|
70
78
|
end
|
71
79
|
|
80
|
+
it "loads the max_retries from the config file" do
|
81
|
+
expect(subject.max_retries).to eq(1212)
|
82
|
+
end
|
83
|
+
|
84
|
+
it "loads the stat_timeout from the config file" do
|
85
|
+
expect(subject.stat_timeout).to eq(1313)
|
86
|
+
end
|
87
|
+
|
72
88
|
it "loads the database from the config file" do
|
73
89
|
expect(subject.database).to eq(3)
|
74
90
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timberline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tommy Morgan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|