rack-dev-mark 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3f1987ff1683e8ab9d12a05e0ecd3f0a301f995
4
- data.tar.gz: a6ca469cb2b2a620b519df065856b0e4e5b3ba37
3
+ metadata.gz: aaae4fd3e3bd67408ed09e426d78a09d81903ae5
4
+ data.tar.gz: 197dcbb4c8c1e0ed92e8d80e55753117ee10a140
5
5
  SHA512:
6
- metadata.gz: 7e1bac00b221687581ccf57ce0bdbb495e2857e4ab0d035a20f2e500af16295f01d9b78515aae80b62ddd4abc688e817fa984072de27e4a6bc72d73a22bc8dd2
7
- data.tar.gz: 348e35319467a0d7117b8d2cca8737c7f58ebcfda1167245aaeacad0d7db0c957a778dec3c04321ca2301d3f0f155a29dd719e0abbcf11a9d8c6ea99fc3b78f7
6
+ metadata.gz: bf46b253b727c1b633e64d819cd8e9b373ca5eccdb269e3fbcffac91745895f91d2cf351e50f748bbe0a98fcc6a7d9beaa4f53f5ef3498c0039856fb0d7bf5d1
7
+ data.tar.gz: 381c7c19a3ab9edaf140c816ec6f68262d2088b874e0fd57f3b5f1c67dc81ca7cd5c2d3fec3e3b97fea70fe58c80e246e433b9fa1b9975daafb38ebe938440a8
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/rack-dev-mark.svg)](http://badge.fury.io/rb/rack-dev-mark) [![Build Status](https://secure.travis-ci.org/dtaniwaki/rack-dev-mark.png?branch=master)](http://travis-ci.org/dtaniwaki/rack-dev-mark) [![Coverage Status](https://coveralls.io/repos/dtaniwaki/rack-dev-mark/badge.png?branch=master)](https://coveralls.io/r/dtaniwaki/rack-dev-mark?branch=master)
4
4
 
5
- Differentiate development environment from production.
5
+ Differentiate development environment from production. You can choose [themes](lib/rack/dev-mark/theme/README.md)
6
6
 
7
7
  ## Screenshot
8
8
 
@@ -0,0 +1,17 @@
1
+ # Theme
2
+
3
+ ## github-fork-ribbon
4
+
5
+ "Fork Me on GitHub" like ribbon
6
+
7
+ https://github.com/simonwhitaker/github-fork-ribbon-css
8
+
9
+ ![github-fork-ribbon](screenshots/github_fork_ribbon.png)
10
+
11
+ ### options
12
+
13
+ `position`: left (default), right, left-bottom, right-bottom
14
+
15
+ `color`: red (default), orange, green, black
16
+
17
+ `fixed`: `true` or `false`(default)
@@ -12,12 +12,13 @@ module Rack
12
12
  def insert_into(html, env, revision)
13
13
  position = @options[:position] || 'left'
14
14
  color = @options[:color] || 'red'
15
+ fixed = @options[:fixed] ? ' fixed' : ''
15
16
  s = <<-EOS
16
17
  #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.css"}
17
18
  <!--[if lt IE 9]>
18
19
  #{stylesheet_link_tag "github-fork-ribbon-css/gh-fork-ribbon.ie.css"}
19
20
  <![endif]-->
20
- <div class="github-fork-ribbon-wrapper #{position}" onClick="this.style.display='none'" title="#{revision}"><div class="github-fork-ribbon #{color}"><span class="github-fork-ribbon-text">#{env}</span></div></div>
21
+ <div class="github-fork-ribbon-wrapper #{position}#{fixed}" onClick="this.style.display='none'" title="#{revision}"><div class="github-fork-ribbon #{color}"><span class="github-fork-ribbon-text">#{env}</span></div></div>
21
22
  EOS
22
23
  html.sub %r{(<body[^>]*>)}i, "\\1#{s.strip}"
23
24
  end
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  module DevMark
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.4'
4
4
  end
5
5
  end
@@ -47,4 +47,20 @@ describe Rack::DevMark::Theme::GithubForkRibbon do
47
47
  subject { Rack::DevMark::Theme::GithubForkRibbon.new(color: 'orange') }
48
48
  end
49
49
  end
50
+ context "fixed option" do
51
+ it_behaves_like "theme" do
52
+ let :out do
53
+ s = <<-EOS
54
+ <html><head>head<title>title</title></head><body><style>#{read_stylesheet "github-fork-ribbon-css/gh-fork-ribbon.css"}</style>
55
+ <!--[if lt IE 9]>
56
+ <style>#{read_stylesheet "github-fork-ribbon-css/gh-fork-ribbon.ie.css"}</style>
57
+ <![endif]-->
58
+ <div class="github-fork-ribbon-wrapper left fixed" onClick="this.style.display='none'" title="rev"><div class="github-fork-ribbon red"><span class="github-fork-ribbon-text">env</span></div></div>body</body></html>
59
+ EOS
60
+ s.strip
61
+ end
62
+
63
+ subject { Rack::DevMark::Theme::GithubForkRibbon.new(fixed: true) }
64
+ end
65
+ end
50
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-dev-mark
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
  - Daisuke Taniwaki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -89,8 +89,10 @@ files:
89
89
  - lib/rack/dev-mark/error.rb
90
90
  - lib/rack/dev-mark/middleware.rb
91
91
  - lib/rack/dev-mark/theme.rb
92
+ - lib/rack/dev-mark/theme/README.md
92
93
  - lib/rack/dev-mark/theme/base.rb
93
94
  - lib/rack/dev-mark/theme/github_fork_ribbon.rb
95
+ - lib/rack/dev-mark/theme/screenshots/github_fork_ribbon.png
94
96
  - lib/rack/dev-mark/title.rb
95
97
  - lib/rack/dev-mark/utils.rb
96
98
  - lib/rack/dev-mark/version.rb