eu_cookies 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -8
- data/app/assets/stylesheets/eu_cookies/_variables.scss +7 -0
- data/app/assets/stylesheets/{eu_cookies.css.scss → eu_cookies/style.css.scss} +1 -7
- data/eu_cookies.gemspec +8 -7
- data/lib/eu_cookies/version.rb +1 -1
- data/lib/generators/eu_cookies/install/install_generator.rb +6 -0
- data/lib/generators/eu_cookies/install/templates/eu_cookies.scss +7 -0
- metadata +23 -21
- data/spec/features/cookies_bar_spec.rb +0 -45
- data/spec/internal/app/controllers/homepages_controller.rb +0 -4
- data/spec/internal/app/views/homepages/index.html.erb +0 -31
- data/spec/internal/config/routes.rb +0 -3
- data/spec/internal/log/.gitignore +0 -1
- data/spec/internal/public/favicon.ico +0 -0
- data/spec/spec_helper.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9bd1942444171419ab2c43b3c3edf49d2e3f965
|
4
|
+
data.tar.gz: 75a846b6ece9ac7ea2a5f9917ecaa61e98375c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11224097d24acbf796265856a929a36231d23456585501b0215a949941c80f6fb2ff4f49ab6a1df6e331387e765f165989ee44259e80af45ed2db6a4b68ed56f
|
7
|
+
data.tar.gz: b084afc988f98b4e5b54d7c89b510f295c34a31b17927b8df742920c94eb8f0a6ea65eb49d47c91741e9c238fa260c4b115c8acc7e2d642816cb383e94189d3f
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ NOTE: This gem imply that you have a working JQuery installation.
|
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
-
|
30
|
+
Just add this on you application layout template:
|
31
31
|
|
32
32
|
```erb
|
33
33
|
<%= cookies_bar %>
|
@@ -39,13 +39,8 @@ You can add a link parameter to link to your cookies explanation page (you have
|
|
39
39
|
<%= cookies_bar link: '/cookies' %>
|
40
40
|
```
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
```javascript
|
45
|
-
.eu_cookies // main div
|
46
|
-
.eu_cookies_ok // button
|
47
|
-
.eu_cookies_link // link
|
48
|
-
```
|
42
|
+
To quickly customize the style you can override [Sass variables](https://github.com/freego/eu_cookies/blob/master/app/assets/stylesheets/eu_cookies/_variables.scss)
|
43
|
+
on your `app/assets/stylesheets/eu_cookies.scss` file.
|
49
44
|
|
50
45
|
## Configuration
|
51
46
|
|
@@ -0,0 +1,7 @@
|
|
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;
|
@@ -1,10 +1,4 @@
|
|
1
|
-
|
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;
|
1
|
+
@import "eu_cookies/variables";
|
8
2
|
|
9
3
|
.eu-cookies[data-position="bottom"] {
|
10
4
|
bottom: 0;
|
data/eu_cookies.gemspec
CHANGED
@@ -8,21 +8,22 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = EuCookies::VERSION
|
9
9
|
spec.authors = ["Alessandro Lepore", "Stjepan Hadjic"]
|
10
10
|
spec.email = ["a.lepore@freegoweb.it"]
|
11
|
-
|
12
|
-
spec.summary =
|
11
|
+
|
12
|
+
spec.summary = %q{A complete Rails solution to the European Cookie Law issue}
|
13
|
+
spec.description = spec.summary
|
13
14
|
spec.homepage = "https://github.com/freego/eu_cookies"
|
14
15
|
spec.license = "MIT"
|
15
16
|
spec.required_ruby_version = '>= 1.9.3'
|
16
17
|
|
17
|
-
spec.files = `git ls-files`.split(
|
18
|
-
spec.executables = spec.files.grep(%r{^
|
19
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.
|
22
|
+
spec.add_runtime_dependency "railties", ">= 3.1"
|
23
|
+
spec.add_runtime_dependency "js_cookie_rails", "~> 1.0"
|
23
24
|
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.3"
|
25
|
-
spec.add_development_dependency "rake"
|
26
|
+
spec.add_development_dependency "rake", "~> 10"
|
26
27
|
spec.add_development_dependency "rspec-rails", "~> 3.2"
|
27
28
|
spec.add_development_dependency "capybara", "~> 2.4"
|
28
29
|
spec.add_development_dependency "combustion", "~> 0.5.3"
|
data/lib/eu_cookies/version.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module EuCookies
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
|
+
|
4
6
|
def add_javascripts
|
5
7
|
append_file 'app/assets/javascripts/application.js', "//= require eu_cookies\n"
|
6
8
|
end
|
@@ -8,6 +10,10 @@ module EuCookies
|
|
8
10
|
def add_stylesheets
|
9
11
|
inject_into_file 'app/assets/stylesheets/application.css', "*= require eu_cookies\n", before: /\*\//, verbose: true
|
10
12
|
end
|
13
|
+
|
14
|
+
def create_stylesheet
|
15
|
+
template 'eu_cookies.scss', 'app/assets/stylesheets/eu_cookies.scss'
|
16
|
+
end
|
11
17
|
end
|
12
18
|
end
|
13
19
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
// You can override Sass variables here. For variables list see:
|
2
|
+
// See https://github.com/freego/eu_cookies/blob/master/app/assets/stylesheets/eu_cookies/_variables.scss
|
3
|
+
|
4
|
+
// $cookies-bar-background-color: red;
|
5
|
+
|
6
|
+
// keep this on the last line
|
7
|
+
@import "eu_cookies/style";
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eu_cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Lepore
|
@@ -11,6 +11,20 @@ bindir: bin
|
|
11
11
|
cert_chain: []
|
12
12
|
date: 2015-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: railties
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '3.1'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '3.1'
|
14
28
|
- !ruby/object:Gem::Dependency
|
15
29
|
name: js_cookie_rails
|
16
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,16 +57,16 @@ dependencies:
|
|
43
57
|
name: rake
|
44
58
|
requirement: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
|
-
- - "
|
60
|
+
- - "~>"
|
47
61
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
62
|
+
version: '10'
|
49
63
|
type: :development
|
50
64
|
prerelease: false
|
51
65
|
version_requirements: !ruby/object:Gem::Requirement
|
52
66
|
requirements:
|
53
|
-
- - "
|
67
|
+
- - "~>"
|
54
68
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
69
|
+
version: '10'
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: rspec-rails
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +193,8 @@ files:
|
|
179
193
|
- README.md
|
180
194
|
- Rakefile
|
181
195
|
- app/assets/javascripts/eu_cookies.js
|
182
|
-
- app/assets/stylesheets/eu_cookies.
|
196
|
+
- app/assets/stylesheets/eu_cookies/_variables.scss
|
197
|
+
- app/assets/stylesheets/eu_cookies/style.css.scss
|
183
198
|
- app/helpers/eu_cookies_helper.rb
|
184
199
|
- app/views/eu_cookies/_cookies_bar.html.erb
|
185
200
|
- app/views/eu_cookies/cookies_info.html.haml
|
@@ -201,13 +216,7 @@ files:
|
|
201
216
|
- lib/eu_cookies/engine.rb
|
202
217
|
- lib/eu_cookies/version.rb
|
203
218
|
- lib/generators/eu_cookies/install/install_generator.rb
|
204
|
-
-
|
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
|
219
|
+
- lib/generators/eu_cookies/install/templates/eu_cookies.scss
|
211
220
|
homepage: https://github.com/freego/eu_cookies
|
212
221
|
licenses:
|
213
222
|
- MIT
|
@@ -232,11 +241,4 @@ rubygems_version: 2.4.6
|
|
232
241
|
signing_key:
|
233
242
|
specification_version: 4
|
234
243
|
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
|
244
|
+
test_files: []
|
@@ -1,45 +0,0 @@
|
|
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
|
@@ -1,31 +0,0 @@
|
|
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>
|
@@ -1 +0,0 @@
|
|
1
|
-
*.log
|
File without changes
|
data/spec/spec_helper.rb
DELETED
@@ -1,39 +0,0 @@
|
|
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
|