rack-noncache 0.0.1 → 0.0.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: 8e3b60bccf86bf63d0f07f3fa7db12ebb8d76ad0
4
- data.tar.gz: e159f9555b2e775cf4963f5e2676ac4d17e07c45
3
+ metadata.gz: 3b238a38c46673c47236c8fc38836e6d0d9e5496
4
+ data.tar.gz: b264fe6a620c06c10240691e3037dcd1ee730bb4
5
5
  SHA512:
6
- metadata.gz: 0e94c71fecc35fb871a9afa43acd9f10d3cd076a1190f41002e8a4ad7b862c693b629b95056274ecdfe59773e63d07b96f1d01060090ab26b012c828d1c6f134
7
- data.tar.gz: 1a27b657526488faad6d76063282e6989e84b6dabe7bb88349e4405250c0cf4ed35213d08ccacae9729d4659c23b7e05b191230c2fe1ef86cd853d97a55347c6
6
+ metadata.gz: 4bb57db3ee43b7bc24adecc17661b5659e303b4a6d01612d5b30b1d911fd66aaa2bfd3a6628b7dc7c12093923aa045649f181e8b6ac4c1c2fbdb7cd0d236363b
7
+ data.tar.gz: 444ffaed91dfb4da455989269b0dc9c4b90584b7e32452d73cbfe09b771f41a9ac590040440346ce88d86aee6304e90bde63ff2fbd427ea4dcc94cc1de48eedc
@@ -6,6 +6,8 @@ module Rack
6
6
 
7
7
  def initialize(backend, options)
8
8
  @backend = backend
9
+ whitelist = options[:whitelist]
10
+ blacklist = options[:blacklist]
9
11
  yield self if block_given?
10
12
  end
11
13
 
@@ -41,10 +43,10 @@ module Rack
41
43
  private
42
44
 
43
45
  def target_path?(uri)
44
- if @whitelist
45
- return match @whitelist, uri
46
- elsif @blacklist
47
- return !match @blacklist, uri
46
+ if whitelist
47
+ return match(whitelist, uri)
48
+ elsif blacklist
49
+ return !match(blacklist, uri)
48
50
  else
49
51
  false
50
52
  end
@@ -53,7 +55,7 @@ module Rack
53
55
  def match(list, uri)
54
56
  list.index do |path|
55
57
  (path.class.eql?(String) && path.eql?(uri)) ||
56
- (path.class.eql?(Regexp) && path.match uri)
58
+ (path.class.eql?(Regexp) && path.match(uri))
57
59
  end
58
60
  end
59
61
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module NonCache
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = Rack::NonCache::VERSION
9
9
  spec.authors = ["David Saenz Tagarro"]
10
10
  spec.email = ["david@redradix.com"]
11
- spec.summary = "HTTP Non caching for Rack"
12
- spec.description = "Rack::NonCache is suitable as a quick drop-in component to HTTP caching for Rack-based applications that produce required header metatags (Pragma, Expires, Cache-Control, Keep-Alive)."
11
+ spec.summary = "HTTP Non browser caching for Rack"
12
+ spec.description = "Rack::NonCache is a rack middleware that disables HTTP browser caching."
13
13
  spec.homepage = "https://github.com/dsaenztagarro/rack-noncache"
14
14
  spec.license = "MIT"
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-noncache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Saenz Tagarro
@@ -38,9 +38,7 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Rack::NonCache is suitable as a quick drop-in component to HTTP caching
42
- for Rack-based applications that produce required header metatags (Pragma, Expires,
43
- Cache-Control, Keep-Alive).
41
+ description: Rack::NonCache is a rack middleware that disables HTTP browser caching.
44
42
  email:
45
43
  - david@redradix.com
46
44
  executables: []
@@ -80,5 +78,5 @@ rubyforge_project:
80
78
  rubygems_version: 2.2.1
81
79
  signing_key:
82
80
  specification_version: 4
83
- summary: HTTP Non caching for Rack
81
+ summary: HTTP Non browser caching for Rack
84
82
  test_files: []