Sha256: a5ab58499bc74e0c00afe0cf742e371eedba69b8c8492c2043af5e1c2a215845

Contents?: true

Size: 1.13 KB

Versions: 9

Compression:

Stored size: 1.13 KB

Contents

require 'rubygems'
require 'thor/group'

module Bookshop
  module Generators
    # Thor based generator for creating new projects based upon a template project which
    # is copied into the name_of_book project-folder when 'build new name_of_book' is issued
    class AppGenerator < Thor::Group
      include Thor::Actions

      # Define arguments and options
      argument :app_path,               :type => :string
      
      # Define source root of application
      def self.source_root
        File.dirname(__FILE__)
      end

      # Create the project from templates
      def create_base_project
        puts "creating base project"
        directory "templates", "#{app_path}"
      end

      # Adds third-party tools
      # def add_tools
      #   directory "tools/", "#{app_path}/tools/"
      # end

      # Change the permissions so tools are executable 
      # def chmod_tools
      #  chmod "#{app_path}/tools/epubcheck-1.2.jar", 0755
      #  chmod "#{app_path}/tools/kindlegen", 0755
      # end

    protected

      def self.banner
        "bookshop new #{self.arguments.map(&:usage).join(' ')} [options]"
      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
bookshop-0.1.2 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.1.1 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.1.0 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.22 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.21 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.19 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.18 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.17 lib/bookshop/generators/bookshop/app/app_generator.rb
bookshop-0.0.16 lib/bookshop/generators/bookshop/app/app_generator.rb