Skip to content

Instantly share code, notes, and snippets.

View markrebec's full-sized avatar

Mark Rebec markrebec

View GitHub Profile
@markrebec
markrebec / gemdeps.rb
Created September 30, 2015 16:00
Reverse Gem Dependency Lookup
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
@markrebec
markrebec / gist:8151661
Created December 27, 2013 19:45
Simple log printing/tailing/download for Capistrano V3.
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