rack-showme 0.0.2.1 → 0.0.2.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.
- data/.travis.yml +9 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +2 -2
- data/MIT-LICENSE +1 -1
- data/README.markdown +11 -1
- data/Rakefile +1 -0
- data/lib/rack/showme/message_box.rb +13 -10
- data/lib/rack/showme/version.rb +1 -1
- data/rack-showme.gemspec +2 -1
- data/test/test_helper.rb +3 -0
- data/test/unit/showme/message_box/html_test.rb +2 -2
- metadata +6 -4
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/MIT-LICENSE
CHANGED
data/README.markdown
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Rack::Showme
|
2
2
|
|
3
|
+
[](https://travis-ci.org/ovargas27/rack-showme)
|
4
|
+
|
3
5
|
Rack middleware that injects a message into HTML responses.
|
4
6
|
|
5
|
-
> By _message_ I mean a
|
7
|
+
> By _message_ I mean a div element
|
6
8
|
|
7
9
|
This give us the ability to, for example, add a message indicating that the server is staging or any other QA environment without have to modify our code base
|
8
10
|
|
@@ -65,3 +67,11 @@ Red colorscheme
|
|
65
67
|
|
66
68
|

|
67
69
|
|
70
|
+
## LICENSE
|
71
|
+
|
72
|
+
MIT License Copyright 2013 Nearsoft
|
73
|
+
|
74
|
+
## About the Author
|
75
|
+
|
76
|
+
[Nearsoft](http://www.nearsoft.com/the-nearsoft-quick-intro.html) is a software product development service, with operations in Mexico. We work with ISVs, SaaS companies and consumer-facing sites. Thanks to our software engineering approach and experience, we help our clients get their products (and their companies) out to market faster.
|
77
|
+
|
data/Rakefile
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Rack
|
2
2
|
class Showme
|
3
3
|
class MessageBox
|
4
|
+
COLORS = %w[yellow red green].freeze
|
5
|
+
PREFIX = 'rack-show-me-colorscheme'
|
6
|
+
|
4
7
|
def initialize(options)
|
5
8
|
@message = options.message
|
6
9
|
@colorscheme = options.colorscheme
|
@@ -15,17 +18,17 @@ module Rack
|
|
15
18
|
end
|
16
19
|
|
17
20
|
def colorscheme_class
|
18
|
-
|
19
|
-
when "yellow"
|
20
|
-
"rack-show-me-colorscheme-yellow"
|
21
|
-
when "red"
|
22
|
-
"rack-show-me-colorscheme-red"
|
23
|
-
when "green"
|
24
|
-
"rack-show-me-colorscheme-green"
|
25
|
-
else
|
26
|
-
"rack-show-me-colorscheme-yellow"
|
27
|
-
end
|
21
|
+
COLORS.include?(@colorscheme) ? custom_class_name : default_class_name
|
28
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
def default_class_name
|
26
|
+
"#{PREFIX}-#{COLORS.first}"
|
27
|
+
end
|
28
|
+
|
29
|
+
def custom_class_name
|
30
|
+
"#{PREFIX}-#{@colorscheme}"
|
31
|
+
end
|
29
32
|
end
|
30
33
|
end
|
31
34
|
end
|
data/lib/rack/showme/version.rb
CHANGED
data/rack-showme.gemspec
CHANGED
@@ -8,9 +8,10 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["Omar Vargas"]
|
10
10
|
s.email = ["ovargas27@gmail.com"]
|
11
|
-
s.homepage = "https://github.com/
|
11
|
+
s.homepage = "https://github.com/Nearsoft/rack-showme"
|
12
12
|
s.summary = %q{Injects a message into HTML responses.}
|
13
13
|
s.description = %q{Rack middleware that injects a message into HTML responses.}
|
14
|
+
s.license = "MIT"
|
14
15
|
|
15
16
|
s.files = `git ls-files`.split("\n")
|
16
17
|
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
data/test/test_helper.rb
CHANGED
@@ -6,10 +6,10 @@ class TestMessageBox < MiniTest::Unit::TestCase
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_html_include_showme_id
|
9
|
-
assert_match
|
9
|
+
assert_match /id=\"rack-show-me-message-box\"/, @message_box.html
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_html_include_colorscheme_class
|
13
|
-
assert_match
|
13
|
+
assert_match /class=\"rack-show-me-colorscheme/, @message_box.html
|
14
14
|
end
|
15
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-showme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.2.
|
4
|
+
version: 0.0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Rack middleware that injects a message into HTML responses.
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
|
+
- .travis.yml
|
22
23
|
- Gemfile
|
23
24
|
- Gemfile.lock
|
24
25
|
- MIT-LICENSE
|
@@ -39,8 +40,9 @@ files:
|
|
39
40
|
- test/unit/showme/message_box/html_test.rb
|
40
41
|
- test/unit/showme/message_box/message_box_helper.rb
|
41
42
|
- test/unit/showme/message_box/message_test.rb
|
42
|
-
homepage: https://github.com/
|
43
|
-
licenses:
|
43
|
+
homepage: https://github.com/Nearsoft/rack-showme
|
44
|
+
licenses:
|
45
|
+
- MIT
|
44
46
|
post_install_message:
|
45
47
|
rdoc_options: []
|
46
48
|
require_paths:
|