dobedobedo 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,15 +1,20 @@
1
1
  # Dobedobedo
2
2
 
3
- Dobedobedo is a Do.com client for ruby. It's in its early stages and currently supports basic crud on:
4
- * comments
5
- * projects
6
- * notes
7
- * tasks
8
-
9
- But does not currently support creation of:
10
- * workspaces
11
- * users
12
- * alerts
3
+ ## Key features:
4
+ Objects are reflective of API results. Future field changes to the API are automatically accounted for.
5
+ * Full CRUD to Projects
6
+ * Full CRUD to Tasks
7
+ * Full CRUD to Notes
8
+ * Full CRUD to Comments
9
+ * Full CRUD to Projects
10
+ * Read access to Alerts
11
+ * Read access to Workspaces
12
+ * Read access to User
13
+ * macRuby compatibility
14
+
15
+ ## Todo: i.e. Notable issues and limitations:
16
+ * Nothing requiring the use of Client-Credential Grant type / Provisioning Scope is functional. Primarily this means you cannot create new workspaces, invite someone to a workspace, or Create a new user
17
+ * Put/Update calls to Task resource are not fully reflective as full reflection of the object back to Do.com currently closes the task automatically.
13
18
 
14
19
  ## Installation
15
20
 
@@ -29,18 +34,33 @@ Or install it yourself as:
29
34
 
30
35
  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.
31
36
 
32
- require 'dobedobedo' # please do this with the bundler.
33
- include Dobedobedo # gives you access to the top level models.
34
-
35
- connection = Dobedobedo::Connection.new(:client_id => 'Your Client Id', :client_secret => 'Your Client Secret', :username => 'Your Email Address', :password => 'Your Passsord Here')
36
- workspace = connection.by_name('workspace name here') #by_name is an alias to find_workspace_by_name
37
- projects = workspace.projects #array of Dobedobedo::Project objects reflecting each of the projects
38
- projects.first.tasks #array of task objects from the first project in the workspace
39
-
40
- task = projects.first.tasks.first
41
- task.name = 'new name'
42
- task.update
43
- #updated task!
37
+ ```ruby
38
+ require 'dobedobedo' # please do this with the bundler.
39
+ include Dobedobedo # gives you access to the top level models.
40
+
41
+ #Dobedobedo does not use the web-flow for oAuth integration, instead relying on username and password, in
42
+ # conjunction with the oAuth client id / secret
43
+ connection = Dobedobedo::Connection.new(:client_id => 'Your Client Id',
44
+ :client_secret => 'Your Client Secret',
45
+ :username => 'Your Email Address',
46
+ :password => 'Your Passsord Here')
47
+ #by_name is an alias to find_workspace_by_name
48
+ workspace = connection.by_name('workspace name here')
49
+
50
+ #array of Dobedobedo::Project objects reflecting each of the projects
51
+ projects = workspace.projects
52
+
53
+ #array of task objects from the first project in the workspace
54
+ projects.first.tasks # you could also use projects[2].tasks to get the tasks from the third project of the
55
+ # workspace selected above.
56
+
57
+ #This will grab the first task of the first project of the workspace selected.
58
+ task = projects.first.tasks.first
59
+ task.name = 'new name' #give the task a new name
60
+ task.description = 'this is a new description of awesomeness'
61
+ task.closed = True #mark the task as done
62
+ task.update
63
+ ```
44
64
 
45
65
  ## Contributing
46
66
 
@@ -7,7 +7,7 @@ module Dobedobedo
7
7
  def initialize(token, workspace_id, h={})
8
8
  @token = token
9
9
  @workspace_id = workspace_id
10
- if h.nil?
10
+ if h.nil? #if we're creating a new project object without a hash of data, hit the post resource to create an empty obj
11
11
  h = token.post("/workspaces/#{workspace_id}/projects").parsed
12
12
  end
13
13
  h.each do |k,v|
@@ -26,7 +26,7 @@ module Dobedobedo
26
26
  end
27
27
 
28
28
  def tasks
29
- @token.get("/workspaces/#{@workspace_id}/projects/#{@id}/tasks").parsed.map {|t| Dobedobedo::Task.new(@token, @id, t)}
29
+ @token.get("/workspaces/#{@workspace_id}/projects/#{@id}/tasks").parsed.map {|t| Dobedobedo::Task.new(@token, @id, nil, t)}
30
30
  end
31
31
 
32
32
  def update()
@@ -1,3 +1,3 @@
1
1
  module Dobedobedo
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -21,11 +21,11 @@ module Dobedobedo
21
21
  end
22
22
 
23
23
  def tasks
24
- @token.get("/workspaces/#{@id}/tasks").parsed.map {|t| Dobedobedo::Task.new(@token, @id, t)}
24
+ @token.get("/workspaces/#{@id}/tasks/").parsed.map {|t| Dobedobedo::Task.new(@token, @id, nil, t)}
25
25
  end
26
26
 
27
27
  def notes
28
- @token.get("/workspaces/#{@id}/notes").parsed.map {|n| Dobedobedo::Note.new(@token, n)}
28
+ @token.get("/workspaces/#{@id}/notes").parsed.map {|n| Dobedobedo::Note.new(@token, @id, n)}
29
29
  end
30
30
 
31
31
  def alerts
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dobedobedo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-25 00:00:00.000000000 Z
12
+ date: 2012-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: oauth2