Sha256: 207c3538f1335ab31262a1037369e80ffa39abcf255a7d9eebd4a3fb4d3fc965

Contents?: true

Size: 779 Bytes

Versions: 21

Compression:

Stored size: 779 Bytes

Contents

desc 'Create new ZCI-based project'
arg 'project_name'
arg_name 'project_name'
skips_pre
command :'init:project' do |c|
  c.desc 'Root dir of project'
  c.long_desc <<-EOS.strip_heredoc
    This is the directory where the project's directory will be made, so if you
    specify a project name `foo` and the root dir of `.`, the directory
    `./foo` will be created
  EOS
  c.flag :r, :root, :default_value => '.'

  c.switch :force, :desc => 'Overwrite/ignore existing files and directories'

  c.action do |global_options, options, args|
    if args.length < 1
      raise 'You must specify the name of your project'
    end

    root_dir = options[:root]
    force = options[:force]
    project_name = args.first

    create_scaffold(root_dir, project_name, force)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
zci-0.11.0 lib/zci/commands/01_init.rb
zci-0.10.1 lib/zci/commands/01_init.rb
zci-0.10.0 lib/zci/commands/01_init.rb
zci-0.9.0 lib/zci/commands/01_init.rb
zci-0.8.0 lib/zci/commands/01_init.rb
zci-0.7.2 lib/zci/commands/01_init.rb
zci-0.7.1 lib/zci/commands/01_init.rb
zci-0.7.0 lib/zci/commands/01_init.rb
zci-0.6.1 lib/zci/commands/01_init.rb
zci-0.6.0 lib/zci/commands/01_init.rb
zci-0.5.0 lib/zci/commands/01_init.rb
zci-0.4.0 lib/zci/commands/01_init.rb
zci-0.3.1 lib/zci/commands/01_init.rb
zci-0.3.0 lib/zci/commands/01_init.rb
zci-0.2.0 lib/zci/commands/01_init.rb
zci-0.1.2 lib/zci/commands/01_init.rb
zci-0.1.1 lib/zci/commands/01_init.rb
zci-0.1.0 lib/zci/commands/01_init.rb
zci-0.0.5 lib/zci/commands/01_init.rb
zci-0.0.4 lib/zci/commands/01_init.rb