Sha256: dee0c25b95637f0ca17b27969f1e669cfac2ca867496d378b79a418809ef1799

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

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

      BASEDIRS = %w{
        components
        config
        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
        BASEDIRS.each { |dir| directory dir }
        %w{
          .ahnrc
          dialplan.rb
          events.rb
          README
          Rakefile
          Gemfile
        }.each { |file| copy_file file }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adhearsion-1.2.6 lib/adhearsion/generators/app/app_generator.rb
adhearsion-1.2.5 lib/adhearsion/generators/app/app_generator.rb
adhearsion-1.2.4 lib/adhearsion/generators/app/app_generator.rb