threepwood 0.7.0 → 0.8.0

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.
data/README.rdoc CHANGED
@@ -1,8 +1,8 @@
1
1
  = Threepwood
2
2
 
3
- == Description
4
-
5
- Allows cookies to be set and unset with simple command.
3
+ Allows cookies to be set and unset with simple command. To comply with EU law, users must explictly accept cookies before amy cookies are placed on their devise.
4
+ By including Threepwood, you block all cookie until you explicitly accept them. It currently only works with rails >=3 projects.
5
+
6
6
 
7
7
  == Installation
8
8
 
@@ -10,10 +10,25 @@ Allows cookies to be set and unset with simple command.
10
10
 
11
11
  == Usage
12
12
 
13
- Add gem 'threepwood' to your Gemfile.
14
- This will remove all cookies from your site.
15
- To allow cookies through, simply call accept_cookies in your controller.
16
- instance variable available @accepted_cookies is set when consent needs to be got
13
+ In your gemfile:
14
+ gem 'threepwood'
15
+ Create a partial saying that your site will use cookies
16
+ %p
17
+ This site uses cookies.
18
+ = link_to 'I accept cookies.', '/cookies_accept'
19
+ = link_to 'I decline cookies.', '/cookies_deny'
20
+ Set up routes etc as normal and create new actions in a controller:
21
+ def cookies_accept
22
+ accept_cookies #this calls the threepwood method to allow cookies
23
+ redirect_to home_path
24
+ end
25
+ def cookies_deny
26
+ reject_cookies # this calls the threepwood method to remove the fact that the user has accepted cookies
27
+ end
28
+
29
+ On your page (assume HAML):
30
+ = render :partial => 'your_message_about_cookies' unless @accepted_cookies
31
+
17
32
 
18
33
  == License
19
34
 
@@ -20,6 +20,9 @@ module Threepwood
20
20
  end
21
21
  def reject_cookies
22
22
  cookies.delete :threepwood_accepted
23
+ cookies.to_hash.each_pair do |k, v|
24
+ cookies.delete k.to_sym
25
+ end
23
26
  end
24
27
  end
25
28
  end
@@ -2,7 +2,7 @@ module Threepwood
2
2
  module Version
3
3
 
4
4
  MAJOR = 0
5
- MINOR = 7
5
+ MINOR = 8
6
6
  TINY = 0
7
7
 
8
8
  def self.to_s # :nodoc:
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threepwood
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 7
8
+ - 8
9
9
  - 0
10
- version: 0.7.0
10
+ version: 0.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yule
@@ -18,8 +18,8 @@ cert_chain: []
18
18
  date: 2012-05-21 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
- description: By including threepwood in your gemfile, all cookies will be blocked on your site until accept_cookies is called
22
- email: user@example.com
21
+ description: Block all cookies, until user explicitly accepts them, comply with EU cookie law
22
+ email: paul@dryule.com
23
23
  executables: []
24
24
 
25
25
  extensions: []
@@ -32,7 +32,7 @@ files:
32
32
  - lib/threepwood/version.rb
33
33
  - lib/threepwood.rb
34
34
  - README.rdoc
35
- homepage: http://www.ahc.uk.com
35
+ homepage: https://github.com/yule/threepwood
36
36
  licenses: []
37
37
 
38
38
  post_install_message: