heroku-nav 0.1.1 → 0.1.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/Rakefile CHANGED
@@ -21,7 +21,7 @@ begin
21
21
  gemspec.add_dependency(%q<rest-client>, ["~> 1.2.0"])
22
22
  gemspec.add_dependency(%q<json>, [">= 0"])
23
23
 
24
- gemspec.version = '0.1.1'
24
+ gemspec.version = '0.1.2'
25
25
  end
26
26
  rescue LoadError
27
27
  puts "Jeweler not available. Install it with: gem install jeweler"
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{heroku-nav}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Todd Matthews", "Pedro Belo"]
12
- s.date = %q{2010-02-25}
12
+ s.date = %q{2010-02-26}
13
13
  s.description = %q{}
14
14
  s.email = %q{pedro@heroku.com}
15
15
  s.files = [
@@ -19,6 +19,7 @@ module Heroku
19
19
  end
20
20
 
21
21
  def can_insert?(env)
22
+ return unless @status == 200
22
23
  return unless @headers['Content-Type'] =~ /text\/html/ || (@body.respond_to?(:headers) && @body.headers['Content-Type'] =~ /text\/html/)
23
24
  @body_accessor = [:first, :body].detect { |m| @body.respond_to?(m) }
24
25
  return unless @body_accessor
@@ -42,6 +42,11 @@ describe Heroku::Nav::Header do
42
42
  last_response.body.should.equal '<html><head><style type="text/css">#header</style>... <body><!-- header -->'
43
43
  end
44
44
 
45
+ it "doesn't add for non 200 responses" do
46
+ get '/404', :body => '<html><body>hi'
47
+ last_response.body.should.not =~ /<!-- header -->/
48
+ end
49
+
45
50
  describe "excluding paths" do
46
51
  def app
47
52
  make_app { use Heroku::Nav::Header, :except => [/x/, /alt/] }
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Todd Matthews
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-02-25 00:00:00 -08:00
18
+ date: 2010-02-26 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency