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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/teamwork.rb +9 -1
  3. data/test/test_teamwork.rb +16 -16
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59a61ea724f6cf704b6c51361060f313c8ba79a7
4
- data.tar.gz: 80bdee67088bb1a75d20f8f5410adccff25f675d
3
+ metadata.gz: 3500f90391343dde0c4b421bdb24e8f968c1c548
4
+ data.tar.gz: 688cae68b2bb51c0a62b27ce14cb298c77e0bee4
5
5
  SHA512:
6
- metadata.gz: 78842132a79dcfed91f5feeecf933fd3d295aff46d8b98b75556a32faafc98b2f6b7403be8c8fc8863a6ee55be4aad5c7958cd73f76ef21f91384806215d9d14
7
- data.tar.gz: e2a808e1ad76694a561050a2c6a4354af926dcf3180e5520c58fa850a970f004a37abd5f31481be969fa5440b078a4dbee909e04103e4efac6464bb5bb533bd8
6
+ metadata.gz: 77f4fdd1ae877ff8b525413405423ff026ce68188d8b564291a58854269fa251cf5e058d3f651e3bacd17795cc83058c2131cdcbceb15c3d0baab1786941b178
7
+ data.tar.gz: 66c567c7357b06bb6dbbb691f99fb76593759aa541036d233801cd00fe0ff6754f164303abaa0196184d160e3523a4ed0b069702286a1980b1ff5ef3521021a1
@@ -5,7 +5,7 @@ require 'json'
5
5
 
6
6
  module Teamwork
7
7
 
8
- VERSION = "0.0.2"
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
@@ -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:'1doom333toe!')
7
- project_id = api.create_project('test 6','Test Client')
8
- task_lists = api.get_tasks('87494')
9
- task_lists.each do |task_list|
10
-
11
- puts task_list
12
- keys = %w[name private pinned tracked todo-list-template-id]
13
- new_tasklist = task_list.select { |key,_| keys.include? key }
14
- new_tasklist_id = api.create_task_list(new_tasklist, project_id).body['TASKLISTID']
15
- task_list['todo-items'].each do |todo_item|
16
- keys = %w[content description]
17
- new_task = todo_item.select { |key,_| keys.include? key }
18
- api.create_task(new_task, new_tasklist_id)
19
- puts new_task
20
- end
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.2
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-01 00:00:00.000000000 Z
11
+ date: 2014-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday