heroku-nav 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ begin
21
21
  gemspec.add_dependency(%q<rest-client>, [">= 1.0"])
22
22
  gemspec.add_dependency(%q<json>, [">= 0"])
23
23
 
24
- gemspec.version = '0.1.4'
24
+ gemspec.version = '0.1.5'
25
25
  end
26
26
  rescue LoadError
27
27
  puts "Jeweler not available. Install it with: gem install jeweler"
data/heroku-nav.gemspec CHANGED
@@ -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.4"
8
+ s.version = "0.1.5"
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-26}
12
+ s.date = %q{2010-03-16}
13
13
  s.description = %q{}
14
14
  s.email = %q{pedro@heroku.com}
15
15
  s.files = [
data/lib/heroku/nav.rb CHANGED
@@ -46,17 +46,17 @@ module Heroku
46
46
  end
47
47
 
48
48
  def resource_url
49
- [api_url, resource].join
49
+ [api_url, '/', resource].join
50
50
  end
51
51
 
52
52
  def api_url
53
- ENV['API_URL'] || "http://nav.heroku.com/"
53
+ ENV['API_URL'] || "http://nav.heroku.com"
54
54
  end
55
55
  end
56
56
 
57
57
  class Header < Base
58
58
  def insert!
59
- @body.send(@body_accessor).gsub!(/(<head>)/i, "\\1<style type=\"text/css\">#{@css}</style>") if @css
59
+ @body.send(@body_accessor).gsub!(/(<head>)/i, "\\1<link href='#{api_url}/header.css' media='all' rel='stylesheet' type='text/css' />") if @css
60
60
  @body.send(@body_accessor).gsub!(/(<body.*?>\s*(<div .*?class=["'].*?container.*?["'].*?>)?)/i, "\\1#{@html}") if @html
61
61
  @headers['Content-Length'] = @body.send(@body_accessor).size.to_s
62
62
  end
@@ -64,7 +64,7 @@ module Heroku
64
64
 
65
65
  class Footer < Base
66
66
  def insert!
67
- @body.send(@body_accessor).gsub!(/(<head>)/i, "\\1<style type=\"text/css\">#{@css}</style>") if @css
67
+ @body.send(@body_accessor).gsub!(/(<head>)/i, "\\1<link href='#{api_url}/footer.css' media='all' rel='stylesheet' type='text/css' />") if @css
68
68
  @body.send(@body_accessor).gsub!(/(<\/body>)/i, "#{@html}\\1") if @html
69
69
  @headers['Content-Length'] = @body.send(@body_accessor).size.to_s
70
70
  end
data/spec/nav_spec.rb CHANGED
@@ -39,7 +39,7 @@ describe Heroku::Nav::Header do
39
39
 
40
40
  it "adds the css right after the head" do
41
41
  get '/', :body => '<html><head>... <body>'
42
- last_response.body.should.equal '<html><head><style type="text/css">#header</style>... <body><!-- header -->'
42
+ last_response.body.should.equal "<html><head><link href='http://nav.heroku.com/header.css' media='all' rel='stylesheet' type='text/css' />... <body><!-- header -->"
43
43
  end
44
44
 
45
45
  it "doesn't add for non 200 responses" do
@@ -87,6 +87,6 @@ describe Heroku::Nav::Footer do
87
87
 
88
88
  it "adds the css right after the head" do
89
89
  get '/', :body => '<html><head>... <body>'
90
- last_response.body.should.equal '<html><head><style type="text/css">#footer</style>... <body>'
90
+ last_response.body.should.equal "<html><head><link href='http://nav.heroku.com/footer.css' media='all' rel='stylesheet' type='text/css' />... <body>"
91
91
  end
92
92
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
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-26 00:00:00 -08:00
18
+ date: 2010-03-16 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency