From be0c35ce64e319de58204ad84f3f16ad358e2896 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 14 Apr 2014 15:19:30 -0700 Subject: [PATCH] website: downloads --- website/helpers/download_helpers.rb | 26 +++++++++++++------------- website/source/downloads.html.erb | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/website/helpers/download_helpers.rb b/website/helpers/download_helpers.rb index ab79b714a4..c04db9f19f 100644 --- a/website/helpers/download_helpers.rb +++ b/website/helpers/download_helpers.rb @@ -1,30 +1,30 @@ require "net/http" -$serf_files = {} -$serf_os = [] +$consul_files = {} +$consul_os = [] -if ENV["SERF_VERSION"] +if ENV["CONSUL_VERSION"] raise "BINTRAY_API_KEY must be set." if !ENV["BINTRAY_API_KEY"] http = Net::HTTP.new("dl.bintray.com", 80) - req = Net::HTTP::Get.new("/mitchellh/serf") + req = Net::HTTP::Get.new("/mitchellh/consul") req.basic_auth "mitchellh", ENV["BINTRAY_API_KEY"] response = http.request(req) response.body.split("\n").each do |line| - next if line !~ /\/mitchellh\/serf\/(#{Regexp.quote(ENV["SERF_VERSION"])}.+?)'/ + next if line !~ /\/mitchellh\/consul\/(#{Regexp.quote(ENV["CONSUL_VERSION"])}.+?)'/ filename = $1.to_s os = filename.split("_")[1] next if os == "SHA256SUMS" - $serf_files[os] ||= [] - $serf_files[os] << filename + $consul_files[os] ||= [] + $consul_files[os] << filename end - $serf_os = ["darwin", "linux", "windows"] & $serf_files.keys - $serf_os += $serf_files.keys - $serf_os.uniq! + $consul_os = ["darwin", "linux", "windows"] & $consul_files.keys + $consul_os += $consul_files.keys + $consul_os.uniq! - $serf_files.each do |key, value| + $consul_files.each do |key, value| value.sort! end end @@ -53,10 +53,10 @@ module DownloadHelpers end def download_url(file) - "https://dl.bintray.com/mitchellh/serf/#{file}" + "https://dl.bintray.com/mitchellh/consul/#{file}" end def latest_version - ENV["SERF_VERSION"] + ENV["CONSUL_VERSION"] end end diff --git a/website/source/downloads.html.erb b/website/source/downloads.html.erb index cb80eb3751..fd5acdf699 100644 --- a/website/source/downloads.html.erb +++ b/website/source/downloads.html.erb @@ -12,21 +12,21 @@ page_title: "Downloads"

- Below are all available downloads for the latest version of Serf + Below are all available downloads for the latest version of Consul (<%= latest_version %>). Please download the proper package for your operating system and architecture. You can find SHA256 checksums - for packages here. + for packages here.

- <% $serf_os.each do |os| %> + <% $consul_os.each do |os| %>
<%= image_tag "/images/icons/icon_#{os}.png" %>

<%= download_os_human(os) %>