eu_cookies 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 38622a027bce930d1ef7e64d3789b369b514a67b
4
+ data.tar.gz: 7c493db6e83b339d823d4039fb0886034a421853
5
+ SHA512:
6
+ metadata.gz: 56b956436b5360fb9f3ef64d8a445d344edd5d3f9038845f0ca8f30de41667c6cd1e62663bde94077df9944e945fd2bb7e8c964c56d42e4af9df3ab10b446fde
7
+ data.tar.gz: d0324712e558b1703470a65f59c6aaa37cc9ba001464dc96eb357c2d4a9757d7c16bb12d64ded10141bf0b64e038091019faedf7b4ff63b5181ad3b91eda93e7
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.rbc
2
+ .bundle
3
+ .config
4
+ .yardoc
5
+ Gemfile.lock
6
+ InstalledFiles
7
+ _yardoc
8
+ coverage
9
+ doc/
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'jquery-rails', '~> 4.0'
4
+
5
+ # Specify your gem's dependencies in eu_cookies.gemspec
6
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Alessandro Lepore
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # EuCookies
2
+
3
+ A complete Rails solution to the European Cookie Law issue.
4
+
5
+ ## Supported languages
6
+
7
+ English, German, Spanish, French, Croatian, Italian, Slovenian, Dutch, Estonian,
8
+ Norwegian, Russian and Swedish.
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ ```ruby
15
+ gem 'eu_cookies', "~> 1.0"
16
+ ```
17
+
18
+ And then execute:
19
+
20
+ $ bundle
21
+
22
+ Run the installation generator:
23
+
24
+ $ bundle exec rails g eu_cookies:install
25
+
26
+ NOTE: This gem imply that you have a working JQuery installation.
27
+
28
+ ## Usage
29
+
30
+ In your layout add
31
+
32
+ ```erb
33
+ <%= cookies_bar %>
34
+ ```
35
+
36
+ You can add a link parameter to link to your cookies explanation page (you have to create the page and controller for this)
37
+
38
+ ```erb
39
+ <%= cookies_bar link: '/cookies' %>
40
+ ```
41
+
42
+ If you wish to customize the style of the div the classes are:
43
+
44
+ ```javascript
45
+ .eu_cookies // main div
46
+ .eu_cookies_ok // button
47
+ .eu_cookies_link // link
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ On a initializer you can configure some things (defaults are shown here):
53
+
54
+ ```ruby
55
+ EuCookies.position = :bottom # or :top
56
+ EuCookies.use_scroll = false # true to treat page scroll as acceptance
57
+ EuCookies.enabled = true # false to disable all the things
58
+ ```
59
+
60
+ ## Turbolinks is NOT supported
61
+
62
+ Please use [jquery.turbolinks gem](https://github.com/kossnocorp/jquery.turbolinks)
63
+
64
+ ## Contributing
65
+
66
+ Bug reports and pull requests are welcome on GitHub at https://github.com/freego/eu_cookies. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
67
+
68
+ ## Credits
69
+
70
+ Originally based on https://github.com/infinum/cookies_eu
71
+
72
+ ## License
73
+
74
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,26 @@
1
+ //= require js.cookie
2
+
3
+ jQuery(document).ready(function() {
4
+ jQuery('.eu-cookies-ok').click(function(e) {
5
+ e.preventDefault();
6
+ process_consent();
7
+ });
8
+
9
+ if (jQuery('.eu-cookies[data-use-scroll="true"]').length) {
10
+ jQuery(window).one('scroll', function(e) {
11
+ // manual scroll
12
+ if (e.originalEvent) {
13
+ process_consent();
14
+ }
15
+ });
16
+ }
17
+ });
18
+
19
+ function process_consent() {
20
+ Cookies.set('eu_cookies_consent', 'true', { expires: 365, path: '/' });
21
+
22
+ var element = jQuery('.eu-cookies');
23
+ element.fadeOut(300, function() {
24
+ element.remove();
25
+ });
26
+ }
@@ -0,0 +1,72 @@
1
+ $cookies-bar-background-color: #f2f2f2 !default;
2
+ $cookies-bar-border-color: #e4e4e4 !default;
3
+ $cookies-bar-button-color: #4d90fe !default;
4
+ $cookies-bar-button-color2: #4787ed !default;
5
+ $cookies-bar-button-border-color: #3079ed !default;
6
+
7
+ $cookies-bar-line-height: 40px !default;
8
+
9
+ .eu-cookies[data-position="bottom"] {
10
+ bottom: 0;
11
+ }
12
+
13
+ .eu-cookies[data-position="top"] {
14
+ top: 0;
15
+ }
16
+
17
+ .eu-cookies {
18
+ position: fixed;
19
+ left: 0;
20
+ line-height: $cookies-bar-line-height;
21
+ background: $cookies-bar-background-color;
22
+ border-top: 1px solid $cookies-bar-border-color;
23
+ width: 100%;
24
+ z-index: 999;
25
+ text-align: center;
26
+
27
+ .eu-cookies-content-holder {
28
+ display: inline-block;
29
+ padding: 0 20px;
30
+ line-height: 26px;
31
+ }
32
+ .eu-cookies-button-holder {
33
+ display: inline-block;
34
+ padding-right: 20px;
35
+
36
+ .eu-cookies-ok {
37
+ background-color: $cookies-bar-button-color;
38
+ background-image: -webkit-linear-gradient(top, $cookies-bar-button-color, $cookies-bar-button-color2);
39
+ border: 1px solid $cookies-bar-button-border-color;
40
+ border-radius: 2px;
41
+ color: #fff;
42
+ cursor: default;
43
+ display: inline-block;
44
+ font-size: 11px;
45
+ font-weight: bold;
46
+ height: 24px;
47
+ line-height: 20px;
48
+ margin-right: 0px;
49
+ min-width: 26px;
50
+ outline: 0;
51
+ padding: 0 11px;
52
+ text-align: center;
53
+ white-space: nowrap;
54
+ margin: 0 5px;
55
+ }
56
+ }
57
+ }
58
+
59
+ @media (max-width: 767px){
60
+ .eu-cookies{
61
+ position: static;
62
+ font-size: 12px;
63
+ line-height: 20px;
64
+ .eu-cookies-content-holder{
65
+ line-height: 16px;
66
+ padding: 5px 20px;
67
+ }
68
+ .eu-cookies-button-holder{
69
+ padding-bottom: 5px;
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,18 @@
1
+ module EuCookiesHelper
2
+ def must_accept_cookie?
3
+ cookies['eu_cookies_consent'] != 'true' && EuCookies.enabled
4
+ end
5
+
6
+ def cookies_bar(params = {})
7
+ if must_accept_cookie?
8
+ render partial: 'eu_cookies/cookies_bar', locals: params
9
+ end
10
+ end
11
+
12
+ def cookies_bar_data
13
+ {
14
+ position: EuCookies.position,
15
+ use_scroll: EuCookies.use_scroll.to_s
16
+ }
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ <%= content_tag :div, class: "eu-cookies", data: cookies_bar_data do %>
2
+ <span class="eu-cookies-content-holder">
3
+ <%= t('eu_cookies.cookies_text') %>
4
+ </span>
5
+ <span class="eu-cookies-button-holder">
6
+ <button class="eu-cookies-ok">
7
+ <%= t('eu_cookies.ok') %>
8
+ </button>
9
+ <% if link = local_assigns[:link].presence %>
10
+ <%= link_to t('eu_cookies.learn_more'), link, class: 'eu-cookies-link' %>
11
+ <% end %>
12
+ </span>
13
+ <% end %>
@@ -0,0 +1,105 @@
1
+ %h2 COOKIES
2
+
3
+ %p Cookies are small text files which are downloaded to your computer, tablet or mobile phone when you visit a website or application. The website or application may retrieve these cookies from your web browser (eg Internet Explorer, Mozilla Firefox or Google Chrome) each time you visit, so they can recognise you, remember your preferences and provide you with a more secure online experience.
4
+
5
+ %p Generally, cookies are very useful and are a common method used by almost every website you visit because they help to make your online experience as smooth as possible. For security reasons, many websites will not function at all without the use of cookies (or other similar technologies, such as "web beacons" or "tags").
6
+
7
+ %p Cookies generally do not hold any information to identify an individual person, but are instead used to identify a browser on an individual machine.
8
+
9
+ %p If you prefer, you can restrict, block or delete cookies by changing your browser settings but that may mean that the website won't work properly
10
+
11
+ %p For more information about cookies and their impact on you and your browsing visit #{link_to 'http://www.aboutcookies.org', 'www.aboutcookies.org'}.
12
+
13
+
14
+ %h2 TYPES OF COOKIES
15
+
16
+ %h3 Necessary cookies
17
+
18
+ %p These cookies are essential in helping you to make use of the features and services we offer on the #{INSERT SITE HERE} website. Without these cookies, the services you want to use cannot be provided. These cookies do not gather information about you that could be used to identify you, and they do not monitor or remember where you have been on the internet.
19
+
20
+ %h3 Functional cookies
21
+
22
+ %p These cookies allow us to provide you with a better online experience when you use our website. They do not gather or store any information which would allow us to identify you personally.
23
+
24
+ %h3 Performance cookies
25
+
26
+ %p Performance cookies help us to understand how our customers use our site, so we can keep our products and services relevant, easy to use and up to date. For example, we can see which products and services are most popular, identify when and where errors occur, and test different versions of a page in order to provide an improved online experience.
27
+
28
+ %p Sometimes, the services we use to collect this information may be operated by other companies on our behalf. They may use similar technologies to cookies, known as "web beacons" or "tags". These are anonymous and, as they are only used for statistical purposes, they do not contain or collect any information that identifies you.
29
+
30
+ %h3 Targeting cookies
31
+
32
+ %p We have relationships with carefully selected and monitored suppliers (third parties) who may also set cookies during your visit. The purpose of these cookies is "behavioural advertising" (also known as "behavioural targeting" or "remarketing"), which is a means of showing you relevant products and services based on what you appear to be interested in. Although these cookies can track your visits around the web they don't know who you are. Without these cookies, online advertisements you encounter will be less relevant to you and your interests.
33
+
34
+
35
+ %h2 MANAGING COOKIES
36
+
37
+ %p Most internet browsers allow you to erase cookies from your computer hard drive, block all cookies (or just third-party cookies) or warn you before a cookie is stored on your device.
38
+
39
+ %p Please note, if you choose to block all cookies, our site will not function as intended and you will not be able to use or access many of the services we provide. If you have blocked all cookies and wish to make full use of the features and services we offer, you will need to enable your cookies. You can do this in your browser (see below).
40
+
41
+ %p Rather than blocking all cookies, you can choose to only block third-party cookies which will still allow our website to function as intended.
42
+
43
+ %h3 How to manage cookies on your PC
44
+
45
+ %p To enable cookies on our website, follow the steps below.
46
+
47
+ %h4 Google Chrome
48
+
49
+ %ol
50
+ %li Click "Tools" at the top of your browser and select "Settings".
51
+ %li Click "Show advanced settings", scroll down to the section "Privacy" and click "Content Settings."
52
+ %li Select "Allow local data to be set". To only acept first-party cookies, check the box next to "Block all third-party cookies without exception"
53
+
54
+ %h4 Microsoft Internet Explorer 6.0, 7.0, 8.0, 9.0
55
+
56
+ %ol
57
+ %li Click "Tools" at the top of your browser and select "Internet Options", then click the "Privacy" tab.
58
+ %li Check that the level of your privacy is set to Medium or lower, which will allow the use of cookies in your browser.
59
+ %li If set above medium level it will prevent the use of cookies.
60
+
61
+ %h4 Mozilla Firefox
62
+
63
+ %ol
64
+ %li Click "Tools" at the top of your browser and select "Options".
65
+ %li Then select the "Privacy" icon.
66
+ %li Click the "Cookies" and select "Allow pages to create a cookie."
67
+
68
+ %h4 Safari
69
+
70
+ %ol
71
+ %li Click the gear icon at the top of your browser and select "Settings".
72
+ %li Click the "Privacy" tab, then select the option "Disable the use of cookies by third parties and advertising cookies."
73
+ %li Click "Save".
74
+
75
+ %h3 How to manage cookies on your Mac
76
+
77
+ %p To enable cookies on our website, follow the steps below.
78
+
79
+ %h4 Microsoft Internet Explorer 5.0 on OSX
80
+
81
+ %ol
82
+ %li Click on "Explorer" at the top of your browser and select "Settings".
83
+ %li Scroll down to the "Cookies" section in the "Received Files".
84
+ %li Select "Do not ask."
85
+
86
+ %h4 Safari on OSX
87
+
88
+ %ol
89
+ %li Click "Safari" on the top of your browser and select "Settings".
90
+ %li Click the "Privacy" and then "Enable cookies."
91
+ %li Select "only the pages you have visited."
92
+
93
+ %h4 Mozilla and Netscape on OSX
94
+
95
+ %ol
96
+ %li Click "Mozilla" or "Netscape" at the top of your browser and select "Settings".
97
+ %li Scroll down to the "Cookies" under "Privacy & Security".
98
+ %li Select "Allow cookies only to the original site."
99
+
100
+ %h4 Opera
101
+
102
+ %ol
103
+ %li Click "Menu" on the top of your browser and select "Settings".
104
+ %li Then select "Options" tab and the "Advanced".
105
+ %li Select "Enable cookies."
@@ -0,0 +1,5 @@
1
+ de:
2
+ eu_cookies:
3
+ cookies_text: "Cookies helfen uns bei der Bereitstellung unserer Dienste. Durch die Nutzung unserer Dienste erklären Sie sich damit einverstanden, dass wir Cookies setzen."
4
+ learn_more: "Mehr erfahren"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ ee:
2
+ eu_cookies:
3
+ cookies_text: "Küpsised aitavad meil osutada teenuseid. Kasutades meie teenuseid nõustute küpsiste kasutamisega."
4
+ learn_more: "Lähemalt"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ en:
2
+ eu_cookies:
3
+ cookies_text: "Cookies help us deliver our services. By using our services, you agree to our use of cookies."
4
+ learn_more: "Learn more"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ es:
2
+ eu_cookies:
3
+ cookies_text: "Las cookies nos ayudan a ofrecer nuestros servicios. Al utilizar nuestros servicios, aceptas el uso de cookies."
4
+ learn_more: "Más información"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ fr:
2
+ eu_cookies:
3
+ cookies_text: "Les cookies assurent le bon fonctionnement de nos services. En utilisant ces derniers, vous acceptez l'utilisation des cookies."
4
+ learn_more: "En savoir plus"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ hr:
2
+ eu_cookies:
3
+ cookies_text: "Cookies nam pomažu pri pružanju usluga. Korištenjem naših usluga, prihvaćate naše korištenje cookies-a."
4
+ learn_more: "Saznaj više"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ it:
2
+ eu_cookies:
3
+ cookies_text: "I cookie ci aiutano a fornire i nostri servizi. Utilizzando tali servizi, accetti l'utilizzo dei cookie da parte nostra."
4
+ learn_more: "Informazioni"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ nl:
2
+ eu_cookies:
3
+ cookies_text: "Wij maken gebruik van cookies voor onze service. Bezoek je onze website dan ga je akkoord met de cookies."
4
+ learn_more: "Meer informatie"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ "no":
2
+ eu_cookies:
3
+ cookies_text: "Cookies hjelper oss å levere våre tjenester. Ved å bruke våre tjenester, samtykker du til vår bruk av informasjonskapsler."
4
+ learn_more: "Lær mer"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ ru:
2
+ eu_cookies:
3
+ cookies_text: "Cookies помогают нам предоставлять наши услуги. Используя наши услуги, вы соглашаетесь с использованием наших cookies."
4
+ learn_more: "Подробнее"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ se:
2
+ eu_cookies:
3
+ cookies_text: "Cookies hjälper oss att leverera våra tjänster. Genom att använda våra tjänster samtycker du till vår användning av cookies."
4
+ learn_more: "Läs mer"
5
+ ok: "OK"
@@ -0,0 +1,5 @@
1
+ sl:
2
+ eu_cookies:
3
+ cookies_text: "Piškotke uporabljamo, da bi vam omogočili nemoteno in prijetno uporabniško izkušnjo. Z nadaljnjo uporabo te spletne strani se strinjate z našo politiko piškotkov."
4
+ learn_more: "Več o tem"
5
+ ok: "OK"
data/config.ru ADDED
@@ -0,0 +1,7 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+
4
+ Bundler.require :default, :development
5
+
6
+ Combustion.initialize! :all
7
+ run Combustion::Application
@@ -0,0 +1,34 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'eu_cookies/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "eu_cookies"
8
+ spec.version = EuCookies::VERSION
9
+ spec.authors = ["Alessandro Lepore", "Stjepan Hadjic"]
10
+ spec.email = ["a.lepore@freegoweb.it"]
11
+ spec.description = %q{A complete Rails solution to the European Cookie Law issue}
12
+ spec.summary = spec.description
13
+ spec.homepage = "https://github.com/freego/eu_cookies"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = '>= 1.9.3'
16
+
17
+ spec.files = `git ls-files`.split($/)
18
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
19
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_dependency "js_cookie_rails", "~> 1.0"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.3"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec-rails", "~> 3.2"
27
+ spec.add_development_dependency "capybara", "~> 2.4"
28
+ spec.add_development_dependency "combustion", "~> 0.5.3"
29
+ spec.add_development_dependency "actionpack", "~> 4.2"
30
+ spec.add_development_dependency "actionview", "~> 4.2"
31
+ spec.add_development_dependency "sprockets-rails", "~> 2.3"
32
+ spec.add_development_dependency "selenium-webdriver", "~> 2.45"
33
+ spec.add_development_dependency "sass-rails", "~> 5.0"
34
+ end
@@ -0,0 +1,9 @@
1
+ module EuCookies
2
+ class Engine < ::Rails::Engine
3
+ initializer 'eu_cookies.environment' do |app|
4
+ EuCookies.enabled = true if EuCookies.enabled.nil?
5
+ EuCookies.position ||= :bottom
6
+ EuCookies.use_scroll ||= false
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module EuCookies
2
+ VERSION = "1.0.0"
3
+ end
data/lib/eu_cookies.rb ADDED
@@ -0,0 +1,9 @@
1
+ require "eu_cookies/version"
2
+ require "eu_cookies/engine"
3
+ require 'js_cookie_rails'
4
+
5
+ module EuCookies
6
+ mattr_accessor :enabled
7
+ mattr_accessor :position
8
+ mattr_accessor :use_scroll
9
+ end
@@ -0,0 +1,13 @@
1
+ module EuCookies
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ def add_javascripts
5
+ append_file 'app/assets/javascripts/application.js', "//= require eu_cookies\n"
6
+ end
7
+
8
+ def add_stylesheets
9
+ inject_into_file 'app/assets/stylesheets/application.css', "*= require eu_cookies\n", before: /\*\//, verbose: true
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,45 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Cookies Bar", type: :feature, js: true do
4
+ before do
5
+ visit homepages_path
6
+ expect_cookie_bar
7
+ end
8
+
9
+ it "show cookies bar unless accepted" do
10
+ visit homepages_path
11
+ expect_cookie_bar
12
+ end
13
+
14
+ it "remove cookie bar on click" do
15
+ click_button I18n.t('eu_cookies.ok')
16
+ dont_expect_cookie_bar
17
+ end
18
+
19
+ it "remove cookie bar on scroll" do
20
+ pending "TODO"
21
+ EuCookies.use_scroll = true
22
+ # scroll
23
+ dont_expect_cookie_bar
24
+ end
25
+
26
+ it "does not show cookie bar if accepted" do
27
+ click_button I18n.t('eu_cookies.ok')
28
+ visit homepages_path
29
+ dont_expect_cookie_bar
30
+ end
31
+
32
+ it "allow to disable cookie bar" do
33
+ EuCookies.enabled = false
34
+ visit homepages_path
35
+ dont_expect_cookie_bar
36
+ end
37
+ end
38
+
39
+ def expect_cookie_bar
40
+ expect(page).to have_text I18n.t('eu_cookies.cookies_text')
41
+ end
42
+
43
+ def dont_expect_cookie_bar
44
+ expect(page).to_not have_text I18n.t('eu_cookies.cookies_text')
45
+ end
@@ -0,0 +1,4 @@
1
+ class HomepagesController < ActionController::Base
2
+ def index
3
+ end
4
+ end
@@ -0,0 +1,31 @@
1
+ <%= stylesheet_link_tag 'eu_cookies' %>
2
+ <%= javascript_include_tag 'jquery' %>
3
+ <%= javascript_include_tag 'eu_cookies' %>
4
+
5
+ <%= cookies_bar %>
6
+
7
+ Dummy homepage
8
+
9
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
10
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
11
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
12
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
13
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
14
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
15
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
16
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
17
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
18
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
19
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
20
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
21
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
22
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
23
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
24
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
25
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
26
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
27
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
28
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
29
+ <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
30
+
31
+ <div id"footer"></div>
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ resources :homepages, only: :index
3
+ end
@@ -0,0 +1 @@
1
+ *.log
File without changes
@@ -0,0 +1,39 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ require 'combustion'
5
+ require 'capybara/rspec'
6
+
7
+ Combustion.initialize! :action_controller, :action_view, :sprockets
8
+
9
+ require 'rspec/rails'
10
+ require 'capybara/rails'
11
+
12
+ RSpec.configure do |config|
13
+
14
+ config.use_transactional_fixtures = true
15
+
16
+ # rspec-expectations config goes here. You can use an alternate
17
+ # assertion/expectation library such as wrong or the stdlib/minitest
18
+ # assertions if you prefer.
19
+ config.expect_with :rspec do |expectations|
20
+ # This option will default to `true` in RSpec 4. It makes the `description`
21
+ # and `failure_message` of custom matchers include text for helper methods
22
+ # defined using `chain`, e.g.:
23
+ # be_bigger_than(2).and_smaller_than(4).description
24
+ # # => "be bigger than 2 and smaller than 4"
25
+ # ...rather than:
26
+ # # => "be bigger than 2"
27
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
28
+ end
29
+
30
+ # rspec-mocks config goes here. You can use an alternate test double
31
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
32
+ config.mock_with :rspec do |mocks|
33
+ # Prevents you from mocking or stubbing a method that does not exist on
34
+ # a real object. This is generally recommended, and will default to
35
+ # `true` in RSpec 4.
36
+ mocks.verify_partial_doubles = true
37
+ end
38
+
39
+ end
metadata ADDED
@@ -0,0 +1,242 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: eu_cookies
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alessandro Lepore
8
+ - Stjepan Hadjic
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2015-06-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: js_cookie_rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.3'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.3'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rspec-rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '3.2'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '3.2'
70
+ - !ruby/object:Gem::Dependency
71
+ name: capybara
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '2.4'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '2.4'
84
+ - !ruby/object:Gem::Dependency
85
+ name: combustion
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: 0.5.3
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: 0.5.3
98
+ - !ruby/object:Gem::Dependency
99
+ name: actionpack
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '4.2'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '4.2'
112
+ - !ruby/object:Gem::Dependency
113
+ name: actionview
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '4.2'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '4.2'
126
+ - !ruby/object:Gem::Dependency
127
+ name: sprockets-rails
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '2.3'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '2.3'
140
+ - !ruby/object:Gem::Dependency
141
+ name: selenium-webdriver
142
+ requirement: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '2.45'
147
+ type: :development
148
+ prerelease: false
149
+ version_requirements: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '2.45'
154
+ - !ruby/object:Gem::Dependency
155
+ name: sass-rails
156
+ requirement: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '5.0'
161
+ type: :development
162
+ prerelease: false
163
+ version_requirements: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '5.0'
168
+ description: A complete Rails solution to the European Cookie Law issue
169
+ email:
170
+ - a.lepore@freegoweb.it
171
+ executables: []
172
+ extensions: []
173
+ extra_rdoc_files: []
174
+ files:
175
+ - ".gitignore"
176
+ - ".rspec"
177
+ - Gemfile
178
+ - LICENSE.txt
179
+ - README.md
180
+ - Rakefile
181
+ - app/assets/javascripts/eu_cookies.js
182
+ - app/assets/stylesheets/eu_cookies.css.scss
183
+ - app/helpers/eu_cookies_helper.rb
184
+ - app/views/eu_cookies/_cookies_bar.html.erb
185
+ - app/views/eu_cookies/cookies_info.html.haml
186
+ - config.ru
187
+ - config/locales/de.yml
188
+ - config/locales/ee.yml
189
+ - config/locales/en.yml
190
+ - config/locales/es.yml
191
+ - config/locales/fr.yml
192
+ - config/locales/hr.yml
193
+ - config/locales/it.yml
194
+ - config/locales/nl.yml
195
+ - config/locales/no.yml
196
+ - config/locales/ru.yml
197
+ - config/locales/se.yml
198
+ - config/locales/sl.yml
199
+ - eu_cookies.gemspec
200
+ - lib/eu_cookies.rb
201
+ - lib/eu_cookies/engine.rb
202
+ - lib/eu_cookies/version.rb
203
+ - lib/generators/eu_cookies/install/install_generator.rb
204
+ - spec/features/cookies_bar_spec.rb
205
+ - spec/internal/app/controllers/homepages_controller.rb
206
+ - spec/internal/app/views/homepages/index.html.erb
207
+ - spec/internal/config/routes.rb
208
+ - spec/internal/log/.gitignore
209
+ - spec/internal/public/favicon.ico
210
+ - spec/spec_helper.rb
211
+ homepage: https://github.com/freego/eu_cookies
212
+ licenses:
213
+ - MIT
214
+ metadata: {}
215
+ post_install_message:
216
+ rdoc_options: []
217
+ require_paths:
218
+ - lib
219
+ required_ruby_version: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - ">="
222
+ - !ruby/object:Gem::Version
223
+ version: 1.9.3
224
+ required_rubygems_version: !ruby/object:Gem::Requirement
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ version: '0'
229
+ requirements: []
230
+ rubyforge_project:
231
+ rubygems_version: 2.4.6
232
+ signing_key:
233
+ specification_version: 4
234
+ summary: A complete Rails solution to the European Cookie Law issue
235
+ test_files:
236
+ - spec/features/cookies_bar_spec.rb
237
+ - spec/internal/app/controllers/homepages_controller.rb
238
+ - spec/internal/app/views/homepages/index.html.erb
239
+ - spec/internal/config/routes.rb
240
+ - spec/internal/log/.gitignore
241
+ - spec/internal/public/favicon.ico
242
+ - spec/spec_helper.rb