dobedobedo 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +42 -22
- data/lib/dobedobedo/project.rb +2 -2
- data/lib/dobedobedo/version.rb +1 -1
- data/lib/dobedobedo/workspace.rb +2 -2
- metadata +2 -2
data/README.md
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
# Dobedobedo
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
*
|
6
|
-
*
|
7
|
-
*
|
8
|
-
|
9
|
-
|
10
|
-
*
|
11
|
-
*
|
12
|
-
*
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
|
data/lib/dobedobedo/project.rb
CHANGED
@@ -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()
|
data/lib/dobedobedo/version.rb
CHANGED
data/lib/dobedobedo/workspace.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2012-10-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|