Skip to content

Commit

Permalink
task to generate ruby versions manifest file
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Nov 8, 2011
1 parent 817add0 commit 0fe5f39
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Rakefile
Expand Up @@ -159,6 +159,21 @@ task "ruby:install", :version do |t, args|
end
end

desc "generate ruby versions manifest"
task "ruby:manifest" do
require 'rexml/document'
require 'yaml'

document = REXML::Document.new(`curl https://#{S3_BUCKET_NAME}.s3.amazonaws.com`)
rubies = document.elements.to_a("//Contents/Key").map {|node| node.text }.select {|text| text.match(/^ruby-\d+\.\d+\.\d+-p\d+/) }

Dir.mktmpdir("ruby_versions-") do |tmpdir|
name = 'ruby_versions.yml'
File.open(name, 'w') {|file| file.puts(rubies.to_yaml) }
sh("#{s3_tools_dir}/s3 put #{S3_BUCKET_NAME} #{name} #{name}")
end
end

desc "install libffi"
task "libffi:install", :version do |t, args|
version = args[:version]
Expand Down

0 comments on commit 0fe5f39

Please sign in to comment.