eco-helpers 2.0.47 → 2.0.48

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: 2471c3dc047c0a9ec3c2f1e374d09e4ab9920bd92a54b52a1a0bb0647f869712
4
- data.tar.gz: 21e3bb5e42b843ee896a4690df358c081accc2338f7afe4aa91acada0755e681
3
+ metadata.gz: 39d2573c1aecfe5839a1867d549ae47af247cbb7819f4733a8c0a07ff98d9e65
4
+ data.tar.gz: c2318e2dd890bdf4a973332c6849c271bb8593c3f799c2add8b34064b022d54e
5
5
  SHA512:
6
- metadata.gz: e73fdfd9ea00ab63ef8fb49fb4dfd52de2c186f93d9fe6464507ea26acc4a8641ea46dd36f99e5c8bf9d1082537518dfd7404a28b43a6fd93cbdce52acd8b367
7
- data.tar.gz: eb9f056454037f0ae46632b27f7a3e0b2922f0d0b4452eebe23ff34f1c205ce87a45693bcc9a8ff981e91acb0fdada9fd2e37c3a79cb2ab7898d7e0e4aad581e
6
+ metadata.gz: 9319378014f0c596dfd3f458e2fe8f3852906c22bf04234f29c5bc28d3e2b677f1e801310d37fcb4505e555b1b258e5ba2a0c0a46c2ac5b7c32c96e274fda45a
7
+ data.tar.gz: 61cfb4fe7e2a7d125e3cc3c0c25175bd732fe048654e7b11044c4b897414d51253ab16f7b97d8178d4ec6167d4e216ec13af7666efc72fb278d332d5a6723c27
data/CHANGELOG.md CHANGED
@@ -1,7 +1,19 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [2.0.47] - 2022-02-xx
4
+ ## [2.0.48] - 2022-02-xx
5
+
6
+ ### Added
7
+ ### Changed
8
+ - upgraded `ecoportal-api-v2` dependency
9
+
10
+ ### Fixed
11
+ - `Eco::API::Common::People::EntryFactory#get_file_content`
12
+ - Call to `String#scrub` to prevent _invalid byte sequence_ error by replacing those characters by their coding identifier
13
+ - This has been implemented with a max tolerance of 5 byte sequence errors
14
+ - Errors are logged (although could not get to identify the line :/)
15
+
16
+ ## [2.0.47] - 2022-02-03
5
17
 
6
18
  ### Added
7
19
  - `Eco::API::UseCases::DefaultCases::CleanUnknownTags`
@@ -11,7 +23,7 @@ All notable changes to this project will be documented in this file.
11
23
  - Default sample case to list, get and archive SFTP remote files
12
24
  ### Changed
13
25
  - upgraded `ecoportal-api-v2` dependency
14
-
26
+
15
27
  ### Fixed
16
28
  - `Eco::API::Common::Session::S3Uploader#upload_file`: check if file exists before opening.
17
29
 
data/eco-helpers.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency "redcarpet", ">= 3.5.1", "< 3.6"
32
32
 
33
33
  spec.add_dependency 'ecoportal-api', '>= 0.8.4', '< 0.9'
34
- spec.add_dependency 'ecoportal-api-v2', '>= 0.8.24', '< 0.9'
34
+ spec.add_dependency 'ecoportal-api-v2', '>= 0.8.25', '< 0.9'
35
35
  spec.add_dependency 'aws-sdk-s3', '>= 1.83.0', '< 2'
36
36
  spec.add_dependency 'aws-sdk-ses', '>= 1.36.0', '< 2'
37
37
  spec.add_dependency 'dotenv', '>= 2.7.6', '< 2.8'
@@ -196,7 +196,23 @@ module Eco
196
196
  ext = File.extname(file)
197
197
  encoding ||= Eco::API::Common::Session::FileManager.encoding(file)
198
198
  encoding = (encoding != "utf-8")? "#{encoding}|utf-8": encoding
199
- content = File.read(file, encoding: encoding)
199
+ read_with_tolerance(file, encoding: encoding)
200
+ end
201
+
202
+ def read_with_tolerance(file, encoding:)
203
+ if content = File.read(file, encoding: encoding)
204
+ tolerance = 5
205
+ content.scrub do |bytes|
206
+ replacement = '<' + bytes.unpack('H*')[0] + '>'
207
+ if tolerance <= 0
208
+ logger.error("There were more than 5 encoding errors in the file '#{file}'.")
209
+ return content
210
+ else
211
+ logger.error("Encoding problem in file '#{file}': '#{replacement}'.")
212
+ replacement
213
+ end
214
+ end
215
+ end
200
216
  end
201
217
 
202
218
  def fatal(msg)
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "2.0.47"
2
+ VERSION = "2.0.48"
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.47
4
+ version: 2.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -136,7 +136,7 @@ dependencies:
136
136
  requirements:
137
137
  - - ">="
138
138
  - !ruby/object:Gem::Version
139
- version: 0.8.24
139
+ version: 0.8.25
140
140
  - - "<"
141
141
  - !ruby/object:Gem::Version
142
142
  version: '0.9'
@@ -146,7 +146,7 @@ dependencies:
146
146
  requirements:
147
147
  - - ">="
148
148
  - !ruby/object:Gem::Version
149
- version: 0.8.24
149
+ version: 0.8.25
150
150
  - - "<"
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0.9'