avm-tools 0.44.2 → 0.45.0

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: 7c9d91dc20429e3c9c932f57e47152b19fb1e468f3e564c44f4f395f7d04b5d7
4
- data.tar.gz: 18bfbdc67f8f8a9c93bccff6798f4b444fc6c20e3a9a4318e1acae168c6cccd1
3
+ metadata.gz: 7e0e6277dfb4d7fb9d026f49aa93d0bc395c1c4b526911a5229f062e95a33a60
4
+ data.tar.gz: 7c3628d294e04080fa3b9adef605bba3c4c75260bcaf398b1a46a8b1cca8a33d
5
5
  SHA512:
6
- metadata.gz: ab35a0b3b98a2885cc1de50a117b5fa579429160aa1cae64d9edf4edc94fa819afad0bb470bcbd7b7f293ca3ff90bda4d56c37460455093dab45ac4879174532
7
- data.tar.gz: 6f7ec8185a22da62ec5b5ada88065ba74ca6a0971235322732aff502c94d5853be532dc188fae5bef70830de18cd20412af536ff82f3c3dd991d08a69f7a4559
6
+ metadata.gz: 690afb20bf63115d36da0090cb070ff112fd187ba6dc428cb25fd6d31b0ab9588f90abcf09faf43d1a33f1aacc0bb5fb549ef63ba14ab7a4f2ff31a6bb32cbff
7
+ data.tar.gz: 28ae352ef538db3bb01a0dc8fbdc593ca61fd34ef24fdfe97e00db3ce3c27af6d953e3c9459fbb51b7dce2106c5d801b717c9d5e2adf0ee3a6ab4fb984a519e8
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/instances/configuration'
4
+ require 'avm/result'
5
+
6
+ module Avm
7
+ module Git
8
+ module Issue
9
+ class Complete
10
+ def test_result
11
+ test_command = configuration.if_present(&:test_command)
12
+ return ::Avm::Result.success('unconfigured') unless test_command.present?
13
+
14
+ if test_command.execute[:exit_code].zero?
15
+ ::Avm::Result.success('yes')
16
+ else
17
+ ::Avm::Result.error('no')
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ def configuration_uncached
24
+ ::Avm::Instances::Configuration.find_by_path(@git)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -14,7 +14,8 @@ module Avm
14
14
  follow_master: 'Follow master?',
15
15
  commits: 'Commits?',
16
16
  bifurcations: 'Bifurcations?',
17
- dry_push: 'Dry push?'
17
+ dry_push: 'Dry push?',
18
+ test: 'Test ok?'
18
19
  }.with_indifferent_access.freeze
19
20
 
20
21
  def valid?
@@ -1,11 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'eac_ruby_utils/configs'
4
+ require 'eac_ruby_utils/core_ext'
4
5
  require 'yaml'
5
6
 
6
7
  module Avm
7
8
  module Instances
8
9
  class Configuration < ::EacRubyUtils::Configs
10
+ require_sub __FILE__
11
+
9
12
  FILENAMES = %w[.avm.yml .avm.yaml].freeze
10
13
 
11
14
  class << self
@@ -30,6 +33,15 @@ module Avm
30
33
  def initialize(path)
31
34
  super(nil, storage_path: path)
32
35
  end
36
+
37
+ # Utility to read a configuration as a [EacRubyUtils::Envs::Command].
38
+ # @return [EacRubyUtils::Envs::Command]
39
+ def read_command(key)
40
+ read_entry(key).if_present do |v|
41
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
42
+ ::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
43
+ end
44
+ end
33
45
  end
34
46
  end
35
47
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Instances
5
+ class Configuration < ::EacRubyUtils::Configs
6
+ RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
7
+ RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
8
+
9
+ def rubocop_command
10
+ read_command(RUBOCOP_COMMAND_KEY)
11
+ end
12
+
13
+ def rubocop_gemfile
14
+ gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
15
+ return nil unless gemfile_path.present?
16
+
17
+ gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
18
+ return gemfile_path if gemfile_path.file?
19
+
20
+ raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Instances
5
+ class Configuration < ::EacRubyUtils::Configs
6
+ TEST_COMMAND_KEY = 'test.command'
7
+
8
+ def test_command
9
+ read_command(TEST_COMMAND_KEY)
10
+ end
11
+ end
12
+ end
13
+ end
@@ -10,25 +10,13 @@ module Avm
10
10
  end
11
11
 
12
12
  def configured_rubocop_command_by_command
13
- rubocop_command = configuration.if_present { |v| v.read_entry('ruby.rubocop.command') }
14
- return nil unless rubocop_command.present?
15
-
16
- args = if rubocop_command.is_a?(::Enumerable)
17
- rubocop_command.map(&:to_s)
18
- else
19
- ::Shellwords.split(rubocop_command)
20
- end
21
- cmd(args).chdir(::File.dirname(configuration.storage_path))
13
+ configuration.if_present(&:rubocop_command)
22
14
  end
23
15
 
24
16
  def configured_rubocop_command_by_gemfile
25
- gemfile_path = configuration.if_present { |v| v.read_entry('ruby.rubocop.gemfile') }
26
- return nil unless gemfile_path.present?
27
-
28
- gemfile_path = ::Pathname.new(gemfile_path).expand_path(configuration.storage_path.parent)
29
- raise "Gemfile path \"#{gemfile_path}\" does not exist" unless gemfile_path.exist?
30
-
31
- rubocop_command_by_gemfile_path(gemfile_path.parent)
17
+ configuration.if_present(&:rubocop_gemfile).if_present do |v|
18
+ rubocop_command_by_gemfile_path(v.parent)
19
+ end
32
20
  end
33
21
 
34
22
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.44.2'
5
+ VERSION = '0.45.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.44.2
4
+ version: 0.45.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-30 00:00:00.000000000 Z
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -64,48 +64,62 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.6'
67
+ version: '0.8'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '0.8'
75
+ - !ruby/object:Gem::Dependency
76
+ name: eac_ruby_gem_support
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.1'
68
82
  - - ">="
69
83
  - !ruby/object:Gem::Version
70
- version: 0.6.1
84
+ version: 0.1.1
71
85
  type: :runtime
72
86
  prerelease: false
73
87
  version_requirements: !ruby/object:Gem::Requirement
74
88
  requirements:
75
89
  - - "~>"
76
90
  - !ruby/object:Gem::Version
77
- version: '0.6'
91
+ version: '0.1'
78
92
  - - ">="
79
93
  - !ruby/object:Gem::Version
80
- version: 0.6.1
94
+ version: 0.1.1
81
95
  - !ruby/object:Gem::Dependency
82
96
  name: eac_ruby_gems_utils
83
97
  requirement: !ruby/object:Gem::Requirement
84
98
  requirements:
85
99
  - - "~>"
86
100
  - !ruby/object:Gem::Version
87
- version: '0.3'
101
+ version: '0.4'
88
102
  type: :runtime
89
103
  prerelease: false
90
104
  version_requirements: !ruby/object:Gem::Requirement
91
105
  requirements:
92
106
  - - "~>"
93
107
  - !ruby/object:Gem::Version
94
- version: '0.3'
108
+ version: '0.4'
95
109
  - !ruby/object:Gem::Dependency
96
110
  name: eac_ruby_utils
97
111
  requirement: !ruby/object:Gem::Requirement
98
112
  requirements:
99
113
  - - "~>"
100
114
  - !ruby/object:Gem::Version
101
- version: '0.30'
115
+ version: '0.32'
102
116
  type: :runtime
103
117
  prerelease: false
104
118
  version_requirements: !ruby/object:Gem::Requirement
105
119
  requirements:
106
120
  - - "~>"
107
121
  - !ruby/object:Gem::Version
108
- version: '0.30'
122
+ version: '0.32'
109
123
  - !ruby/object:Gem::Dependency
110
124
  name: filesize
111
125
  requirement: !ruby/object:Gem::Requirement
@@ -154,54 +168,6 @@ dependencies:
154
168
  - - ">="
155
169
  - !ruby/object:Gem::Version
156
170
  version: '0'
157
- - !ruby/object:Gem::Dependency
158
- name: rspec
159
- requirement: !ruby/object:Gem::Requirement
160
- requirements:
161
- - - '='
162
- - !ruby/object:Gem::Version
163
- version: '3.8'
164
- type: :development
165
- prerelease: false
166
- version_requirements: !ruby/object:Gem::Requirement
167
- requirements:
168
- - - '='
169
- - !ruby/object:Gem::Version
170
- version: '3.8'
171
- - !ruby/object:Gem::Dependency
172
- name: rubocop
173
- requirement: !ruby/object:Gem::Requirement
174
- requirements:
175
- - - '='
176
- - !ruby/object:Gem::Version
177
- version: 0.80.1
178
- type: :development
179
- prerelease: false
180
- version_requirements: !ruby/object:Gem::Requirement
181
- requirements:
182
- - - '='
183
- - !ruby/object:Gem::Version
184
- version: 0.80.1
185
- - !ruby/object:Gem::Dependency
186
- name: rubocop-rspec
187
- requirement: !ruby/object:Gem::Requirement
188
- requirements:
189
- - - "~>"
190
- - !ruby/object:Gem::Version
191
- version: '1.34'
192
- - - ">="
193
- - !ruby/object:Gem::Version
194
- version: 1.34.1
195
- type: :development
196
- prerelease: false
197
- version_requirements: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '1.34'
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- version: 1.34.1
205
171
  description:
206
172
  email:
207
173
  executables:
@@ -256,6 +222,7 @@ files:
256
222
  - lib/avm/git/issue/complete/_local_tag.rb
257
223
  - lib/avm/git/issue/complete/_push.rb
258
224
  - lib/avm/git/issue/complete/_remote.rb
225
+ - lib/avm/git/issue/complete/_test.rb
259
226
  - lib/avm/git/issue/complete/_tracker.rb
260
227
  - lib/avm/git/issue/complete/_validations.rb
261
228
  - lib/avm/git/issue/complete/_working_tree.rb
@@ -276,6 +243,8 @@ files:
276
243
  - lib/avm/instances/base/auto_values/web.rb
277
244
  - lib/avm/instances/base/dockerizable.rb
278
245
  - lib/avm/instances/configuration.rb
246
+ - lib/avm/instances/configuration/_rubocop.rb
247
+ - lib/avm/instances/configuration/_tests.rb
279
248
  - lib/avm/instances/entries.rb
280
249
  - lib/avm/instances/entries/entry_reader.rb
281
250
  - lib/avm/instances/entry_keys.rb