cookie_monster 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 +8 -8
- data/Gemfile.lock +1 -1
- data/lib/cookie_monster/jar.rb +8 -5
- data/lib/cookie_monster/version.rb +1 -1
- data/test/cookie_monster/test_jar.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWFiOThjMzI5Y2FjOGUwYjcxOWRiMzU4NzVjYzY2YzM5NTllNmRjYw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OGIwZTMwYmMwODg2M2FlYmE3M2IyNzFjYzRjMDBiYjcxZjRlODAyMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmIwNTVjM2Q3ZWJkZjE1MTFkNmZiNzBlMmViYzMzODJmNTIyOWMxZWE1Y2Fh
|
10
|
+
NjVjZDRlOTBkMGI3NGRhNDk0ODNmMjhkN2I0NTE2YTE1ZTVhYzY5ODA3Y2Nh
|
11
|
+
MjA5ZWU3YTMwODkzMWEyOTU5NTAxYzA2OGE2M2VlY2QyOWZiNjM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODU5Y2RiZjk0NmE2Nzg5YzVjYWFlODA4NTY1OWQ3NTg1ODEwMDI1MzI5ZWQ3
|
14
|
+
ZjU0ZTFiMGEyYWEzYjQwMjQ4NzNiNGIwNzJlMzBhMWExZTY0YTBmN2E1NmI0
|
15
|
+
ZGMxNWNmODUwZmRhZTc1M2QxM2EzMDU0MWUxYjhmYWI4NjMyMmE=
|
data/Gemfile.lock
CHANGED
data/lib/cookie_monster/jar.rb
CHANGED
@@ -28,15 +28,18 @@ module CookieMonster
|
|
28
28
|
encrypted.decrypt
|
29
29
|
end
|
30
30
|
|
31
|
-
def []=(key,
|
31
|
+
def []=(key, value_or_options)
|
32
|
+
value, options = value_or_options
|
33
|
+
options ||= {}
|
34
|
+
|
32
35
|
encrypted_value = Encryption.new(value).encrypt
|
33
36
|
|
34
37
|
@response.set_cookie key, {
|
35
38
|
:value => encrypted_value,
|
36
|
-
:httponly =>
|
37
|
-
:expires =>
|
38
|
-
:domain =>
|
39
|
-
:path =>
|
39
|
+
:httponly => options[:httponly],
|
40
|
+
:expires => options[:expires],
|
41
|
+
:domain => options[:domain],
|
42
|
+
:path => options[:path] || '/',
|
40
43
|
:secure => false # Needed so it can be read by cookie logger over http
|
41
44
|
}
|
42
45
|
end
|
@@ -53,4 +53,9 @@ class JarTest < Test::Unit::TestCase
|
|
53
53
|
@jar[:something] = hash
|
54
54
|
assert_equal hash, @jar[:something]
|
55
55
|
end
|
56
|
+
|
57
|
+
def test_including_other_options
|
58
|
+
@jar[:cookie] = 'something', { expires: 'some point in the future' }
|
59
|
+
assert_equal 'some point in the future', @jar.response.cookies[:cookie][:expires]
|
60
|
+
end
|
56
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookie_monster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Griffin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-06-
|
11
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|