#!/usr/bin/env ruby # encoding: UTF-8 require 'optparse' $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) options = {} parser = OptionParser.new do |opts| opts.banner = < 'http://code.jquery.com/jquery-latest.min.js' folder 'vendor/plugins/parallel_tests' => 'https://github.com/grosser/parallel_tests.git' Run `vendorer init` to create Vendorfile. Run `vendorer` to install. Run `vendorer update` to update. Options: BANNER opts.on("-v", "--version", "Show Version"){ require 'vendorer/version' puts Vendorer::VERSION exit } opts.on("-h", "--help", "Show this.") { puts opts; exit } end parser.parse! require 'vendorer' v = Vendorer.new(:update => (ARGV[1] || true if ARGV[0] == 'update'), :init => (true if ARGV[0] == 'init')) v.init and exit if ARGV[0] == 'init' config_locations = ['Vendorfile.rb', 'Vendorfile'] config_location = config_locations.detect { |f| File.exist?(f) } || config_locations.last v.parse(File.read(config_location))