#!/usr/bin/env ruby require 'optparse' require 'nephos-server/bin-helpers' GEMFILE = < err puts "Warning: git repository not initialized" rescue => err puts "Error: #{err.message}" end exec("bundle install") end 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" when "r", "route" generate_route(*(ARGV[1..4])) else puts "\"#{ARGV[0]}\" not recognized has a command" end rescue => err puts "Error: #{err.message}" end