Skip to content
Browse files

Changed application cache file extension: manifest—app cache

The new recommendation for application cache is to use `.appcache` as
the file extension.
  • Loading branch information...
1 parent 258804c commit d11835335a1c0e720be7b4ffe40b5702723b656c @benschwarz committed Sep 10, 2011
Showing with 7 additions and 4 deletions.
  1. +5 −2 app.rb
  2. +1 −1 views/layout.erb
  3. +1 −1 views/{offline.manifest.erb → offline.appcache.erb}
View
7 app.rb
@@ -29,6 +29,7 @@
post '/exchange' do
content_type :json
+ # This is all pretty awful, but we do it to keep the client side code simple.
currencies = params[:currencies].split(',')
currency_list = currencies.inject("") {|o,c| o << "'" + c + "USD'," }[0...-1]
@@ -37,12 +38,14 @@
q: "select * from yahoo.finance.xchange where pair in (#{currency_list})",
env: "http://datatables.org/alltables.env"}).body
+ # These days, I'd probably use faraday with faraday-stack to handle the
+ # HTTP requests and automagically parse the JSON being returned.
::Yajl::Parser.parse(request)['query']['results']['rate'].inject({}) do |hash, exchange|
hash.merge(exchange["id"][0..2] => exchange["Rate"].to_f)
end.to_json
end
-get '/offline.manifest' do
+get '/offline.appcache' do
content_type :manifest
- erb :"offline.manifest", layout: false
+ erb :"offline.appcache", layout: false
end
View
2 views/layout.erb
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en" manifest="/offline.manifest">
+<html lang="en" manifest="/offline.appcache">
<head>
<meta charset="utf-8">
<title>currency.io</title>
View
2 views/offline.manifest.erb → views/offline.appcache.erb
@@ -1,5 +1,5 @@
CACHE MANIFEST
-# Version 02
+# Version 00
/stylesheets/application.css
/stylesheets/images.css

0 comments on commit d118353

Please sign in to comment.
Something went wrong with that request. Please try again.