Ruby bindings for TaskWarrior
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
test
.gitignore
.travis.yml
Gemfile
Guardfile
LICENSE
README.md
Rakefile
taskwarrior.gemspec

README.md

taskwarrior

Ruby bindings for TaskWarrior. Right now this gem provides read-only access to tasks, projects, tags etc.

Build Status

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.tags.size

puts r.tasks.first.description
puts r.tasks.first.project.name
puts r.tasks.first.tags.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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request