Release Name: 0.3.0
Notes:
= Drydock - v0.3
Inspired by github-gem and bmizerany-frylock.
== Overview
Drydock is a seaworthy DSL for command line apps. It is contained in a single .rb which can be copied directly into your project.
== Install
One of:
* gem install drydock
* copy lib/drydock.rb into your lib directory.
Or for GitHub fans:
* git clone git://github.com/delano/drydock.git
* gem install delano-drydock
== Examples
See bin/example for more.
require 'rubygems'
require 'drydock'
default :welcome
before do
# You can execute a block before the requests command is executed. Instance
# variables defined here will be available to all commands.
end
command :welcome do
# Example: ruby bin/example
puts "Meatwad: Science is a mystery to man, isn't it Frylock?"
print "Frylock: At least we have some commands: "
# The commands method returns a hash of Frylock::Command objects
puts commands.keys.inject([]) { |list, command| list << command.to_s }.sort.join(', ')
end
option :f, :found, "A boolean value. Did you find the car?"
command :findcar do |options|
# +options+ is a hash containing the options defined above
# Example: ruby bin/example -f findcar
puts "Frylock: So, did they ever find your car?"
# The keys to the hash are the long string from the option definition.
# If only the short string is provided, those will be used instead (i.e. :f).
puts (!options[:found]) ? "Carl: No" :
"Carl: Oh, they found part of it, hangin' from a trestle near the turnpike."
end
== More Information
http://www.youtube.com/watch?v=m_wFEB4Oxlo
== Credits
* Delano Mandelbaum (delano@solutious.com)
* Bernie Kopell (bernie@solutious.com)
== License
See LICENSE.txt
Changes:
DRYDOCK, CHANGES
#### 0.3 (2009-02-05) ###############################
* Added support for custom Drydock::Commands objects
* Global and command-specific options are now available as
attributes of the Drydock::Commands class instance.
* Automatic execution
* Now in a single file (lib/drydock.rb)
* Started adding tests
* Improved documentation
#### 0.2 (2008-12-27) ###############################
* Initial release
* Forked from bmizerany/frylock
|