avm-tools 0.64.2 → 0.65.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: 1c71ff7120a1b3c607918aa5b7da6a186b6ea37433d6e4f95a830c6cbc4c8e13
4
- data.tar.gz: b54aa3bc18d965cd52eb79a7f75123fae71eba79c54d3cb5b06059890f435b01
3
+ metadata.gz: b49415c22196804138f3b05422b6efeec1aa7d092d4ec282721b4a292b81cc26
4
+ data.tar.gz: da7e1f8019ee6ea9694088a328f8c988143325f72fca48b99e082a8217616aca
5
5
  SHA512:
6
- metadata.gz: 94f79c9df6c95353fbf9205b5d82705d0a316f8aeaae1ac1a5ff774f87b468145717f8a5bf10f515ff657750f9a812af73bd42b29b0d099c9d89a50a9f16f203
7
- data.tar.gz: 7f8f5c507b0f26776283e0ffe359ba6b405368014f834039b595a0e59be21421108bf40ace4c6a7f2ba0d4c94e26e943534f1c9ac129ed7bea095cb46a77eb17
6
+ metadata.gz: 993126704ac357031cd9f050964aace90fedb10c29849b1de13a05b1cc4f8c222223f6d10604517d5a87c03bcf03d09337d517e067cad85af0aba9c39e001af2
7
+ data.tar.gz: 40d27a357cf1ba0d5534289bebc3cbf2a529e4250cee92a8a6de80b623a5ba6b9d055c22f397e133e1f5fcc5ec26e57e9d307c07acc1e70721600a57a7930258
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/instances/configuration'
3
4
  require 'eac_launcher/paths/real'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
  require 'avm/projects/stereotypes'
@@ -13,6 +14,8 @@ module Avm
13
14
  source_stereotypes_mixins
14
15
  end
15
16
 
17
+ delegate :to_s, to: :path
18
+
16
19
  # Backward compatibility with [EacLauncher::Paths::Logical].
17
20
  # @return [EacLauncher::Paths::Real].
18
21
  def real
@@ -21,6 +24,11 @@ module Avm
21
24
 
22
25
  private
23
26
 
27
+ # @return [Avm::Instances::Configuration]
28
+ def configuration_uncached
29
+ ::Avm::Instances::Configuration.find_in_path(path)
30
+ end
31
+
24
32
  def stereotypes_uncached
25
33
  ::Avm::Projects::Stereotypes.list.select { |s| s.match?(self) }
26
34
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/self'
3
4
  require 'eac_ruby_utils/patches/object/template'
4
5
 
5
- ::EacRubyUtils::Templates::Searcher.default.included_paths << ::File.expand_path(
6
- ('../' * 4) + 'template', __dir__
7
- )
6
+ ::EacRubyUtils::Templates::Searcher.default.included_paths <<
7
+ ::Avm::Self.root.join('template').to_path
@@ -47,14 +47,14 @@ module Avm
47
47
  private
48
48
 
49
49
  def sub_constant(constant_name, is_a)
50
+ return nil unless const_defined?(constant_name)
51
+
50
52
  constant = const_get(constant_name)
51
53
  unless is_a.if_present(true) { |v| constant.is_a?(v) }
52
54
  raise("#{constant} is not a #{is_a}")
53
55
  end
54
56
 
55
57
  constant
56
- rescue NameError
57
- nil
58
58
  end
59
59
  end
60
60
  end
@@ -10,12 +10,16 @@ module Avm
10
10
 
11
11
  class << self
12
12
  def application
13
- @application ||= ::EacRubyBase0::Application.new(::File.expand_path('../..', __dir__))
13
+ @application ||= ::EacRubyBase0::Application.new(root.to_path)
14
14
  end
15
15
 
16
16
  def instance
17
17
  @instance ||= ::Avm::Self::Instance.by_id('avm-tools_self')
18
18
  end
19
+
20
+ def root
21
+ ::Pathname.new('../..').expand_path(__dir__)
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -17,6 +17,11 @@ module Avm
17
17
  subcommands
18
18
  end
19
19
 
20
+ def instance_banner
21
+ infov 'Instance', instance
22
+ infov 'Stereotypes', instance.stereotypes.map(&:label).join(', ')
23
+ end
24
+
20
25
  private
21
26
 
22
27
  def instance_uncached
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/console/docopt_runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Tools
8
+ class Runner < ::EacRubyUtils::Console::DocoptRunner
9
+ class LocalProject < ::EacRubyUtils::Console::DocoptRunner
10
+ class Test < ::EacRubyUtils::Console::DocoptRunner
11
+ include ::EacCli::DefaultRunner
12
+
13
+ runner_definition do
14
+ desc 'Test local project.'
15
+ end
16
+
17
+ def run
18
+ context(:instance_banner)
19
+ infov 'Test command', test_command
20
+ if test_command.present?
21
+ test_command.system!
22
+ else
23
+ fatal_error 'No test command found'
24
+ end
25
+ end
26
+
27
+ def test_command
28
+ context(:instance).configuration.if_present(&:any_test_command)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.64.2'
5
+ VERSION = '0.65.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.64.2
4
+ version: 0.65.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-08-25 00:00:00.000000000 Z
11
+ date: 2020-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -489,6 +489,7 @@ files:
489
489
  - lib/avm/tools/runner/launcher/publish.rb
490
490
  - lib/avm/tools/runner/local_project.rb
491
491
  - lib/avm/tools/runner/local_project/info.rb
492
+ - lib/avm/tools/runner/local_project/test.rb
492
493
  - lib/avm/tools/runner/local_project/update.rb
493
494
  - lib/avm/tools/runner/ruby.rb
494
495
  - lib/avm/tools/runner/ruby/gems.rb