eco-rake 0.1.6 → 0.2.0

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: 60189b6e7dc7efcff09a1086ea880b932ffefd23355c352d9811e2ea777f81b6
4
- data.tar.gz: aea908242491f387979870592ce41c9535bf22122420148d8b5c4d77d6c4809f
3
+ metadata.gz: 628181cc7bb3f65177780f0ce04dba3e16ce33256bd708c1619a214699622fc5
4
+ data.tar.gz: d70cadf71bcc60f3578993ef16d10300f938bce65ae325faf2e3a9ae86e82c23
5
5
  SHA512:
6
- metadata.gz: 0d11088ce6730501e61af2fb5d2863138801f35381acf60a756afa2fc45d8bb24dfaffda13a8cf47b9b808cca67fd6fecc6a62f890e7f15d2a0ae81fb7699558
7
- data.tar.gz: f57a89800529e1556b6b69e851e1b813f5f614ef3d8257efcebbb271a0cb4dd2b4890609cc2641c2a9d6f333e19a58b4553dc4d7dbdd4f39e2c4740045676a0d
6
+ metadata.gz: 46504cb702b95c53a542a93cb749951a31093cdd7191f6364c100e58f70c62646448b3341cd4a87c979b4c4c15f2ab2d926f28852191fe92d32ed76e99694ccf
7
+ data.tar.gz: dc9bb1377d36e0bcca062d85cfe90305167771210095563b3fe122a52a06f1d57153cf4d2723b61ec18e9e285add8915f297ca6cc0b1f3253a344d7f871060bc
@@ -0,0 +1,4 @@
1
+ {
2
+ "MD013": false,
3
+ "MD024": false
4
+ }
data/.rubocop.yml CHANGED
@@ -1,90 +1,93 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.7.2
3
- Exclude:
4
- - 'config/routes.rb'
2
+ TargetRubyVersion: 3.2.2
3
+ NewCops: enable
5
4
 
6
- Naming/VariableNumber:
7
- EnforcedStyle: snake_case
8
- Naming/FileName:
9
- Enabled: false
10
-
11
- Metrics/LineLength:
12
- Enabled: false
13
- Metrics/BlockLength:
14
- ExcludedMethods: [context, describe]
15
- Max: 50
16
- Metrics/MethodLength:
17
- Max: 50
18
5
  Metrics/ClassLength:
19
- Max: 200
6
+ Max: 500
20
7
  Metrics/ModuleLength:
21
- Max: 200
8
+ Max: 300
9
+ Metrics/MethodLength:
10
+ Max: 50
22
11
  Metrics/AbcSize:
12
+ Max: 30
13
+ Metrics/ParameterLists:
14
+ Max: 5
15
+ CountKeywordArgs: false
16
+ Metrics/BlockLength:
17
+ CountAsOne: ['array', 'heredoc', 'method_call']
23
18
  Max: 50
24
- Exclude:
25
- - 'lib/eco-rake/base/method_helpers.rb'
26
19
  Metrics/CyclomaticComplexity:
27
- Max: 10
28
- Exclude:
29
- - 'lib/eco-rake/base/method_helpers.rb'
20
+ Max: 30
30
21
  Metrics/PerceivedComplexity:
31
- Max: 10
32
- Exclude:
33
- - 'lib/eco-rake/base/method_helpers.rb'
22
+ Max: 30
34
23
 
35
- ParameterLists:
36
- Max: 5
37
- CountKeywordArgs: false
38
-
39
- Style/Alias:
40
- EnforcedStyle: prefer_alias_method
41
- Style/StringLiterals:
24
+ Style/AccessorGrouping:
42
25
  Enabled: false
43
- Style/FrozenStringLiteralComment:
26
+ Style/ConditionalAssignment:
44
27
  Enabled: false
45
- Style/CommentedKeyword:
28
+ Style/BlockDelimiters:
29
+ BracesRequiredMethods: ['log']
30
+ AllowedPatterns: ['proc', 'new']
31
+ Style/ClassAndModuleChildren:
46
32
  Enabled: false
47
- Style/MultilineBlockChain:
33
+ Style/FrozenStringLiteralComment:
48
34
  Enabled: false
49
- Style/Documentation:
35
+ Style/StringLiterals:
50
36
  Enabled: false
51
37
  Style/StringLiteralsInInterpolation:
52
38
  Enabled: false
53
- Style/AndOr:
39
+ Style/Documentation:
54
40
  Enabled: false
55
- Style/SlicingWithRange:
41
+ Style/CommentedKeyword:
56
42
  Enabled: false
57
- Style/ClassAndModuleChildren:
43
+ Style/MultilineBlockChain:
58
44
  Enabled: false
59
- Style/OptionalBooleanParameter:
45
+ Style/AndOr:
46
+ Enabled: false
47
+ Style/Alias:
48
+ EnforcedStyle: prefer_alias_method
49
+ Style/FetchEnvVar:
60
50
  Enabled: false
51
+ Style/RegexpLiteral:
52
+ EnforcedStyle: mixed
53
+ AllowInnerSlashes: true
61
54
 
62
55
  Layout/HashAlignment:
63
56
  EnforcedColonStyle: table
64
- Layout/ArgumentAlignment:
65
- EnforcedStyle: with_fixed_indentation
57
+ EnforcedHashRocketStyle: table
58
+ Layout/LeadingCommentSpace:
59
+ Enabled: false
60
+ AllowGemfileRubyComment: true
61
+ Layout/ParameterAlignment:
62
+ Enabled: false
63
+ Layout/MultilineMethodDefinitionBraceLayout:
64
+ EnforcedStyle: symmetrical
65
+ Layout/LineLength:
66
+ Enabled: true
67
+ Layout/SpaceInsideHashLiteralBraces:
68
+ Enabled: false
69
+ Layout/SpaceInsideBlockBraces:
70
+ Enabled: false
71
+ Layout/SpaceAroundOperators:
72
+ Enabled: false
66
73
  Layout/ExtraSpacing:
67
74
  AllowForAlignment: true
75
+ AllowBeforeTrailingComments: true
68
76
  Layout/AccessModifierIndentation:
69
77
  EnforcedStyle: indent
70
78
  Layout/DotPosition:
71
79
  EnforcedStyle: trailing
72
80
  Layout/MultilineMethodCallIndentation:
73
81
  EnforcedStyle: indented
74
- Layout/SpaceInsideHashLiteralBraces:
75
- Enabled: false
76
- Layout/SpaceInsideBlockBraces:
77
- Enabled: false
78
- Layout/SpaceAroundOperators:
79
- Enabled: false
80
82
  Layout/FirstHashElementIndentation:
81
83
  Enabled: false
82
84
  Layout/EmptyLineAfterGuardClause:
83
85
  Enabled: false
84
- Layout/LeadingCommentSpace:
85
- Enabled: false
86
86
 
87
- Lint/AssignmentInCondition:
88
- Enabled: false
89
- Lint/UnderscorePrefixedVariableName:
87
+ Naming/VariableNumber:
88
+ EnforcedStyle: snake_case
89
+ CheckSymbols: false
90
+ Naming/MethodParameterName:
91
+ AllowedNames: ['x', 'y', 'i', 'j', 'id', 'io', 'to']
92
+ Naming/RescuedExceptionsVariableName:
90
93
  Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,37 +1,52 @@
1
1
  # Change Log
2
+
2
3
  All notable changes to this project will be documented in this file.
3
4
 
4
- ## [0.1.7] - 2024-02-xx
5
+ ## [0.2.1] - 2024-08-xx
5
6
 
6
7
  ### Added
8
+
7
9
  ### Fixed
10
+
8
11
  ### Changed
9
12
 
13
+ ## [0.2.0] - 2024-08-01
14
+
15
+ ### Changed
16
+
17
+ - require `ruby 3`
18
+
10
19
  ## [0.1.6] - 2024-02-03
11
20
 
12
21
  ### Fixed
13
- - Compatibility with `ruby 3`
14
- - call to `super` with no args where method on parent class doesn't match parameters.
22
+
23
+ - Compatibility with `ruby 3`
24
+ - call to `super` with no args where method on parent class doesn't match parameters.
15
25
 
16
26
  ### Changed
17
- - upgrade dependencies
27
+
28
+ - upgrade dependencies
18
29
 
19
30
  ## [0.1.5] - 2024-02-01
20
31
 
21
32
  ### Added
22
- - new options for file pattern const and remote subfolder for the SFTP task
33
+
34
+ - new options for file pattern const and remote subfolder for the SFTP task
23
35
 
24
36
  ## [0.1.4] - 2023-07-23
25
37
 
26
38
  ### Fixed
27
- - Type in `EcoRake::Utils::Mailing#email`
39
+
40
+ - Type in `EcoRake::Utils::Mailing#email`
28
41
 
29
42
  ## [0.1.2] - 2023-06-09
30
43
 
31
44
  ### Changed
32
- - Notify when file decryption fails
45
+
46
+ - Notify when file decryption fails
33
47
 
34
48
  ## [0.1.1] - 2023-06-06
35
49
 
36
50
  ### Added
37
- - Very first version, with support to migrate all the rake integrations.
51
+
52
+ - Very first version, with support to migrate all the rake integrations.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # EcoRake
2
2
 
3
- A set of helpers to build re-usable `rake` integration helpers.
3
+ A set of helpers to build re-usable `rake` integration helpers.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,8 +18,9 @@ Or install it yourself as:
18
18
 
19
19
  $ gem install eco-rake
20
20
 
21
- ## Usage
21
+ ## Changelog
22
22
 
23
+ See {file:CHANGELOG.md} for a list of changes.
23
24
 
24
25
  ## Development
25
26
 
data/eco-rake.gemspec CHANGED
@@ -19,16 +19,17 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.required_ruby_version = '>= 2.7.2'
22
+ spec.metadata['rubygems_mfa_required'] = 'true'
23
+
24
+ spec.required_ruby_version = '>= 3.2.2'
23
25
 
24
- spec.add_development_dependency "bundler", ">= 2.4.12", "< 3"
25
26
  spec.add_development_dependency "rake", ">= 13.0.6", "< 14"
26
27
  spec.add_development_dependency "rspec", ">= 3.10.0", "< 4"
27
28
  spec.add_development_dependency "yard", ">= 0.9.34", "< 1"
28
29
  spec.add_development_dependency "redcarpet", ">= 3.6.0", "< 4"
29
30
 
30
31
  #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
- spec.add_dependency 'rake-commander', '>= 0.3.6', "< 0.4"
32
+ spec.add_dependency 'aws-sdk-ses', '~> 1', '>= 1.58.0'
33
+ spec.add_dependency 'dotenv', '~> 3'
34
+ spec.add_dependency 'rake-commander', '~> 0.4'
34
35
  end
@@ -16,10 +16,10 @@ class EcoRake
16
16
  target_files.each do |file|
17
17
  delete_file(gpg_to_csv_filename(file))
18
18
  stat = sh_continue(decrypt_command(file, ignore_mdc_error: ignore_mdc_error))
19
- status = stat unless stat == 0
19
+ status = stat unless stat.zero?
20
20
  end
21
21
  delete_file(*target_files, message: "Deleting files from '#{source_folder}'") unless options[:simulate]
22
- exit status unless status == 0
22
+ exit status unless status.zero?
23
23
  end
24
24
 
25
25
  def display_target_files
@@ -18,9 +18,8 @@ class EcoRake
18
18
  def task(*_args)
19
19
  upsert_local_dir(options[:folder])
20
20
  sh_continue pull_file
21
- if do_decrypt
22
- failed_decryption_notify unless 0 == sh_continue(rake_decrypt)
23
- end
21
+ failed_decryption_notify if do_decrypt && !sh_continue(rake_decrypt).zero?
22
+
24
23
  sh_continue rake_sync_command
25
24
  return if options[:simulate]
26
25
  sh_continue rake_sftp_archive if pull_driver == 'sftp'
@@ -38,7 +38,7 @@ class EcoRake
38
38
  def namespaced_task(task_name = target_task)
39
39
  ns = self.class.namespace || ''
40
40
  ns_with_enviro = ns.split(':').any? {|s| s == options[:enviro]}
41
- ns = ns_with_enviro ? ns : "#{ns}:#{options[:enviro]}"
41
+ ns = "#{ns}:#{options[:enviro]}" unless ns_with_enviro
42
42
  "#{ns}:#{task_name || self.class.task}"
43
43
  end
44
44
  end
@@ -13,7 +13,7 @@ class EcoRake
13
13
  raise ArgumentError, msg if missing && argument_required? && raise
14
14
  return nil if missing && argument_required?
15
15
 
16
- value = value == :not_used ? default : value
16
+ value = default if value == :not_used
17
17
  "#{opt} \"#{value}\""
18
18
  end
19
19
 
@@ -22,12 +22,12 @@ class EcoRake
22
22
  # Implements the mirror of Boolean options/switches.
23
23
  def boolean_mirror(value = :not_used)
24
24
  opt = name_hyphened
25
- puts "boolean_mirror (#{value}): #{opt}" if name == :no_get
25
+ # puts "boolean_mirror (#{value}): #{opt}" if name == :no_get
26
26
 
27
27
  return nil unless [TrueClass, NilClass, FalseClass].any? {|klass| type_coercion == klass}
28
28
  enabled_value = !boolean_name? || [TrueClass, NilClass].any? {|klass| type_coercion == klass}
29
- return opt if value == enabled_value
30
- return name_false_hypen if boolean_name? && value == !enabled_value
29
+ return opt if value == enabled_value
30
+ name_false_hypen if boolean_name? && value == !enabled_value
31
31
  end
32
32
  end
33
33
  end
@@ -44,7 +44,8 @@ class EcoRake
44
44
  # @return [Boolean]
45
45
  def gpg_version_gte?(major:, minor:)
46
46
  result = shell_gpg_version
47
- return false unless match = result.match(GPG_VERSION_REGEX)
47
+ return false unless (match = result.match(GPG_VERSION_REGEX))
48
+
48
49
  maj = match[:maj].to_i
49
50
  min = match[:min].to_i
50
51
  (maj >= major) && (min >= minor)
@@ -1,5 +1,5 @@
1
1
  require 'rake-commander'
2
2
 
3
3
  class EcoRake < RakeCommander
4
- VERSION = '0.1.6'.freeze
4
+ VERSION = '0.2.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
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: 2024-02-02 00:00:00.000000000 Z
11
+ date: 2024-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 2.4.12
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '3'
23
- type: :development
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 2.4.12
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '3'
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: rake
35
15
  requirement: !ruby/object:Gem::Requirement
@@ -114,60 +94,48 @@ dependencies:
114
94
  name: aws-sdk-ses
115
95
  requirement: !ruby/object:Gem::Requirement
116
96
  requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '1'
117
100
  - - ">="
118
101
  - !ruby/object:Gem::Version
119
102
  version: 1.58.0
120
- - - "<"
121
- - !ruby/object:Gem::Version
122
- version: '2'
123
103
  type: :runtime
124
104
  prerelease: false
125
105
  version_requirements: !ruby/object:Gem::Requirement
126
106
  requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '1'
127
110
  - - ">="
128
111
  - !ruby/object:Gem::Version
129
112
  version: 1.58.0
130
- - - "<"
131
- - !ruby/object:Gem::Version
132
- version: '2'
133
113
  - !ruby/object:Gem::Dependency
134
114
  name: dotenv
135
115
  requirement: !ruby/object:Gem::Requirement
136
116
  requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: 2.8.1
140
- - - "<"
117
+ - - "~>"
141
118
  - !ruby/object:Gem::Version
142
119
  version: '3'
143
120
  type: :runtime
144
121
  prerelease: false
145
122
  version_requirements: !ruby/object:Gem::Requirement
146
123
  requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: 2.8.1
150
- - - "<"
124
+ - - "~>"
151
125
  - !ruby/object:Gem::Version
152
126
  version: '3'
153
127
  - !ruby/object:Gem::Dependency
154
128
  name: rake-commander
155
129
  requirement: !ruby/object:Gem::Requirement
156
130
  requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 0.3.6
160
- - - "<"
131
+ - - "~>"
161
132
  - !ruby/object:Gem::Version
162
133
  version: '0.4'
163
134
  type: :runtime
164
135
  prerelease: false
165
136
  version_requirements: !ruby/object:Gem::Requirement
166
137
  requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- version: 0.3.6
170
- - - "<"
138
+ - - "~>"
171
139
  - !ruby/object:Gem::Version
172
140
  version: '0.4'
173
141
  description:
@@ -179,8 +147,10 @@ extra_rdoc_files: []
179
147
  files:
180
148
  - ".gitignore"
181
149
  - ".gitlab-ci.yml"
150
+ - ".markdownlint.json"
182
151
  - ".rspec"
183
152
  - ".rubocop.yml"
153
+ - ".ruby-version"
184
154
  - ".yardopts"
185
155
  - CHANGELOG.md
186
156
  - Gemfile
@@ -248,7 +218,8 @@ files:
248
218
  homepage: https://www.ecoportal.com
249
219
  licenses:
250
220
  - MIT
251
- metadata: {}
221
+ metadata:
222
+ rubygems_mfa_required: 'true'
252
223
  post_install_message:
253
224
  rdoc_options: []
254
225
  require_paths:
@@ -257,14 +228,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
228
  requirements:
258
229
  - - ">="
259
230
  - !ruby/object:Gem::Version
260
- version: 2.7.2
231
+ version: 3.2.2
261
232
  required_rubygems_version: !ruby/object:Gem::Requirement
262
233
  requirements:
263
234
  - - ">="
264
235
  - !ruby/object:Gem::Version
265
236
  version: '0'
266
237
  requirements: []
267
- rubygems_version: 3.4.12
238
+ rubygems_version: 3.5.6
268
239
  signing_key:
269
240
  specification_version: 4
270
241
  summary: A set of helpers to build re-usable `rake` integration helpers.