eco-helpers 1.5.9 → 1.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/eco-helpers.gemspec +1 -0
- data/lib/eco/api/common/people/person_entry.rb +1 -1
- data/lib/eco/api/session/batch/errors.rb +12 -2
- data/lib/eco/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3074007c647b1ebecc8aac29368f17218d05a57fd918ece4d9531849e6075cd
|
4
|
+
data.tar.gz: 85fe74039f69e7cd268250f3cac40cf84a7a69ac52b113be70be8ff504c0deba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8baf56c80119b6acbabd979e4d421dbe013f056b68d7ff3b0efb9728b2da6788d3be4b464f3a5054c518befa14408a9ba74d89ff6c164d8da3c70dc09e10c08a
|
7
|
+
data.tar.gz: a93465c18b2c153966066e644f5021d07fbb7df00c928010a3f51865b04212764255e70d89047c643c9a48cf8e3387be9d7806e121dbfee177e8654bbc024b5e
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [1.5.10] - 2021-01-xx
|
5
|
+
|
6
|
+
### Added
|
7
|
+
### Changed
|
8
|
+
### Fixed
|
9
|
+
- `Eco::API::Session::Batch::Errors#print` show the row number of the input data.
|
10
|
+
|
4
11
|
## [1.5.9] - 2021-01-08
|
5
12
|
|
6
13
|
### Added
|
data/eco-helpers.gemspec
CHANGED
@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.summary = %q{eco-helpers to manage people api cases}
|
14
14
|
s.homepage = "https://www.ecoportal.com"
|
15
15
|
s.licenses = %w[MIT]
|
16
|
+
s.required_ruby_version = '>= 2.4.4'
|
16
17
|
|
17
18
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
19
|
f.match(%r{^(test|spec|features)/})
|
@@ -75,7 +75,7 @@ module Eco
|
|
75
75
|
!parsing?
|
76
76
|
end
|
77
77
|
|
78
|
-
# @note `Eco::API::Common::People::EntryFactory#entries` adds this `idx`
|
78
|
+
# @note `Eco::API::Common::People::EntryFactory#entries` adds this `idx` (i.e. row number)
|
79
79
|
# @return [Integer] the entry number in the input file
|
80
80
|
def idx
|
81
81
|
final_entry["idx"]
|
@@ -123,7 +123,7 @@ module Eco
|
|
123
123
|
entry = queue.to_a[i]
|
124
124
|
response = status[i]
|
125
125
|
msg = "Error #{response.status}: #{response.body}\n"
|
126
|
-
msg += "-- Failed to batch #{method}
|
126
|
+
msg += "-- Failed to batch #{method}. Person: #{person_ref(entry)}"
|
127
127
|
end
|
128
128
|
msg
|
129
129
|
end
|
@@ -164,7 +164,8 @@ module Eco
|
|
164
164
|
private
|
165
165
|
|
166
166
|
def person_ref(entry)
|
167
|
-
|
167
|
+
row_str = (row = get_row(entry)) ? "(row: #{row}) " : nil
|
168
|
+
"#{row_str}(id: '#{get_attr(entry, :id)}') '#{get_attr(entry, :name)}' ('#{get_attr(entry, :external_id)}': '#{get_attr(entry, :email)}')"
|
168
169
|
end
|
169
170
|
|
170
171
|
def get_attr(entry, attr)
|
@@ -175,6 +176,15 @@ module Eco
|
|
175
176
|
end
|
176
177
|
end
|
177
178
|
|
179
|
+
def get_row(value)
|
180
|
+
case value
|
181
|
+
when Eco::API::Common::People::PersonEntry
|
182
|
+
value.idx
|
183
|
+
when Ecoportal::API::V1::Person
|
184
|
+
get_row(value.entry)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
178
188
|
end
|
179
189
|
end
|
180
190
|
end
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eco-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
@@ -474,7 +474,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
474
474
|
requirements:
|
475
475
|
- - ">="
|
476
476
|
- !ruby/object:Gem::Version
|
477
|
-
version:
|
477
|
+
version: 2.4.4
|
478
478
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
479
479
|
requirements:
|
480
480
|
- - ">="
|