Sha256: 6beef92dde99116870438403dd6e0d20eced9101f9a71c40c8c55230244372a1

Contents?: true

Size: 1.6 KB

Versions: 29

Compression:

Stored size: 1.6 KB

Contents

#!/usr/bin/env ruby

require 'gli'
require 'gli/commands/scaffold'

include GLI::App

program_desc 'create scaffolding for a GLI-powered application'

version GLI::VERSION

switch :v, :desc => 'Be verbose'

switch :n, :desc => 'Dry run; don''t change the disk'

desc 'Root dir of project'
long_desc <<EOS
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

flag :r,:root, :default_value => '.'

desc 'Create a new GLI-based project'
long_desc <<EOS
This will create a scaffold command line project that uses GLI
for command line processing.  Specifically, this will create
an executable ready to go, as well as a lib and test directory, all
inside the directory named for your project
EOS
arg_name 'project_name [command[ command]*]'
command [:init,:scaffold] do |c|

  c.switch :e,:ext, :desc => 'Create an ext dir'

  c.switch :notest, :desc => 'Do not create a test or features dir', :negatable => false

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

  c.switch :rvmrc, :desc => 'Create an .rvmrc based on your current RVM setup'

  c.action do |g,o,args|
    if args.length < 1
      raise 'You must specify the name of your project'
    end
    GLI::Commands::Scaffold.create_scaffold(g[:r],!o[:notest],o[:e],args[0],args[1..-1],o[:force],g[:n],o[:rvmrc])
  end
end

pre do |global,command,options,args|
  puts "Executing #{command.name}" if global[:v]
  true
end

post do |global,command,options,args|
  puts "Executed #{command.name}" if global[:v]
end
exit run(ARGV)

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
gli-2.11.0 bin/gli
gli-2.10.0 bin/gli
gli-2.9.0 bin/gli
gli_aziz_light-2.8.1 bin/gli
gli-2.8.1 bin/gli
gli-2.8.0 bin/gli
gli-2.7.0 bin/gli
gli-2.6.2 bin/gli
gli-2.6.1 bin/gli
gli-2.6.0 bin/gli
gli-2.6.0.rc1 bin/gli
gli-2.5.6 bin/gli
gli-2.5.5 bin/gli
gli-2.5.4 bin/gli
gli-2.5.3 bin/gli
gli-2.5.2 bin/gli
gli-2.5.1 bin/gli
gli-2.5.0 bin/gli
gli-2.4.1 bin/gli
gli-2.4.0 bin/gli