caddy 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53c6371c7ae4a7d4187d15a3e001e54956038497
4
- data.tar.gz: 065bb3be46129e37bc971db5be7bf5de573064b0
3
+ metadata.gz: 35f94550914496091060c7ac30c89ce141d88571
4
+ data.tar.gz: c802fa9fcc6079d07e24c394bf5dc23b4f23e714
5
5
  SHA512:
6
- metadata.gz: 03ea3bd82390a146981ee37b90e6215481e47775c5e6ffa1257bb07349d49a05cb6396373566f1fcf4807eda93a89ec3fe6ee79826ac5252de017fa559768731
7
- data.tar.gz: 8f5002ebd4b6ddec46535225a1ce1f4c20602a601c1673bc46a40f2d51744f929d8e83cd8977feab04d3d61bd37cc54193226ee9ce35a849a07a8f8fee536746
6
+ metadata.gz: b295ec30505c9481aee7e8c72920cdcfadd94b5587efe151bbbafb105f8a6a2fcfb876eb7987871aed52375422d3e1aed2b1d54cd1d9a66442996f2aac35910c
7
+ data.tar.gz: 78dbcebfc38eae77fdb28791a73bc97445feaf79e9feea1fc5789a9955b4afe7a2fa8d5e3ad2cf00917f1d74a9bd51f183ec61a5ba3a134b7b5386c42dafec09
@@ -1,3 +1,8 @@
1
+ ## 1.5.2
2
+
3
+ - Further clarity in error messaging.
4
+ - Freeze the cache list after start.
5
+
1
6
  ## 1.5.1
2
7
 
3
8
  - Add back in alerting if you attempt to load a cache before the refresher has run.
@@ -28,6 +28,8 @@ module Caddy
28
28
  raise "Please run `Caddy.start` *after* forking, as the refresh thread will get killed after fork"
29
29
  end
30
30
 
31
+ @caches.freeze
32
+
31
33
  @caches.values.each(&:start).all?
32
34
  end
33
35
 
@@ -19,7 +19,7 @@ module Caddy
19
19
 
20
20
  def cache
21
21
  raise "Please run `Caddy.start` before attempting to access the cache" unless @task && @task.running?
22
- raise "Caddy cache access before initial load; allow some more time for your app to start up" unless @cache
22
+ raise "Caddy cache access of :#{@key} before initial load; allow some more time for your app to start up" unless @cache
23
23
 
24
24
  @cache
25
25
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Caddy
3
- VERSION = "1.5.1".freeze
3
+ VERSION = "1.5.2".freeze
4
4
  end
@@ -5,7 +5,7 @@ class CaddyTest < Minitest::Test
5
5
  Caddy.stop
6
6
  Caddy.error_handler = nil
7
7
 
8
- [:test, :test_two].each do |k|
8
+ [:test, :test_two, :nope].each do |k|
9
9
  Caddy[k].refresher = -> {}
10
10
  Caddy[k].refresh_interval = 30
11
11
  Caddy[k].error_handler = nil
@@ -167,6 +167,12 @@ class CaddyTest < Minitest::Test
167
167
  assert_raises { Caddy.start }
168
168
  end
169
169
 
170
+ def test_requires_initial_load
171
+ Caddy[:nope].refresher = -> { nil }
172
+
173
+ assert_raises { Caddy[:nope][:not_there] }
174
+ end
175
+
170
176
  def test_requires_positive_interval
171
177
  Caddy[:test].refresh_interval = -2
172
178
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Elser
@@ -77,12 +77,12 @@ files:
77
77
  - ".gitignore"
78
78
  - ".rubocop.yml"
79
79
  - ".travis.yml"
80
+ - CHANGELOG.md
80
81
  - Gemfile
81
82
  - LICENSE.txt
82
83
  - README.md
83
84
  - Rakefile
84
85
  - caddy.gemspec
85
- - changelog.md
86
86
  - docs/architecture.dot
87
87
  - docs/architecture.svg
88
88
  - lib/caddy.rb