harvesting 0.5.0 → 0.5.1

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
2
  SHA256:
3
- metadata.gz: fb6b38d71800f5156d305c7702286b90f74b0db7a0718912495117acc11a5865
4
- data.tar.gz: 548e13f94ef0e0cac713350afadad6e039f995ce481ff7166ee5de441c3cc3a9
3
+ metadata.gz: 36525f3c1b0a053c53690e55831d69d402bdc9fb5709b68e0d8cfc885f9a5bf0
4
+ data.tar.gz: bb3c642047e046ebbc8a72448ac5c29358264f8609b34f2c7a746680e721a74c
5
5
  SHA512:
6
- metadata.gz: c8daf60be6c6c9fb503a1f7778a963390c8857d52f76b6aecfe8a1d046f589946defc9b56cd17c501aa84c6c6318224cb082f1c603a3ae0c38b3f92ab9109f9c
7
- data.tar.gz: 781ed847b381891c9f66675720e4db332bc7835fb94d2362db73c65e5460f9580400b6a10812eefc5c6c10539f0f4c61603f0e1fb5dbd24452a891d521778704
6
+ metadata.gz: be1d66442a2b3bf3c0896055e15f8cdbdf506c8929814b1d5781c07676a36eab523e3182b155d593371aa91639fd55d86fb8689b0e1194f6f54ff091dd93c886
7
+ data.tar.gz: f0660def1ec97d8e02cb04dda6a52a14cd1fd08811a0372854632d076162ccc7990bcfa8e34906df3a439a7dcfc8d92bed60b25a78d531f1b045e9176062de1c
@@ -1,7 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.10
5
4
  - 2.5.8
6
5
  - 2.6.6
7
6
  - 2.7.1
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Harvesting
2
2
 
3
- [![Build Status](https://travis-ci.org/fastruby/harvesting.svg?branch=master)](https://travis-ci.org/ombulabs/harvesting)
4
- [![Code Climate](https://codeclimate.com/github/fastruby/harvesting/badges/gpa.svg)](https://codeclimate.com/github/ombulabs/harvesting)
3
+ [![Build Status](https://travis-ci.org/fastruby/harvesting.svg?branch=main)](https://travis-ci.org/fastruby/harvesting)
4
+ [![Code Climate](https://codeclimate.com/github/fastruby/harvesting/badges/gpa.svg)](https://codeclimate.com/github/fastruby/harvesting)
5
+ [![codecov](https://codecov.io/gh/fastruby/harvesting/branch/main/graph/badge.svg)](https://codecov.io/gh/fastruby/harvesting)
5
6
 
6
7
  A Ruby gem to interact with the Harvest API v2.0 and forward.
7
8
 
@@ -23,7 +24,7 @@ Or install it yourself as:
23
24
 
24
25
  ## Documentation
25
26
 
26
- The API is documented [here](https://www.rubydoc.info/github/ombulabs/harvesting)
27
+ The API is documented [here](https://www.rubydoc.info/github/fastruby/harvesting)
27
28
 
28
29
  ## Usage
29
30
 
@@ -166,7 +167,7 @@ end
166
167
 
167
168
  ## Roadmap
168
169
 
169
- There are many things to be developed for this gem. For now they are tracked here: [TODO.md](https://github.com/ombulabs/harvesting/blob/master/TODO.md)
170
+ There are many things to be developed for this gem. For now they are tracked here: [TODO.md](https://github.com/fastruby/harvesting/blob/main/TODO.md)
170
171
 
171
172
  ## Releases
172
173
 
@@ -240,7 +241,7 @@ We follow semantic versioning for version numbers: [https://semver.org](https://
240
241
 
241
242
  ## Contributing
242
243
 
243
- Bug reports and pull requests are welcome on GitHub at [https://github.com/ombulabs/harvesting](https://github.com/ombulabs/harvesting). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
244
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/fastruby/harvesting](https://github.com/fastruby/harvesting). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
244
245
 
245
246
  ## License
246
247
 
@@ -248,4 +249,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
248
249
 
249
250
  ## Code of Conduct
250
251
 
251
- Everyone interacting in the Harvesting project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ombulabs/harvesting/blob/master/CODE_OF_CONDUCT.md).
252
+ Everyone interacting in the Harvesting project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/fastruby/harvesting/blob/main/CODE_OF_CONDUCT.md).
@@ -1,13 +1,28 @@
1
1
  # RELEASE NOTES
2
2
 
3
- ### main
3
+ ### main
4
4
 
5
5
  **Notes**
6
6
 
7
- ### Version 0.5.0 - September 3, 2020
7
+ **Bug Fixes**
8
+
9
+ ### Version 0.5.1 - January 14, 2021
10
+
11
+ **Notes**
12
+ - Add support for Codecov so that we can track code coverage over time in the
13
+ library: https://github.com/fastruby/harvesting/pull/59
14
+
15
+ **Bug Fixes**
16
+ - Fix incompatibility with Ruby 3.0: https://github.com/fastruby/harvesting/pull/64
17
+ - Relax `http` dependency declaration so that we can `bundle install` with more
18
+ modern versions of that gem: https://github.com/fastruby/harvesting/pull/63
19
+ - Fix issue when trying to remove an entity that is not removable:
20
+ https://github.com/fastruby/harvesting/pull/61
21
+
22
+ ### Version 0.5.0 - September 3, 2020
8
23
 
9
24
  **Notes**
10
- - Changed behavior of `client.clients` so that it returns an instance of `Harvesting::Models::Clients` instead of an `Array`: https://github.com/ombulabs/harvesting/pull/39
25
+ - Changed behavior of `client.clients` so that it returns an instance of `Harvesting::Models::Clients` instead of an `Array`: https://github.com/fastruby/harvesting/pull/39
11
26
 
12
27
  **Bug Fixes**
13
28
  - Add support for Harvesting::RateLimitExceeded instead of a JSON::ParserError: https://github.com/fastruby/harvesting/pull/57
@@ -16,47 +31,47 @@
16
31
  ### Version 0.4.0 - June 6, 2020
17
32
 
18
33
  **Notes**
19
- - Added Ruby 2.5.1 to version matrix in Travis: https://github.com/ombulabs/harvesting/pull/31
20
- - Associated time entries for project: https://github.com/ombulabs/harvesting/pull/32
21
- - Add require forwardable in havest_record_collection model: https://github.com/ombulabs/harvesting/pull/40
22
- - Add syntax highlighting to readme examples: https://github.com/ombulabs/harvesting/pull/41
23
- - Rename the client key as harvest_client to avoid confusion: https://github.com/ombulabs/harvesting/pull/43
24
- - Update rake requirement from ~> 10.0 to ~> 13.0: https://github.com/ombulabs/harvesting/pull/44
25
- - Bump ffi from 1.9.23 to 1.12.2: https://github.com/ombulabs/harvesting/pull/45
26
- - Ability to supply filter options to the invoice end point and a model for line items on an invoice.: https://github.com/ombulabs/harvesting/pull/46
34
+ - Added Ruby 2.5.1 to version matrix in Travis: https://github.com/fastruby/harvesting/pull/31
35
+ - Associated time entries for project: https://github.com/fastruby/harvesting/pull/32
36
+ - Add require forwardable in havest_record_collection model: https://github.com/fastruby/harvesting/pull/40
37
+ - Add syntax highlighting to readme examples: https://github.com/fastruby/harvesting/pull/41
38
+ - Rename the client key as harvest_client to avoid confusion: https://github.com/fastruby/harvesting/pull/43
39
+ - Update rake requirement from ~> 10.0 to ~> 13.0: https://github.com/fastruby/harvesting/pull/44
40
+ - Bump ffi from 1.9.23 to 1.12.2: https://github.com/fastruby/harvesting/pull/45
41
+ - Ability to supply filter options to the invoice end point and a model for line items on an invoice.: https://github.com/fastruby/harvesting/pull/46
27
42
 
28
43
  **Bug Fixes**
29
44
 
30
- - Complete pending test: https://github.com/ombulabs/harvesting/pull/28
31
- - Fixed Code Climate link: https://github.com/ombulabs/harvesting/pull/38
45
+ - Complete pending test: https://github.com/fastruby/harvesting/pull/28
46
+ - Fixed Code Climate link: https://github.com/fastruby/harvesting/pull/38
32
47
 
33
48
 
34
49
  ### Version 0.3.0 - Jan 22, 2019
35
50
 
36
51
  **Notes**
37
52
 
38
- - Support for users: https://github.com/ombulabs/harvesting/pull/9
39
- - Support for fetching single records: https://github.com/ombulabs/harvesting/pull/14 and https://github.com/ombulabs/harvesting/pull/22
40
- - Nested models make it easier to access data: https://github.com/ombulabs/harvesting/pull/15
41
- - Better architecture for collections: https://github.com/ombulabs/harvesting/pull/18
53
+ - Support for users: https://github.com/fastruby/harvesting/pull/9
54
+ - Support for fetching single records: https://github.com/fastruby/harvesting/pull/14 and https://github.com/fastruby/harvesting/pull/22
55
+ - Nested models make it easier to access data: https://github.com/fastruby/harvesting/pull/15
56
+ - Better architecture for collections: https://github.com/fastruby/harvesting/pull/18
42
57
 
43
58
  **Bug Fixes**
44
59
 
45
- - Correct pagination support: https://github.com/ombulabs/harvesting/pull/17
46
- - Added documentation: https://github.com/ombulabs/harvesting/pull/30
60
+ - Correct pagination support: https://github.com/fastruby/harvesting/pull/17
61
+ - Added documentation: https://github.com/fastruby/harvesting/pull/30
47
62
 
48
63
  ### Version 0.2.0 - Oct 18, 2018
49
64
 
50
65
  **Notes**
51
66
 
52
67
  - More documentation in README.md
53
- - Adds ability to access user associated with time entries: https://github.com/ombulabs/harvesting/pull/3
54
- - Adds support for Docker for development: https://github.com/ombulabs/harvesting/pull/1
68
+ - Adds ability to access user associated with time entries: https://github.com/fastruby/harvesting/pull/3
69
+ - Adds support for Docker for development: https://github.com/fastruby/harvesting/pull/1
55
70
 
56
71
  **Bug Fixes**
57
72
 
58
- - Fixes issues with specs: https://github.com/ombulabs/harvesting/pull/2
59
- - Fixed https://github.com/ombulabs/harvesting/issues/6 with https://github.com/ombulabs/harvesting/pull/7
73
+ - Fixes issues with specs: https://github.com/fastruby/harvesting/pull/2
74
+ - Fixed https://github.com/fastruby/harvesting/issues/6 with https://github.com/fastruby/harvesting/pull/7
60
75
 
61
76
  ## Version 0.1.0 - Sep 04, 2018
62
77
 
data/TODO.md CHANGED
@@ -1,2 +1,2 @@
1
- * Implement methods like `project.time_entries` or `user.time_entries`
1
+ * Implement methods like `user.time_entries`
2
2
  * Implement methods like `project.time_entries.create(attribute: value)`
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.bindir = "exe"
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
- spec.add_dependency "http", "~> 3.3", ">= 3.3"
23
+ spec.add_dependency "http", ">= 3.3", "< 5.0"
24
24
 
25
25
  spec.add_development_dependency "bundler", ">= 2.0", "< 3.0"
26
26
  spec.add_development_dependency "rake", "~> 13.0"
@@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "vcr", "~> 4.0", ">= 4.0"
31
31
  spec.add_development_dependency "webmock", "~> 3.4", ">= 3.4"
32
32
  spec.add_development_dependency "dotenv", "~> 2.5", ">= 2.5"
33
+ spec.add_development_dependency "simplecov", "~> 0.19.0"
34
+ spec.add_development_dependency "codecov", "~> 0.2.9"
33
35
  end
@@ -115,7 +115,8 @@ module Harvesting
115
115
  url = "#{DEFAULT_HOST}/#{entity.path}"
116
116
  uri = URI(url)
117
117
  response = http_response(:delete, uri)
118
- raise UnprocessableRequest(response.to_s) unless response.code.to_i == 200
118
+ raise UnprocessableRequest.new(response.to_s) unless response.code.to_i == 200
119
+
119
120
  JSON.parse(response.body)
120
121
  end
121
122
 
@@ -7,7 +7,7 @@ module Harvesting
7
7
  include ::Enumerable
8
8
 
9
9
  # @return [Enumerator]
10
- def each(start = 0)
10
+ def each(start = 0, &block)
11
11
  @cursor = start
12
12
  return to_enum(:each, start) unless block_given?
13
13
  Array(@entries[start..-1]).each_with_index do |element, index|
@@ -18,7 +18,7 @@ module Harvesting
18
18
  unless last?
19
19
  start = [@entries.size, start].max
20
20
  fetch_next_page
21
- each(start, &Proc.new)
21
+ each(start, &block)
22
22
  end
23
23
  self
24
24
  end
@@ -1,3 +1,3 @@
1
1
  module Harvesting
2
- VERSION = "0.5.0".freeze
2
+ VERSION = "0.5.1".freeze
3
3
  end
metadata CHANGED
@@ -1,36 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harvesting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernesto Tagwerker
8
8
  - M. Scott Ford
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-09-04 00:00:00.000000000 Z
12
+ date: 2021-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
19
- - !ruby/object:Gem::Version
20
- version: '3.3'
21
18
  - - ">="
22
19
  - !ruby/object:Gem::Version
23
20
  version: '3.3'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '5.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - "~>"
29
- - !ruby/object:Gem::Version
30
- version: '3.3'
31
28
  - - ">="
32
29
  - !ruby/object:Gem::Version
33
30
  version: '3.3'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '5.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -179,6 +179,34 @@ dependencies:
179
179
  - - ">="
180
180
  - !ruby/object:Gem::Version
181
181
  version: '2.5'
182
+ - !ruby/object:Gem::Dependency
183
+ name: simplecov
184
+ requirement: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: 0.19.0
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: 0.19.0
196
+ - !ruby/object:Gem::Dependency
197
+ name: codecov
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: 0.2.9
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: 0.2.9
182
210
  description: Interact with the Harvest API v2.0 from your Ruby application
183
211
  email:
184
212
  - ernesto+github@ombulabs.com
@@ -233,7 +261,7 @@ homepage: https://github.com/fastruby/harvesting
233
261
  licenses:
234
262
  - MIT
235
263
  metadata: {}
236
- post_install_message:
264
+ post_install_message:
237
265
  rdoc_options: []
238
266
  require_paths:
239
267
  - lib
@@ -249,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
249
277
  version: '0'
250
278
  requirements: []
251
279
  rubygems_version: 3.1.3
252
- signing_key:
280
+ signing_key:
253
281
  specification_version: 4
254
282
  summary: Ruby wrapper for the Harvest API v2.0
255
283
  test_files: []