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 ADDED
@@ -0,0 +1,9 @@
1
+ nguage: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 1.9.2
5
+ - jruby-19mode
6
+ - rbx-19mode
7
+ - ruby-head
8
+ - jruby-head
9
+
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'rake', :group => :development
3
+ group :development, :test do
4
+ gem 'rake', '~> 10.0.4'
5
+ end
4
6
 
5
7
  # Specify your gem's dependencies in rack-showme.gemspec
6
8
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rack-showme (0.0.2.pre)
4
+ rack-showme (0.0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -13,4 +13,4 @@ PLATFORMS
13
13
 
14
14
  DEPENDENCIES
15
15
  rack-showme!
16
- rake
16
+ rake (~> 10.0.4)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Omar Vargas.
1
+ Copyright (c) 2013 Nearsoft & Omar Vargas.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.markdown CHANGED
@@ -1,8 +1,10 @@
1
1
  # Rack::Showme
2
2
 
3
+ [![Build Status](https://travis-ci.org/ovargas27/rack-showme.png?branch=master)](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 <div> element
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
  ![Screenshot](doc/images/red.png)
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
@@ -10,3 +10,4 @@ Rake::TestTask.new do |t|
10
10
  t.libs << 'test'
11
11
  end
12
12
 
13
+ task :default => [:test]
@@ -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
- case @colorscheme
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
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Showme
3
- VERSION = "0.0.2.1"
3
+ VERSION = "0.0.2.2"
4
4
  end
5
5
  end
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/ovargas27/rack-showme"
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
@@ -1 +1,4 @@
1
1
  require 'minitest/autorun'
2
+
3
+ require 'rack/showme/options'
4
+ require 'rack/showme/message_box'
@@ -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 @message_box.html, /id=\"rack-show-me-message-box\"/
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 @message_box.html, /class=\"rack-show-me-colorscheme/
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.1
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-01 00:00:00.000000000 Z
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/ovargas27/rack-showme
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: