rack-env-notifier 0.0.5 → 0.0.6
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/.rspec +0 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -4
- data/README.md +24 -18
- data/lib/rack-env-notifier.rb +1 -1
- data/rack-env-notifier.gemspec +1 -1
- data/spec/rack/body_injector_spec.rb +5 -5
- data/spec/rack/env_notifier_spec.rb +9 -9
- metadata +18 -25
- data/assets/preview1.png +0 -0
- data/assets/preview2.png +0 -0
- data/assets/preview3.png +0 -0
- data/assets/preview4.png +0 -0
- data/assets/preview5.png +0 -0
- data/assets/preview6.png +0 -0
- data/assets/preview7.png +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c711471a2395c34dec0e0866c2d40beb6ee1c9fe
|
4
|
+
data.tar.gz: e51db158212b94eab7a2998ed0ee7b0707f01940
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814308e9b7da228f01e7fdc597be71cd0a325d7756db592e1ad794f8106d02e65db9dc378c0e65a4a9381fef0b6b81ee0cc4229efa842556d0a18e8dca320e43
|
7
|
+
data.tar.gz: e2ad77d6f418940c8e3b54b84bcf0ce9092702cc68d5a41476887c349cbf10269450bc00e50d576c3a0b8e6cbb044223096b0732b948be74577694425c42dc26
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,22 +1,8 @@
|
|
1
|
-
# Rack::EnvNotifier [](
|
1
|
+
# Rack::EnvNotifier [](https://travis-ci.org/ducknorris/rack-env-notifier)
|
2
2
|
|
3
3
|
[](https://codeclimate.com/github/ducknorris/rack-env-notifier) [](https://gemnasium.com/ducknorris/rack-env-notifier) [](http://badge.fury.io/rb/rack-env-notifier)
|
4
4
|
|
5
|
-
Middleware that displays
|
6
|
-
|
7
|
-

|
8
|
-
|
9
|
-

|
10
|
-
|
11
|
-

|
12
|
-
|
13
|
-

|
14
|
-
|
15
|
-

|
16
|
-
|
17
|
-

|
18
|
-
|
19
|
-

|
5
|
+
Middleware that displays a custom notification for every HTML page. It's designed to work both in production and development.
|
20
6
|
|
21
7
|
## Installation
|
22
8
|
|
@@ -102,9 +88,25 @@ The default message is configured in the initializer:
|
|
102
88
|
Rack::EnvNotifier.message = 'Dev'
|
103
89
|
end
|
104
90
|
|
91
|
+
## Preview
|
92
|
+
|
93
|
+

|
94
|
+
|
95
|
+

|
96
|
+
|
97
|
+

|
98
|
+
|
99
|
+

|
100
|
+
|
101
|
+

|
102
|
+
|
103
|
+

|
104
|
+
|
105
|
+

|
106
|
+
|
105
107
|
## Contributing
|
106
108
|
|
107
|
-
Thanks to our [contributors](https://github.com/ducknorris/
|
109
|
+
Thanks to our [contributors](https://github.com/ducknorris/rack-env-notifier/graphs/contributors).
|
108
110
|
|
109
111
|
1. Fork it
|
110
112
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -112,4 +114,8 @@ Thanks to our [contributors](https://github.com/ducknorris/env_notifier/graphs/c
|
|
112
114
|
4. Push to the branch (`git push origin my-new-feature`)
|
113
115
|
5. Create new Pull Request
|
114
116
|
|
115
|
-
#### Inspired by [harleyttd / miniprofiler](https://github.com/harleyttd/miniprofiler/)
|
117
|
+
#### Inspired by [harleyttd / miniprofiler](https://github.com/harleyttd/miniprofiler/).
|
118
|
+
|
119
|
+
|
120
|
+
[](https://bitdeli.com/free "Bitdeli Badge")
|
121
|
+
|
data/lib/rack-env-notifier.rb
CHANGED
data/rack-env-notifier.gemspec
CHANGED
@@ -8,13 +8,13 @@ describe Rack::EnvNotifier::BodyInjector do
|
|
8
8
|
it { should be_kind_of(Regexp) }
|
9
9
|
|
10
10
|
it 'only picks a valid <body> tag' do
|
11
|
-
regex.match("<body></body>").to_s.
|
12
|
-
regex.match("<body><h1></h1></body>").to_s.
|
13
|
-
regex.match("<body attribute='something'><h1></h1></body>").to_s.
|
11
|
+
expect(regex.match("<body></body>").to_s).to eq('<body>')
|
12
|
+
expect(regex.match("<body><h1></h1></body>").to_s).to eq('<body>')
|
13
|
+
expect(regex.match("<body attribute='something'><h1></h1></body>").to_s).to eq("<body attribute='something'>")
|
14
14
|
end
|
15
15
|
|
16
|
-
it 'responds
|
17
|
-
regex.match("<html></html>").
|
16
|
+
it 'responds nil when no head tag' do
|
17
|
+
expect(regex.match("<html></html>")).to eq nil
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -31,20 +31,20 @@ describe Rack::EnvNotifier do
|
|
31
31
|
end
|
32
32
|
|
33
33
|
it 'returns 200' do
|
34
|
-
last_response.
|
34
|
+
expect(last_response).to be_ok
|
35
35
|
end
|
36
36
|
|
37
37
|
it 'has the X-EnvNotifier header' do
|
38
|
-
last_response.headers.has_key?('X-EnvNotifier').
|
38
|
+
expect(last_response.headers.has_key?('X-EnvNotifier')).to eq true
|
39
39
|
end
|
40
40
|
|
41
41
|
it 'has only one X-EnvNotifier header' do
|
42
42
|
h = last_response.headers['X-EnvNotifier']
|
43
|
-
h.
|
43
|
+
expect(h).to eq('warning!!! hot zone!!!')
|
44
44
|
end
|
45
45
|
|
46
46
|
it 'has the Notification in the body' do
|
47
|
-
last_response.body.include?('<div id="env-notifier" class="warning-hot-zone" style="position: fixed; top: 0; right: 0; left: 0; background: rgba(150, 50, 50, .7); color: #fff; text-align: center; font-size: 16px; font-weight: bold; padding: 2px; z-index: 999999">warning!!! hot zone!!!</div>').
|
47
|
+
expect(last_response.body.include?('<div id="env-notifier" class="warning-hot-zone" style="position: fixed; top: 0; right: 0; left: 0; background: rgba(150, 50, 50, .7); color: #fff; text-align: center; font-size: 16px; font-weight: bold; padding: 2px; z-index: 999999">warning!!! hot zone!!!</div>')).to eq true
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|
@@ -58,15 +58,15 @@ describe Rack::EnvNotifier do
|
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'returns 200' do
|
61
|
-
last_response.
|
61
|
+
expect(last_response).to be_ok
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'has the X-EnvNotifier header' do
|
65
|
-
last_response.headers.has_key?('X-EnvNotifier').
|
65
|
+
expect(last_response.headers.has_key?('X-EnvNotifier')).not_to eq true
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'has the Notification in the body' do
|
69
|
-
last_response.body.include?('<div id="env-notifier" class="warning" style="position: fixed; top: 0; right: 0; left: 0; background: rgba(150, 50, 50, .7); color: #fff; text-align: center; font-size: 16px; font-weight: bold; padding: 2px; z-index: 999999">warning</div>').
|
69
|
+
expect(last_response.body.include?('<div id="env-notifier" class="warning" style="position: fixed; top: 0; right: 0; left: 0; background: rgba(150, 50, 50, .7); color: #fff; text-align: center; font-size: 16px; font-weight: bold; padding: 2px; z-index: 999999">warning</div>')).not_to eq true
|
70
70
|
end
|
71
71
|
|
72
72
|
end
|
@@ -79,7 +79,7 @@ describe Rack::EnvNotifier do
|
|
79
79
|
|
80
80
|
describe "with default CSS" do
|
81
81
|
it "does format the Notification" do
|
82
|
-
Rack::EnvNotifier.notification.
|
82
|
+
expect(Rack::EnvNotifier.notification).to eq(<<-EOF
|
83
83
|
<!-- Notify Start -->
|
84
84
|
<div id="env-notifier" class="notification" style="position: fixed; top: 0; right: 0; left: 0; background: rgba(150, 50, 50, .7); color: #fff; text-align: center; font-size: 16px; font-weight: bold; padding: 2px; z-index: 999999">notification</div>
|
85
85
|
<!-- Notify End -->
|
@@ -94,7 +94,7 @@ describe Rack::EnvNotifier do
|
|
94
94
|
end
|
95
95
|
|
96
96
|
it "does format the Notification" do
|
97
|
-
Rack::EnvNotifier.notification.
|
97
|
+
expect(Rack::EnvNotifier.notification).to eq(<<-EOF
|
98
98
|
<!-- Notify Start -->
|
99
99
|
<div id="env-notifier" class="notification">notification</div>
|
100
100
|
<!-- Notify End -->
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-env-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Catalin Ilinca
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.3'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rack-test
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rack
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.1.3
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.1.3
|
83
83
|
description: Middleware that displays the custom notification for every html page.
|
@@ -90,21 +90,14 @@ extra_rdoc_files:
|
|
90
90
|
- README.md
|
91
91
|
- CHANGELOG.md
|
92
92
|
files:
|
93
|
-
- .gitignore
|
94
|
-
- .rspec
|
95
|
-
- .travis.yml
|
93
|
+
- ".gitignore"
|
94
|
+
- ".rspec"
|
95
|
+
- ".travis.yml"
|
96
96
|
- CHANGELOG.md
|
97
97
|
- Gemfile
|
98
98
|
- LICENSE
|
99
99
|
- README.md
|
100
100
|
- Rakefile
|
101
|
-
- assets/preview1.png
|
102
|
-
- assets/preview2.png
|
103
|
-
- assets/preview3.png
|
104
|
-
- assets/preview4.png
|
105
|
-
- assets/preview5.png
|
106
|
-
- assets/preview6.png
|
107
|
-
- assets/preview7.png
|
108
101
|
- lib/rack-env-notifier.rb
|
109
102
|
- lib/rack/env_notifier.rb
|
110
103
|
- lib/rack/env_notifier/body_injector.rb
|
@@ -122,17 +115,17 @@ require_paths:
|
|
122
115
|
- lib
|
123
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
117
|
requirements:
|
125
|
-
- -
|
118
|
+
- - ">="
|
126
119
|
- !ruby/object:Gem::Version
|
127
120
|
version: '0'
|
128
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
122
|
requirements:
|
130
|
-
- -
|
123
|
+
- - ">="
|
131
124
|
- !ruby/object:Gem::Version
|
132
125
|
version: '0'
|
133
126
|
requirements: []
|
134
127
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.4.1
|
136
129
|
signing_key:
|
137
130
|
specification_version: 4
|
138
131
|
summary: Know your ground!
|
data/assets/preview1.png
DELETED
Binary file
|
data/assets/preview2.png
DELETED
Binary file
|
data/assets/preview3.png
DELETED
Binary file
|
data/assets/preview4.png
DELETED
Binary file
|
data/assets/preview5.png
DELETED
Binary file
|
data/assets/preview6.png
DELETED
Binary file
|
data/assets/preview7.png
DELETED
Binary file
|