Tap (Task Application)
A framework for creating configurable, distributable tasks and workflows. Kind of like Rake, kind of like Rails, but geared towards command line applications.
Tap Features
- easy configuration, documentation, and testing
- imperative and dependency-based workflows
- command-line execution
- generators
- distribution of task libraries as gems
A quick look
Tasks may be defined as full classes:
[lib/goodnight.rb]
# Goodnight::manifest your basic goodnight moon task
# Says goodnight with a configurable message.
class Goodnight < Tap::Task
config :message, 'goodnight' # a goodnight message
def process(name)
puts "#{message} #{name}"
end
end
or in rakish declarations.
[Tapfile]
# ::desc your basic goodnight moon task
# Says goodnight with a configurable message.
Tap.task(:goodnight, :name, :message => 'goodnight') do |task, args|
puts "#{task.message} #{args.name}"
end
These are immediately available in the command line …
% tap run -T
goodnight # your basic goodnight moon task
% tap run -- goodnight moon
I[23:22:19] goodnight moon
configurable …
% tap run -- goodnight moon --message hello
I[23:22:46] hello moon
and documented.
% tap run -- goodnight --help
Goodnight -- your basic goodnight moon task
--------------------------------------------------------------------------------
Says goodnight with a configurable message.
--------------------------------------------------------------------------------
usage: tap run -- goodnight NAME
configurations:
--message MESSAGE a goodnight message
options:
-h, --help Print this help
--name NAME Specify a name
--use FILE Loads inputs from file