#!/usr/bin/env ruby require File.expand_path('../../lib/openshifter/init', __FILE__) unless File.exists?('.openshift/openshifter') puts '-> Removing default .openshift directory' FileUtils.rm_rf('.openshift') puts '-> Copying openshifter .openshift direcotry' FileUtils.cp_r(File.expand_path('../../templates/openshift', __FILE__), '.openshift') puts '-> Cleaning other default mess' FileUtils.rm_rf('src') FileUtils.rm_rf('pom.xml') FileUtils.rm_rf('README') end unless File.exists?('.openshift/lib/jruby.jar') puts "-> Downloading jRuby" `curl -o .openshift/lib/jruby.jar "http://jruby.org.s3.amazonaws.com/downloads/1.6.6/jruby-complete-1.6.6.jar"` end unless File.exists?('.openshift/lib/jruby-rack.jar') puts "-> Downloading jRuby-Rack" `curl -o .openshift/lib/jruby-rack.jar "http://repository.codehaus.org/org/jruby/rack/jruby-rack/1.1.3/jruby-rack-1.1.3.jar"` end puts '-> Installing Bundler' puts `java -jar .openshift/lib/jruby.jar -S gem install bundler --no-ri --no-rdoc`