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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37896bf21f1661d488b3af20ac7ed8ee298536d3e96324308f84459ad0e2abb2
4
- data.tar.gz: 05e8eac1fcb530509af91b62c17e89380f3b5ac0926a3a445bd29a309a440c44
3
+ metadata.gz: a3074007c647b1ebecc8aac29368f17218d05a57fd918ece4d9531849e6075cd
4
+ data.tar.gz: 85fe74039f69e7cd268250f3cac40cf84a7a69ac52b113be70be8ff504c0deba
5
5
  SHA512:
6
- metadata.gz: 75e90bf526e20a8dde18a64445f07d5bcaadd7038cb5e2070d8e777341a9799f604da94f4aae359772959a7d92da01db658311afa2d765c31882bf59b138dabe
7
- data.tar.gz: 338389f47335ae1f01f683ba3d54974ecce8eb70e90243534d835aa5cede39ab44458a37aa800206c018e023ff0e45eb228c7a52721a3e95801606743ae2b971
6
+ metadata.gz: 8baf56c80119b6acbabd979e4d421dbe013f056b68d7ff3b0efb9728b2da6788d3be4b464f3a5054c518befa14408a9ba74d89ff6c164d8da3c70dc09e10c08a
7
+ data.tar.gz: a93465c18b2c153966066e644f5021d07fbb7df00c928010a3f51865b04212764255e70d89047c643c9a48cf8e3387be9d7806e121dbfee177e8654bbc024b5e
@@ -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
@@ -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} (entry #{i+1}). Person: #{person_ref(entry)}"
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
- "(id: '#{get_attr(entry, :id)}') '#{get_attr(entry, :name)}' ('#{get_attr(entry, :external_id)}': '#{get_attr(entry, :email)}')"
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
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "1.5.9"
2
+ VERSION = "1.5.10"
3
3
  end
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.9
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: '0'
477
+ version: 2.4.4
478
478
  required_rubygems_version: !ruby/object:Gem::Requirement
479
479
  requirements:
480
480
  - - ">="