Permalink
Browse files

Fetch current Genghis version on compile.

  • Loading branch information...
1 parent 3b7716e commit ccceb32ea6f30c7de0ef8606a67c5447eacae246 @bobthecow committed Sep 19, 2012
Showing with 13 additions and 5 deletions.
  1. +4 −0 Rules
  2. +0 −2 config.yaml
  3. +2 −2 content/index.html.erb
  4. +7 −1 lib/default.rb
View
@@ -1,5 +1,9 @@
#!/usr/bin/env ruby
+preprocess do
+ get_genghis_version
+end
+
# passthrough '/CNAME/' ## Currently borken
compile '/CNAME/' do; end
route '/CNAME/' do
View
@@ -17,5 +17,3 @@ watcher:
prune:
auto_prune: true
exclude: [ '.git' ]
-
-genghis_version: 2.0.2
@@ -5,11 +5,11 @@ title: Genghis, the single-file MongoDB admin app.
<li>
<input value="gem install genghisapp" autocorrect="off" autocomplete="off" readonly="true">
<span>or</span>
- <a class="download" href="https://github.com/downloads/bobthecow/genghis/genghis-<%= @config[:genghis_version] %>.tgz" title="Genghis v<%= @config[:genghis_version] %>">Download</a>
+ <a class="download" href="https://github.com/downloads/bobthecow/genghis/genghis-<%= item[:genghis_version] %>.tgz" title="Genghis v<%= item[:genghis_version] %>">Download</a>
</li>
<li><a href="https://github.com/bobthecow/genghis#readme">Documentation</a></li>
<li><a href="https://github.com/bobthecow/genghis/issues">Issues</a></li>
- <li><span>Version <%= @config[:genghis_version] %></span></li>
+ <li><span>Version <%= item[:genghis_version] %></span></li>
</nav>
<ul id="screenshots">
View
@@ -8,4 +8,10 @@ def item_slug(item=nil)
def screenshots
@items.select {|i| i.identifier =~ /^\/screenshots\/./ && i[:extension] == 'png' }
-end
+end
+
+def get_genghis_version
+ require 'open-uri'
+ index = @items.find {|i| i.identifier == '/' }
+ index[:genghis_version] = open('https://raw.github.com/bobthecow/genghis/master/VERSION').read
+end

0 comments on commit ccceb32

Please sign in to comment.