quaderno 1.7.2 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/VERSION +1 -1
- data/changelog.md +3 -1
- data/lib/quaderno-ruby/behavior/crud.rb +1 -1
- data/lib/quaderno-ruby/exceptions/exceptions.rb +2 -2
- data/quaderno.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ce3b824827732c0cf058860e1214ae0b4ffb731
|
4
|
+
data.tar.gz: aa1b3180548004212bce574d2e00d15e4e79c15c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d06bfee33d9ee87a0dac839a20187e022567d1ee5df572e40adcb66e1672099d80f3ba659e61f05987ec0e6efb5dad988227b6fa20052a24e0f92fa46f773f8
|
7
|
+
data.tar.gz: 9664ede64110b77aa953e6fda25edab0ed78639a4795f9341e6633970c97a6ee9d25fe05f5da887d9a0db4c2b1fed5a196776d00a00aaaeddbce6ce2ed691d77
|
data/README.md
CHANGED
@@ -223,7 +223,7 @@ In order to remove a payment you will need the Invoice instance you want to upd
|
|
223
223
|
|
224
224
|
will return an array with all your credit notes on the first page. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
|
225
225
|
|
226
|
-
### Finding
|
226
|
+
### Finding a credit
|
227
227
|
```ruby
|
228
228
|
Quaderno::Credit.find(id) #=> Quaderno::Credit
|
229
229
|
```
|
@@ -236,7 +236,7 @@ will return the credit with the id passed as parameter.
|
|
236
236
|
Quaderno::Credit.create(params) #=> Quaderno::Credit
|
237
237
|
```
|
238
238
|
|
239
|
-
will create
|
239
|
+
will create a credit using the information of the hash passed as parameter.
|
240
240
|
|
241
241
|
### Updating an existing credit
|
242
242
|
```ruby
|
@@ -245,7 +245,7 @@ will create an credit using the information of the hash passed as parameter.
|
|
245
245
|
|
246
246
|
will update the specified credit with the data of the hash passed as second parameter.
|
247
247
|
|
248
|
-
### Deleting
|
248
|
+
### Deleting a credit
|
249
249
|
|
250
250
|
```ruby
|
251
251
|
Quaderno::Credit.delete(id) #=> Boolean
|
@@ -398,7 +398,7 @@ will delete the expense with the id passed as parameter.
|
|
398
398
|
|
399
399
|
will return an array with all your recurring notes on the first page. You can also pass query strings using the attribute :q in order to filter the results by contact name, :state to filter by state or :date to filter by date
|
400
400
|
|
401
|
-
### Finding
|
401
|
+
### Finding a recurring
|
402
402
|
```ruby
|
403
403
|
Quaderno::Recurring.find(id) #=> Quaderno::Recurring
|
404
404
|
```
|
@@ -411,7 +411,7 @@ will return the recurring with the id passed as parameter.
|
|
411
411
|
Quaderno::Recurring.create(params) #=> Quaderno::Recurring
|
412
412
|
```
|
413
413
|
|
414
|
-
will create
|
414
|
+
will create a recurring using the information of the hash passed as parameter.
|
415
415
|
|
416
416
|
### Updating an existing recurring
|
417
417
|
```ruby
|
@@ -420,7 +420,7 @@ will create an recurring using the information of the hash passed as parameter.
|
|
420
420
|
|
421
421
|
will update the specified recurring with the data of the hash passed as second parameter.
|
422
422
|
|
423
|
-
### Deleting
|
423
|
+
### Deleting a recurring
|
424
424
|
|
425
425
|
```ruby
|
426
426
|
Quaderno::Recurring.delete(id) #=> Boolean
|
@@ -438,7 +438,7 @@ will delete the recurring with the id passed as parameter.
|
|
438
438
|
|
439
439
|
will return an array with all the webhooks you have subscribed.
|
440
440
|
|
441
|
-
### Finding
|
441
|
+
### Finding a webhook
|
442
442
|
```ruby
|
443
443
|
Quaderno::Webhook.find(id) #=> Quaderno::Webhook
|
444
444
|
```
|
@@ -485,7 +485,8 @@ Quaderno-ruby exceptions raise depending on the type of error:
|
|
485
485
|
|
486
486
|
Quaderno::Exceptions::RateLimitExceeded # Raised when the rate limit is exceeded.
|
487
487
|
|
488
|
-
Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid # Raised if the format of the request is right but some validations failed.
|
488
|
+
Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid # Raised if the format of the request is right but some validations failed. You can JSON parse the exception message to get which field triggered the exception. For example: '{"errors":{"vat_number":["is not a valid German vat number"]}}'
|
489
|
+
|
489
490
|
```
|
490
491
|
|
491
492
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.3
|
data/changelog.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#Changelog
|
2
|
+
##1.7.3
|
3
|
+
* Raise exception on failed updates
|
2
4
|
##1.7.2
|
3
|
-
* Fix URL in Quaderno::Tax.calculate [**@jcxplorer**]
|
5
|
+
* Fix URL in Quaderno::Tax.calculate by [**@jcxplorer**] (https://github.com/jcxplorer)
|
4
6
|
|
5
7
|
##1.7.1
|
6
8
|
* Breaking change: change configuration options
|
@@ -68,7 +68,7 @@ module Quaderno
|
|
68
68
|
|
69
69
|
def update(id, params)
|
70
70
|
party_response = put "#{api_model.url}#{ api_model.api_path }/#{ id }.json", body: params, basic_auth: { username: api_model.auth_token }
|
71
|
-
check_exception_for(party_response, { rate_limit: true, subdomain_or_token: true, id: true })
|
71
|
+
check_exception_for(party_response, { rate_limit: true, required_fields: true, subdomain_or_token: true, id: true })
|
72
72
|
hash = party_response.parsed_response
|
73
73
|
|
74
74
|
api_model.parse(hash) if is_a_document?
|
@@ -37,10 +37,10 @@ module Quaderno
|
|
37
37
|
raise(Quaderno::Exceptions::InvalidID, "Invalid #{ api_model } instance identifier") if (party_response.response.class == Net::HTTPInternalServerError) || (party_response.response.class == Net::HTTPNotFound)
|
38
38
|
end
|
39
39
|
if params[:required_fields].nil? == false
|
40
|
-
raise(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid,
|
40
|
+
raise(Quaderno::Exceptions::RequiredFieldsEmptyOrInvalid, party_response.body) if party_response.response.class == Net::HTTPUnprocessableEntity
|
41
41
|
end
|
42
42
|
if params[:has_documents].nil? == false
|
43
|
-
raise(Quaderno::Exceptions::HasAssociatedDocuments,
|
43
|
+
raise(Quaderno::Exceptions::HasAssociatedDocuments, party_response.body) if party_response.response.class == Net::HTTPClientError
|
44
44
|
end
|
45
45
|
end
|
46
46
|
end
|
data/quaderno.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: quaderno 1.7.
|
5
|
+
# stub: quaderno 1.7.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "quaderno"
|
9
|
-
s.version = "1.7.
|
9
|
+
s.version = "1.7.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Recrea"]
|
14
|
-
s.date = "
|
14
|
+
s.date = "2016-04-15"
|
15
15
|
s.description = " A ruby wrapper for Quaderno API "
|
16
16
|
s.email = "carlos@recrea.es"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -97,7 +97,7 @@ Gem::Specification.new do |s|
|
|
97
97
|
]
|
98
98
|
s.homepage = "http://github.com/quaderno/quaderno-ruby"
|
99
99
|
s.licenses = ["MIT"]
|
100
|
-
s.rubygems_version = "2.4.
|
100
|
+
s.rubygems_version = "2.4.8"
|
101
101
|
s.summary = "one-line summary of your gem"
|
102
102
|
|
103
103
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quaderno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recrea
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.4.
|
158
|
+
rubygems_version: 2.4.8
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: one-line summary of your gem
|