teamwork-pm 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teamwork.rb +9 -1
- data/test/test_teamwork.rb +16 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3500f90391343dde0c4b421bdb24e8f968c1c548
|
4
|
+
data.tar.gz: 688cae68b2bb51c0a62b27ce14cb298c77e0bee4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77f4fdd1ae877ff8b525413405423ff026ce68188d8b564291a58854269fa251cf5e058d3f651e3bacd17795cc83058c2131cdcbceb15c3d0baab1786941b178
|
7
|
+
data.tar.gz: 66c567c7357b06bb6dbbb691f99fb76593759aa541036d233801cd00fe0ff6754f164303abaa0196184d160e3523a4ed0b069702286a1980b1ff5ef3521021a1
|
data/lib/teamwork.rb
CHANGED
@@ -5,7 +5,7 @@ require 'json'
|
|
5
5
|
|
6
6
|
module Teamwork
|
7
7
|
|
8
|
-
VERSION = "0.0.
|
8
|
+
VERSION = "0.0.3"
|
9
9
|
|
10
10
|
class API
|
11
11
|
|
@@ -82,6 +82,14 @@ module Teamwork
|
|
82
82
|
}).status
|
83
83
|
end
|
84
84
|
|
85
|
+
def archive_project(id)
|
86
|
+
@api_conn.put("projects/#{id}.json", {
|
87
|
+
project: {
|
88
|
+
status: 'inactive',
|
89
|
+
}
|
90
|
+
}).status
|
91
|
+
end
|
92
|
+
|
85
93
|
def delete_project(id)
|
86
94
|
@api_conn.delete "projects/#{id}.json"
|
87
95
|
end
|
data/test/test_teamwork.rb
CHANGED
@@ -3,22 +3,22 @@ require "../lib/teamwork"
|
|
3
3
|
|
4
4
|
class TestTeamwork < MiniTest::Unit::TestCase
|
5
5
|
def test_sanity
|
6
|
-
api = Teamwork::API.new(project_name: 'digital', api_key:'
|
7
|
-
project_id = api.create_project('test
|
8
|
-
|
9
|
-
task_lists
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
6
|
+
api = Teamwork::API.new(project_name: 'digital', api_key:'1doom333toe3')
|
7
|
+
# project_id = api.create_project('test 11z','Test Client')
|
8
|
+
api.archive_project("142792")
|
9
|
+
# task_lists = api.get_tasks('87494')
|
10
|
+
# task_lists.each do |task_list|
|
11
|
+
#
|
12
|
+
# puts task_list
|
13
|
+
# keys = %w[name private pinned tracked todo-list-template-id]
|
14
|
+
# new_tasklist = task_list.select { |key,_| keys.include? key }
|
15
|
+
# new_tasklist_id = api.create_task_list(new_tasklist, project_id).body['TASKLISTID']
|
16
|
+
# task_list['todo-items'].each do |todo_item|
|
17
|
+
# keys = %w[content description]
|
18
|
+
# new_task = todo_item.select { |key,_| keys.include? key }
|
19
|
+
# api.create_task(new_task, new_tasklist_id)
|
20
|
+
# puts new_task
|
21
|
+
# end
|
22
22
|
# api.delete_project project_id
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamwork-pm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|