eco-helpers 1.0.14 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eco/api/common/session/s3_uploader.rb +7 -0
- data/lib/eco/api/session.rb +1 -0
- data/lib/eco/api/session/batch/status.rb +4 -0
- data/lib/eco/api/session/config/people.rb +8 -0
- data/lib/eco/api/session/task.rb +1 -0
- data/lib/eco/cli/config/default/workflow.rb +2 -2
- data/lib/eco/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95da9d9333887803067673474e450666533d5c94379048ccf9a15e43b41d4ff2
|
4
|
+
data.tar.gz: b5beff497b2e1ade6d47471381908d318f18b61b16c7a379289f3965c23f32d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28cd8fb38da900ed0917313c662a51e98e9cb2e1847b4a1b49308a452cc4814c2b7077cddfbc1fe9a0c94f1aedafc22da7fc4344c874b14d102bd06d3459c8da
|
7
|
+
data.tar.gz: 9a1ade2d02d8ab9460fc88bc0c56d36ba13cea56e9d31873db0c135c4340bd81bf701d3e59b8dab147d15d2692cd7568fda487ab56bfda7ac766b485bc29eab9
|
@@ -43,6 +43,13 @@ module Eco
|
|
43
43
|
end.compact
|
44
44
|
end
|
45
45
|
|
46
|
+
def path_to_link(path)
|
47
|
+
unless path.is_a?(Enumerable)
|
48
|
+
return "https://s3.console.aws.amazon.com/s3/object/#{path.sub("s3://","")}?region=#{fetch_region}&tab=overview"
|
49
|
+
end
|
50
|
+
path.map {|pth| path_to_link(pth)}
|
51
|
+
end
|
52
|
+
|
46
53
|
private
|
47
54
|
|
48
55
|
def full_path(obj)
|
data/lib/eco/api/session.rb
CHANGED
@@ -214,6 +214,7 @@ module Eco
|
|
214
214
|
# @param content [String] content to be uploaded (requires `file`)
|
215
215
|
# @param file [String] name of the file to be uploaded
|
216
216
|
# @param directory [String] name of source directory to be uploaded
|
217
|
+
# @return [String, Array<String>] paths to S3
|
217
218
|
def s3upload(content: nil, file: nil, directory: nil)
|
218
219
|
if content && file
|
219
220
|
s3uploader.upload(file, content)
|
@@ -2,6 +2,10 @@ module Eco
|
|
2
2
|
module API
|
3
3
|
class Session
|
4
4
|
class Batch
|
5
|
+
# The `Batch::Status` class aims to offer support to keep memory on:
|
6
|
+
# 1. what has happened during the execution of a `Session::Batch` (i.e. errors)
|
7
|
+
# 2. be able to build a summary of what happened
|
8
|
+
# 3. gather the people that was returned as a result of the `batch` (for `get` batch type)
|
5
9
|
# @attr_reader source_queue [Array<Hash>, Array<Ecoportal::API::V1::Person>, Array<Ecoportal::API::Internal::Person>]
|
6
10
|
# The queue as it was originally made (it could contain duplicates)
|
7
11
|
# @attr_reader queue [Array<Hash>, Array<Ecoportal::API::V1::Person>, Array<Ecoportal::API::Internal::Person>]
|
@@ -12,6 +12,14 @@ module Eco
|
|
12
12
|
self["cache"]
|
13
13
|
end
|
14
14
|
|
15
|
+
def partial_cache
|
16
|
+
if file = self.cache
|
17
|
+
File.join(File.dirname(file),
|
18
|
+
File.basename(file, File.extname(file)) + "_partial" + File.extname(file)
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
15
23
|
# specifies if people search should be strict or not
|
16
24
|
def strict_search=(value)
|
17
25
|
self["strict_search"] = !!value
|
data/lib/eco/api/session/task.rb
CHANGED
@@ -24,8 +24,8 @@ ASSETS.cli.config do |config|
|
|
24
24
|
# save partial entries -> should be native to session.workflow
|
25
25
|
partial_update = io.options.dig(:people, :get, :type) == :partial
|
26
26
|
if !io.options[:dry_run] && partial_update
|
27
|
-
|
28
|
-
io.session.file_manager.save_json(io.people,
|
27
|
+
partial_file = io.session.config.people.partial_cache
|
28
|
+
io.session.file_manager.save_json(io.people, partial_file, :timestamp)
|
29
29
|
end
|
30
30
|
io
|
31
31
|
end
|
data/lib/eco/version.rb
CHANGED