lib/adhearsion/generators/app/app_generator.rb in adhearsion-2.0.0.alpha2 vs lib/adhearsion/generators/app/app_generator.rb in adhearsion-2.0.0.alpha3
- old
+ new
@@ -1,34 +1,12 @@
-begin
- require 'thor/group'
-rescue LoadError
- puts "Thor is not available.\nIf you ran this command from a git checkout " \
- "of Adhearsion, please make sure thor is installed,\nand run this command " \
- "as `ruby #{$0} #{(ARGV | ['--dev']).join(" ")}`"
- exit
-end
-
module Adhearsion
module Generators
- class AppGenerator < Thor::Group
- include Thor::Actions
+ class AppGenerator < Generator
BASEDIRS = %w( config lib script )
- argument :app_action, :type => :string
- argument :app_path, :type => :string
-
- def self.source_root(path = nil)
- path = File.join(base_root, 'templates')
- path if File.exists?(path)
- end
-
- def self.base_root
- File.dirname(__FILE__)
- end
-
def setup_project
- self.destination_root = @app_path
+ self.destination_root = @generator_name
BASEDIRS.each { |dir| directory dir }
template "Gemfile.erb", "Gemfile"
copy_file "gitignore", ".gitignore"
copy_file "Procfile"
copy_file "Rakefile"