rack-strip-cookies 0.0.2 → 0.0.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: c8f7845afe771475ad4812a44369964852af03d3
4
- data.tar.gz: 0526bd74ec9f67ce7cf439e1fcbb8bc4719f4afb
3
+ metadata.gz: 7eafe50366d6e4108cceffe2e11c6b252ffef7f9
4
+ data.tar.gz: a5191640fd78fe70345bf3ee699173cfe352e87b
5
5
  SHA512:
6
- metadata.gz: 0bc9c234235bf6e655163f0036cd0965f9f370ea3544fb93a8bedccdf1030aebc161f56e0144fc78450fc57b298c2a9bd9266b88ce5e23f14fc99533a1933418
7
- data.tar.gz: 589231190b9aa753d17411d3394fe9363b6914eebc3eeff29b3bc41253937c44b69357b2d44a6507389d9a92786c0f4853c4f0733ad8fdece77f48ae9398f8d1
6
+ metadata.gz: 89592d00d384bb07e1f460085a4c9913dc41957a238c052b154cbd554a8872240397fba0be1b81682532c7e233c7197e78ad34b8a9156d027a528ba4ec72873e
7
+ data.tar.gz: 771c40ff4e8d62fbef97ac7d89899b9116879851d127de1f65d53e75e1b2af443868f0025c89a130f0d8534d7bf55f395b577c89d60aa4bc334c0d544a1b7770
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.1.0-preview1
1
+ ruby-2.1.5
data/.travis.yml CHANGED
@@ -1,10 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- - 1.9.2
6
- - ruby-head
7
- - jruby-19mode
8
- - rbx-19mode
3
+ - 1.9.2
4
+ - 1.9.3
5
+ - 2.1
9
6
  notifications:
10
7
  email: false
8
+ env:
9
+ - "rack=1.2.8"
10
+ - "rack=1.3.10"
11
+ - "rack=1.4.5"
12
+ - "rack=1.5.2"
13
+ - "rack=master"
data/Gemfile CHANGED
@@ -4,6 +4,18 @@ gemspec
4
4
 
5
5
  gem 'rake'
6
6
 
7
+ github = 'git://github.com/%s.git'
8
+ repos = { 'rack' => github % 'rack/rack' }
9
+
10
+ %w(rack).each do |lib|
11
+ dep = case ENV[lib]
12
+ when 'stable', nil then nil
13
+ when /(\d+\.)+\d+/ then '~> ' + ENV[lib].sub("#{lib}-", '')
14
+ else { git: repos[lib], branch: dep }
15
+ end
16
+ gem lib, dep
17
+ end
18
+
7
19
  group :test do
8
20
  gem 'rack-test'
9
21
  gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rack::StripCookies [![Build Status](https://secure.travis-ci.org/icoretech/rack-strip-cookies.png)](https://travis-ci.org/icoretech/rack-strip-cookies?branch=master) [![Coverage Status](https://coveralls.io/repos/icoretech/rack-strip-cookies/badge.png)](https://coveralls.io/r/icoretech/rack-strip-cookies) [![Dependency Status](https://gemnasium.com/icoretech/rack-strip-cookies.png)](https://gemnasium.com/icoretech/rack-strip-cookies)
1
+ # Rack::StripCookies [![Build Status](https://secure.travis-ci.org/icoretech/rack-strip-cookies.png)](https://travis-ci.org/icoretech/rack-strip-cookies?branch=master)
2
2
 
3
3
  Simple Rack middleware to remove cookies at specified paths.
4
4
 
@@ -16,9 +16,17 @@ Or install it yourself as:
16
16
 
17
17
  $ gem install rack-strip-cookies
18
18
 
19
- ## Ruby on Rails
19
+ ## Concept
20
+
21
+ The goal of this gem is not only avoid serving a cookie to a client through the Set-Cookie header, but also to erase cookies sent in the request. In other words the client-sent cookies will not make it to your application layer, provided the middleware is loaded in the correct place in the stack.
22
+
23
+ ## Use cases
20
24
 
21
- This library has been tested on Rails 3.2 and 4.0.
25
+ - You have a buggy third party library that raises exception when cookies are sent in a request, such as an authentication engine.
26
+ - You are looking for a cheap way to not mess with session cookie disabilitation in your framework.
27
+ - Selectively shut down cookies on specific paths, configurable when adding the middleware.
28
+
29
+ ## Ruby on Rails
22
30
 
23
31
  To make the middleware available in all environments, open `config/application.rb` and add in `class Application < Rails::Application`:
24
32
 
@@ -28,6 +36,8 @@ config.middleware.insert_before(ActionDispatch::Cookies, Rack::StripCookies, pat
28
36
 
29
37
  If you want to customize the environment in which the middleware is enabled edit the respective environment files instead.
30
38
 
39
+ You can verify the middleware positioning by typing `rake middleware` in the root of your application.
40
+
31
41
  ## Contributing
32
42
 
33
43
  1. Fork it
@@ -8,7 +8,7 @@ module Rack
8
8
 
9
9
  def call(env)
10
10
  path = Rack::Request.new(env).path
11
- included = paths.include?(path)
11
+ included = paths.any? { |s| path.include?(s)}
12
12
 
13
13
  env.delete('HTTP_COOKIE') if included
14
14
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class StripCookies
3
- VERSION = "0.0.2"
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'rack/strip-cookies/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "rack-strip-cookies"
7
+ spec.name = 'rack-strip-cookies'
8
8
  spec.version = Rack::StripCookies::VERSION
9
- spec.authors = ["Claudio Poli"]
10
- spec.email = ["claudio@icorete.ch"]
11
- spec.summary = %q{Rack middleware to remove cookies at user-defined paths.}
12
- spec.description = %q{Rack middleware to remove cookies at user-defined paths.}
13
- spec.homepage = "http://github.com/icoretech/rack-strip-cookies"
14
- spec.license = "MIT"
9
+ spec.authors = ['Claudio Poli']
10
+ spec.email = ['claudio@icorete.ch']
11
+ spec.summary = 'Rack middleware to remove cookies at user-defined paths.'
12
+ spec.description = 'Rack middleware to remove cookies at user-defined paths.'
13
+ spec.homepage = 'http://github.com/icoretech/rack-strip-cookies'
14
+ spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files`.split($/)
16
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.0"
22
- spec.add_development_dependency "rack", "~> 1.2.0"
23
- spec.add_development_dependency "rack-test", "~> 0.5.4"
21
+ spec.add_development_dependency 'bundler', '~> 1.0'
22
+ spec.add_development_dependency 'rack', '~> 1.2'
23
+ spec.add_development_dependency 'rack-test', '~> 0.6.2'
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-strip-cookies
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claudio Poli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-10 00:00:00.000000000 Z
11
+ date: 2014-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,28 +30,28 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.2.0
33
+ version: '1.2'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.2.0
40
+ version: '1.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.5.4
47
+ version: 0.6.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.5.4
54
+ version: 0.6.2
55
55
  description: Rack middleware to remove cookies at user-defined paths.
56
56
  email:
57
57
  - claudio@icorete.ch
@@ -61,7 +61,6 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
- - ".ruby-gemset"
65
64
  - ".ruby-version"
66
65
  - ".travis.yml"
67
66
  - Gemfile
@@ -93,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
92
  version: '0'
94
93
  requirements: []
95
94
  rubyforge_project:
96
- rubygems_version: 2.1.10
95
+ rubygems_version: 2.4.3
97
96
  signing_key:
98
97
  specification_version: 4
99
98
  summary: Rack middleware to remove cookies at user-defined paths.
data/.ruby-gemset DELETED
@@ -1 +0,0 @@
1
- rack-strip-cookies