rack-env_ribbon 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a0680f38f8de7f1ce108c93f415ade85ea87c7d9
4
- data.tar.gz: 6f29381bb1b5d6aadf4886eedbcb148ae82fe8a9
3
+ metadata.gz: 82c9e16482d3bbc4dd33c54a3fd7ca043d9a4eda
4
+ data.tar.gz: f6f25fb50e956590a04c0fc6013ebd97e2a91200
5
5
  SHA512:
6
- metadata.gz: 9c2d13eec9942b130eecd45c54e991778ce69ac6116c4ea837db31c25fdeca631ad87391b57b21b6d864ba3fff27f670e2a1705c82de4cdfd22baf0da2ebf03f
7
- data.tar.gz: d45862178c17201ecb69988c59da9a25b1027e2a601e4c36087c43fb7e3637774119fad313ee627a38878edcd37b024b532db926d473001a3f95eb381a438e4c
6
+ metadata.gz: 71587b05b1022d10224a53f3790cb04c13e11845d1e21d59336266855bf98390be9c83327f1d52b16a2be478719da88146b2d274daa2887f2f3d5ee8c53d6931
7
+ data.tar.gz: f82c2afe1a3cf2946bee8bf6b9b5de11c7953504894c4528336e7028ccf60079343404e8c41c43554381ef5498102ec1e896e376b5a04f16134536860f817e9e
data/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Rack::EnvRibbon
2
+
3
+ [![Build Status](https://travis-ci.org/iguchi1124/rack-env_ribbon.svg?branch=master)](https://travis-ci.org/iguchi1124/rack-env_ribbon)
4
+
2
5
  Add env ribbon on your rack application views.
3
6
 
4
7
  ![](screen_shot.png)
@@ -20,32 +20,14 @@ module Rack
20
20
  end
21
21
 
22
22
  def insert_env_ribbon_style_into_head_tag!
23
- css_file = ::File.open(::File.join(assets_path, 'stylesheets/env_ribbon.css'))
24
- ie_css_file = ::File.open(::File.join(assets_path, 'stylesheets/env_ribbon.ie.css'))
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 = <<-EOS
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  class EnvRibbon
5
- VERSION = '0.1.3'
5
+ VERSION = '0.1.4'
6
6
  end
7
7
  end
@@ -15,7 +15,7 @@ module Rack
15
15
  status, headers, body = @app.call(env)
16
16
  headers = HeaderHash.new(headers)
17
17
 
18
- if applicable?(status, headers)
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.3
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: 2016-10-22 00:00:00.000000000 Z
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}