rack-showme 0.0.2.2 → 0.0.3

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 CHANGED
@@ -2,8 +2,8 @@ nguage: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 1.9.2
5
+ - 2.0.0
5
6
  - jruby-19mode
6
7
  - rbx-19mode
7
- - ruby-head
8
8
  - jruby-head
9
9
 
data/README.markdown CHANGED
@@ -1,6 +1,6 @@
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)
3
+ [![Build Status](https://travis-ci.org/Nearsoft/rack-showme.png?branch=master)](https://travis-ci.org/Nearsoft/rack-showme)
4
4
 
5
5
  Rack middleware that injects a message into HTML responses.
6
6
 
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class Showme
3
- VERSION = "0.0.2.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
data/lib/rack/showme.rb CHANGED
@@ -2,7 +2,7 @@ require "rack/showme/options"
2
2
  require "rack/showme/message_box"
3
3
 
4
4
  module Rack
5
- class Showme
5
+ class Showme
6
6
  def initialize(app)
7
7
  @app = app
8
8
  end
@@ -21,8 +21,12 @@ module Rack
21
21
  @env["HTTP_X_REQUESTED_WITH"] == "XMLHttpRequest"
22
22
  end
23
23
 
24
+ def response_compatible?
25
+ @response.respond_to?(:body)
26
+ end
27
+
24
28
  def initial_page_request?
25
- !ajax_request? && html_response?
29
+ !ajax_request? && html_response? && response_compatible?
26
30
  end
27
31
 
28
32
  def html_response?
@@ -31,7 +35,7 @@ module Rack
31
35
 
32
36
  def inject_html
33
37
  css_line = %Q{<style type="text/css">#{read_public_file("showme.css")}</style>\n}
34
- message_box = MessageBox.new(Options).html
38
+ message_box = MessageBox.new(Options).html
35
39
 
36
40
  body = @response.body
37
41
  body.gsub!("</body>", "#{css_line}</body>")
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.2
4
+ version: 0.0.3
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-28 00:00:00.000000000 Z
12
+ date: 2013-07-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Rack middleware that injects a message into HTML responses.
15
15
  email:
@@ -29,6 +29,9 @@ files:
29
29
  - doc/images/green.png
30
30
  - doc/images/normal.png
31
31
  - doc/images/red.png
32
+ - doc/images/staging_green.png
33
+ - doc/images/staging_red.png
34
+ - doc/images/staging_yellow.png
32
35
  - lib/rack/showme.rb
33
36
  - lib/rack/showme/message_box.rb
34
37
  - lib/rack/showme/options.rb