upwork-api 1.2.2 → 1.3.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aecc1625eafef46e28c0847afdd0ac818930b27b
4
- data.tar.gz: 789e5666f2b68fe09dfddaabb360d8cc0f2d0b98
2
+ SHA256:
3
+ metadata.gz: 0b2e8926f9643382cf971940857b19fb0361ac88c164a51ba6d1c7fe012f927f
4
+ data.tar.gz: a350200eef734e54db98fa608dca33a646fcfaf1932a44a7772aabf9f4e63b6d
5
5
  SHA512:
6
- metadata.gz: 493b1f34958730e964bae8d940d5abb524f10058608b93c586c437cdcbc671abda96c6cdb3c823fcf4ba852f7609d77280b3d1f62466e8c37181013681030360
7
- data.tar.gz: 586f35e52e29055f4f36777dbc15d99fd4226716830f417255d96ade8e2d8215f5eff21131ab8b9a832c00ab0ffb74db76726361474c5999e0e1a1641a3cfd7c
6
+ metadata.gz: 21d7bdf4e36804439183a91648d163f4e924f3ce966a29568060dbb470a84e6d5d2ec62a3766abe26ee59c8fa6444e7e89d237a11a003fbfb750ffbd42b88447
7
+ data.tar.gz: 1b6af05929c86efc601e06ffe9d476b03d5508b3b2ade7287b7f7f2f50b2ebee07132632d807e71cb9187de600c909fbbfd25378bacf2bb88a07c2708204cf23
data/.tests ADDED
@@ -0,0 +1 @@
1
+ rake test
data/.travis.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  language: ruby
2
2
  script: rake
3
3
  rvm:
4
- - 2.0.0
5
- - 2.1.0
6
4
  - 2.3.0
5
+ - 2.5.1
7
6
  - ruby-head
8
7
  install: gem install oauth test-unit mocha
9
8
  matrix:
data/CHANGES.md ADDED
@@ -0,0 +1,5 @@
1
+ # Release History
2
+
3
+ ## 1.3.0
4
+ * Stop supporting deprecated Teamrooms API
5
+ * Migrate Workdiaries, Workdays and Snapshots API to v3
@@ -27,39 +27,6 @@ module Upwork
27
27
  @client.epoint = ENTRY_POINT
28
28
  end
29
29
 
30
- # Get snapshot info
31
- #
32
- # Arguments:
33
- # company: (String)
34
- # username: (String)
35
- # ts: (String)
36
- def get(company, username, ts)
37
- $LOG.i "running " + __method__.to_s
38
- @client.get '/team/v1/snapshots/' + company + '/' + username + '/' + ts
39
- end
40
-
41
- # Update snapshot
42
- #
43
- # Arguments:
44
- # company: (String)
45
- # username: (String)
46
- # ts: (String)
47
- # params: (Hash)
48
- def update(company, username, ts, params)
49
- $LOG.i "running " + __method__.to_s
50
- @client.put '/team/v1/snapshots/' + company + '/' + username + '/' + ts, params
51
- end
52
-
53
- # Delete snapshot
54
- # Arguments:
55
- # company: (String)
56
- # username: (String)
57
- # ts: (String)
58
- def delete(company, username, ts)
59
- $LOG.i "running " + __method__.to_s
60
- @client.delete '/team/v1/snapshots/' + company + '/' + username + '/' + ts
61
- end
62
-
63
30
  # Get snapshot info by specific contract
64
31
  #
65
32
  # Arguments:
@@ -67,7 +34,7 @@ module Upwork
67
34
  # ts: (String)
68
35
  def get_by_contract(contract, ts)
69
36
  $LOG.i "running " + __method__.to_s
70
- @client.get '/team/v2/snapshots/contracts/' + contract + '/' + ts
37
+ @client.get '/team/v3/snapshots/contracts/' + contract + '/' + ts
71
38
  end
72
39
 
73
40
  # Update snapshot by specific contract
@@ -78,7 +45,7 @@ module Upwork
78
45
  # params: (Hash)
79
46
  def update_by_contract(contract, ts, params)
80
47
  $LOG.i "running " + __method__.to_s
81
- @client.put '/team/v2/snapshots/contracts/' + contract + '/' + ts, params
48
+ @client.put '/team/v3/snapshots/contracts/' + contract + '/' + ts, params
82
49
  end
83
50
 
84
51
  # Delete snapshot by specific contract
@@ -87,7 +54,7 @@ module Upwork
87
54
  # ts: (String)
88
55
  def delete_by_contract(contract, ts)
89
56
  $LOG.i "running " + __method__.to_s
90
- @client.delete '/team/v2/snapshots/contracts/' + contract + '/' + ts
57
+ @client.delete '/team/v3/snapshots/contracts/' + contract + '/' + ts
91
58
  end
92
59
  end
93
60
  end
@@ -35,7 +35,7 @@ module Upwork
35
35
  # params: (Hash)
36
36
  def get_by_company(company, from_date, till_date, params = {})
37
37
  $LOG.i "running " + __method__.to_s
38
- @client.get '/team/v2/workdays/companies/' + company + '/' + from_date + ',' + till_date, params
38
+ @client.get '/team/v3/workdays/companies/' + company + '/' + from_date + ',' + till_date, params
39
39
  end
40
40
 
41
41
  # Get Workdays by Contract
@@ -46,7 +46,7 @@ module Upwork
46
46
  # params: (Hash)
47
47
  def get_by_contract(contract, from_date, till_date, params = {})
48
48
  $LOG.i "running " + __method__.to_s
49
- @client.get '/team/v2/workdays/contracts/' + contract + '/' + from_date + ',' + till_date, params
49
+ @client.get '/team/v3/workdays/contracts/' + contract + '/' + from_date + ',' + till_date, params
50
50
  end
51
51
  end
52
52
  end
@@ -27,15 +27,14 @@ module Upwork
27
27
  @client.epoint = ENTRY_POINT
28
28
  end
29
29
 
30
- # Get Workdiary
30
+ # Get Workdiary by Company
31
31
  # Arguments:
32
32
  # company: (String)
33
- # username: (String)
34
33
  # date: (String)
35
34
  # params: (Hash)
36
- def get(company, username, date, params = {})
35
+ def get(company, date, params = {})
37
36
  $LOG.i "running " + __method__.to_s
38
- @client.get '/team/v1/workdiaries/' + company + '/' + username + '/' + date, params
37
+ @client.get '/team/v3/workdiaries/companies/' + company + '/' + date, params
39
38
  end
40
39
 
41
40
  # Get Work Diary by Contract
@@ -45,7 +44,7 @@ module Upwork
45
44
  # params: (Hash)
46
45
  def get_by_contract(contract, date, params = {})
47
46
  $LOG.i "running " + __method__.to_s
48
- @client.get '/team/v2/workdiaries/contracts/' + contract + '/' + date, params
47
+ @client.get '/team/v3/workdiaries/contracts/' + contract + '/' + date, params
49
48
  end
50
49
  end
51
50
  end
@@ -13,6 +13,6 @@
13
13
 
14
14
  module Upwork # :nodoc:
15
15
  module Api
16
- VERSION = "1.2.2"
16
+ VERSION = "1.3.0"
17
17
  end
18
18
  end
@@ -9,21 +9,6 @@ require 'mocha/test_unit'
9
9
  class SnapshotTest < Test::Unit::TestCase
10
10
  include TestHelper
11
11
 
12
- def test_get
13
- api = Upwork::Api::Routers::Snapshot.new(get_client_mock)
14
- assert api.get('company', 'username', '20140101')
15
- end
16
-
17
- def test_update
18
- api = Upwork::Api::Routers::Snapshot.new(get_client_mock)
19
- assert api.update('company', 'username', '20140101', {})
20
- end
21
-
22
- def test_delete
23
- api = Upwork::Api::Routers::Snapshot.new(get_client_mock)
24
- assert api.delete('company', 'username', '20140101')
25
- end
26
-
27
12
  def test_get_by_contract
28
13
  api = Upwork::Api::Routers::Snapshot.new(get_client_mock)
29
14
  assert api.get_by_contract('contract', '20140101')
@@ -11,7 +11,7 @@ class WorkdiaryTest < Test::Unit::TestCase
11
11
 
12
12
  def test_get
13
13
  api = Upwork::Api::Routers::Workdiary.new(get_client_mock)
14
- assert api.get('company', 'username', '20140101', {})
14
+ assert api.get('company', '20140101', {})
15
15
  end
16
16
 
17
17
  def test_get_by_contract
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: upwork-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksym Novozhylov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2018-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oauth
@@ -90,7 +90,9 @@ extra_rdoc_files: []
90
90
  files:
91
91
  - ".docgen"
92
92
  - ".gitignore"
93
+ - ".tests"
93
94
  - ".travis.yml"
95
+ - CHANGES.md
94
96
  - Gemfile
95
97
  - LICENSE.txt
96
98
  - README.md
@@ -129,7 +131,6 @@ files:
129
131
  - lib/upwork/api/routers/reports/finance/earnings.rb
130
132
  - lib/upwork/api/routers/reports/time.rb
131
133
  - lib/upwork/api/routers/snapshot.rb
132
- - lib/upwork/api/routers/teams.rb
133
134
  - lib/upwork/api/routers/workdays.rb
134
135
  - lib/upwork/api/routers/workdiary.rb
135
136
  - lib/upwork/api/version.rb
@@ -166,7 +167,6 @@ files:
166
167
  - test/test_reports_finance_earnings.rb
167
168
  - test/test_reports_time.rb
168
169
  - test/test_snapshot.rb
169
- - test/test_teams.rb
170
170
  - test/test_workdays.rb
171
171
  - test/test_workdiary.rb
172
172
  - upwork-api.gemspec
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubyforge_project:
193
- rubygems_version: 2.5.1
193
+ rubygems_version: 2.7.6
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: Ruby bindings for Upwork API.
@@ -228,6 +228,5 @@ test_files:
228
228
  - test/test_reports_finance_earnings.rb
229
229
  - test/test_reports_time.rb
230
230
  - test/test_snapshot.rb
231
- - test/test_teams.rb
232
231
  - test/test_workdays.rb
233
232
  - test/test_workdiary.rb
@@ -1,47 +0,0 @@
1
- # Licensed under the Upwork's API Terms of Use;
2
- # you may not use this file except in compliance with the Terms.
3
- #
4
- # Unless required by applicable law or agreed to in writing, software
5
- # distributed under the License is distributed on an "AS IS" BASIS,
6
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7
- # See the License for the specific language governing permissions and
8
- # limitations under the License.
9
- #
10
- # Author:: Maksym Novozhylov (mnovozhilov@upwork.com)
11
- # Copyright:: Copyright 2014(c) Upwork.com
12
- # License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html
13
-
14
- module Upwork
15
- module Api
16
- module Routers
17
- # Team API
18
- class Teams
19
- ENTRY_POINT = 'api'
20
-
21
- # Init
22
- #
23
- # Arguments:
24
- # client: (Client)
25
- def initialize(client)
26
- @client = client
27
- @client.epoint = ENTRY_POINT
28
- end
29
-
30
- # Get Team Rooms
31
- def get_list
32
- $LOG.i "running " + __method__.to_s
33
- @client.get '/team/v2/teamrooms'
34
- end
35
-
36
- # Get specific team or company
37
- # Arguments:
38
- # team: (String)
39
- # params: (Hash)
40
- def get_specific(team, params)
41
- $LOG.i "running " + __method__.to_s
42
- @client.get '/team/v2/teamrooms/' + team, params
43
- end
44
- end
45
- end
46
- end
47
- end
data/test/test_teams.rb DELETED
@@ -1,21 +0,0 @@
1
- $:.unshift 'lib'
2
- $LOAD_PATH << File.dirname(__FILE__)
3
-
4
- require 'helper'
5
- require 'upwork/api/routers/teams'
6
- require 'test/unit'
7
- require 'mocha/test_unit'
8
-
9
- class TeamsTest < Test::Unit::TestCase
10
- include TestHelper
11
-
12
- def test_get_list
13
- api = Upwork::Api::Routers::Teams.new(get_client_mock)
14
- assert api.get_list
15
- end
16
-
17
- def test_get_specific
18
- api = Upwork::Api::Routers::Teams.new(get_client_mock)
19
- assert api.get_specific('team', {})
20
- end
21
- end