micoo 0.1.3 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +16 -1
- data/app/components/cookies_component.rb +4 -2
- data/lib/micoo/version.rb +2 -1
- data/lib/micoo/version.rb.bak +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c82aee71a8f615ee75b99c1b14d640b0b09886a73460482efe9e5bba96da02b
|
|
4
|
+
data.tar.gz: 19de10e0ac48e27806b38c7ba723089e4492c5b8981107334525fb75157cb61d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96fba69bce87544895ed7b292c953e7295053a180e2ad8b93ecf6c03dc8a970c6639caa4bf59f336a41d0131a0e776ad6105167b55d04dec5d5982b460782967
|
|
7
|
+
data.tar.gz: 94a73329dc3ceced61c709b9056b818c1ee7732771505ba1ac5e30daebd76c67b21f21fd6f85e05a0134d1e7725c7d2d194820d57138564f93ca4ba8dc9f55ff
|
data/README.md
CHANGED
|
@@ -34,7 +34,7 @@ add additional text and links for further description.
|
|
|
34
34
|
### _url_
|
|
35
35
|
|
|
36
36
|
Redirection to _url_ will be triggered by clicking *Accept* or *Reject*.
|
|
37
|
-
|
|
37
|
+
Default is "/".
|
|
38
38
|
|
|
39
39
|
## Usage
|
|
40
40
|
|
|
@@ -51,6 +51,21 @@ Defult is "/".
|
|
|
51
51
|
...
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
## I18n
|
|
55
|
+
You may provide an "internationalized" text via the _text_ parameter.
|
|
56
|
+
|
|
57
|
+
_Micoo_ buttons uses the I18n.translate method for the legend.
|
|
58
|
+
A configuration file (a sample) may be:
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
# config/locales/en.yml
|
|
62
|
+
en:
|
|
63
|
+
micoo:
|
|
64
|
+
button:
|
|
65
|
+
accept: Accept
|
|
66
|
+
reject: Reject
|
|
67
|
+
```
|
|
68
|
+
|
|
54
69
|
## Installation
|
|
55
70
|
As usual:
|
|
56
71
|
|
|
@@ -48,6 +48,8 @@ class CookiesComponent < ViewComponent::Base
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
#cookies
|
|
51
|
+
- accept_text = t("micoo.button.accept", default: "Accept")
|
|
52
|
+
- reject_text = t("micoo.button.reject", default: "Reject")
|
|
51
53
|
- @url ||= "/"
|
|
52
54
|
- [@text].flatten.each do |line|
|
|
53
55
|
p = line.html_safe
|
|
@@ -55,8 +57,8 @@ class CookiesComponent < ViewComponent::Base
|
|
|
55
57
|
p = line.html_safe
|
|
56
58
|
.buttons
|
|
57
59
|
button
|
|
58
|
-
a href=helpers.cookies_path(cookiesOK: :x, url: @url)
|
|
60
|
+
a href=helpers.cookies_path(cookiesOK: :x, url: @url) = accept_text
|
|
59
61
|
button
|
|
60
|
-
a href=helpers.cookies_path(url: @url)
|
|
62
|
+
a href=helpers.cookies_path(url: @url) = reject_text
|
|
61
63
|
HEREDOC
|
|
62
64
|
end
|
data/lib/micoo/version.rb
CHANGED
data/lib/micoo/version.rb.bak
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: micoo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dittmar Krall
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-05-
|
|
11
|
+
date: 2024-05-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: combustion
|