cookie_store 0.1.2 → 0.1.3

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: 29abc6c560da56cebca5d0fb11276868b60cfbb8
4
- data.tar.gz: a2ec8c727588b16427dd57abdce421484b5a24fe
3
+ metadata.gz: 806d7fee9bc861c73d9e390e0d3bfbc5c5ece797
4
+ data.tar.gz: 7b92809c676dccebd896f876bace50256576cde7
5
5
  SHA512:
6
- metadata.gz: 258940c03a7219d087061a8446e0c016ffc795a43fee85a3b59ca427ffef3c001ca75228c742a7baa389ad2230b801a8239ce8e519ecf5a8f3a2052a7544f335
7
- data.tar.gz: 8d3d9fefa69dcb5fac6e659471288856389074c78e8f333caf4d95677f367fa8de26be0fb22491f18c383a05db4a7054eb01e34dadecb20e5a2d594b1b905394
6
+ metadata.gz: 1f7a35021d374cf51d8ac896870f15c9a97f2766edb56f1ab2dcfeb18dff50ad7224078ee616cf2f2f940968b9e14005099404373578cb424fdc1f28f228f209
7
+ data.tar.gz: aec3b0876c4df351a7bf1f0c6da82a7d103dc299e9a21a67d98c4ec663499b427803220c1467de5511a3c117521e918f65fbe16a60b76848259bec8ff25a1db9
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in cookie_store.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,54 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cookie_store (0.1.2)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ activesupport (4.1.8)
10
+ i18n (~> 0.6, >= 0.6.9)
11
+ json (~> 1.7, >= 1.7.7)
12
+ minitest (~> 5.1)
13
+ thread_safe (~> 0.1)
14
+ tzinfo (~> 1.1)
15
+ addressable (2.3.6)
16
+ ansi (1.4.3)
17
+ builder (3.2.2)
18
+ crack (0.4.2)
19
+ safe_yaml (~> 1.0.0)
20
+ faker (1.4.3)
21
+ i18n (~> 0.5)
22
+ i18n (0.6.11)
23
+ json (1.8.1)
24
+ metaclass (0.0.4)
25
+ minitest (5.5.0)
26
+ minitest-reporters (1.0.8)
27
+ ansi
28
+ builder
29
+ minitest (>= 5.0)
30
+ ruby-progressbar
31
+ mocha (1.1.0)
32
+ metaclass (~> 0.0.1)
33
+ rake (10.4.2)
34
+ ruby-progressbar (1.7.0)
35
+ safe_yaml (1.0.4)
36
+ thread_safe (0.3.4)
37
+ tzinfo (1.2.2)
38
+ thread_safe (~> 0.1)
39
+ webmock (1.20.4)
40
+ addressable (>= 2.3.6)
41
+ crack (>= 0.3.2)
42
+
43
+ PLATFORMS
44
+ ruby
45
+
46
+ DEPENDENCIES
47
+ activesupport
48
+ cookie_store!
49
+ faker
50
+ minitest
51
+ minitest-reporters
52
+ mocha
53
+ rake
54
+ webmock
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- cookie_store
1
+ cookie_store [![Circle CI](https://circleci.com/gh/malomalo/cookie_store.svg?style=svg)](https://circleci.com/gh/malomalo/cookie_store)
2
2
  ============
3
3
 
4
4
  A Ruby library to handle client-side HTTP cookies
data/cookie_store.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "cookie_store"
6
- s.version = '0.1.2'
6
+ s.version = '0.1.3'
7
7
  s.authors = ["Jon Bracy"]
8
8
  s.email = ["jonbracy@gmail.com"]
9
9
  s.homepage = "https://github.com/malomalo/cookie_store"
@@ -21,4 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'minitest'
22
22
  s.add_development_dependency 'minitest-reporters'
23
23
  s.add_development_dependency 'mocha'
24
+ s.add_development_dependency 'faker'
25
+ s.add_development_dependency 'webmock'
26
+ s.add_development_dependency 'activesupport'
24
27
  end
@@ -8,7 +8,8 @@ class CookieStore::Cookie
8
8
 
9
9
  TOKEN = '[^(),\/<>@;:\\\"\[\]?={}\s]+'
10
10
  VALUE = "(?:#{TOKEN}|#{IPADDR}|#{QUOTED_TEXT})"
11
- EXPIRES_AT_VALUE = '[A-Za-z]{3},\ \d{2}[-\ ][A-Za-z]{3}[-\ ]\d{4}\ \d{2}:\d{2}:\d{2}\ [A-Z]{3}'
11
+ EXPIRES_AT_VALUE = '[A-Za-z]{3},\ \d{2}[-\ ][A-Za-z]{3}[-\ ]\d{4}\ \d{2}:\d{2}:\d{2}\ (?:[A-Z]{3}|[-+]\d{4})'
12
+ NUMERICAL_TIMEZONE = /[-+]\d{4}$/
12
13
 
13
14
  COOKIE = /(?<name>#{TOKEN})=(?:"(?<quoted_value>#{QUOTED_TEXT})"|(?<value>#{VALUE}))(?<attributes>.*)/n
14
15
  COOKIE_AV = %r{
@@ -209,7 +210,7 @@ class CookieStore::Cookie
209
210
  options[:domain] = (value.start_with?('.') ? value : ".#{value}").downcase
210
211
  end
211
212
  when 'expires'
212
- if value.include?('-')
213
+ if value.include?('-') && !value.match(NUMERICAL_TIMEZONE)
213
214
  options[:expires] = DateTime.strptime(value, '%a, %d-%b-%Y %H:%M:%S %Z')
214
215
  else
215
216
  options[:expires] = DateTime.strptime(value, '%a, %d %b %Y %H:%M:%S %Z')
@@ -318,6 +318,13 @@ class CookieStore::CookieTest < Minitest::Test
318
318
 
319
319
  cookie = CookieStore::Cookie.parse('http://google.com/test/this', 'foo=bar; Expires="Wed, 13-Jan-2021 22:23:01 GMT"')
320
320
  assert_equal DateTime.new(2021, 1, 13, 22, 23, 1, 0), cookie.expires
321
+
322
+ # Wed, 13 Jan 2021 22:23:01 -0000 format
323
+ cookie = CookieStore::Cookie.parse('http://google.com/test/this', 'foo=bar; Expires=Wed, 13 Jan 2021 22:23:01 -0000')
324
+ assert_equal DateTime.new(2021, 1, 13, 22, 23, 1, 0), cookie.expires
325
+
326
+ cookie = CookieStore::Cookie.parse('http://google.com/test/this', 'foo=bar; Expires="Wed, 13 Jan 2021 22:23:01 +0000"')
327
+ assert_equal DateTime.new(2021, 1, 13, 22, 23, 1, 0), cookie.expires
321
328
  end
322
329
 
323
330
  test "::parse max_age attribute" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookie_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-22 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,48 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: faker
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: webmock
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: activesupport
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
69
111
  description: A Ruby library to handle client-side HTTP cookies
70
112
  email:
71
113
  - jonbracy@gmail.com
@@ -73,6 +115,8 @@ executables: []
73
115
  extensions: []
74
116
  extra_rdoc_files: []
75
117
  files:
118
+ - Gemfile
119
+ - Gemfile.lock
76
120
  - LICENSE
77
121
  - README.md
78
122
  - Rakefile
@@ -112,4 +156,3 @@ test_files:
112
156
  - test/cookie_store/hash_store_test.rb
113
157
  - test/cookie_store_test.rb
114
158
  - test/test_helper.rb
115
- has_rdoc: