Sha256: db3b25dc1f96ebeaa11ee61e61950cb2bbc9e5ba4b52e6cb5c7e7f041a405bb6

Contents?: true

Size: 1.63 KB

Versions: 13

Compression:

Stored size: 1.63 KB

Contents

# ==========================================================================
# Generator: PROJECT
# Copyright: ©2006-2009 Sprout Systems, Inc. and contributors
#            portions copyright ©2009 Apple, Inc.
# ==========================================================================

namespace :generator do

  # Accept the following types of arguments:
  #
  #  project .             #=> Make current working directory. like sc-init
  #  project project_name  #=> Create project_name, namespace: ProjectName
  #  project ProjectName   #=> Create project_name, namespace: ProjectName
  #  project NameSpace path/to/project #=> Create path/to/project, NameSpace
  #
  task :prepare do
    # get arguments & normalize
    gen = GENERATOR
    namespace = gen.arguments[1]
    project_path = gen.arguments[2]
    
    if project_path
      project_path = File.expand_path(project_path)
      namespace = File.basename(project_path) if namespace == '.'
    elsif namespace == '.'
      project_path = Dir.pwd
      namespace = File.basename(project_path)
    else
      project_path = Dir.pwd / gen.snake_case(namespace)
    end
      
    # Setup standard options for generating a project
    gen.target_name = gen.target = gen.method_name = gen.class_name = nil
    gen.build_root = File.dirname(project_path) # dir where project dir lives
    gen.filename = File.basename(project_path) # project dir name
    gen.namespace = gen.camel_case namespace
  end
  
end

# default behavior for a template is to just copy the contents of the
# templates directory to the end destination. Add any additional configs here.
config :templates,
  :root_dir   => '_file_path_'
  

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sproutit-sproutcore-1.0.0.20090407205609 gen/project/Buildfile
sproutit-sproutcore-1.0.0.20090408130025 gen/project/Buildfile
sproutit-sproutcore-1.0.0.20090416161445 gen/project/Buildfile
sproutit-sproutcore-1.0.0.20090720093355 gen/project/Buildfile
sproutit-sproutcore-1.0.0.20090720202429 gen/project/Buildfile
sproutit-sproutcore-1.0.0.20090721125122 gen/project/Buildfile
sproutit-sproutcore-1.0.126 gen/project/Buildfile
sproutit-sproutcore-1.0.20090721145236 gen/project/Buildfile
sproutit-sproutcore-1.0.20090721145251 gen/project/Buildfile
sproutit-sproutcore-1.0.20090721145280 gen/project/Buildfile
sproutit-sproutcore-1.0.20090721145281 gen/project/Buildfile
sproutit-sproutcore-1.0.20090721145282 gen/project/Buildfile
sproutit-sproutcore-1.0.203 gen/project/Buildfile