Skip to content

Commit

Permalink
Downloads page now lists previous versions and includes a link to git…
Browse files Browse the repository at this point in the history
…hub tags page
  • Loading branch information
Richard Young committed Nov 16, 2011
1 parent f22fad7 commit fe768b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
16 changes: 16 additions & 0 deletions scripts/downloads.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Download
========

The latest version of QuickFIX/n is {{latest_version}}

You can download it [here] (http://quickfixn.s3.amazonaws.com/quickfixn-{{latest_version}}.zip)

Previous Versions
-----------------
{{#previous_versions}}
* [{{.}}] (http://quickfixn.s3.amazonaws.com/quickfixn-{{.}}.zip)
{{/previous_versions}}

[View all previous versions in github][0]

[0]: https://github.com/connamara/quickfixn/tags
13 changes: 9 additions & 4 deletions scripts/update_download_page.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require 'rubygems'
require 'mustache'

if ARGV[0].nil? or ARGV[1].nil?
puts "Usage: ruby update_downloads_page.rb <PATH_TO_DOWNLOADS_PAGE> <VERSION_NO>"
exit 1
end

page = File.join(Dir.pwd, ARGV[0])
ver = ARGV[1]
Mustache.template_file = File.join(File.dirname(__FILE__), 'downloads.mustache')
view = Mustache.new
view[:latest_version] = ARGV[1]
view[:previous_versions] = prev_versions = `git tag -l`.split("\n")

File.open(page, 'w') do |f|
f.puts "Download\n========\n\nThe latest version of QuickFIX/n is #{ver}\n\nYou can download it [here] (http://quickfixn.s3.amazonaws.com/quickfixn-#{ver}.zip)"
File.open(File.join(Dir.pwd, ARGV[0]), 'w') do |f|
f.puts view.render
end

0 comments on commit fe768b5

Please sign in to comment.