timberline 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5dcba7d76edc4b00c7060cfa2c01e7df38700912
4
- data.tar.gz: f3dad3c3080a4c35db3f91f2b8b599f008039bf7
3
+ metadata.gz: 8e1df2f3cc18ce504f11aec22b955a5ff6b92884
4
+ data.tar.gz: 94879a8342807a14a3ac4d5072c90eaa7c6f4f88
5
5
  SHA512:
6
- metadata.gz: 03b760d6e84c72d91884ee18f87fa797577839f16e495148c144144780adfeab120e8bb2ffb4661eec4d51d1e4dbc06e14a0faab6cef95400712a3c3a6fbb2d0
7
- data.tar.gz: 3cbb508700948108bbabd33e1e24e0f98189ae06545047dec89479cb9e3266aeb7b9116bae2fd6c931434722b77cd5e81b91c21df54c869412174ca1f3f20d7f
6
+ metadata.gz: 4b8859df734695a2c6550b8130a1a79df7c47eb50b412b85800a112231f44844b40c370a4dd9413fdf4c566ae7540c2bbf0411289deb908f41a574f008f27f62
7
+ data.tar.gz: 5c03733de228b0a3f5573ab32fdf2442d6a689e2de8e041f14e92c8e6aa10d30f8a185794f803d87f107eaf94c70b827eecec75365aa6d8dd2d8696b7c09df4e
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.8.4
2
+ - Allow stat_timeout and max_retries to be set from config
1
3
  0.8.3
2
4
  - Add support for configuring via env var
3
5
  - Add support for Redis sentinels
@@ -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
@@ -1,4 +1,4 @@
1
1
  class Timberline
2
2
  # The current canonical version for Timberline.
3
- VERSION = "0.8.3"
3
+ VERSION = "0.8.4"
4
4
  end
@@ -4,6 +4,8 @@ timeout: 10
4
4
  password: foo
5
5
  database: 3
6
6
  namespace: treecurve
7
+ max_retries: 1212
8
+ stat_timeout: 1313
7
9
  sentinels:
8
10
  -
9
11
  host: localhost
@@ -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.3
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-12 00:00:00.000000000 Z
11
+ date: 2015-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis