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 are defined as full classes:
[lib/goodnight.rb]
# Goodnight::task your basic goodnight moon task
# Says goodnight with a configurable message.
class Goodnight < Tap::Task
config :message, 'goodnight' # a goodnight message
def process(name)
"#{message} #{name}"
end
end
Tasks are immediately available on the command line for use in workflows:
% tap run -- goodnight moon --: dump
goodnight moon
% tap run -- load mittens -- load boat -- goodnight -- dump --[0,1][2] --[2][3]
goodnight mittens
goodnight boat
configurable …
% tap run -- goodnight moon --message hello --: dump
hello moon
and documented.
% tap run -T
sample:
goodnight # your basic goodnight moon task
tap:
dump # the default dump task
load # the default load task
% 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
Moreover tasks are distributed as gems; simply add a tap.yml file to a gem and tap will automatically discover tasks that have the '::task' resource identifier within the class documentation.
See the Tutorial and Documentation for more information.