Sha256: 8fc65cfe9fdf47a2025ce422380613f20baa4df4a86e8c7a4eec8df8e70ef1f7

Contents?: true

Size: 782 Bytes

Versions: 6

Compression:

Stored size: 782 Bytes

Contents

desc 'Create a new FCI-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

6 entries across 6 versions & 1 rubygems

Version Path
fci-0.0.6 lib/fci/commands/01_init.rb
fci-0.0.5 lib/fci/commands/01_init.rb
fci-0.0.4 lib/fci/commands/01_init.rb
fci-0.0.3 lib/fci/commands/01_init.rb
fci-0.0.2 lib/fci/commands/01_init.rb
fci-0.0.1 lib/fci/commands/01_init.rb