eco-rake 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -1
- data/eco-rake.gemspec +5 -5
- data/lib/eco-rake/lib/files/sftp.rb +6 -1
- data/lib/eco-rake/lib/people/sync_process.rb +16 -2
- data/lib/eco-rake/options/parental.rb +1 -1
- data/lib/eco-rake/version.rb +1 -1
- metadata +21 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60189b6e7dc7efcff09a1086ea880b932ffefd23355c352d9811e2ea777f81b6
|
4
|
+
data.tar.gz: aea908242491f387979870592ce41c9535bf22122420148d8b5c4d77d6c4809f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d11088ce6730501e61af2fb5d2863138801f35381acf60a756afa2fc45d8bb24dfaffda13a8cf47b9b808cca67fd6fecc6a62f890e7f15d2a0ae81fb7699558
|
7
|
+
data.tar.gz: f57a89800529e1556b6b69e851e1b813f5f614ef3d8257efcebbb271a0cb4dd2b4890609cc2641c2a9d6f333e19a58b4553dc4d7dbdd4f39e2c4740045676a0d
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,25 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
-
## [0.1.
|
4
|
+
## [0.1.7] - 2024-02-xx
|
5
5
|
|
6
6
|
### Added
|
7
7
|
### Fixed
|
8
|
+
### Changed
|
9
|
+
|
10
|
+
## [0.1.6] - 2024-02-03
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
- Compatibility with `ruby 3`
|
14
|
+
- call to `super` with no args where method on parent class doesn't match parameters.
|
8
15
|
|
9
16
|
### Changed
|
17
|
+
- upgrade dependencies
|
18
|
+
|
19
|
+
## [0.1.5] - 2024-02-01
|
20
|
+
|
21
|
+
### Added
|
22
|
+
- new options for file pattern const and remote subfolder for the SFTP task
|
10
23
|
|
11
24
|
## [0.1.4] - 2023-07-23
|
12
25
|
|
data/eco-rake.gemspec
CHANGED
@@ -21,14 +21,14 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.required_ruby_version = '>= 2.7.2'
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", ">= 2.4.
|
24
|
+
spec.add_development_dependency "bundler", ">= 2.4.12", "< 3"
|
25
25
|
spec.add_development_dependency "rake", ">= 13.0.6", "< 14"
|
26
|
-
spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
|
27
26
|
spec.add_development_dependency "rspec", ">= 3.10.0", "< 4"
|
28
27
|
spec.add_development_dependency "yard", ">= 0.9.34", "< 1"
|
28
|
+
spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
|
29
29
|
|
30
|
-
#spec.add_dependency 'aws-sdk-s3', '>= 1.
|
31
|
-
spec.add_dependency 'aws-sdk-ses', '>= 1.
|
32
|
-
spec.add_dependency 'dotenv', '>= 2.
|
30
|
+
#spec.add_dependency 'aws-sdk-s3', '>= 1.142.0', '< 2'
|
31
|
+
spec.add_dependency 'aws-sdk-ses', '>= 1.58.0', '< 2'
|
32
|
+
spec.add_dependency 'dotenv', '>= 2.8.1', '< 3'
|
33
33
|
spec.add_dependency 'rake-commander', '>= 0.3.6', "< 0.4"
|
34
34
|
end
|
@@ -8,7 +8,9 @@ class EcoRake
|
|
8
8
|
list: '-list',
|
9
9
|
get_last: '-get-last',
|
10
10
|
get: '-get',
|
11
|
-
archive: '-archive'
|
11
|
+
archive: '-archive',
|
12
|
+
file_pattern: ->(str) { "-file-pattern-const #{str}"},
|
13
|
+
remote_subfolder: ->(sub) { "-remote-subfolder #{sub}"}
|
12
14
|
}.freeze
|
13
15
|
|
14
16
|
options_with_defaults true
|
@@ -19,6 +21,8 @@ class EcoRake
|
|
19
21
|
option '-g', '--get', TrueClass, desc: 'Gets all available CSV feed files'
|
20
22
|
option '-t', '--get-last', TrueClass, desc: 'Gets the last available CSV feed file'
|
21
23
|
option '-a', '--archive', TrueClass, desc: "Moves the remote CSV feed files to the '/Archive' folder"
|
24
|
+
option '-p', '--file-pattern CONST', String, desc: "Specifies a const to use as the target file pattern"
|
25
|
+
option '-r', '--remote-subfolder SUBFOLDER', String, desc: "Remote subfolder of the env (at the top of the enviro folder)"
|
22
26
|
|
23
27
|
option_forwarding(**FORWARD_RULES)
|
24
28
|
|
@@ -35,6 +39,7 @@ class EcoRake
|
|
35
39
|
cmd = [base_command]
|
36
40
|
cmd << forward_option(:folder)
|
37
41
|
cmd << forward_options(:list, :get_last, :get, :archive).compact.first || '-list'
|
42
|
+
cmd.push(*forward_options(:remote_subfolder, :file_pattern))
|
38
43
|
cmd << '-no-people'
|
39
44
|
cmd = yield(cmd) if block_given?
|
40
45
|
string_cmd(*cmd)
|
@@ -4,6 +4,7 @@ class EcoRake
|
|
4
4
|
# The top level task that organizes all the people sync
|
5
5
|
class SyncProcess < EcoRake::Lib::People::SyncRely
|
6
6
|
attr_const :do_decrypt, default: false
|
7
|
+
attr_const :pull_driver, default: 'sftp'
|
7
8
|
attr_const :target_task
|
8
9
|
|
9
10
|
attr_const :target_enviro, required: true
|
@@ -16,23 +17,36 @@ class EcoRake
|
|
16
17
|
|
17
18
|
def task(*_args)
|
18
19
|
upsert_local_dir(options[:folder])
|
19
|
-
sh_continue
|
20
|
+
sh_continue pull_file
|
20
21
|
if do_decrypt
|
21
22
|
failed_decryption_notify unless 0 == sh_continue(rake_decrypt)
|
22
23
|
end
|
23
24
|
sh_continue rake_sync_command
|
24
25
|
return if options[:simulate]
|
25
|
-
sh_continue rake_sftp_archive
|
26
|
+
sh_continue rake_sftp_archive if pull_driver == 'sftp'
|
26
27
|
sh_continue rake_files_purge('cache')
|
27
28
|
sh_continue rake_files_purge('requests')
|
28
29
|
end
|
29
30
|
|
30
31
|
private
|
31
32
|
|
33
|
+
def pull_file
|
34
|
+
case pull_driver
|
35
|
+
when 'sftp'
|
36
|
+
rake_sftp_get
|
37
|
+
when 'url'
|
38
|
+
rake_url_get
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
32
42
|
def rake_sftp_get
|
33
43
|
rake_command('csv:sftp', *forward_options(:enviro, :folder), '-t')
|
34
44
|
end
|
35
45
|
|
46
|
+
def rake_url_get
|
47
|
+
rake_command("csv:#{options[:enviro]}:url", *forward_options(:folder))
|
48
|
+
end
|
49
|
+
|
36
50
|
def rake_sftp_archive
|
37
51
|
rake_command('csv:sftp', *forward_options(:enviro, :folder), '-a')
|
38
52
|
end
|
data/lib/eco-rake/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eco-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oscar Segura Samper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.4.
|
19
|
+
version: 2.4.12
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '3'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 2.4.
|
29
|
+
version: 2.4.12
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '3'
|
@@ -51,12 +51,12 @@ dependencies:
|
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '14'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
54
|
+
name: rspec
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 3.
|
59
|
+
version: 3.10.0
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '4'
|
@@ -66,57 +66,57 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 3.
|
69
|
+
version: 3.10.0
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '4'
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
|
-
name:
|
74
|
+
name: yard
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
76
76
|
requirements:
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version:
|
79
|
+
version: 0.9.34
|
80
80
|
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '1'
|
83
83
|
type: :development
|
84
84
|
prerelease: false
|
85
85
|
version_requirements: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 0.9.34
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
|
-
version: '
|
92
|
+
version: '1'
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
|
-
name:
|
94
|
+
name: redcarpet
|
95
95
|
requirement: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
99
|
+
version: 3.6.0
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '
|
102
|
+
version: '4'
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
105
|
version_requirements: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
109
|
+
version: 3.6.0
|
110
110
|
- - "<"
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
112
|
+
version: '4'
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: aws-sdk-ses
|
115
115
|
requirement: !ruby/object:Gem::Requirement
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: 1.
|
119
|
+
version: 1.58.0
|
120
120
|
- - "<"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '2'
|
@@ -126,7 +126,7 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: 1.
|
129
|
+
version: 1.58.0
|
130
130
|
- - "<"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '2'
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: 2.
|
139
|
+
version: 2.8.1
|
140
140
|
- - "<"
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: '3'
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: 2.
|
149
|
+
version: 2.8.1
|
150
150
|
- - "<"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '3'
|