filebound_client 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da2595d81baa79573163bb00a9ad7d0bfc51fef38e629bbe91a40c786a735e81
4
- data.tar.gz: ae877807f57a5b534a7dcbc2c7eb68a866fcc97d74e0e5244f0dddb7e0ce225b
3
+ metadata.gz: 78c968b126940138166073c4d4737a5a9e2299075f8e612a0b201a10dd7c5e06
4
+ data.tar.gz: bd92c85ec24b82f53cccca5d24ebf623498e9ff154d1b9c390275ad09c089453
5
5
  SHA512:
6
- metadata.gz: 7a0408600f6c72a6f125a523c8bbf2d71e4ea740ec9e5df5884ca9a4e79a8e17644f0cac4b94162166904a712121c24800ab3a4464205c606bbe1579565ecae2
7
- data.tar.gz: 9e8bc0d1a6df750fc9178436115ecf69bbce22244d84a1a04678c465ca26df21d32df1ffc3ad28e5e3fd9e6efbcf6045b3787a4ecd0f8912934f70193e354a0f
6
+ metadata.gz: a2bb9e29ddf5bc4585c908501c5f9ab1217f0e5cfa6fa50d28d782c6eae6a4a5aaa9399d43ee3235e3ebd06168cf9325e2d68545633e443935ed16fabe758079
7
+ data.tar.gz: 3afd1349d71c255e9a8397fbfc56d48a010289b7e775c23acad77a1a1c381b44cfea04fb005f75f00c04b49935cf0f9d5464ebe20b28a5f407708d8931cd0751
data/.gitignore CHANGED
@@ -9,4 +9,6 @@
9
9
  test.yml
10
10
 
11
11
  # rspec failure tracking
12
- .rspec_status
12
+ .rspec_status
13
+
14
+ *.gem
data/.rubocop.yml CHANGED
@@ -1,4 +1,8 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.5.1
1
3
  Metrics/LineLength:
2
4
  Max: 120
3
5
  Metrics/MethodLength:
4
- Max: 20
6
+ Max: 20
7
+ Style/FrozenStringLiteralComment:
8
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
 
4
4
  Changes to this gem will be noted here.
5
5
 
6
+ ## [0.3.2] - 2019-01-31
7
+
8
+ ### Added
9
+ - Improved error information returned when and API call fails.
10
+
6
11
  ## [0.3.1] - 2019-01-23
7
12
 
8
13
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- filebound_client (0.2.0)
4
+ filebound_client (0.3.2)
5
5
  httpi (~> 2.4.0)
6
6
  rubyntlm (~> 0.6.0)
7
7
 
data/lib/ext/object.rb CHANGED
@@ -14,6 +14,6 @@ class Object
14
14
  # @return [true, false]
15
15
  def greater_than_zero?
16
16
  return false if nil?
17
- to_i > 0
17
+ to_i.positive?
18
18
  end
19
19
  end
@@ -93,9 +93,15 @@ module FileboundClient
93
93
 
94
94
  def perform(action, url, params)
95
95
  response = connection.send(action, url, params)
96
- # rubocop:disable Metrics/LineLength
97
- raise FileboundClientException.new("#{action.upcase} request failed: #{response.code}", response.code) unless response.code == 200
98
- # rubocop:enable Metrics/LineLength
96
+ if response.error?
97
+ message = <<~ERROR
98
+ #{action.upcase} request failed: #{response.code}
99
+ Headers: #{response.headers}
100
+ Body: #{response.body}
101
+ ERROR
102
+ raise FileboundClientException.new(message, response.code)
103
+ end
104
+
99
105
  response.body
100
106
  end
101
107
  end
@@ -87,7 +87,7 @@ module FileboundClient
87
87
  # @param [Hash] document the document hash to add
88
88
  # @return [Hash] the newly added document hash
89
89
  def document_add(document)
90
- raise FileboundClientException.new('File Id is required', 0) unless document && document[:fileId] > 0
90
+ raise FileboundClientException.new('File Id is required', 0) unless document && document[:fileId].positive?
91
91
  put("/documents/#{document[:fileId]}", nil, document)
92
92
  end
93
93
 
@@ -1,4 +1,4 @@
1
1
  module FileboundClient
2
2
  # Current version of gem
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filebound_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Richardson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler