rack-env_ribbon 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/rack/env_ribbon/html_converter.rb +4 -22
- data/lib/rack/env_ribbon/version.rb +1 -1
- data/lib/rack/env_ribbon.rb +1 -5
- metadata +2 -3
- data/vendor/assets/stylesheets/env_ribbon.ie.css +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82c9e16482d3bbc4dd33c54a3fd7ca043d9a4eda
|
4
|
+
data.tar.gz: f6f25fb50e956590a04c0fc6013ebd97e2a91200
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71587b05b1022d10224a53f3790cb04c13e11845d1e21d59336266855bf98390be9c83327f1d52b16a2be478719da88146b2d274daa2887f2f3d5ee8c53d6931
|
7
|
+
data.tar.gz: f82c2afe1a3cf2946bee8bf6b9b5de11c7953504894c4528336e7028ccf60079343404e8c41c43554381ef5498102ec1e896e376b5a04f16134536860f817e9e
|
data/README.md
CHANGED
@@ -20,32 +20,14 @@ module Rack
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def insert_env_ribbon_style_into_head_tag!
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
content = <<-EOS
|
27
|
-
<style>
|
28
|
-
#{css_file.read}
|
29
|
-
</style>
|
30
|
-
|
31
|
-
<!--[if lt IE 9]>
|
32
|
-
<style>
|
33
|
-
#{ie_css_file.read}
|
34
|
-
</style>
|
35
|
-
<![endif]-->
|
36
|
-
EOS
|
37
|
-
|
38
|
-
css_file.close
|
39
|
-
ie_css_file.close
|
40
|
-
|
23
|
+
css = ::File.open(::File.join(assets_path, 'stylesheets/env_ribbon.css'))
|
24
|
+
content = "<style>#{css.read}</style>"
|
25
|
+
css.close
|
41
26
|
insert_into('head', content, last_line: true, new_line: true)
|
42
27
|
end
|
43
28
|
|
44
29
|
def insert_env_ribbon_into_body_tag!
|
45
|
-
content =
|
46
|
-
<a class="github-fork-ribbon left-top red fixed" onClick="this.style.display='none'" title="#{env}">#{env}</a>
|
47
|
-
EOS
|
48
|
-
|
30
|
+
content = "<a class=\"github-fork-ribbon left-top red fixed\" onClick=\"this.style.display='none'\" title=\"#{env}\">#{env}</a>"
|
49
31
|
insert_into('body', content, new_line: true)
|
50
32
|
end
|
51
33
|
|
data/lib/rack/env_ribbon.rb
CHANGED
@@ -15,7 +15,7 @@ module Rack
|
|
15
15
|
status, headers, body = @app.call(env)
|
16
16
|
headers = HeaderHash.new(headers)
|
17
17
|
|
18
|
-
if
|
18
|
+
if !STATUS_WITH_NO_ENTITY_BODY.include?(status) && headers[CONTENT_TYPE] =~ /\btext\/html\b/
|
19
19
|
new_body = []
|
20
20
|
new_content_length = 0
|
21
21
|
|
@@ -49,10 +49,6 @@ module Rack
|
|
49
49
|
def app_env
|
50
50
|
@app_env ||= ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'development'
|
51
51
|
end
|
52
|
-
|
53
|
-
def applicable?(status, headers)
|
54
|
-
!STATUS_WITH_NO_ENTITY_BODY.include?(status) && headers[CONTENT_TYPE] =~ /\btext\/html\b/
|
55
|
-
end
|
56
52
|
end
|
57
53
|
end
|
58
54
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-env_ribbon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shota Iguchi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -123,7 +123,6 @@ files:
|
|
123
123
|
- lib/rack/env_ribbon/railtie.rb
|
124
124
|
- lib/rack/env_ribbon/version.rb
|
125
125
|
- vendor/assets/stylesheets/env_ribbon.css
|
126
|
-
- vendor/assets/stylesheets/env_ribbon.ie.css
|
127
126
|
homepage: https://github.com/iguchi1124/rack-env_ribbon
|
128
127
|
licenses:
|
129
128
|
- MIT
|
@@ -1,4 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* "Fork me on GitHub" CSS ribbon v0.2.0 | MIT License
|
3
|
-
* https://github.com/simonwhitaker/github-fork-ribbon-css
|
4
|
-
*/html{overflow:auto}body{position:relative;width:100%;height:auto;overflow:hidden}.github-fork-ribbon{width:15.38em;height:5.62em;top:-3.92em;right:-4.46em;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')"}.github-fork-ribbon.left-top,.github-fork-ribbon.right-bottom{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865483, M12=0.7071067811865467, M21=-0.7071067811865467, M22=0.7071067811865483, SizingMethod='auto expand')"}.github-fork-ribbon:after,.github-fork-ribbon:before{left:auto!important;right:auto!important;font-size:inherit}.github-fork-ribbon.left-bottom,.github-fork-ribbon.left-top{left:-3.92em}.github-fork-ribbon.left-bottom,.github-fork-ribbon.right-bottom{bottom:4.77em}
|