This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
nathaniel (author)
Wed Jan 10 14:52:04 -0800 2007
| name | age | message | |
|---|---|---|---|
| |
.tm_last_run_ruby | Thu Nov 30 16:11:17 -0800 2006 | [nathaniel] |
| |
History.txt | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
| |
Manifest.txt | Sat Dec 09 11:58:52 -0800 2006 | [nathaniel] |
| |
README.txt | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
| |
Rakefile | Sat Dec 09 17:16:58 -0800 2006 | [nathaniel] |
| |
cooloptions.tmproj | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
| |
lib/ | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
| |
samples/ | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
| |
test/ | Wed Jan 10 14:52:04 -0800 2007 | [nathaniel] |
README.txt
= CoolOptions
by Nathaniel Talbott <nathaniel@terralien.com>
http://cooloptions.rubyforge.org/
== DESCRIPTION:
CoolOptions is a simple wrapper around optparse that provides less options and more convenience.
As a huge fan of optparse due to its flexibility, self-documenting nature, and ease of use, I nevertheless found myself
doing almost the exact same thing with it over and over again, and decided to write a thin wrapper around it to handle
the common cases. Thus CoolOptions was born.
== SYNOPSIS:
=== Declaration:
options = CoolOptions.parse!("[options] PROJECTNAME") do |o|
o.desc 'Sets up a new Rails project.'
o.on "repository URL", "Remote subversion repository."
o.on "svk", "Use svk.", true
o.on "project-path PATH", "Root of project workspaces.", File.expand_path("~/svk")
o.on "l)repository-path PATH", "Remote repository path.", "/"
o.on "mirror-path SVKPATH", "SVK mirror path.", "//"
o.on "local-pa(t)h SVKPATH", "SVK local path.", "//local"
o.on "create-structure", "Create trunk/tags/branches structure.", true
o.on "finish", "Prep and commit the new project.", true
o.after do |r|
r.project_path = File.expand_path(r.project_path)
o.error("Invalid path.") unless File.exist?(r.project_path)
r.project_name = ARGV.shift
o.error("Project name is required.") unless r.project_name
o.error("Project name is too funky.") unless /^\w+$/ =~ r.project_name
end
end
=== Usage:
$ ./new_rails_project --no-svk -r http://terralien.com/svn/terralien/ myproject
=== Result:
p options.svk # => false
p options.project_path # => '/Users/ntalbott/svk'
p options.repository # => 'http://terralien.com/svn/terralien/'
p options.create_structure # => true
p options.project_name # => 'myproject'
=== Also:
$ ./new_rails_project --help
Usage: t.rb [options] PROJECTNAME
-s, --[no-]svk Use svk.
Default is: true
-p, --project-path PATH Root of project workspaces.
Default is: /Users/ntalbott/svk
-r, --repository URL Remote subversion repository.
-l, --repository-path PATH Remote repository path.
Default is: /
-m, --mirror-path SVKPATH SVK mirror path.
Default is: //
-t, --local-path SVKPATH SVK local path.
Default is: //local
-c, --[no-]create-structure Create trunk/tags/branches structure.
Default is: true
-f, --[no-]finish Prep and commit the new project.
Default is: true
-h, --help This help info.
== REQUIREMENTS:
optparse & ostruct (included in Ruby standard library).
== DOWNLOAD:
Via gems or from the
{Rubyforge project page}[http://rubyforge.org/projects/cooloptions].
== INSTALL:
sudo gem install cooloptions
== CONTRIBUTE:
Drop me an email (see above) and/or
{check out the source}[http://terralien.com/svn/projects/cooloptions/trunk].
== LICENSE:
The RUBY License
Copyright (c) 2006 Nathaniel Talbott and Terralien, Inc. All Rights Reserved.



