avm-tools 0.69.1 → 0.69.2

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: 1c51b06ceb6e966dfbe8819df28aa66fef0217aa9183bffd2dee2a8a3be5ec60
4
- data.tar.gz: 1ef4e225329e6a1923ac2baf173a1260f71e4fc27953b53c72a6d1ec3ac8e4f5
3
+ metadata.gz: dfc5d456e6af7146005267a2cde8312b31b99dab08864cff3641607feabfca8a
4
+ data.tar.gz: 49a01ba7df2fdbd651cd89185ffc8b0dc3de1754bf590dfd3872cfaaaf210c6c
5
5
  SHA512:
6
- metadata.gz: 7d9c395c329cea72eff3f2ca65d847725ed2d288057a040f39af3a94054ce7d79aafc4b31adab7fa86fc90f819fc077e0d77aca0cc2eb805acf37021499aa2c8
7
- data.tar.gz: 881bcef2f71c1f0ed32830fd4fcfe563068c74ce2438174602b56c967ecc00a8116946924e6ca8748d342071e10cba72ded20f3c4f797a5cc1d5312dfa3a2c2e
6
+ metadata.gz: 923ca13f3beda2ffc8c36ef97b13be6d503e92f8a7075a20f4ac692b6542d7a1c470492909ccfc39ef8888581e607ee7f5c086b1ccd07ad04e945a901f678e76
7
+ data.tar.gz: 98cc6fbb347ee06e2c0df2f490bff6898606ccd604aec40014ab75f2e633163c4087c1926e2cba9dba319bd6df7bc3ea7597aeea53536ceca4ccf437e205f178
@@ -10,6 +10,7 @@ module Avm
10
10
  def git_subrepos_result
11
11
  return ::Avm::Result.error('Unclean workspace') unless clean_workspace?
12
12
 
13
+ infom 'Checking Git subrepos...'
13
14
  r = ::Avm::Git::SubrepoChecks.new(::EacGit::Local.new(@git)).add_all_subrepos
14
15
  r.check_remote = true
15
16
  r.result
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.69.1'
5
+ VERSION = '0.69.2'
6
6
  end
7
7
  end
@@ -1,22 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/concern'
4
- require 'eac_cli/runner'
5
- require 'eac_ruby_utils/console/speaker'
6
- require 'eac_ruby_utils/simple_cache'
3
+ require 'eac_cli/runner_with/help'
4
+ require 'eac_ruby_utils/core_ext'
7
5
 
8
6
  module EacCli
9
7
  module DefaultRunner
10
- extend ::ActiveSupport::Concern
11
-
12
- included do
13
- include ::EacCli::Runner
14
- include ::EacRubyUtils::Console::Speaker
15
- include ::EacRubyUtils::SimpleCache
16
- runner_definition.alt do
17
- options_arg false
18
- bool_opt '-h', '--help', 'Show help.', usage: true
19
- end
8
+ common_concern do
9
+ include ::EacCli::RunnerWith::Help
10
+ enable_console_speaker
11
+ enable_simple_cache
20
12
  end
21
13
  end
22
14
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module EacCli
6
+ module RunnerWith
7
+ require_sub __FILE__
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module EacCli
7
+ module RunnerWith
8
+ module Help
9
+ common_concern do
10
+ include ::EacCli::Runner
11
+
12
+ runner_definition.alt do
13
+ options_arg false
14
+ bool_opt '-h', '--help', 'Show help.', usage: true
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_cli/runner'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module EacCli
7
+ module RunnerWith
8
+ module OutputFile
9
+ common_concern do
10
+ include ::EacCli::Runner
11
+
12
+ runner_definition do
13
+ arg_opt '-o', '--output-file', 'Output to file.'
14
+ end
15
+ end
16
+
17
+ def run_output
18
+ if parsed.output_file.present?
19
+ ::File.write(parsed.output_file, output_content)
20
+ else
21
+ out output_content
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacCli
4
- VERSION = '0.6.1'
4
+ VERSION = '0.7.0'
5
5
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'eac_cli', '~> 0.3'
16
- s.add_dependency 'eac_ruby_gems_utils', '~> 0.6'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.39'
15
+ s.add_dependency 'eac_cli', '~> 0.7'
16
+ s.add_dependency 'eac_ruby_gems_utils', '~> 0.7', '>= 0.7.2'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.46'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.1', '>= 0.1.2'
20
20
  end
@@ -28,8 +28,12 @@ module EacRubyBase0
28
28
  end
29
29
  end
30
30
 
31
+ def application_version
32
+ context(:application).version.to_s
33
+ end
34
+
31
35
  def show_version
32
- out(context(:application).version + "\n")
36
+ out("#{application_version}\n")
33
37
  end
34
38
  end
35
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyBase0
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
@@ -10,11 +10,7 @@ module EacRubyGemsUtils
10
10
  VERSION_LINE_PATTERN = /\A(\s*)VERSION\s*=\s*[\'\"]([^\'\"]+)[\'\"](\s*)\z/.freeze
11
11
 
12
12
  def value
13
- path.read.each_line do |line|
14
- VERSION_LINE_PATTERN.if_match(line.rstrip, false) do |m|
15
- ::Gem::Version.new(m[2])
16
- end
17
- end
13
+ path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
18
14
  end
19
15
 
20
16
  def value=(new_value)
@@ -23,6 +19,11 @@ module EacRubyGemsUtils
23
19
 
24
20
  private
25
21
 
22
+ # @return Version found in line, nil otherwise.
23
+ def line_value(line)
24
+ VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Gem::Version.new(m[2]) }
25
+ end
26
+
26
27
  def new_value_content(new_value)
27
28
  path.read.each_line
28
29
  .map { |line| new_value_line(line, new_value) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyGemsUtils
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_gems_utils/gem'
4
+
5
+ ::RSpec.describe ::EacRubyGemsUtils::Gem::VersionFile do
6
+ let(:stubs_dir) { ::Pathname.new(__dir__).join('version_file_spec_files') }
7
+ let(:stub_file) { stubs_dir.join('a_version_file.rb') }
8
+ let(:instance) { described_class.new(stub_file) }
9
+ let(:target_version) { ::Gem::Version.new('0.69.1') }
10
+
11
+ describe '#value' do
12
+ it { expect(instance.value).to eq(target_version) }
13
+ end
14
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Tools
5
+ VERSION = '0.69.1'
6
+ end
7
+ end
@@ -21,8 +21,12 @@ module EacRubyUtils
21
21
  end
22
22
  end
23
23
 
24
- def reset_cache
25
- @cache_keys = nil
24
+ def reset_cache(*keys)
25
+ if keys.any?
26
+ keys.each { |key| cache_keys.delete(key) }
27
+ else
28
+ @cache_keys = nil
29
+ end
26
30
  end
27
31
 
28
32
  private
@@ -27,6 +27,12 @@ module EacRubyUtils
27
27
  property_method?(method_name) || super
28
28
  end
29
29
 
30
+ def to_h
31
+ data.dup
32
+ end
33
+
34
+ delegate :to_s, to: :data
35
+
30
36
  private
31
37
 
32
38
  attr_accessor :data
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacRubyUtils
4
- VERSION = '0.45.2'
4
+ VERSION = '0.46.0'
5
5
  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.69.1
4
+ version: 0.69.2
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-09-26 00:00:00.000000000 Z
11
+ date: 2020-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -576,6 +576,9 @@ files:
576
576
  - vendor/eac_cli/lib/eac_cli/parser/positional_collection.rb
577
577
  - vendor/eac_cli/lib/eac_cli/runner.rb
578
578
  - vendor/eac_cli/lib/eac_cli/runner/context.rb
579
+ - vendor/eac_cli/lib/eac_cli/runner_with.rb
580
+ - vendor/eac_cli/lib/eac_cli/runner_with/help.rb
581
+ - vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb
579
582
  - vendor/eac_cli/lib/eac_cli/version.rb
580
583
  - vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb
581
584
  - vendor/eac_cli/spec/rubocop_spec.rb
@@ -825,6 +828,8 @@ files:
825
828
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple/result.rb
826
829
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/rspec.rb
827
830
  - vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb
831
+ - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec.rb
832
+ - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem/version_file_spec_files/a_version_file.rb
828
833
  - vendor/eac_ruby_gems_utils/spec/lib/eac_ruby_gems_utils/gem_spec.rb
829
834
  - vendor/eac_ruby_gems_utils/spec/rubocop_check_spec.rb
830
835
  - vendor/eac_ruby_gems_utils/spec/spec_helper.rb