eco-helpers 0.6.13 → 0.6.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/eco-helpers.gemspec +1 -1
  3. data/lib/eco/api.rb +1 -2
  4. data/lib/eco/api/common/people/person_entry.rb +1 -1
  5. data/lib/eco/api/common/people/person_factory.rb +3 -3
  6. data/lib/eco/api/common/session/base_session.rb +14 -2
  7. data/lib/eco/api/common/session/environment.rb +9 -7
  8. data/lib/eco/api/common/version_patches/external_person.rb +16 -2
  9. data/lib/eco/api/common/version_patches/internal_person.rb +17 -0
  10. data/lib/eco/api/session.rb +13 -19
  11. data/lib/eco/api/session/batch.rb +4 -17
  12. data/lib/eco/api/session/batch_job.rb +4 -13
  13. data/lib/eco/api/session/{job_group.rb → batch_jobs.rb} +6 -8
  14. data/lib/eco/api/session/batch_status.rb +3 -7
  15. data/lib/eco/api/session/config.rb +186 -0
  16. data/lib/eco/api/session/config/api.rb +49 -0
  17. data/lib/eco/api/session/config/apis.rb +91 -0
  18. data/lib/eco/api/session/config/files.rb +32 -0
  19. data/lib/eco/api/session/config/logger.rb +56 -0
  20. data/lib/eco/api/session/config/mailer.rb +67 -0
  21. data/lib/eco/api/session/config/people.rb +95 -0
  22. data/lib/eco/api/session/config/s3_storage.rb +64 -0
  23. data/lib/eco/api/session/config/use_cases.rb +33 -0
  24. data/lib/eco/api/session/job_groups.rb +4 -6
  25. data/lib/eco/api/session/task.rb +2 -13
  26. data/lib/eco/version.rb +1 -1
  27. metadata +18 -11
  28. data/lib/eco/api/session_config.rb +0 -187
  29. data/lib/eco/api/session_config/api.rb +0 -47
  30. data/lib/eco/api/session_config/apis.rb +0 -89
  31. data/lib/eco/api/session_config/files.rb +0 -30
  32. data/lib/eco/api/session_config/logger.rb +0 -54
  33. data/lib/eco/api/session_config/mailer.rb +0 -65
  34. data/lib/eco/api/session_config/people.rb +0 -93
  35. data/lib/eco/api/session_config/s3_storage.rb +0 -62
  36. data/lib/eco/api/session_config/use_cases.rb +0 -31
@@ -1,30 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class Files < Hash
5
-
6
- def initialize(root:)
7
- super(nil)
8
- @root = root
9
- end
10
-
11
- def working_directory=(path)
12
- self["dir"] = path
13
- end
14
-
15
- def working_directory
16
- self["dir"]
17
- end
18
-
19
- def timestamp_pattern=(pattern)
20
- self["timestamp_pattern"] = pattern
21
- end
22
-
23
- def timestamp_pattern
24
- self["timestamp_pattern"]
25
- end
26
-
27
- end
28
- end
29
- end
30
- end
@@ -1,54 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class Logger < Hash
5
-
6
- def initialize(root:)
7
- super(nil)
8
- @root = root
9
- end
10
-
11
- def console_level=(value)
12
- self["console_level"] = value
13
- end
14
-
15
- def console_level
16
- self["console_level"]
17
- end
18
-
19
- def file_level=(value)
20
- self["file_level"] = value
21
- end
22
-
23
- def file_level
24
- self["file_level"]
25
- end
26
-
27
- def file=(file)
28
- self["file"] = file
29
- end
30
-
31
- def file
32
- self["file"]
33
- end
34
-
35
- def timestamp_console=(value)
36
- self["timestamp_console"] = value
37
- end
38
-
39
- def timestamp_console
40
- self["timestamp_console"]
41
- end
42
-
43
- def log_connection=(value)
44
- self["log_connection"] = value
45
- end
46
-
47
- def log_connection?
48
- !!self["log_connection"]
49
- end
50
-
51
- end
52
- end
53
- end
54
- end
@@ -1,65 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class Mailer < Hash
5
-
6
- def initialize(root:)
7
- super(nil)
8
- @root = root
9
- end
10
-
11
- def from=(value)
12
- self["from"] = value
13
- end
14
-
15
- def from
16
- self["from"]
17
- end
18
-
19
- def access_key_id=(key)
20
- self["access_key_id"] = key
21
- end
22
-
23
- def access_key_id
24
- self["access_key_id"]
25
- end
26
-
27
- def secret_access_key=(key)
28
- self["secret_access_key"] = key
29
- end
30
-
31
- def secret_access_key
32
- self["secret_access_key"]
33
- end
34
-
35
- # AWS::SES::Client
36
- def region=(region)
37
- self["region"] = region
38
- end
39
-
40
- def region
41
- self["region"]
42
- end
43
-
44
- # AWS::SES::Base
45
- def server=(domain)
46
- self["server"] = domain
47
- end
48
-
49
- def server
50
- self["server"]
51
- end
52
-
53
- # AWS::SES::Base
54
- def message_id_domain=(domain)
55
- self["message_id_domain"] = domain
56
- end
57
-
58
- def message_id_domain
59
- self["message_id_domain"]
60
- end
61
-
62
- end
63
- end
64
- end
65
- end
@@ -1,93 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class People < Hash
5
- attr_reader :config
6
-
7
- def initialize(root:)
8
- super(nil)
9
- @root = root
10
- @config = @root
11
- end
12
-
13
- def cache=(file)
14
- self["cache"] = file
15
- end
16
-
17
- def cache
18
- self["cache"]
19
- end
20
-
21
- # api queried logs
22
- def requests_folder=(folder)
23
- self["requests_folder"] = folder
24
- end
25
-
26
- def requests_folder
27
- self["requests_folder"]
28
- end
29
-
30
- # people to exclude from update feeds
31
- def discarded_file=(file)
32
- self["discarded_file"] = file
33
- end
34
-
35
- def discarded_file
36
- self["discarded_file"]
37
- end
38
-
39
- # internal-external fields map
40
- def fields_mapper=(file)
41
- self["fields_mapper"] = file
42
- end
43
-
44
- def fields_mapper
45
- self["fields_mapper"]
46
- end
47
-
48
- # person model
49
- def default_schema=(name)
50
- self["default_schema"] = name
51
- end
52
-
53
- def default_schema
54
- self["default_schema"]
55
- end
56
-
57
- def presets_custom=(file)
58
- self["presets_custom"] = file
59
- end
60
-
61
- def presets_custom
62
- self["presets_custom"]
63
- end
64
-
65
- def presets_map=(file)
66
- self["presets_map"] = file
67
- end
68
-
69
- def presets_map
70
- self["presets_map"]
71
- end
72
-
73
- # CUSTOM PERSON PARSERS
74
- def add_parser(format: :csv)
75
- new_parsers = Eco::API::Common::People::PersonParser.new
76
- yield(new_parsers, config)
77
-
78
- parsers[format] ||= Eco::API::Common::People::PersonParser.new
79
- parsers[format] = parsers[format] ? parsers[format].merge(new_parsers) : new_parsers
80
- end
81
-
82
- def parsers
83
- self["parsers"] ||= {}
84
- end
85
-
86
- def parser(format: :csv)
87
- parsers[format]
88
- end
89
-
90
- end
91
- end
92
- end
93
- end
@@ -1,62 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class S3Storage < Hash
5
-
6
- def initialize(root:)
7
- super(nil)
8
- @root = root
9
- end
10
-
11
- def bucket_name=(value)
12
- self["bucket_name"] = value
13
- end
14
-
15
- def bucket_name
16
- self["bucket_name"]
17
- end
18
-
19
- def prefix=(value)
20
- self["prefix"] = value
21
- end
22
-
23
- def prefix
24
- self["prefix"]
25
- end
26
-
27
- def access_key_id=(key)
28
- self["access_key_id"] = key
29
- end
30
-
31
- def access_key_id
32
- self["access_key_id"]
33
- end
34
-
35
- def secret_access_key=(key)
36
- self["secret_access_key"] = key
37
- end
38
-
39
- def secret_access_key
40
- self["secret_access_key"]
41
- end
42
-
43
- def region=(region)
44
- self["region"] = region
45
- end
46
-
47
- def region
48
- self["region"]
49
- end
50
-
51
- def target_directories=(value)
52
- self["target_directories"] = [value].flatten
53
- end
54
-
55
- def target_directories
56
- self["target_directories"]
57
- end
58
-
59
- end
60
- end
61
- end
62
- end
@@ -1,31 +0,0 @@
1
- module Eco
2
- module API
3
- class SessionConfig
4
- class UseCases < Hash
5
- attr_reader :config
6
-
7
- def initialize(root:)
8
- super(nil)
9
- @root = root
10
- @config = @root
11
- end
12
-
13
- # CUSTOM USE CASES
14
- def add
15
- new_group = Eco::API::UseCases::UseGroup.new
16
- yield(new_group, config)
17
-
18
- self["use_group"] ||= Eco::API::UseCases::UseGroup.new
19
- group = self["use_group"]
20
- group = group ? group.merge(new_group) : group
21
- self["use_group"] = group
22
- end
23
-
24
- def use_group
25
- self["use_group"] ||= Eco::API::UseCases::UseGroup.new
26
- end
27
-
28
- end
29
- end
30
- end
31
- end