#!/usr/bin/env ruby require 'fileutils' require 'getoptlong' raise StandardError unless RUBY_VERSION =~ /^1\.9\.\d$/ opts = GetoptLong.new([ '--snapshot', '-s', GetoptLong::REQUIRED_ARGUMENT ]) opts.each { |opt, arg| if opt == '--snapshot' || opt == '-s' raise ArgumentError, "Please provide a valid directory." unless File.directory?(arg) FileUtils.cp_r File.expand_path(File.dirname(__FILE__) + '/..'), arg end }