ribbonit 0.3.0 → 2.0.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 +5 -5
- data/.rubocop.yml +12 -11
- data/.simplecov +5 -6
- data/CHANGELOG.md +58 -29
- data/Gemfile +7 -0
- data/README.md +9 -7
- data/app/assets/stylesheets/ribbon.css +204 -0
- data/{lib/app/views/partials → app/views/application}/_lines.html.erb +6 -0
- data/{lib/app/views/partials → app/views/application}/_ribbon.html.erb +2 -2
- data/bin/rspec +1 -2
- data/bin/rubocop +1 -2
- data/lib/generators/ribbonit/install_generator.rb +1 -2
- data/lib/generators/ribbonit/templates/ribbonit.rb +5 -0
- data/lib/ribbonit/configuration.rb +16 -16
- data/lib/ribbonit/rails/engine.rb +1 -5
- data/lib/ribbonit/version.rb +1 -1
- data/lib/ribbonit/view_helpers.rb +9 -2
- data/ribbonit.gemspec +4 -11
- metadata +11 -126
- data/vendor/assets/stylesheets/_ribbon.sass +0 -143
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: f83935018a2b13e6ea6b47eb7c9f57429ce1d136f3946ea1d578aaca0c819565
|
|
4
|
+
data.tar.gz: 86a81eb156007cf4058c5d11e96c5fab629e5dfc75668048b7b72822a3e21420
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0af9e8207ae140322d7facba1bd121263ff595773507a6dae6b4bb587231ec0ad7e1584d64680e887873c9c615079e941291054510ec47df0251799eb0dc735d
|
|
7
|
+
data.tar.gz: 5e977b649b626e89df3118ff8b6b740497e19db2f997f1d7531c56d356c71b1cfe7edf740510326e0b157f1dd088c5b732ddba6d5dd7b66e4f502fe4f58a19b0
|
data/.rubocop.yml
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
inherit_from:
|
|
2
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-bundler.yml
|
|
3
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-layout.yml
|
|
4
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-lint.yml
|
|
5
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-naming.yml
|
|
6
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-performance.yml
|
|
7
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-style.yml
|
|
8
|
-
- https://raw.githubusercontent.com/anthony-robin/rubocop-rules/master/.rubocop-rails.yml
|
|
9
|
-
|
|
10
1
|
AllCops:
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
NewCops: enable
|
|
3
|
+
SuggestExtensions: false
|
|
4
|
+
TargetRubyVersion: 2.7
|
|
5
|
+
|
|
6
|
+
Layout/LineLength:
|
|
7
|
+
Enabled: false
|
|
8
|
+
|
|
9
|
+
Style/FrozenStringLiteralComment:
|
|
10
|
+
Enabled: false
|
|
11
|
+
|
|
12
|
+
Style/Documentation:
|
|
13
|
+
Enabled: false
|
data/.simplecov
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
SimpleCov
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
])
|
|
1
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
2
|
+
[
|
|
3
|
+
SimpleCov::Formatter::HTMLFormatter
|
|
4
|
+
]
|
|
5
|
+
)
|
|
7
6
|
|
|
8
7
|
SimpleCov.start do
|
|
9
8
|
add_group 'lib', 'lib'
|
data/CHANGELOG.md
CHANGED
|
@@ -1,59 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
4
|
-
|
|
3
|
+
## [Unreleased](https://github.com/anthony-robin/ribbonit/tree/HEAD)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/v1.0.0...HEAD)
|
|
6
|
+
|
|
7
|
+
**Closed issues:**
|
|
8
|
+
|
|
9
|
+
- +YJIT [\#27](https://github.com/anthony-robin/ribbonit/issues/27)
|
|
10
|
+
- config for production [\#22](https://github.com/anthony-robin/ribbonit/issues/22)
|
|
11
|
+
|
|
12
|
+
## [v1.0.0](https://github.com/anthony-robin/ribbonit/tree/v1.0.0) (2023-12-09)
|
|
13
|
+
|
|
14
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/v0.3.0...v1.0.0)
|
|
15
|
+
|
|
16
|
+
**Implemented enhancements:**
|
|
17
|
+
|
|
18
|
+
- USE `I18n` files to store hardcoded texts [\#9](https://github.com/anthony-robin/ribbonit/issues/9)
|
|
19
|
+
- Add `extra_content` configuration option [\#28](https://github.com/anthony-robin/ribbonit/pull/28) ([anthony-robin](https://github.com/anthony-robin))
|
|
20
|
+
|
|
21
|
+
**Closed issues:**
|
|
22
|
+
|
|
23
|
+
- ADD option to display 'server' name [\#20](https://github.com/anthony-robin/ribbonit/issues/20)
|
|
24
|
+
- ADD specs [\#15](https://github.com/anthony-robin/ribbonit/issues/15)
|
|
25
|
+
|
|
26
|
+
## [v0.3.0](https://github.com/anthony-robin/ribbonit/tree/v0.3.0) (2017-11-06)
|
|
27
|
+
|
|
28
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/v0.2.1...v0.3.0)
|
|
5
29
|
|
|
6
30
|
**Implemented enhancements:**
|
|
7
31
|
|
|
8
|
-
- REFACTOR way to define environments to apply [\#25](https://github.com/anthony-robin/
|
|
9
|
-
- UPDATE Rubocop sources [\#24](https://github.com/anthony-robin/
|
|
32
|
+
- REFACTOR way to define environments to apply [\#25](https://github.com/anthony-robin/ribbonit/pull/25) ([anthony-robin](https://github.com/anthony-robin))
|
|
33
|
+
- UPDATE Rubocop sources [\#24](https://github.com/anthony-robin/ribbonit/pull/24) ([anthony-robin](https://github.com/anthony-robin))
|
|
10
34
|
|
|
11
35
|
**Merged pull requests:**
|
|
12
36
|
|
|
13
|
-
- CLEAN documentation options [\#26](https://github.com/anthony-robin/
|
|
37
|
+
- CLEAN documentation options [\#26](https://github.com/anthony-robin/ribbonit/pull/26) ([anthony-robin](https://github.com/anthony-robin))
|
|
14
38
|
|
|
15
|
-
## [v0.2.1](https://github.com/anthony-robin/
|
|
16
|
-
|
|
39
|
+
## [v0.2.1](https://github.com/anthony-robin/ribbonit/tree/v0.2.1) (2017-06-04)
|
|
40
|
+
|
|
41
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/v0.2.0...v0.2.1)
|
|
17
42
|
|
|
18
43
|
**Fixed bugs:**
|
|
19
44
|
|
|
20
|
-
- FIX broken CSS [\#21](https://github.com/anthony-robin/
|
|
45
|
+
- FIX broken CSS [\#21](https://github.com/anthony-robin/ribbonit/pull/21) ([anthony-robin](https://github.com/anthony-robin))
|
|
46
|
+
|
|
47
|
+
## [v0.2.0](https://github.com/anthony-robin/ribbonit/tree/v0.2.0) (2017-05-28)
|
|
21
48
|
|
|
22
|
-
|
|
23
|
-
[Full Changelog](https://github.com/anthony-robin/Ribbonit/compare/v0.1.0...v0.2.0)
|
|
49
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/v0.1.0...v0.2.0)
|
|
24
50
|
|
|
25
51
|
**Implemented enhancements:**
|
|
26
52
|
|
|
27
|
-
- REFACTOR style using BEM syntax [\#19](https://github.com/anthony-robin/
|
|
28
|
-
- ADD 'root\_link' option that wraps ribbon [\#18](https://github.com/anthony-robin/
|
|
29
|
-
- ADD Changelog file [\#17](https://github.com/anthony-robin/
|
|
30
|
-
- ADD 'git\_branch' option [\#14](https://github.com/anthony-robin/
|
|
31
|
-
- ADD 'sticky' option [\#13](https://github.com/anthony-robin/
|
|
32
|
-
- USE Array for infos [\#12](https://github.com/anthony-robin/
|
|
33
|
-
- REPLACE 'minitest' by 'rspec' [\#8](https://github.com/anthony-robin/
|
|
34
|
-
- ADD Codacy badges [\#5](https://github.com/anthony-robin/
|
|
35
|
-
- ADD Gemnasium badge [\#4](https://github.com/anthony-robin/
|
|
36
|
-
- ADD badge displaying 'gem' version [\#3](https://github.com/anthony-robin/
|
|
53
|
+
- REFACTOR style using BEM syntax [\#19](https://github.com/anthony-robin/ribbonit/pull/19) ([anthony-robin](https://github.com/anthony-robin))
|
|
54
|
+
- ADD 'root\_link' option that wraps ribbon [\#18](https://github.com/anthony-robin/ribbonit/pull/18) ([anthony-robin](https://github.com/anthony-robin))
|
|
55
|
+
- ADD Changelog file [\#17](https://github.com/anthony-robin/ribbonit/pull/17) ([anthony-robin](https://github.com/anthony-robin))
|
|
56
|
+
- ADD 'git\_branch' option [\#14](https://github.com/anthony-robin/ribbonit/pull/14) ([anthony-robin](https://github.com/anthony-robin))
|
|
57
|
+
- ADD 'sticky' option [\#13](https://github.com/anthony-robin/ribbonit/pull/13) ([anthony-robin](https://github.com/anthony-robin))
|
|
58
|
+
- USE Array for infos [\#12](https://github.com/anthony-robin/ribbonit/pull/12) ([anthony-robin](https://github.com/anthony-robin))
|
|
59
|
+
- REPLACE 'minitest' by 'rspec' [\#8](https://github.com/anthony-robin/ribbonit/pull/8) ([anthony-robin](https://github.com/anthony-robin))
|
|
60
|
+
- ADD Codacy badges [\#5](https://github.com/anthony-robin/ribbonit/pull/5) ([anthony-robin](https://github.com/anthony-robin))
|
|
61
|
+
- ADD Gemnasium badge [\#4](https://github.com/anthony-robin/ribbonit/pull/4) ([anthony-robin](https://github.com/anthony-robin))
|
|
62
|
+
- ADD badge displaying 'gem' version [\#3](https://github.com/anthony-robin/ribbonit/pull/3) ([anthony-robin](https://github.com/anthony-robin))
|
|
37
63
|
|
|
38
64
|
**Fixed bugs:**
|
|
39
65
|
|
|
40
|
-
- RUN specs with Travis [\#7](https://github.com/anthony-robin/
|
|
66
|
+
- RUN specs with Travis [\#7](https://github.com/anthony-robin/ribbonit/pull/7) ([anthony-robin](https://github.com/anthony-robin))
|
|
41
67
|
|
|
42
68
|
**Closed issues:**
|
|
43
69
|
|
|
44
|
-
- ADD 'git\_branch' option to Ribbon displayed informations [\#16](https://github.com/anthony-robin/
|
|
45
|
-
- CREATE a 'CHANGELOG' file [\#11](https://github.com/anthony-robin/
|
|
46
|
-
- ADD 'sticky' option to Ribbon configuration [\#10](https://github.com/anthony-robin/
|
|
70
|
+
- ADD 'git\_branch' option to Ribbon displayed informations [\#16](https://github.com/anthony-robin/ribbonit/issues/16)
|
|
71
|
+
- CREATE a 'CHANGELOG' file [\#11](https://github.com/anthony-robin/ribbonit/issues/11)
|
|
72
|
+
- ADD 'sticky' option to Ribbon configuration [\#10](https://github.com/anthony-robin/ribbonit/issues/10)
|
|
73
|
+
|
|
74
|
+
## [v0.1.0](https://github.com/anthony-robin/ribbonit/tree/v0.1.0) (2017-05-21)
|
|
75
|
+
|
|
76
|
+
[Full Changelog](https://github.com/anthony-robin/ribbonit/compare/d88c4473e5d90902326a4ddbc398237872ee4462...v0.1.0)
|
|
47
77
|
|
|
48
|
-
## [v0.1.0](https://github.com/anthony-robin/Ribbonit/tree/v0.1.0) (2017-05-21)
|
|
49
78
|
**Implemented enhancements:**
|
|
50
79
|
|
|
51
|
-
- UPDATE travis instructions, FIX rubocop offenses [\#1](https://github.com/anthony-robin/
|
|
80
|
+
- UPDATE travis instructions, FIX rubocop offenses [\#1](https://github.com/anthony-robin/ribbonit/pull/1) ([anthony-robin](https://github.com/anthony-robin))
|
|
52
81
|
|
|
53
82
|
**Fixed bugs:**
|
|
54
83
|
|
|
55
|
-
- ADD 'line-height' css property [\#2](https://github.com/anthony-robin/
|
|
84
|
+
- ADD 'line-height' css property [\#2](https://github.com/anthony-robin/ribbonit/pull/2) ([anthony-robin](https://github.com/anthony-robin))
|
|
56
85
|
|
|
57
86
|
|
|
58
87
|
|
|
59
|
-
\* *This
|
|
88
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/Gemfile
CHANGED
data/README.md
CHANGED
|
@@ -5,10 +5,6 @@
|
|
|
5
5
|
It is completely inspired from the Github 'fork me' ribbon.
|
|
6
6
|
|
|
7
7
|
[](https://rubygems.org/gems/ribbonit)
|
|
8
|
-
[](https://travis-ci.org/anthony-robin/Ribbonit)
|
|
9
|
-
[](https://www.codacy.com/app/anthony-robin/Ribbonit)
|
|
10
|
-
[](https://www.codacy.com/app/anthony-robin/Ribbonit)
|
|
11
|
-
[](https://gemnasium.com/github.com/anthony-robin/Ribbonit)
|
|
12
8
|
|
|
13
9
|
## Installation
|
|
14
10
|
|
|
@@ -39,9 +35,12 @@ $ bin/rails g ribbonit:install
|
|
|
39
35
|
This will create a `ribbonit.rb` file in `config/initializers`
|
|
40
36
|
|
|
41
37
|
2) Import assets
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
```css
|
|
39
|
+
/* application.css */
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
*= require ribbon
|
|
43
|
+
*/
|
|
45
44
|
```
|
|
46
45
|
|
|
47
46
|
3) Call ribbon in layout
|
|
@@ -63,6 +62,9 @@ Ribbonit.configure do |config|
|
|
|
63
62
|
# git_branch: Current git branch (only displayed in development)
|
|
64
63
|
config.infos_to_display = %i[rails_version ruby_version git_branch]
|
|
65
64
|
|
|
65
|
+
# additional extra content to display at the bottom of ribbon
|
|
66
|
+
config.extra_content = nil # 'Foo bar'
|
|
67
|
+
|
|
66
68
|
config.root_link = false # Wrap ribbon with root_url link ?
|
|
67
69
|
|
|
68
70
|
config.hide_for_small = true # Display ribbon in small devices ?
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--ribbon-width: 165px;
|
|
3
|
+
--ribbon-height: 165px;
|
|
4
|
+
|
|
5
|
+
--ribbon-top: 33px;
|
|
6
|
+
--ribbon-left: -66px;
|
|
7
|
+
--ribbon-offset: -5px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.ribbon,
|
|
11
|
+
.ribbon__container {
|
|
12
|
+
-webkit-box-sizing: border-box;
|
|
13
|
+
-moz-box-sizing: border-box;
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.ribbon {
|
|
18
|
+
display: block;
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
left: 0;
|
|
22
|
+
width: var(--ribbon-width);
|
|
23
|
+
height: var(--ribbon-height);
|
|
24
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
line-height: 1rem;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
z-index: 1001;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ribbon__container {
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: var(--ribbon-top);
|
|
34
|
+
left: var(--ribbon-left);
|
|
35
|
+
width: 260px;
|
|
36
|
+
padding: 7px 40px;
|
|
37
|
+
transform: rotate(-45deg);
|
|
38
|
+
background: #333;
|
|
39
|
+
color: #fff;
|
|
40
|
+
font-size: 1rem;
|
|
41
|
+
text-align: center;
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.ribbon__container a {
|
|
47
|
+
display: block;
|
|
48
|
+
color: inherit;
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ribbon__container a:hover {
|
|
53
|
+
color: inherit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ribbon__container::before,
|
|
57
|
+
.ribbon__container::after {
|
|
58
|
+
display: block;
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: 1px;
|
|
61
|
+
left: 0;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 1px;
|
|
64
|
+
background: #fff;
|
|
65
|
+
content: '';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ribbon__container::after {
|
|
69
|
+
top: auto;
|
|
70
|
+
bottom: 1px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ribbon__container--orange {
|
|
74
|
+
background: #f80;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ribbon__container--blue {
|
|
78
|
+
background: #49a;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ribbon__container--green {
|
|
82
|
+
background: #090;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ribbon__container--red {
|
|
86
|
+
background: #a00;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.ribbon__container--purple {
|
|
90
|
+
background: #551a8b;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.ribbon__container--black {
|
|
94
|
+
background: #333;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ribbon__container--white {
|
|
98
|
+
background: #fff;
|
|
99
|
+
color: #333;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ribbon__container--white a {
|
|
103
|
+
color: #333;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.ribbon__container__environment {
|
|
107
|
+
display: block;
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.ribbon__container__version,
|
|
112
|
+
.ribbon__container__git {
|
|
113
|
+
display: block;
|
|
114
|
+
font-size: 11px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.ribbon--sticky {
|
|
118
|
+
position: fixed;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.ribbon--top-right {
|
|
122
|
+
right: 0;
|
|
123
|
+
left: inherit;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.ribbon--top-right .ribbon__container {
|
|
127
|
+
right: var(--ribbon-left);
|
|
128
|
+
left: inherit;
|
|
129
|
+
transform: rotate(45deg);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.ribbon--bottom-left {
|
|
133
|
+
top: inherit;
|
|
134
|
+
bottom: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ribbon--bottom-left .ribbon__container {
|
|
138
|
+
top: inherit;
|
|
139
|
+
bottom: var(--ribbon-top);
|
|
140
|
+
transform: rotate(45deg);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ribbon--bottom-right {
|
|
144
|
+
top: inherit;
|
|
145
|
+
right: 0;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
left: inherit;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.ribbon--bottom-right .ribbon__container {
|
|
151
|
+
top: inherit;
|
|
152
|
+
right: var(--ribbon-left);
|
|
153
|
+
bottom:var(--ribbon-top);
|
|
154
|
+
left: inherit;
|
|
155
|
+
transform: rotate(-45deg);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* 3 lines */
|
|
159
|
+
|
|
160
|
+
.ribbon--3-lines {
|
|
161
|
+
width: calc(var(--ribbon-width) + 15px);
|
|
162
|
+
height: calc(var(--ribbon-height) + 15px);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.ribbon--3-lines.ribbon--top-left,
|
|
166
|
+
.ribbon--4-lines.ribbon--top-left {
|
|
167
|
+
top: var(--ribbon-offset);
|
|
168
|
+
left: var(--ribbon-offset);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ribbon--3-lines.ribbon--top-right,
|
|
172
|
+
.ribbon--4-lines.ribbon--top-right {
|
|
173
|
+
top: var(--ribbon-offset);
|
|
174
|
+
right: var(--ribbon-offset);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.ribbon--3-lines.ribbon--bottom-left,
|
|
178
|
+
.ribbon--4-lines.ribbon--bottom-left {
|
|
179
|
+
bottom: var(--ribbon-offset);
|
|
180
|
+
left: var(--ribbon-offset);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.ribbon--3-lines.ribbon--bottom-right,
|
|
184
|
+
.ribbon--4-lines.ribbon--bottom-right {
|
|
185
|
+
right: var(--ribbon-offset);
|
|
186
|
+
bottom: var(--ribbon-offset);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* 4 lines */
|
|
190
|
+
|
|
191
|
+
.ribbon--4-lines {
|
|
192
|
+
width: calc(var(--ribbon-width) + 30px);
|
|
193
|
+
height: calc(var(--ribbon-height) + 30px);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.ribbon--4-lines .ribbon__container {
|
|
197
|
+
width: 280px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@media only screen and (max-width: 40em) {
|
|
201
|
+
.ribbon--hide-for-small {
|
|
202
|
+
display: none;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
<div class="ribbon__container ribbon__container--<%= config.themes[Rails.env.to_sym] %>">
|
|
7
7
|
<% if config.root_link %>
|
|
8
8
|
<%= link_to root_url do %>
|
|
9
|
-
<%= render '
|
|
9
|
+
<%= render 'lines', config: config %>
|
|
10
10
|
<% end %>
|
|
11
11
|
<% else %>
|
|
12
|
-
<%= render '
|
|
12
|
+
<%= render 'lines', config: config %>
|
|
13
13
|
<% end %>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
data/bin/rspec
CHANGED
data/bin/rubocop
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# rubocop:disable ClassAndModuleChildren
|
|
2
1
|
module Ribbonit
|
|
3
2
|
module Generators
|
|
4
3
|
class InstallGenerator < ::Rails::Generators::Base
|
|
5
4
|
desc 'Copy Ribbonit initializer configuration'
|
|
6
|
-
source_root File.expand_path('
|
|
5
|
+
source_root File.expand_path('templates', __dir__)
|
|
7
6
|
|
|
8
7
|
def copy_initializer
|
|
9
8
|
template 'ribbonit.rb', 'config/initializers/ribbonit.rb'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
require 'active_support/
|
|
1
|
+
require 'active_support/core_ext/class/attribute'
|
|
2
2
|
|
|
3
3
|
module Ribbonit
|
|
4
4
|
def self.configuration
|
|
5
|
-
@configuration ||=
|
|
5
|
+
@configuration ||= Configuration
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
def self.configure
|
|
@@ -10,20 +10,20 @@ module Ribbonit
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
class Configuration
|
|
13
|
-
|
|
13
|
+
class_attribute :infos_to_display, default: %i[
|
|
14
|
+
rails_version
|
|
15
|
+
ruby_version
|
|
16
|
+
]
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
staging: 'blue'
|
|
26
|
-
}
|
|
27
|
-
end
|
|
18
|
+
class_attribute :extra_content, default: nil
|
|
19
|
+
class_attribute :root_link, default: false
|
|
20
|
+
class_attribute :hide_for_small, default: true
|
|
21
|
+
class_attribute :position, default: 'top-left'
|
|
22
|
+
class_attribute :sticky, default: true
|
|
23
|
+
|
|
24
|
+
class_attribute :themes, default: {
|
|
25
|
+
development: 'black',
|
|
26
|
+
staging: 'blue'
|
|
27
|
+
}
|
|
28
28
|
end
|
|
29
29
|
end
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
require 'ribbonit/view_helpers'
|
|
2
2
|
|
|
3
|
-
# rubocop:disable ClassAndModuleChildren
|
|
4
3
|
module Ribbonit
|
|
5
4
|
module Rails
|
|
6
5
|
class Engine < ::Rails::Engine
|
|
7
6
|
initializer 'ribbonit.view_helpers' do |_app|
|
|
8
|
-
ActionView::Base.
|
|
9
|
-
ActiveSupport.on_load(:action_controller) do
|
|
10
|
-
append_view_path "#{Gem.loaded_specs['ribbonit'].full_gem_path}/lib/app/views/partials"
|
|
11
|
-
end
|
|
7
|
+
ActionView::Base.include ViewHelpers
|
|
12
8
|
end
|
|
13
9
|
end
|
|
14
10
|
end
|
data/lib/ribbonit/version.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Ribbonit
|
|
2
2
|
module ViewHelpers
|
|
3
3
|
def ribbonit
|
|
4
|
-
render '
|
|
4
|
+
render 'ribbon'
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def branch_name
|
|
@@ -10,10 +10,17 @@ module Ribbonit
|
|
|
10
10
|
|
|
11
11
|
def line_count
|
|
12
12
|
height = 1
|
|
13
|
-
items =
|
|
13
|
+
items = configuration.infos_to_display
|
|
14
14
|
height += 1 if items.include?(:ruby_version) || items.include?(:rails_version)
|
|
15
15
|
height += 1 if items.include?(:git_branch)
|
|
16
|
+
height += 1 if configuration.extra_content.present?
|
|
16
17
|
height
|
|
17
18
|
end
|
|
19
|
+
|
|
20
|
+
private
|
|
21
|
+
|
|
22
|
+
def configuration
|
|
23
|
+
Ribbonit.configuration
|
|
24
|
+
end
|
|
18
25
|
end
|
|
19
26
|
end
|
data/ribbonit.gemspec
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
3
|
require 'ribbonit/version'
|
|
5
4
|
|
|
@@ -18,14 +17,8 @@ Gem::Specification.new do |spec|
|
|
|
18
17
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
18
|
spec.require_paths = ['lib']
|
|
20
19
|
|
|
21
|
-
spec.
|
|
22
|
-
spec.add_dependency '
|
|
20
|
+
spec.required_ruby_version = '>= 2.7'
|
|
21
|
+
spec.add_dependency 'rails', '>= 5.2'
|
|
23
22
|
|
|
24
|
-
spec.
|
|
25
|
-
spec.add_development_dependency 'rake', '~> 12.0'
|
|
26
|
-
spec.add_development_dependency 'rspec', '~> 3.6'
|
|
27
|
-
spec.add_development_dependency 'byebug'
|
|
28
|
-
spec.add_development_dependency 'rubocop'
|
|
29
|
-
spec.add_development_dependency 'simplecov'
|
|
30
|
-
spec.add_development_dependency 'codacy-coverage', '~> 1.1'
|
|
23
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
31
24
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ribbonit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Anthony Robin
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rails
|
|
@@ -16,126 +15,14 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '5.2'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: sassc-rails
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ">="
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ">="
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '0'
|
|
41
|
-
- !ruby/object:Gem::Dependency
|
|
42
|
-
name: bundler
|
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
|
44
|
-
requirements:
|
|
45
|
-
- - "~>"
|
|
46
|
-
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.14'
|
|
48
|
-
type: :development
|
|
49
|
-
prerelease: false
|
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
-
requirements:
|
|
52
|
-
- - "~>"
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.14'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: rake
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - "~>"
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '12.0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - "~>"
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '12.0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: rspec
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - "~>"
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '3.6'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - "~>"
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '3.6'
|
|
83
|
-
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: byebug
|
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
|
86
|
-
requirements:
|
|
87
|
-
- - ">="
|
|
88
|
-
- !ruby/object:Gem::Version
|
|
89
|
-
version: '0'
|
|
90
|
-
type: :development
|
|
91
|
-
prerelease: false
|
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
-
requirements:
|
|
94
|
-
- - ">="
|
|
95
|
-
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0'
|
|
97
|
-
- !ruby/object:Gem::Dependency
|
|
98
|
-
name: rubocop
|
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
|
100
|
-
requirements:
|
|
101
|
-
- - ">="
|
|
102
|
-
- !ruby/object:Gem::Version
|
|
103
|
-
version: '0'
|
|
104
|
-
type: :development
|
|
105
|
-
prerelease: false
|
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
-
requirements:
|
|
108
|
-
- - ">="
|
|
109
|
-
- !ruby/object:Gem::Version
|
|
110
|
-
version: '0'
|
|
111
|
-
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: simplecov
|
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
|
114
|
-
requirements:
|
|
115
|
-
- - ">="
|
|
116
|
-
- !ruby/object:Gem::Version
|
|
117
|
-
version: '0'
|
|
118
|
-
type: :development
|
|
119
|
-
prerelease: false
|
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - ">="
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: codacy-coverage
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - "~>"
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '1.1'
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - "~>"
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '1.1'
|
|
25
|
+
version: '5.2'
|
|
139
26
|
description: Display an elegant Github like ribbon to your Rails application showing
|
|
140
27
|
environment informations (Rails environment, Ruby version, Rails version, ...)
|
|
141
28
|
email:
|
|
@@ -153,12 +40,13 @@ files:
|
|
|
153
40
|
- Gemfile
|
|
154
41
|
- README.md
|
|
155
42
|
- Rakefile
|
|
43
|
+
- app/assets/stylesheets/ribbon.css
|
|
44
|
+
- app/views/application/_lines.html.erb
|
|
45
|
+
- app/views/application/_ribbon.html.erb
|
|
156
46
|
- bin/console
|
|
157
47
|
- bin/rspec
|
|
158
48
|
- bin/rubocop
|
|
159
49
|
- bin/setup
|
|
160
|
-
- lib/app/views/partials/_lines.html.erb
|
|
161
|
-
- lib/app/views/partials/_ribbon.html.erb
|
|
162
50
|
- lib/generators/ribbonit/install_generator.rb
|
|
163
51
|
- lib/generators/ribbonit/templates/ribbonit.rb
|
|
164
52
|
- lib/ribbonit.rb
|
|
@@ -179,11 +67,10 @@ files:
|
|
|
179
67
|
- vendor/assets/images/positions/bottom-left.png
|
|
180
68
|
- vendor/assets/images/positions/bottom-right.png
|
|
181
69
|
- vendor/assets/images/positions/top-right.png
|
|
182
|
-
- vendor/assets/stylesheets/_ribbon.sass
|
|
183
70
|
homepage: https://github.com/anthony-robin/ribbonit
|
|
184
71
|
licenses: []
|
|
185
|
-
metadata:
|
|
186
|
-
|
|
72
|
+
metadata:
|
|
73
|
+
rubygems_mfa_required: 'true'
|
|
187
74
|
rdoc_options: []
|
|
188
75
|
require_paths:
|
|
189
76
|
- lib
|
|
@@ -191,16 +78,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
191
78
|
requirements:
|
|
192
79
|
- - ">="
|
|
193
80
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: '
|
|
81
|
+
version: '2.7'
|
|
195
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
83
|
requirements:
|
|
197
84
|
- - ">="
|
|
198
85
|
- !ruby/object:Gem::Version
|
|
199
86
|
version: '0'
|
|
200
87
|
requirements: []
|
|
201
|
-
|
|
202
|
-
rubygems_version: 2.6.12
|
|
203
|
-
signing_key:
|
|
88
|
+
rubygems_version: 4.0.6
|
|
204
89
|
specification_version: 4
|
|
205
90
|
summary: Display Ribbon with Rails env
|
|
206
91
|
test_files: []
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
$ribbon_width: 165px
|
|
2
|
-
$ribbon_height: 165px
|
|
3
|
-
|
|
4
|
-
$top: 33px
|
|
5
|
-
$left: -66px
|
|
6
|
-
$offset: -5px
|
|
7
|
-
|
|
8
|
-
.ribbon,
|
|
9
|
-
.ribbon__container
|
|
10
|
-
-webkit-box-sizing: border-box
|
|
11
|
-
box-sizing: border-box
|
|
12
|
-
|
|
13
|
-
.ribbon
|
|
14
|
-
display: block
|
|
15
|
-
position: absolute
|
|
16
|
-
top: 0
|
|
17
|
-
left: 0
|
|
18
|
-
width: $ribbon_width
|
|
19
|
-
height: $ribbon_height
|
|
20
|
-
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif
|
|
21
|
-
font-size: 16px
|
|
22
|
-
line-height: 1rem
|
|
23
|
-
overflow: hidden
|
|
24
|
-
z-index: 1001
|
|
25
|
-
|
|
26
|
-
// Container
|
|
27
|
-
&__container
|
|
28
|
-
position: absolute
|
|
29
|
-
top: $top
|
|
30
|
-
left: $left
|
|
31
|
-
width: 260px
|
|
32
|
-
padding: 7px 40px
|
|
33
|
-
transform: rotate(-45deg)
|
|
34
|
-
background: #333
|
|
35
|
-
color: #fff
|
|
36
|
-
font-size: 1rem
|
|
37
|
-
text-align: center
|
|
38
|
-
text-decoration: none
|
|
39
|
-
box-shadow: 1px 1px 3px rgba(#000, 0.8)
|
|
40
|
-
|
|
41
|
-
a
|
|
42
|
-
display: block
|
|
43
|
-
color: inherit
|
|
44
|
-
text-decoration: none
|
|
45
|
-
&:hover
|
|
46
|
-
color: inherit
|
|
47
|
-
|
|
48
|
-
&::before, &::after
|
|
49
|
-
display: block
|
|
50
|
-
position: absolute
|
|
51
|
-
top: 1px
|
|
52
|
-
left: 0
|
|
53
|
-
width: 100%
|
|
54
|
-
height: 1px
|
|
55
|
-
background: #fff
|
|
56
|
-
content: ''
|
|
57
|
-
|
|
58
|
-
&::after
|
|
59
|
-
top: auto
|
|
60
|
-
bottom: 1px
|
|
61
|
-
|
|
62
|
-
// Colors
|
|
63
|
-
&--orange
|
|
64
|
-
background: #f80
|
|
65
|
-
&--blue
|
|
66
|
-
background: #49a
|
|
67
|
-
&--green
|
|
68
|
-
background: #090
|
|
69
|
-
&--red
|
|
70
|
-
background: #a00
|
|
71
|
-
&--purple
|
|
72
|
-
background: #551a8b
|
|
73
|
-
&--black
|
|
74
|
-
background: #333
|
|
75
|
-
&--white
|
|
76
|
-
background: #fff
|
|
77
|
-
color: #333
|
|
78
|
-
a
|
|
79
|
-
color: #333
|
|
80
|
-
|
|
81
|
-
// Displayed informations
|
|
82
|
-
&__environment
|
|
83
|
-
display: block
|
|
84
|
-
text-transform: uppercase
|
|
85
|
-
|
|
86
|
-
&__version, &__git
|
|
87
|
-
display: block
|
|
88
|
-
font-size: 11px
|
|
89
|
-
|
|
90
|
-
// Sticky
|
|
91
|
-
&--sticky
|
|
92
|
-
position: fixed
|
|
93
|
-
|
|
94
|
-
// Position
|
|
95
|
-
&--top-right
|
|
96
|
-
right: 0
|
|
97
|
-
left: inherit
|
|
98
|
-
.ribbon__container
|
|
99
|
-
right: $left
|
|
100
|
-
left: inherit
|
|
101
|
-
transform: rotate(45deg)
|
|
102
|
-
|
|
103
|
-
&--bottom-left
|
|
104
|
-
top: inherit
|
|
105
|
-
bottom: 0
|
|
106
|
-
.ribbon__container
|
|
107
|
-
top: inherit
|
|
108
|
-
bottom: $top
|
|
109
|
-
transform: rotate(45deg)
|
|
110
|
-
|
|
111
|
-
&--bottom-right
|
|
112
|
-
top: inherit
|
|
113
|
-
right: 0
|
|
114
|
-
bottom: 0
|
|
115
|
-
left: inherit
|
|
116
|
-
.ribbon__container
|
|
117
|
-
top: inherit
|
|
118
|
-
right: $left
|
|
119
|
-
bottom: $top
|
|
120
|
-
left: inherit
|
|
121
|
-
transform: rotate(-45deg)
|
|
122
|
-
|
|
123
|
-
// Ribbon size depending of displayed options
|
|
124
|
-
&--3-lines
|
|
125
|
-
width: $ribbon_width + 15px
|
|
126
|
-
height: $ribbon_height + 15px
|
|
127
|
-
&--top-left
|
|
128
|
-
top: $offset
|
|
129
|
-
left: $offset
|
|
130
|
-
&--top-right
|
|
131
|
-
top: $offset
|
|
132
|
-
right: $offset
|
|
133
|
-
&--bottom-left
|
|
134
|
-
bottom: $offset
|
|
135
|
-
left: $offset
|
|
136
|
-
&--bottom-right
|
|
137
|
-
right: $offset
|
|
138
|
-
bottom: $offset
|
|
139
|
-
|
|
140
|
-
@media only screen and (max-width: 40em)
|
|
141
|
-
.ribbon
|
|
142
|
-
&--hide-for-small
|
|
143
|
-
display: none
|