avm-eac_ruby_base1 0.31.2 → 0.32.1

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: 8c120ab255f7d64dff133fd5e4047dcd927bb3b2a9af1eebc93c8e8c52559083
4
- data.tar.gz: c2bdf9ff353dca9697ad09ba5100bcd7fcef42c8c42d21e0a0103e165f0ae90e
3
+ metadata.gz: 789c1286e939fea7eaec5d9840fdcdd08e7fb95b1878a07a4778e34cad1658b0
4
+ data.tar.gz: 15331da0f7215694e7641414f0f2ce371f1b6c7abc029fa8782f4c4b3e9373fa
5
5
  SHA512:
6
- metadata.gz: 5361c12917431ecb63afcb004d4d98a375f27d9b687b86363a50fa54ff606e8aeb546e57323c2c8445409ba44dc50869ef1858be56b9de3c9d2ecf88ba091c83
7
- data.tar.gz: aaa73983e8e33fcf78bbd694a5fb8726149bc2b007bfd3bacc99bace00667754574fdf21522e3cdd73ba455743d2cd409607b4550be3d752375d0238ea95a8cf
6
+ metadata.gz: 22103d338d843d4fc4de1281d74b09b591e00d218c19d076a01bd1ca9116aec6a226f86aab95302d85fa5d841e6d8729236599a039a36aa2e1efac0675ea61bd
7
+ data.tar.gz: 247d13c01bb3bb1afe1502465b57aa34897d28ff78391fa4d34991299b689e4aeac51f3493e9b64e5d40329d6585a267e1c71d0ed746c8a43dbc026bd298b471
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_generic_base0/sources/base'
4
+ require 'avm/eac_ruby_base1/sources/base/bundle_command'
5
+ require 'avm/eac_ruby_base1/sources/bundle_update'
6
+ require 'eac_ruby_utils/core_ext'
7
+
8
+ module Avm
9
+ module EacRubyBase1
10
+ module Sources
11
+ class Base < ::Avm::EacGenericBase0::Sources::Base
12
+ module Rubocop
13
+ RUBOCOP_CONFIG_SUBPATH = '.rubocop.yml'
14
+
15
+ # @return [Avm::EacRubyBase1::Sources::Base::RubocopCommand]
16
+ def rubocop_command
17
+ ::Avm::EacRubyBase1::Sources::Base::RubocopCommand.new(self)
18
+ end
19
+
20
+ # @return [Pathname]
21
+ def rubocop_config_path
22
+ path.join(RUBOCOP_CONFIG_SUBPATH)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/eac_generic_base0/sources/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacRubyBase1
8
+ module Sources
9
+ class Base < ::Avm::EacGenericBase0::Sources::Base
10
+ class RubocopCommand
11
+ acts_as_immutable
12
+ immutable_accessor :ignore_parent_exclusion, :autocorrect, :autocorrect_all,
13
+ type: :boolean
14
+ immutable_accessor :file, type: :array
15
+ common_constructor :source
16
+ delegate :execute, :execute!, :system, :system!, to: :bundle_command
17
+
18
+ # @return [Enumerable]
19
+ def immutable_constructor_args
20
+ [source]
21
+ end
22
+
23
+ # @return [Gemspec::Version]
24
+ def version
25
+ @version ||= ::Gemspec::Version.new(
26
+ source.bundle('exec', 'rubocop', '--version').execute!
27
+ )
28
+ end
29
+
30
+ private
31
+
32
+ # @return [String]
33
+ def autocorrect_option
34
+ '--auto-correct'
35
+ end
36
+
37
+ # @return [String]
38
+ def autocorrect_all_option
39
+ '--auto-correct-all'
40
+ end
41
+
42
+ # @return [String]
43
+ def ignore_parent_exclusion_option
44
+ '--ignore-parent-exclusion'
45
+ end
46
+
47
+ # @return [Avm::EacRubyBase1::Sources::Base::BundleCommand]
48
+ def bundle_command
49
+ source.bundle(*bundle_command_args)
50
+ end
51
+
52
+ # @return [Array<String>]
53
+ def bundle_command_args
54
+ %w[exec rubocop] + rubocop_command_args
55
+ end
56
+
57
+ # @return [Array<String>]
58
+ def rubocop_command_args
59
+ r = ['--config', source.rubocop_config_path]
60
+ r << ignore_parent_exclusion_option if ignore_parent_exclusion?
61
+ if autocorrect_all?
62
+ r << autocorrect_all_option
63
+ elsif autocorrect?
64
+ r << autocorrect_option
65
+ end
66
+ r + files
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -10,6 +10,8 @@ module Avm
10
10
  enable_simple_cache
11
11
  common_constructor :source, :gem_name
12
12
 
13
+ RUBOCOP_OK_CODES = [256].freeze
14
+
13
15
  def perform
14
16
  source.scm.commit_if_change(commit_message) { update_code }
15
17
  end
@@ -24,6 +26,12 @@ module Avm
24
26
  __locale: source.locale)
25
27
  end
26
28
 
29
+ def format_gemspec
30
+ source.rubocop_command.ignore_parent_exclusion(true).autocorrect(true)
31
+ .file(source.gemspec_path)
32
+ .execute!(exit_outputs: RUBOCOP_OK_CODES.map { |k| [k, nil] }.to_h)
33
+ end
34
+
27
35
  # @return [Array<String>]
28
36
  def requirements_list_uncached
29
37
  ::Avm::EacRubyBase1::PreferredVersionRequirements.new(
@@ -48,9 +56,7 @@ module Avm
48
56
  def update_gemspec
49
57
  gemspec.dependency(gem_name).version_specs = requirements_list
50
58
  gemspec.write(source.gemspec_path)
51
- ::Avm::EacRubyBase1::Rubocop.new(
52
- source.path, ['-a', '--ignore-parent-exclusion', source.gemspec_path]
53
- ).run
59
+ format_gemspec
54
60
  end
55
61
  end
56
62
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.31.2'
5
+ VERSION = '0.32.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-eac_ruby_base1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.31.2
4
+ version: 0.32.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Put here the authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2023-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.79'
33
+ version: '0.80'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.79'
40
+ version: '0.80'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: avm-eac_generic_base0
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -45,6 +45,9 @@ dependencies:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.12'
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 0.12.1
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,6 +55,9 @@ dependencies:
52
55
  - - "~>"
53
56
  - !ruby/object:Gem::Version
54
57
  version: '0.12'
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 0.12.1
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: eac_envs-http
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -81,7 +87,7 @@ dependencies:
81
87
  version: '0.119'
82
88
  - - ">="
83
89
  - !ruby/object:Gem::Version
84
- version: 0.119.1
90
+ version: 0.119.2
85
91
  type: :runtime
86
92
  prerelease: false
87
93
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +97,7 @@ dependencies:
91
97
  version: '0.119'
92
98
  - - ">="
93
99
  - !ruby/object:Gem::Version
94
- version: 0.119.1
100
+ version: 0.119.2
95
101
  - !ruby/object:Gem::Dependency
96
102
  name: aranha-parsers
97
103
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +193,8 @@ files:
187
193
  - lib/avm/eac_ruby_base1/sources/base/bundle_command.rb
188
194
  - lib/avm/eac_ruby_base1/sources/base/bundler.rb
189
195
  - lib/avm/eac_ruby_base1/sources/base/rake.rb
196
+ - lib/avm/eac_ruby_base1/sources/base/rubocop.rb
197
+ - lib/avm/eac_ruby_base1/sources/base/rubocop_command.rb
190
198
  - lib/avm/eac_ruby_base1/sources/base/rubygems.rb
191
199
  - lib/avm/eac_ruby_base1/sources/base/update.rb
192
200
  - lib/avm/eac_ruby_base1/sources/base/version.rb