eco-helpers 2.0.28 → 2.0.32

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: b80eb47cf2adf3301ae87dd42a54c1317f864733af3d1cce071d8c326b4309b6
4
- data.tar.gz: f72f9feeca70b9b9c159ad9efc48c379104c3e6ddde433b571b65f08ec0b5f07
3
+ metadata.gz: 0a1f04caab2cae362249d46b694021287a8904052f3851151b4cb6103e7f8790
4
+ data.tar.gz: b050e7dd4626f331080cb6dc1437da74a793460bce5426ff3aa5a9b91bba5a53
5
5
  SHA512:
6
- metadata.gz: dc7717f2ac13b00d5b91607f45dc1c0965336ab1ff4e7792785f35425f361e05b98d60f727f65117ae0002867c5be401041cd65b9448c01c73d0fd50306d2218
7
- data.tar.gz: 2605aadb300be3ae8b48770fab89ccbb39395f8d7239c66d7dd6dda8649c2f27f55b3e9ca912150e19a290e46b359e1909de7c2214277fc4bb6a510e9edb7415
6
+ metadata.gz: 7eb83d0cd4b318f42e90065f772b0b9aa801afddd39d0f2e6fa9861446fd06d537cc436500f8cc9a2c852ce46d3ea2b00a2d3a7199cdba9bf244a8104aa63bfc
7
+ data.tar.gz: ef8ab06e274156c0341212b9b72865e0dfe4e55e9c4f0f816b67554739b6fc2a1b15614a973bfae234dbdd03de7b429513ad19edcd9264b0123cb80374dc78b8
data/CHANGELOG.md CHANGED
@@ -1,12 +1,31 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.0.28] - 2021-07-08
4
+ ## [2.0.32] - 2021-07-xx
5
5
 
6
6
  ### Added
7
7
 
8
8
  ### Changed
9
9
 
10
+ ### Fixed
11
+ - `Eco::API::UseCases::OozeSamples::OozeUpdateCase` prompting user, fixed typo
12
+ - `Eco::API::Session::Batch::Job`: `include-excluded` again... typo.
13
+
14
+ ## [2.0.31] - 2021-07-13
15
+
16
+ ### Fixed
17
+ - `Eco::API::Session::Batch::Job`: `include-excluded` was triggering a type error.
18
+
19
+ ## [2.0.30] - 2021-07-08
20
+
21
+ ### Added
22
+ * `Eco::API::Common::People::DefaultParsers::XLSParser` uses as default the `fields_map.json` to identify the headers.
23
+
24
+ ### Fixed
25
+ * `Eco::API::Common::People::DefaultParsers::XLSParser` should return all `String` values
26
+
27
+ ## [2.0.29] - 2021-07-08
28
+
10
29
  ### Fixed
11
30
  - `Eco::API::Common::People::PersonEntryAttributeMapper#details_attrs`
12
31
  * What a mess this was doing to the `csv` export :/
@@ -75,9 +94,6 @@ All notable changes to this project will be documented in this file.
75
94
  * when in `dry-run` it fakes the `id` with a counter
76
95
  - `Eco::API::Common::People::PersonFactory` gets `subordinates` initialized to `0` (when **creating** a `new` person)
77
96
 
78
- ### Fixed
79
-
80
-
81
97
  ## [2.0.25] - 2021-06-23
82
98
 
83
99
  ### Added
@@ -5,7 +5,7 @@ module Eco
5
5
  class Base
6
6
  extend Eco::API::Common::ClassHelpers
7
7
 
8
- class << self
8
+ class << self
9
9
  # Sort order
10
10
  def <=>(other)
11
11
  created_at <=> other.created_at
@@ -6,7 +6,12 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
6
6
 
7
7
  def parser(file, deps)
8
8
  @file = file
9
- rows.tap {|r| @file = nil}
9
+ rows.tap do |rws|
10
+ @file = nil
11
+ rws.each do |row|
12
+ to_string!(row)
13
+ end
14
+ end
10
15
  end
11
16
 
12
17
  def serializer(array_hash, deps)
@@ -15,8 +20,18 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
15
20
 
16
21
  private
17
22
 
23
+ def to_string!(row)
24
+ row.transform_values! do |val|
25
+ next nil unless val
26
+ next val if val.is_a?(String)
27
+ val.to_s
28
+ end
29
+ end
30
+
31
+
18
32
  def headers
19
- raise "You should implement this method"
33
+ logger.warn("Headers detection is using your fields_map.json file (native behaviour)")
34
+ session.fields_mapper.list(:external).uniq
20
35
  end
21
36
 
22
37
  def sheet_name
@@ -34,7 +49,7 @@ class Eco::API::Common::People::DefaultParsers::XLSParser < Eco::API::Common::Lo
34
49
 
35
50
  def rows(target = headers)
36
51
  begin
37
- spreadheet.parse(header_search: target)
52
+ spreadheet.parse(header_search: target, clean: true)
38
53
  rescue Roo::HeaderRowNotFoundError => e
39
54
  missing = JSON.parse(e.message)
40
55
  logger.warn("The input file is missing these headers: #{missing}")
@@ -252,13 +252,14 @@ module Eco
252
252
  # - filter out excluded entries from the api update
253
253
  def api_included(full_queue)
254
254
  return full_queue if type == :create
255
- return full_queue unless excluded = session.config.people.api_excluded
256
- if options.dig(:include, :excluded, :only)
257
- full_queue.select {|entry| excluded.call(entry, session, options, self)}
255
+ return full_queue unless excluded_callback = session.config.people.api_excluded
256
+ excluded = options.dig(:include, :excluded)
257
+ if excluded.is_a?(Hash) && excluded[:only]
258
+ full_queue.select {|entry| excluded_callback.call(entry, session, options, self)}
258
259
  elsif options.dig(:include, :excluded)
259
260
  full_queue
260
261
  else
261
- full_queue.select {|entry| !excluded.call(entry, session, options, self)}
262
+ full_queue.select {|entry| !excluded_callback.call(entry, session, options, self)}
262
263
  end
263
264
  end
264
265
 
@@ -45,7 +45,7 @@ class Eco::API::UseCases::OozeSamples::OozeUpdateCase < Eco::API::Common::Loader
45
45
  end
46
46
 
47
47
  def ooze
48
- @ooze ||= apiv2.pages.get(ooze_id).tap do |ooze|
48
+ @ooze ||= apiv2.pages.get(ooze_id, stage_id: stage_id).tap do |ooze|
49
49
  if ooze
50
50
  new_target(ooze)
51
51
  logger.info("Got #{object_reference(ooze)}")
@@ -124,7 +124,7 @@ class Eco::API::UseCases::OozeSamples::OozeUpdateCase < Eco::API::Common::Loader
124
124
  end
125
125
 
126
126
  def prompt_to_confirm!
127
- prompt_user("Do you want to proceed (y/N)?", default: "Y") do |response|
127
+ micro.prompt_user("Do you want to proceed (y/N)?", default: "Y") do |response|
128
128
  exit(1) unless response.upcase.start_with?("Y")
129
129
  end
130
130
  end
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.0.28"
2
+ VERSION = "2.0.32"
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: 2.0.28
4
+ version: 2.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura