firespring_dev_commands 2.1.26.pre.alpha.3 → 2.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e85fa03c8d3741894c226c3ea8b84616eebb28287ba855d4da44a242370200de
4
- data.tar.gz: 8468adbf7fa2821686d14cce1efd1c083e1a732471ae90330c49f9e566af7c43
3
+ metadata.gz: 14012894728c84550e3d2b59fad8fda3792ed8c6a548115b3a95dd0580420cd1
4
+ data.tar.gz: 77315bb5bbcfc940253870fc070911f8f23aeb6536dc38f9b768b8749676f3a4
5
5
  SHA512:
6
- metadata.gz: 3abd512246b31b86a045d84b19cddc4f0a193e0c76701dc26b19fa44b10b19a97aa054f2b29ee47d4d692c71e67e25c621a432825d8d1d14581ad14c237a7d83
7
- data.tar.gz: 3cb0d1738d5ff0ad5a5e45e2af5371ca45c8ceeb2e55d9fdcbba7f29b4e91fa5cbfaa4989f20a966a2674f4d5fa920c2d1b0f2f387707bc3c2499ebbd61c8e2a
6
+ metadata.gz: 576bdab4cbf3e569fef9114a1e5d413e8b9495da3b6ef546d0121e8aaa68af1e3d3232e85e5ec9c2ef1cc47e7ffb089c5badade94c5f4edce24e63c2b9cf091c
7
+ data.tar.gz: 4d6c01abd25e937f02c8629b10ce1380eb8a2d65ce7cf1afc86be0fd58311fb88d76d437754e4155bea3bbbe85983c482479b76356a8e99e00e5ee87e224f1f2
@@ -190,6 +190,7 @@ module Dev
190
190
 
191
191
  # Center the string and pad on either side with the given padding character
192
192
  def center_pad(string = '', pad: '-', len: 80)
193
+ string = " #{string} " unless string.strip.empty?
193
194
  center_dash = len / 2
194
195
  string = string.to_s
195
196
  center_str = string.length / 2
@@ -5,9 +5,8 @@ module Dev
5
5
  END_OF_LIFE_API_URL = 'https://endoflife.date/api'.freeze
6
6
 
7
7
  # Config object for setting top level git config options
8
- Config = Struct.new(:check_aws_resources, :product_versions, :manual_dates) do
8
+ Config = Struct.new(:product_versions, :manual_dates) do
9
9
  def initialize
10
- self.check_aws_resources = false
11
10
  self.product_versions = []
12
11
  self.manual_dates = {}
13
12
  end
@@ -27,10 +26,9 @@ module Dev
27
26
  alias_method :configure, :config
28
27
  end
29
28
 
30
- attr_accessor :url, :products, :check_aws_resources, :product_versions
29
+ attr_accessor :url, :products, :product_versions
31
30
 
32
- def initialize(check_aws_resources: self.class.config.check_aws_resources, product_versions: self.class.config.product_versions)
33
- @check_aws_resources = check_aws_resources
31
+ def initialize(product_versions: self.class.config.product_versions)
34
32
  @product_versions = Array(product_versions)
35
33
  raise 'product version must be of type Dev::EndOfLife::ProductVersions' unless @product_versions.all?(Dev::EndOfLife::ProductVersion)
36
34
  end
@@ -48,20 +46,23 @@ module Dev
48
46
  @products
49
47
  end
50
48
 
49
+ # Prints all of the product version statuses
50
+ def status
51
+ product_versions.sort_by(&:name).each(&:print_status)
52
+ end
53
+
54
+ # Returns true if any of the products are EOL
55
+ def eol?
56
+ product_versions.any?(&:eol)
57
+ end
58
+
51
59
  # Prints all of the product version statuses
52
60
  # Raises an error if any products are EOL
53
61
  def check
54
62
  puts
55
- checks_to_perform = product_versions.clone
56
- if check_aws_resources
57
- account_id = Dev::Aws::Profile.new.current
58
- account_name = Dev::Aws::Account.new.name_by_account(account_id)
59
- LOG.info " Current AWS Account is #{account_name} (#{account_id})\n".light_yellow
60
- checks_to_perform.concat(Dev::EndOfLife::Aws.new.default_products)
61
- end
62
- checks_to_perform.sort_by(&:name).each(&:print_status)
63
+ status
63
64
  puts
64
- raise 'found EOL versions' if product_versions.any?(&:eol)
65
+ raise 'found EOL versions' if eol?
65
66
  end
66
67
  end
67
68
  end
@@ -113,7 +113,7 @@ module Dev
113
113
  next unless File.exist?(project_dir)
114
114
 
115
115
  repo_basename = File.basename(File.realpath(project_dir))
116
- header = " #{repo_basename} (#{original_branches[project_dir]}) "
116
+ header = "#{repo_basename} (#{original_branches[project_dir]})"
117
117
  puts Dev::Common.new.center_pad(header).light_green
118
118
  @success &= status(dir: project_dir)
119
119
  puts Dev::Common.new.center_pad.light_green
@@ -165,7 +165,7 @@ module Dev
165
165
  next unless File.exist?(project_dir)
166
166
 
167
167
  repo_basename = File.basename(File.realpath(project_dir))
168
- header = " #{repo_basename} (#{original_branches[project_dir]}) "
168
+ header = "#{repo_basename} (#{original_branches[project_dir]})"
169
169
  puts Dev::Common.new.center_pad(header).light_green
170
170
  reset(dir: project_dir)
171
171
  puts Dev::Common.new.center_pad.light_green
@@ -191,8 +191,7 @@ module Dev
191
191
  next unless File.exist?(project_dir)
192
192
 
193
193
  repo_basename = File.basename(File.realpath(project_dir))
194
- header = " #{repo_basename} "
195
- puts Dev::Common.new.center_pad(header).light_green
194
+ puts Dev::Common.new.center_pad(repo_basename).light_green
196
195
  @success &= checkout(branch, dir: project_dir)
197
196
  puts Dev::Common.new.center_pad.light_green
198
197
  end
@@ -285,8 +284,7 @@ module Dev
285
284
  next unless File.exist?(project_dir)
286
285
 
287
286
  repo_basename = File.basename(File.realpath(project_dir))
288
- header = " #{repo_basename} "
289
- puts Dev::Common.new.center_pad(header).light_green
287
+ puts Dev::Common.new.center_pad(repo_basename).light_green
290
288
  @success &= merge(branch, dir: project_dir)
291
289
  puts Dev::Common.new.center_pad.light_green
292
290
  end
@@ -334,8 +332,7 @@ module Dev
334
332
  next unless File.exist?(project_dir)
335
333
 
336
334
  repo_basename = File.basename(File.realpath(project_dir))
337
- header = " #{repo_basename} "
338
- puts Dev::Common.new.center_pad(header).light_green
335
+ puts Dev::Common.new.center_pad(repo_basename).light_green
339
336
  @success &= pull(dir: project_dir)
340
337
  puts Dev::Common.new.center_pad.light_green
341
338
  end
@@ -373,8 +370,7 @@ module Dev
373
370
  next unless File.exist?(project_dir)
374
371
 
375
372
  repo_basename = File.basename(File.realpath(project_dir))
376
- header = " #{repo_basename} "
377
- puts Dev::Common.new.center_pad(header).light_green
373
+ puts Dev::Common.new.center_pad(repo_basename).light_green
378
374
  @success &= push(dir: project_dir)
379
375
  puts Dev::Common.new.center_pad.light_green
380
376
  end
@@ -438,6 +434,13 @@ module Dev
438
434
  string.to_s.split("\n").each { |line| puts "#{padding}#{line}" }
439
435
  end
440
436
 
437
+ # Center the string and pad on either side with the given padding character
438
+ # @deprecated Please use {Dev::Common#center_pad} instead
439
+ def center_pad(string = '', pad: '-', len: 80)
440
+ warn '[DEPRECATION] `Dev::Git#center_pad` is deprecated. Please use `Dev::Common#center_pad` instead.'
441
+ Dev::Common.new.center_pad(string, pad:, len:)
442
+ end
443
+
441
444
  # Exclude the command from the message and print all error lines
442
445
  private def print_errors(message)
443
446
  indent message.split('error:')[1..].join
@@ -94,19 +94,28 @@ module Dev
94
94
  end
95
95
  # rubocop:enable Metrics/MethodLength
96
96
 
97
- # Set the EOL library to also check AWS resources
97
+ # Create the rake task for the eol method
98
98
  def create_eol_task!
99
- return if exclude.include?(:eol)
99
+ # Have to set a local variable to be accessible inside of the instance_eval block
100
+ exclude = @exclude
100
101
 
101
- Dev::EndOfLife.config do |c|
102
- env_check = ENV.fetch('CHECK_AWS', nil).to_s.strip
103
- if env_check == 'false'
104
- c.check_aws_resources = false
105
- else
106
- c.check_aws_resources = true
102
+ DEV_COMMANDS_TOP_LEVEL.instance_eval do
103
+ return if exclude.include?(:eol)
104
+ return if ENV.fetch('CHECK_AWS', nil).to_s.strip == 'false'
105
+
106
+ task eol: [:'eol:aws'] do
107
+ # This is just a placeholder to execute the dependencies
108
+ end
107
109
 
108
- task eol: %w(ensure_aws_credentials) do
109
- # Require the user is logged in to aws since those resources will be checked
110
+ namespace :eol do
111
+ desc 'Compares the current date to the EOL date for supported aws resources'
112
+ task aws: %w(init ensure_aws_credentials) do
113
+ account_id = Dev::Aws::Profile.new.current
114
+ account_name = Dev::Aws::Account.new.name_by_account(account_id)
115
+ LOG.info " Current AWS Account is #{account_name} (#{account_id})".light_yellow
116
+ puts
117
+ Dev::EndOfLife.new(product_versions: Dev::EndOfLife::Aws.new.default_products).status
118
+ puts
110
119
  end
111
120
  end
112
121
  end
@@ -15,7 +15,7 @@ module Dev
15
15
  desc 'Compares the current date to the EOL date for all configured projects' \
16
16
  "\n\toptionally specify CHECK_AWS=<true/false> to toggle whether AWS resources are checked for EOL (defaults to true)"
17
17
  task eol: %w(init) do
18
- Dev::EndOfLife.new.check
18
+ Dev::EndOfLife.new.status
19
19
  end
20
20
  end
21
21
  end
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.26.pre.alpha.3'.freeze
9
+ VERSION = '2.1.26'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.26.pre.alpha.3
4
+ version: 2.1.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-19 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -409,9 +409,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
409
409
  version: '3.1'
410
410
  required_rubygems_version: !ruby/object:Gem::Requirement
411
411
  requirements:
412
- - - ">"
412
+ - - ">="
413
413
  - !ruby/object:Gem::Version
414
- version: 1.3.1
414
+ version: '0'
415
415
  requirements: []
416
416
  rubygems_version: 3.4.10
417
417
  signing_key: