#!/usr/bin/env ruby GEMFILE = < err puts "Warning: git repository not initialized" rescue => err puts "Error: #{err.message}" end exec("bundle install") end require 'optparse' begin OptionParser.new do |opts| opts.banner = "Usage: nephos-generator [controller name] [appli [name]]" end.parse! case ARGV[0] when "c", "controller" if ARGV[1].to_s.match(/[\w_\-\.]+/) generate_controller("#{ARGV[1].capitalize}Controller", "app/#{ARGV[1].downcase}.rb") else puts "error" end when "a", "appli", "application" if not ARGV[1].to_s.empty? create_application_dir(ARGV[1]) puts "Application #{ARGV[1]} created" move_to_application_dir(ARGV[1]) end initialize_application puts "Application initialized" else puts "\"#{ARGV[0]}\" not recognized has a command" end rescue => err puts "Error: #{err.message}" end