Sha256: 7a84fe5457b929285b48a267dc2941ded532e7fa252f6beaa8d84c6bc18d75e5

Contents?: true

Size: 1.39 KB

Versions: 28

Compression:

Stored size: 1.39 KB

Contents

#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'ramaze/tool/project_creator'

module Ramaze
  module Tool

    # Create is a simple class used to create new projects based on the proto
    # directory.
    #
    # It is primarly used for this command:
    #
    #   ramaze --create project
    #
    # where project is the directory you want the content put into.

    class Create

      # Default options passed to Create::create
      #   :proto  is the directory to duplicate
      #   :amend  no files may be overwritten but missing files will be added
      #   :force  will overwrite existing files
      #   :layout copy one subdirectory in +proto+

      DEFAULT = {
        :proto => File.join(ROOT, 'proto'),
        :amend => false,
        :force => false,
        :layout => '/',
      }

      # Using ProjectCreator to copy all files and directories from lib/proto
      # to another location.
      # +options+ are described in the DEFAULT constant and should be:
      #   :force  => (true|false|nil)
      #   :amend  => (true|false|nil)
      #   :layout => (String|nil)
      #   :proto  => String

      def self.create(project, options = {})
        options = DEFAULT.merge(options)
        creator = ProjectCreator.new(project, options)
        creator.create
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
Pistos-ramaze-2009.04.08 lib/ramaze/tool/create.rb
Pistos-ramaze-2009.06.12 lib/ramaze/tool/create.rb
manveru-ramaze-2009.04.08 lib/ramaze/tool/create.rb
manveru-ramaze-2009.04.18 lib/ramaze/tool/create.rb
manveru-ramaze-2009.04.22 lib/ramaze/tool/create.rb
manveru-ramaze-2009.04 lib/ramaze/tool/create.rb
manveru-ramaze-2009.05.08 lib/ramaze/tool/create.rb
manveru-ramaze-2009.05 lib/ramaze/tool/create.rb
manveru-ramaze-2009.06.04 lib/ramaze/tool/create.rb
manveru-ramaze-2009.06.12 lib/ramaze/tool/create.rb
manveru-ramaze-2009.06 lib/ramaze/tool/create.rb
manveru-ramaze-2009.07 lib/ramaze/tool/create.rb
rjspotter-ramaze-2009.06.29 lib/ramaze/tool/create.rb
rjspotter-ramaze-2009.06.31 lib/ramaze/tool/create.rb
ramaze-2011.01.30 lib/ramaze/tool/create.rb
ramaze-2011.01 lib/ramaze/tool/create.rb
ramaze-2010.06.18 lib/ramaze/tool/create.rb
ramaze-2010.04.04 lib/ramaze/tool/create.rb
ramaze-2010.04 lib/ramaze/tool/create.rb
ramaze-2010.03 lib/ramaze/tool/create.rb