Skip to content

Commit

Permalink
Convert 404 image to data url
Browse files Browse the repository at this point in the history
  • Loading branch information
meltingice committed Oct 8, 2012
1 parent 332ca54 commit d084a28
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions generators/files/config.ru
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'divergence'
require ::File.expand_path('../config/config', __FILE__)

use Rack::Static, :urls => ["/images"], :root => "public"

run Divergence::Application.new()
5 changes: 3 additions & 2 deletions lib/divergence/respond.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ def error!
Application.log.error "Branch #{@req.branch} does not exist"
Application.log.error @req.raw

file = File.open("../public/404.html", "r")
public_path = File.expand_path('../../../public', __FILE__)
file = File.open("#{public_path}/404.html", "r")
contents = file.read
file.close

[404, {"Content-Type" => "text/html"}, contents]
[404, {"Content-Type" => "text/html"}, [contents]]
end
end
end
2 changes: 1 addition & 1 deletion public/404.html

Large diffs are not rendered by default.

Binary file removed public/images/compass@2x.png
Binary file not shown.

0 comments on commit d084a28

Please sign in to comment.