Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

version bundled assets based on the deployed sha

  • Loading branch information...
commit e562d39e2ed33eca741076ff7ad9a0cca1470101 1 parent 4499dbb
@defunkt defunkt authored
View
4 app/templates/layout.mustache
@@ -5,9 +5,9 @@
<meta content="Hurl makes HTTP requests and is the perfect tool for testing APIs." name="description" />
{{# bundled?}}
- <link type="text/css" href="/css/bundle.css" rel="stylesheet">
+ <link type="text/css" href="/css/bundle.css?{{deployed_sha}}" rel="stylesheet">
<script type="text/javascript" src="/js/jquery.js?1.3.2"></script>
- <script type="text/javascript" src="/js/bundle.js"></script>
+ <script type="text/javascript" src="/js/bundle.js?{{deployed_sha}}"></script>
{{/ bundled?}}
{{^ bundled?}}
View
4 app/views/layout.rb
@@ -10,6 +10,10 @@ def flash
@flash
end
+ def deployed_sha
+ @deployed_sha ||= `git rev-parse --short HEAD`
+ end
+
def bundled?
File.exist?("#{RACK_ROOT}/public/css/bundle.css") &&
File.exist?("#{RACK_ROOT}/public/js/bundle.js")
View
4 app/views/stats.rb
@@ -1,9 +1,5 @@
module Views
class Stats < Layout
- def deployed_sha
- @deployed_sha ||= `git rev-parse --short HEAD`
- end
-
def hurl_stats
return [
count(:users),
Please sign in to comment.
Something went wrong with that request. Please try again.