taskwarrior
Ruby bindings for TaskWarrior. Right now this gem provides read-only access to tasks, projects, tags etc.
Installation
Add this line to your application's Gemfile:
gem 'taskwarrior'
And then execute:
$ bundle
Or install it yourself as:
$ gem install taskwarrior
Platforms
This gem is tested on Ruby 1.9.3. Please see the build status for the status of other rubies.
Usage
TaskWarrior::Repository
is the main entry point. It expects an array of JSON objects, typically produced by task export
. Technically, anything that can be consumed by JSON.parse
is fine as long as it follows the format TaskWarrior uses.
# Assuming that a TaskWarrior export was written to a file
r = TaskWarrior::Repository.new(File.read('/tmp/task_export.json'))
Once instantiated, the repository provides access to tasks, projects and tags. Each task will also carry its attributes (description, uuid, etc) as well as its project and tags.
puts r.tasks.size
puts r.projects.size
puts r..size
puts r.tasks.first.description
puts r.tasks.first.project.name
puts r.tasks.first..join(' ')
Please see the examples for further use, or have a look at the twdeps tool which creates a graph that visualizes the dependencies between tasks.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request