eco-helpers 1.5.11 → 1.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/CHANGELOG.md +12 -1
- data/eco-helpers.gemspec +1 -1
- data/lib/eco/api/common/people/default_parsers/csv_parser.rb +15 -2
- data/lib/eco/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb7b7377b64d086bb76f11f99c2f63f19eae2e25c67dc52fdeb034d58af888f4
|
4
|
+
data.tar.gz: d1fecbe4232a57e21a9f100fcb5ef7e0058787cdb19d5e84cb79dfc9d0082889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c77b34e3ce111d4203eb54bd765f04d00044e42cdd53a05443668e3a35589193f95b877b24fe10acbdb0214aab1aaaa5031be6f6f6012983242e4e03ebcfe7a
|
7
|
+
data.tar.gz: 2cff100787f222de6300ec9d991b6dba8b36726b64a90ca7618ff35330efe1dd4b0431d197cdf952dc657701357b5ff3f9fe5799f2b749f512baf9f6dd145c83
|
data/.yardopts
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [1.5.
|
4
|
+
## [1.5.12] - 2021-01-xx
|
5
|
+
|
6
|
+
### Added
|
7
|
+
- `Eco::API::Common::People::DefaultParsers::CSVParser` when cell content is `Null`, capture `nil` value.
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
- upgraded `ecoportal-api` dependency
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
|
14
|
+
|
15
|
+
## [1.5.11] - 2021-01-25
|
5
16
|
|
6
17
|
### Added
|
7
18
|
- `Eco::API::Organization::TagTree#subtag?` to check if the tag is in any subtree.
|
data/eco-helpers.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
s.add_development_dependency "yard", ">= 0.9.18", "< 0.10"
|
30
30
|
s.add_development_dependency "redcarpet", ">= 3.5.0", "< 3.6"
|
31
31
|
|
32
|
-
s.add_dependency 'ecoportal-api', '>= 0.7.
|
32
|
+
s.add_dependency 'ecoportal-api', '>= 0.7.4', '< 0.8'
|
33
33
|
s.add_dependency 'ecoportal-api-oozes', '>= 0.7.2', '< 0.8'
|
34
34
|
s.add_dependency 'aws-sdk-s3', '>= 1.64.0', '< 2'
|
35
35
|
s.add_dependency 'aws-sdk-ses', '>= 1.29.0', '< 2'
|
@@ -5,8 +5,7 @@ class Eco::API::Common::People::DefaultParsers::CSVParser < Eco::API::Common::Lo
|
|
5
5
|
Eco::CSV.parse(data, headers: true, skip_blanks: true).each_with_object([]) do |row, arr_hash|
|
6
6
|
row_hash = row.headers.uniq.each_with_object({}) do |attr, hash|
|
7
7
|
next if attr.to_s.strip.empty?
|
8
|
-
|
9
|
-
hash[attr.strip] = value.to_s.empty?? nil : value
|
8
|
+
hash[attr.strip] = parse_string(row[attr])
|
10
9
|
end
|
11
10
|
arr_hash.push(row_hash)
|
12
11
|
end
|
@@ -23,4 +22,18 @@ class Eco::API::Common::People::DefaultParsers::CSVParser < Eco::API::Common::Lo
|
|
23
22
|
CSV::Table.new(arr_rows).to_csv
|
24
23
|
end
|
25
24
|
|
25
|
+
private
|
26
|
+
|
27
|
+
def parse_string(value)
|
28
|
+
return nil if value.to_s.empty?
|
29
|
+
return nil if null?(value)
|
30
|
+
value
|
31
|
+
end
|
32
|
+
|
33
|
+
def null?(value)
|
34
|
+
return true if !value
|
35
|
+
str = value.strip.upcase
|
36
|
+
["NULL"].any? {|token| str == token}
|
37
|
+
end
|
38
|
+
|
26
39
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.7.
|
119
|
+
version: 0.7.4
|
120
120
|
- - "<"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0.8'
|
@@ -126,7 +126,7 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 0.7.
|
129
|
+
version: 0.7.4
|
130
130
|
- - "<"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0.8'
|