development_ribbon 0.1.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/.gitignore +17 -0
- data/CHANGELOG +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +54 -0
- data/Rakefile +5 -0
- data/app/helpers/development_ribbon_helper.rb +15 -0
- data/development_ribbon.gemspec +22 -0
- data/example_image.png +0 -0
- data/lib/development_ribbon.rb +6 -0
- data/lib/development_ribbon/engine.rb +6 -0
- data/lib/development_ribbon/version.rb +3 -0
- data/spec/development_ribbon_spec.rb +1 -0
- data/spec/helpers/development_ribbon_helper_spec.rb +5 -0
- data/spec/spec_helper.rb +1 -0
- data/vendor/assets/stylesheets/development_ribbon.css.sass +120 -0
- metadata +103 -0
data/.gitignore
ADDED
data/CHANGELOG
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Thomas Preißler
|
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,54 @@
|
|
1
|
+
# DevelopmentRibbon
|
2
|
+
|
3
|
+
This gem shows a nice ribbon at the top corner of your page to indicate that you are using the development environment. The design is mostly based on the design of [Jeff Balogh](https://github.com/jbalogh/ribbons).
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'development_ribbon', group: :development
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Load the stylesheet by adding it to your application.html.erb.
|
18
|
+
|
19
|
+
<%= stylesheet_link_tag "development_ribbon" if Rails.env.development? %>
|
20
|
+
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Use the provided helper anywhere in your views to show your development ribbon:
|
25
|
+
|
26
|
+
<%= development_ribbon %>
|
27
|
+
|
28
|
+
I suggest you to place this helper directly after the body tag in your layout file.
|
29
|
+
|
30
|
+
|
31
|
+
### Customisation
|
32
|
+
|
33
|
+
You can provide a few options to the helper to style your ribbon.
|
34
|
+
|
35
|
+
<%= development_ribbon position: :left, color: :green, text: "dev env" %>
|
36
|
+
|
37
|
+
This shows your ribbon on the top left corner on your page with green background and displaying the text "dev env".
|
38
|
+
|
39
|
+
All possible options are:
|
40
|
+
|
41
|
+
- position: left, right
|
42
|
+
- color: white, red, green, darkblue, orange, gray
|
43
|
+
- text: any text you want
|
44
|
+
|
45
|
+
Furthermore you can show the ribbon regardless of the environment and use it for any purpose you intend to do. Just remove the development group of your Gemfile and include the stylesheet without the if-clause. Use the :text hash option to customise the text to show.
|
46
|
+
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
module DevelopmentRibbonHelper
|
2
|
+
def development_ribbon(options = {})
|
3
|
+
options.reverse_merge! position: "right", color: "red", text: Rails.env
|
4
|
+
|
5
|
+
content_tag :div, :id => "development-ribbon" do
|
6
|
+
content_tag :div, class: "#{options[:position]} ribbon-holder" do
|
7
|
+
content_tag :div, class: "#{options[:color]} ribbon" do
|
8
|
+
content_tag :div, class: "text" do
|
9
|
+
options[:text]
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'development_ribbon/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "development_ribbon"
|
8
|
+
gem.version = DevelopmentRibbon::VERSION
|
9
|
+
gem.authors = ["Thomas Preißler"]
|
10
|
+
gem.email = ["thomas.preissler@gmx.de"]
|
11
|
+
gem.description = %q{Use a banner to indicate that you are using the development environment.}
|
12
|
+
gem.summary = %q{Displays a banner at the top corner to indicate that your app is running in development environment.}
|
13
|
+
gem.homepage = "https://github.com/ding280/development-ribbon"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_development_dependency "rake"
|
21
|
+
gem.add_development_dependency "rspec"
|
22
|
+
end
|
data/example_image.png
ADDED
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'development_ribbon'
|
@@ -0,0 +1,120 @@
|
|
1
|
+
#development-ribbon
|
2
|
+
|
3
|
+
.ribbon-holder
|
4
|
+
position: absolute
|
5
|
+
overflow: hidden
|
6
|
+
height: 200px
|
7
|
+
width: 200px
|
8
|
+
top: 0
|
9
|
+
|
10
|
+
.right.ribbon-holder
|
11
|
+
right: 0
|
12
|
+
|
13
|
+
.left.ribbon-holder
|
14
|
+
left: 0
|
15
|
+
|
16
|
+
.ribbon
|
17
|
+
text-decoration: none !important
|
18
|
+
&:hover
|
19
|
+
text-decoration: none !important
|
20
|
+
font-family: 'Helvetiva Neue', Helvetica, Arial, sans-serif
|
21
|
+
text-align: center
|
22
|
+
letter-spacing: -0.1px
|
23
|
+
opacity: 0.95
|
24
|
+
padding: 3px 0
|
25
|
+
position: relative
|
26
|
+
display: block
|
27
|
+
top: 44px
|
28
|
+
/* Defaults friendly for white pages.
|
29
|
+
-webkit-box-shadow: 0 0 13px #888
|
30
|
+
-moz-box-shadow: 0 0 13px #888
|
31
|
+
-ms-box-shadow: 0 0 13px #888
|
32
|
+
-o-box-shadow: 0 0 13px #888
|
33
|
+
box-shadow: 0 0 13px #888
|
34
|
+
color: #FFF
|
35
|
+
.text
|
36
|
+
padding: 3px 0
|
37
|
+
|
38
|
+
.right .ribbon
|
39
|
+
-webkit-transform: rotate(45deg)
|
40
|
+
-moz-transform: rotate(45deg)
|
41
|
+
-ms-transform: rotate(45deg)
|
42
|
+
-o-transform: rotate(45deg)
|
43
|
+
transform: rotate(45deg)
|
44
|
+
right: -41px
|
45
|
+
|
46
|
+
.left .ribbon
|
47
|
+
-webkit-transform: rotate(-45deg)
|
48
|
+
-moz-transform: rotate(-45deg)
|
49
|
+
-ms-transform: rotate(-45deg)
|
50
|
+
-o-transform: rotate(-45deg)
|
51
|
+
transform: rotate(-45deg)
|
52
|
+
left: -41px
|
53
|
+
|
54
|
+
.white.ribbon
|
55
|
+
color: #111
|
56
|
+
background-color: #F5F5F5
|
57
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #f3f3f3), color-stop(100%, white))
|
58
|
+
background: -webkit-linear-gradient(top, #f3f3f3 0%, white 100%)
|
59
|
+
background: -moz-linear-gradient(top, #f3f3f3 0%, white 100%)
|
60
|
+
background: -ms-linear-gradient(top, #f3f3f3 0%, white 100%)
|
61
|
+
background: -o-linear-gradient(top, #f3f3f3 0%, white 100%)
|
62
|
+
background: linear-gradient(top, #f3f3f3 0%, white 100%)
|
63
|
+
-webkit-box-shadow: 0 0 13px #999
|
64
|
+
-moz-box-shadow: 0 0 13px #999
|
65
|
+
-ms-box-shadow: 0 0 13px #999
|
66
|
+
-o-box-shadow: 0 0 13px #999
|
67
|
+
box-shadow: 0 0 13px #999
|
68
|
+
text-shadow: 0 0 1px
|
69
|
+
.text
|
70
|
+
border: 1px solid #cecece
|
71
|
+
|
72
|
+
.red.ribbon
|
73
|
+
background-color: #9a0000
|
74
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #9a0000), color-stop(100%, #a90000))
|
75
|
+
background: -webkit-linear-gradient(top, #9a0000 0%, #a90000 100%)
|
76
|
+
background: -moz-linear-gradient(top, #9a0000 0%, #a90000 100%)
|
77
|
+
background: -ms-linear-gradient(top, #9a0000 0%, #a90000 100%)
|
78
|
+
background: -o-linear-gradient(top, #9a0000 0%, #a90000 100%)
|
79
|
+
background: linear-gradient(top, #9a0000 0%, #a90000 100%)
|
80
|
+
.text
|
81
|
+
border: 1px solid #bf6060
|
82
|
+
|
83
|
+
.green.ribbon
|
84
|
+
background-color: #006e00
|
85
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #006e00), color-stop(100%, #007200))
|
86
|
+
background: -webkit-linear-gradient(top, #006e00 0%, #007200 100%)
|
87
|
+
background: -moz-linear-gradient(top, #006e00 0%, #007200 100%)
|
88
|
+
background: -ms-linear-gradient(top, #006e00 0%, #007200 100%)
|
89
|
+
background: -o-linear-gradient(top, #006e00 0%, #007200 100%)
|
90
|
+
background: linear-gradient(top, #006e00 0%, #007200 100%)
|
91
|
+
.text
|
92
|
+
border: 1px solid #6bac6b
|
93
|
+
|
94
|
+
.darkblue.ribbon
|
95
|
+
background-color: #121621
|
96
|
+
color: #ecedee
|
97
|
+
.text
|
98
|
+
border: 1px solid #53565e
|
99
|
+
|
100
|
+
.orange.ribbon
|
101
|
+
background-color: #E57504
|
102
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dc7202), color-stop(100%, #ee7906))
|
103
|
+
background: -webkit-linear-gradient(top, #dc7202 0%, #ee7906 100%)
|
104
|
+
background: -moz-linear-gradient(top, #dc7202 0%, #ee7906 100%)
|
105
|
+
background: -ms-linear-gradient(top, #dc7202 0%, #ee7906 100%)
|
106
|
+
background: -o-linear-gradient(top, #dc7202 0%, #ee7906 100%)
|
107
|
+
background: linear-gradient(top, #dc7202 0%, #ee7906 100%)
|
108
|
+
.text
|
109
|
+
border: 1px solid #ebaa65
|
110
|
+
|
111
|
+
.gray.ribbon
|
112
|
+
background-color: #6d6d6d
|
113
|
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #6a6a6a), color-stop(100%, #6d6d6d))
|
114
|
+
background: -webkit-linear-gradient(top, #6a6a6a 0%, #6d6d6d 100%)
|
115
|
+
background: -moz-linear-gradient(top, #6a6a6a 0%, #6d6d6d 100%)
|
116
|
+
background: -ms-linear-gradient(top, #6a6a6a 0%, #6d6d6d 100%)
|
117
|
+
background: -o-linear-gradient(top, #6a6a6a 0%, #6d6d6d 100%)
|
118
|
+
background: linear-gradient(top, #6a6a6a 0%, #6d6d6d 100%)
|
119
|
+
.text
|
120
|
+
border: 1px solid #a4a4a4
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: development_ribbon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Thomas Preißler
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rspec
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: Use a banner to indicate that you are using the development environment.
|
47
|
+
email:
|
48
|
+
- thomas.preissler@gmx.de
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- CHANGELOG
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE.txt
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- app/helpers/development_ribbon_helper.rb
|
60
|
+
- development_ribbon.gemspec
|
61
|
+
- example_image.png
|
62
|
+
- lib/development_ribbon.rb
|
63
|
+
- lib/development_ribbon/engine.rb
|
64
|
+
- lib/development_ribbon/version.rb
|
65
|
+
- spec/development_ribbon_spec.rb
|
66
|
+
- spec/helpers/development_ribbon_helper_spec.rb
|
67
|
+
- spec/spec_helper.rb
|
68
|
+
- vendor/assets/stylesheets/development_ribbon.css.sass
|
69
|
+
homepage: https://github.com/ding280/development-ribbon
|
70
|
+
licenses: []
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
hash: 2392280989151051712
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
hash: 2392280989151051712
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 1.8.24
|
96
|
+
signing_key:
|
97
|
+
specification_version: 3
|
98
|
+
summary: Displays a banner at the top corner to indicate that your app is running
|
99
|
+
in development environment.
|
100
|
+
test_files:
|
101
|
+
- spec/development_ribbon_spec.rb
|
102
|
+
- spec/helpers/development_ribbon_helper_spec.rb
|
103
|
+
- spec/spec_helper.rb
|