route_matcher 0.0.2 → 0.0.3

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.
@@ -4,10 +4,11 @@
4
4
 
5
5
  module RouteMatcher
6
6
  class UrlMatcher
7
+ CACHE_KEY = "route_matcher_url_matcher_%s"
7
8
 
8
9
  def initialize(name, &block)
9
10
  @name, @block = name, block
10
- Rails.cache.write(cache_key(@name), Time.now, :unless_exists => true)
11
+ Rails.cache.write(CACHE_KEY % @name), Time.now, :unless_exists => true)
11
12
  end
12
13
 
13
14
  def matches?(request)
@@ -21,16 +22,12 @@ module RouteMatcher
21
22
  end
22
23
 
23
24
  def self.mark_dirty(name)
24
- Rails.cache.write(cache_key(name), Time.now)
25
+ Rails.cache.write(CACHE_KEY % name, Time.now)
25
26
  end
26
27
 
27
28
  private
28
- def self.cache_key(name)
29
- "route_matcher_url_matcher_#{name}"
30
- end
31
-
32
29
  def get_stamp
33
- Rails.cache.read(cache_key(@name))
30
+ Rails.cache.read(CACHE_KEY % @name)
34
31
  end
35
32
 
36
33
  end
@@ -1,3 +1,3 @@
1
1
  module RouteMatcher
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Raymond Vellener