lib/vendorise/tasks.rb in vendorise-0.2.0 vs lib/vendorise/tasks.rb in vendorise-0.3.0
- old
+ new
@@ -2,14 +2,16 @@
require_relative "parser"
require_relative "arborist"
namespace :vendorise do
desc "Installs a gem from the specified url to /vendor/gems"
- task :gem, :url do |t, args|
+ task :gem, [:url, :branch] do |t, args|
+ args.with_defaults(branch: "master")
parser = Vendorise::Parser.new(args[:url])
url = parser.gem_url or raise "Please specify a valid url for the gem"
+ branch = args[:branch]
- command = Vendorise::Arborist.new("vendor/gems/#{parser.gem_name}", url).subtree_command
+ command = Vendorise::Arborist.new("vendor/gems/#{parser.gem_name}", url, branch).subtree_command
- system(command)
+ sh(command)
end
end