staging_alert_rails 0.0.2
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 +7 -0
- data/.gitignore +20 -0
- data/LICENSE +22 -0
- data/README.md +31 -0
- data/Rakefile +19 -0
- data/app/assets/stylesheets/staging_alert_rails.css.sass +36 -0
- data/app/views/staging_alert_rails/_bar.html.haml +6 -0
- data/config/locales/de.yml +4 -0
- data/config/locales/en.yml +4 -0
- data/lib/staging_alert_rails/engine.rb +15 -0
- data/lib/staging_alert_rails/helper.rb +19 -0
- data/lib/staging_alert_rails/version.rb +3 -0
- data/lib/staging_alert_rails.rb +22 -0
- metadata +99 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 835e367af8fc44afa1af32645d4de0a125a48f76
|
4
|
+
data.tar.gz: f5f094f380ab1e21442bb321f14c7d0a3ab70641
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f35b5742d14828d00144d4490aa28073457f7f7192062b41f22811a72e5c890196aa4d1c827a495ac2fbb5232009e8755b0a5fb9c2cdda1edc4ea14f9f1b3954
|
7
|
+
data.tar.gz: 48e56af243c088f9640bcc47a243247ad72aba4eeae0c65ac1d0b81c60678886405f8bc83cafd8724a916b3e5b2f3f660db1310d361268cbee2e5a45dd5095fb
|
data/.gitignore
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
*.rbc
|
2
|
+
capybara-*.html
|
3
|
+
.rspec
|
4
|
+
/log
|
5
|
+
/tmp
|
6
|
+
/coverage/
|
7
|
+
/spec/tmp
|
8
|
+
|
9
|
+
Gemfile.lock
|
10
|
+
/.bundle
|
11
|
+
/vendor/bundle
|
12
|
+
|
13
|
+
.ruby-version
|
14
|
+
.ruby-gemset
|
15
|
+
.rvmrc
|
16
|
+
|
17
|
+
# if using bower-rails ignore default bower_components path bower.json files
|
18
|
+
/vendor/assets/bower_components
|
19
|
+
*.bowerrc
|
20
|
+
bower.json
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Hillig & Schrot wonderweblabs GbR - www.wonderweblabs.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# staging-alert-rails
|
2
|
+
|
3
|
+
By [wonderweblabs](http://www.wonderweblabs.com).
|
4
|
+
|
5
|
+
**staging-alert-rails** is a little alert bar for staging environments of rails projects. If there is
|
6
|
+
a file named "REVISION" in your app-root directory, the content will be shown additionally in that
|
7
|
+
bar.
|
8
|
+
|
9
|
+
### Installation
|
10
|
+
|
11
|
+
Require in your Gemfile:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
gem 'staging_alert_rails', git: 'https://github.com/wonderweblabs/staging-alert-rails.git'
|
15
|
+
```
|
16
|
+
|
17
|
+
Require in your css file:
|
18
|
+
|
19
|
+
```css
|
20
|
+
*= require staging_alert_rails
|
21
|
+
```
|
22
|
+
|
23
|
+
Require at the top of you body:
|
24
|
+
|
25
|
+
```erb
|
26
|
+
<%= staging_alert_bar %>
|
27
|
+
```
|
28
|
+
|
29
|
+
## License
|
30
|
+
|
31
|
+
MIT License.
|
data/Rakefile
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'bundler/setup'
|
5
|
+
rescue LoadError
|
6
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'rdoc/task'
|
10
|
+
|
11
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
12
|
+
rdoc.rdoc_dir = 'rdoc'
|
13
|
+
rdoc.title = 'StagingAlertRails'
|
14
|
+
rdoc.options << '--line-numbers'
|
15
|
+
rdoc.rdoc_files.include('README.rdoc')
|
16
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
17
|
+
end
|
18
|
+
|
19
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#staging-alert-bar
|
2
|
+
width: 100%
|
3
|
+
padding: 10px
|
4
|
+
background-color: #fcf8e3
|
5
|
+
border-bottom: 1px solid #faebcc
|
6
|
+
font-family: 'Helvetica', 'Arial', sans-serif
|
7
|
+
color: #8a6d3b
|
8
|
+
.inside-container
|
9
|
+
max-width: 1140px
|
10
|
+
margin: 0 auto
|
11
|
+
clear: both
|
12
|
+
.headline
|
13
|
+
float: left
|
14
|
+
margin-right: 20px
|
15
|
+
font-size: 25px
|
16
|
+
font-family: inherit
|
17
|
+
color: inherit
|
18
|
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.6)
|
19
|
+
.description
|
20
|
+
max-width: 510px
|
21
|
+
margin-top: 5px
|
22
|
+
font-size: 12px
|
23
|
+
line-height: 1.1
|
24
|
+
color: inherit
|
25
|
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.6)
|
26
|
+
font-family: inherit
|
27
|
+
.revision
|
28
|
+
float: right
|
29
|
+
margin-top: 8px
|
30
|
+
|
31
|
+
@media (max-width: 500px)
|
32
|
+
#staging-alert-bar
|
33
|
+
.headline
|
34
|
+
float: none
|
35
|
+
font-size: 16px
|
36
|
+
text-decoration: underline
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module StagingAlertRails
|
2
|
+
class Engine < ::Rails::Engine
|
3
|
+
|
4
|
+
# initializer - curo.load_app_root
|
5
|
+
initializer 'staging_alert_rails.load_app_root' do |app|
|
6
|
+
StagingAlertRails.app_root = app.root
|
7
|
+
end
|
8
|
+
|
9
|
+
# get helper in app
|
10
|
+
config.to_prepare do
|
11
|
+
ActionView::Base.send :include, StagingAlertRails::Helper
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module StagingAlertRails
|
2
|
+
module Helper
|
3
|
+
|
4
|
+
def staging_alert_bar
|
5
|
+
if Rails.env.staging?
|
6
|
+
render("staging_alert_rails/bar", revision: git_revision_number)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def git_revision_number
|
14
|
+
filename = "#{StagingAlertRails.app_root}/REVISION"
|
15
|
+
File.exist?(filename) ? File.open(filename, 'rb') { |f| f.read } : nil
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# rails
|
2
|
+
require 'rails/all'
|
3
|
+
|
4
|
+
# view
|
5
|
+
require 'haml-rails'
|
6
|
+
require 'sass-rails'
|
7
|
+
|
8
|
+
# engine
|
9
|
+
require 'staging_alert_rails/helper'
|
10
|
+
require 'staging_alert_rails/engine'
|
11
|
+
|
12
|
+
module StagingAlertRails
|
13
|
+
|
14
|
+
# application root path (the app that uses curo)
|
15
|
+
mattr_accessor :app_root
|
16
|
+
|
17
|
+
# root path
|
18
|
+
def self.root
|
19
|
+
File.expand_path '../..', __FILE__
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: staging_alert_rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Sascha Hillig
|
8
|
+
- Alexander Schrot
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-01-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: haml-rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 0.5.3
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 0.5.3
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: sass-rails
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 4.0.0
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 4.0.0
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rails
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 4.1.5
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 4.1.5
|
56
|
+
description: Shows an alert on staging environments to separate visually from live-system.
|
57
|
+
email:
|
58
|
+
- email@wonderweblabs.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- LICENSE
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- app/assets/stylesheets/staging_alert_rails.css.sass
|
68
|
+
- app/views/staging_alert_rails/_bar.html.haml
|
69
|
+
- config/locales/de.yml
|
70
|
+
- config/locales/en.yml
|
71
|
+
- lib/staging_alert_rails.rb
|
72
|
+
- lib/staging_alert_rails/engine.rb
|
73
|
+
- lib/staging_alert_rails/helper.rb
|
74
|
+
- lib/staging_alert_rails/version.rb
|
75
|
+
homepage: https://github.com/wonderweblabs/staging-alert-rails
|
76
|
+
licenses:
|
77
|
+
- MIT
|
78
|
+
metadata: {}
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubyforge_project:
|
95
|
+
rubygems_version: 2.4.5
|
96
|
+
signing_key:
|
97
|
+
specification_version: 4
|
98
|
+
summary: Shows an alert on staging environments to separate visually from live-system.
|
99
|
+
test_files: []
|