timberline 0.5.0 → 0.6.0

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: 7aa514d129ba4ac74886845982675b82975051bb
4
- data.tar.gz: d668a59889b0f78d60e04321b2a0224c1264712e
3
+ metadata.gz: 29b010166f8c116bf4469cf6c09d3d65b0f769ee
4
+ data.tar.gz: a06cc3487b8acaef76c85c87b7b56d32bd11785d
5
5
  SHA512:
6
- metadata.gz: 3f44d9c9e5f008d8b01e0ee8e008a6e4adeb22ca4db90dfffde5b5e3a2aa263976cc0d89f4a82217a639a2dbfafcefb7bcd9864f0df86c5178fe65452490a36b
7
- data.tar.gz: 5ff02917829e79ddf5d7f8e0d9e99a35bd35df784893a54773dcde8878f351633bad12de48587e8a5dbac62fd9421c3a5fb1701ddfde36e5e029b8ebd6771216
6
+ metadata.gz: 6d5ced0644e73be8bd3bce8905e46d99ddeb36c61ae7e78890a8bbd9fa727fd8969301ee4e074e5d4518dda7aa77046238e7f068e48dc4da5968fc899398f682
7
+ data.tar.gz: 75f4e3acc70d27d9021e8c0d4816f31ac40854a7a30f8bba1d625fb6a3498de8de12a3b89c99fe7102a4bea1a21c7903d4c69232557d87541a7a721f8174991f
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ 0.6.0
2
+ - Remove Rails-specific configuration logic in preparation for release of timberline-rails
1
3
  0.5.0
2
4
  - Each queue now has its own error queue, rather than having one error_queue for everything
3
5
  - Queues can now be created with a 'hidden' option that removes them from the Timberline listing
data/README.markdown CHANGED
@@ -77,24 +77,16 @@ queue (more on that later). There are 3 ways to configure Timberline:
77
77
  your settings will all take effect. Redis defaults will be used if you omit
78
78
  anything.
79
79
 
80
- 2. If you're including Timberline in a Rails app, there's a convenient way to
81
- configure it that should fit in with the rest of your app - if you include a
82
- yaml file named timberline.yaml in your config directory, Timberline will
83
- automatically detect it and load it up. The syntax for this file is
84
- shockingly boring:
80
+ 2. If you prefer a static config file, you can write a YAML file like the following:
85
81
 
86
- development:
87
82
  database: 1
88
83
  host: 192.168.1.105
89
84
  port: 12345
90
85
  password: foobar
91
- production:
92
- ...etc.
93
86
 
94
- 3. Like the yaml format but you're not using Rails? Don't worry, just write your
95
- yaml file and set the TIMBERLINE\_YAML constant inside your app like so:
87
+ ...and then use the `TIMBERLINE_YAML` constant to specify the file's location:
96
88
 
97
- TIMBERLINE_YAML = 'path/to/your/yaml/file.yaml'
89
+ TIMBERLINE_YAML = 'path/to/your/yaml/file.yaml'
98
90
 
99
91
  ### Pushing jobs onto a queue
100
92
 
@@ -167,6 +159,11 @@ queue.
167
159
  There are some options to the Timberline binary that you may find helpful -
168
160
  `timberline --help` for more.
169
161
 
162
+ ### Rails
163
+
164
+ If you're using Timberline in conjunction with a Rails environment, check out
165
+ the [timberline-rails](https://github.com/treehouse/timberline-rails) gem.
166
+
170
167
  ## TODO
171
168
 
172
169
  Still to be done:
@@ -180,8 +177,6 @@ Still to be done:
180
177
  cumbersome. Need to rewrite some of the basic stuff to be more OO-appropriate.
181
178
  - **Forking** - Timberline should support forking in its watcher model so that jobs can
182
179
  be run in parallel and independently of each other.
183
- - **Relocate Rails** - Create a `timberline-rails` gem that includes all of our Rails-specific
184
- functionality and configuration rather than have that in Timberline proper.
185
180
 
186
181
  ## Future
187
182
 
@@ -10,18 +10,18 @@ class Timberline
10
10
  else
11
11
  raise "Specified Timberline config file #{TIMBERLINE_YAML} is not present."
12
12
  end
13
- elsif defined? Rails.root
14
- config_file = File.join(Rails.root, 'config', 'timberline.yaml')
15
- if File.exists?(config_file)
16
- configs = YAML.load_file(config_file)
17
- config = configs[Rails.env]
18
- load_from_yaml(config)
19
- end
20
13
  end
14
+ end
15
+
16
+ def namespace
17
+ @namespace ||= 'timberline'
18
+ end
21
19
 
22
- # load defaults
23
- @namespace ||= 'timberline'
20
+ def max_retries
24
21
  @max_retries ||= 5
22
+ end
23
+
24
+ def stat_timeout
25
25
  @stat_timeout ||= 60
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  class Timberline
2
- VERSION = "0.5.0"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -52,70 +52,6 @@ describe Timberline::Config do
52
52
  end
53
53
  end
54
54
 
55
- context "if Rails.root is defined" do
56
- context "and a config/timberline.yaml file exists" do
57
- before do
58
- SpecSupport::FakeRails.create_fake_env
59
- end
60
-
61
- after do
62
- SpecSupport::FakeRails.destroy_fake_env
63
- end
64
-
65
- it "loads the host variable from the config file" do
66
- expect(subject.host).to eq("localhost")
67
- end
68
-
69
- it "loads the port variable from the config file" do
70
- expect(subject.port).to eq(12345)
71
- end
72
-
73
- it "loads the timeout variable from the config file" do
74
- expect(subject.timeout).to eq(10)
75
- end
76
-
77
- it "loads the password from the config file" do
78
- expect(subject.password).to eq("foo")
79
- end
80
-
81
- it "loads the database from the config file" do
82
- expect(subject.database).to eq(3)
83
- end
84
-
85
- it "loads the namespace from the config file" do
86
- expect(subject.namespace).to eq("treecurve")
87
- end
88
- end
89
-
90
- context "and a config/timberline.yaml file does not exist" do
91
- before do
92
- SpecSupport::FakeRails.create_fake_env_without_config
93
- end
94
-
95
- after do
96
- SpecSupport::FakeRails.destroy_fake_env
97
- end
98
-
99
- it "configures a default namespace of 'timberline'" do
100
- expect(subject.namespace).to eq("timberline")
101
- end
102
-
103
- it "configures a default max_retries of 5" do
104
- expect(subject.max_retries).to eq(5)
105
- end
106
-
107
- it "configures a stat_timeout of 60" do
108
- expect(subject.stat_timeout).to eq(60)
109
- end
110
-
111
- it "doesn't configure any redis settings so that redis will use its own defaults" do
112
- [:database, :host, :port, :timeout, :password, :logger].each do |value|
113
- expect(subject.send(value)).to be_nil
114
- end
115
- end
116
- end
117
- end
118
-
119
55
  context "when no configuration exists" do
120
56
  it "configures a default namespace of 'timberline'" do
121
57
  expect(subject.namespace).to eq("timberline")
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.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-03 00:00:00.000000000 Z
11
+ date: 2014-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -148,13 +148,11 @@ files:
148
148
  - lib/timberline/queue.rb
149
149
  - lib/timberline/version.rb
150
150
  - spec/config/test_config.yaml
151
- - spec/fake_rails/config/timberline.yaml
152
151
  - spec/lib/timberline/config_spec.rb
153
152
  - spec/lib/timberline/envelope_spec.rb
154
153
  - spec/lib/timberline/queue_spec.rb
155
154
  - spec/lib/timberline_spec.rb
156
155
  - spec/spec_helper.rb
157
- - spec/support/fake_rails.rb
158
156
  - spec/support/timberline_reset.rb
159
157
  - spec/support/timberline_yaml.rb
160
158
  - timberline.gemspec
@@ -1,7 +0,0 @@
1
- development:
2
- host: localhost
3
- port: 12345
4
- timeout: 10
5
- password: foo
6
- database: 3
7
- namespace: treecurve
@@ -1,17 +0,0 @@
1
- module SpecSupport
2
- module FakeRails
3
- def self.create_fake_env
4
- fake_rails = OpenStruct.new(root: File.join(File.dirname(File.path(__FILE__)), "..", "fake_rails"), env: "development")
5
- Object.send(:const_set, :Rails, fake_rails)
6
- end
7
-
8
- def self.create_fake_env_without_config
9
- fake_rails = OpenStruct.new(root: File.join(File.dirname(File.path(__FILE__)), "..", "gibberish"), env: "development")
10
- Object.send(:const_set, :Rails, fake_rails)
11
- end
12
-
13
- def self.destroy_fake_env
14
- Object.send(:remove_const, :Rails)
15
- end
16
- end
17
- end