Sha256: 65db583dcc682a0256ed2308d0a8d24c16579806acbf2b5c1445a9dffe80940e
Contents?: true
Size: 1.63 KB
Versions: 35
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
35 entries across 35 versions & 2 rubygems