Sha256: eac1f558f8360f8dfc63727b50c8441cdec1c6aafa63313bc297473ec3967a3b
Contents?: true
Size: 1.13 KB
Versions: 13
Compression:
Stored size: 1.13 KB
Contents
#!/usr/bin/env ruby # # == Synopsis # # Generates template files for leaves, seasons, and other Autumn objects. # # == Usage # # script/generate <options> <template> <name> # # <template>:: The template to create. Valid templates are "leaf" and "season". # <name>:: The name to give the created template. For example, you can call # "script/generate leaf Scorekeeper" to create a leaf named # Scorekeeper. # # == Options # # --help, -h:: Displays this usage information. # --vcs, -c:: Add any created files or directories to the project's version # control system. (Autodetects CVS and Subversion.) require 'libs/script' opts = GetoptLong.new( [ '--help', '-h', GetoptLong::NO_ARGUMENT ], [ '--vcs', '-c', GetoptLong::NO_ARGUMENT ] ) script = Autumn::Script.new begin opts.each do |opt, arg| case opt when '--help' then RDoc::usage when '--vcs' then script.use_vcs end end rescue GetoptLong::InvalidOption RDoc::usage exit 0 end exit(0) unless script.parse_argv(ARGV) case script.object when 'leaf' then script.call_generator(:leaf) when 'season' then script.call_generator(:season) end
Version data entries
13 entries across 13 versions & 2 rubygems