#!/usr/bin/env ruby require 'rubygems' require File.join(File.dirname(__FILE__), "..", "lib", "marvin") Marvin::Application.processing(ARGV) do |a| version = Marvin.version version << "p#{Marvin::VERSION[3]}" if Marvin::VERSION[3] != 0 a.banner = "Marvin v#{version} - An IRC Library for Ruby" a.generator! a.option :development, "Runs the app in development mode (handler reloading)", :shortcut => "D" a.controller! :client, "Starts the actual Marvin client instance" a.controller! :console, "Opens a friendly IRB prompt with Marvin pre-loaded" a.controller! :distributed_client, "Starts a distributed client instance" a.option :force, "force the creation of the application" a.add "create PATH", "Creates a marvin application at the given location" do |path, options| path = File.expand_path(path) if File.exists?(path) && !options[:force] die! "The path you tried to use, #{path}, already exists. Please try another or use the --force option" end setup_generator(path) folders 'tmp', 'config', 'lib', 'handlers', 'test' template 'boot.erb', 'config/boot.rb' template 'setup.erb', 'config/setup.rb' template 'settings.yml.erb', 'config/settings.yml' template 'connections.yml.erb', 'config/connections.yml' template 'debug_handler.erb', 'handlers/debug_handler.rb' template 'hello_world.erb', 'handlers/hello_world.rb' template 'rakefile.erb', 'Rakefile' end end