Skip to content

Commit

Permalink
Fetch current Genghis version on compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Sep 19, 2012
1 parent 3b7716e commit ccceb32
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions Rules
@@ -1,5 +1,9 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby


preprocess do
get_genghis_version
end

# passthrough '/CNAME/' ## Currently borken # passthrough '/CNAME/' ## Currently borken
compile '/CNAME/' do; end compile '/CNAME/' do; end
route '/CNAME/' do route '/CNAME/' do
Expand Down
2 changes: 0 additions & 2 deletions config.yaml
Expand Up @@ -17,5 +17,3 @@ watcher:
prune: prune:
auto_prune: true auto_prune: true
exclude: [ '.git' ] exclude: [ '.git' ]

genghis_version: 2.0.2
4 changes: 2 additions & 2 deletions content/index.html.erb
Expand Up @@ -5,11 +5,11 @@ title: Genghis, the single-file MongoDB admin app.
<li> <li>
<input value="gem install genghisapp" autocorrect="off" autocomplete="off" readonly="true"> <input value="gem install genghisapp" autocorrect="off" autocomplete="off" readonly="true">
<span>or</span> <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>
<li><a href="https://github.com/bobthecow/genghis#readme">Documentation</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><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> </nav>


<ul id="screenshots"> <ul id="screenshots">
Expand Down
8 changes: 7 additions & 1 deletion lib/default.rb
Expand Up @@ -8,4 +8,10 @@ def item_slug(item=nil)


def screenshots def screenshots
@items.select {|i| i.identifier =~ /^\/screenshots\/./ && i[:extension] == 'png' } @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.