Sha256: c991f239c0d3fda0aea2cd0e973d1e4079daddc1d6e73bc7039a2824d6e01519
Contents?: true
Size: 916 Bytes
Versions: 14
Compression:
Stored size: 916 Bytes
Contents
namespace :gems do desc "Install gems locally" task :sync => [:environment] do require 'bowline/dependencies/lib/ext/rubygems' conf = Bowline.configuration repo = Dependencies::Repository.new( conf.gem_path ) conf.gems.each do |dep| gem = repo.gem(dep.name, dep.versions) next unless repo.search(gem).empty? repo.install(gem) end repo.reload_index! full_list = conf.gems.map do |dep| gem = repo.gem(dep.name, dep.versions) spec = repo.index.search(gem).last unless spec raise Exception.new("A required dependency #{gem} was not found") end deps = spec.recursive_dependencies(gem, repo.index) [spec] + deps end.flatten.uniq.map do |spec| "#{spec.name}-#{spec.version}" end (repo.installed - full_list).each do |g| /^(.*)\-(.*)$/ =~ g repo.uninstall($1, $2) end end end
Version data entries
14 entries across 14 versions & 2 rubygems