Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
Created November 27, 2012 14:52
Show Gist options
  • Save noeticpenguin/4154630 to your computer and use it in GitHub Desktop.
Save noeticpenguin/4154630 to your computer and use it in GitHub Desktop.
Dobedobedo gem Usage

Installation

Add this line to your application's Gemfile:

gem 'dobedobedo'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dobedobedo

Usage

Dobedobedo is modeled on the notion of establishing a secure connection and establishing model objects that reflect your do.com workspaces, projects, tasks, comments, etc. As such, usage is pretty simple.

require 'dobedobedo' # please do this with the bundler.
include Dobedobedo   # gives you access to the top level models.

#Dobedobedo does not use the web-flow for oAuth integration, instead relying on username and password, in 
# conjunction with the oAuth client id / secret
connection = Dobedobedo::Connection.new(:client_id => 'Your Client Id', 
                                        :client_secret => 'Your Client Secret', 
                                        :username => 'Your Email Address', 
                                        :password => 'Your Passsord Here')
#by_name is an alias to find_workspace_by_name
workspace = connection.by_name('workspace name here') 

#array of Dobedobedo::Project objects reflecting each of the projects
projects = workspace.projects

#array of task objects from the first project in the workspace
projects.first.tasks # you could also use projects[2].tasks to get the tasks from the third project of the 
		     # workspace selected above.

#This will grab the first task of the first project of the workspace selected.
task = projects.first.tasks.first
task.name = 'new name' #give the task a new name
task.description = 'this is a new description of awesomeness'
task.closed = True #mark the task as done
task.update

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment