This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'json' | |
gem_name = ARGV[0] | |
def rubygems_get(gem_name: "", endpoint: "") | |
path = File.join("/api/v1/gems/", gem_name, endpoint).chomp("/") + ".json" | |
JSON.parse(Net::HTTP.get("rubygems.org", path)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :logs do | |
desc "Download all log files from all hosts" | |
task :fetch do | |
on roles(:all) do | |
capture(:ls, "#{shared_path}/log/").split(' ').each do |logfile| | |
download! File.join(shared_path, 'log', logfile), File.join('.', 'tmp', "#{host}.#{logfile}") | |
end | |
end | |
end |