avm-tools 0.116.2 → 0.117.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +0 -2
  3. data/lib/avm/tools/runner/app_src/version_bump.rb +4 -9
  4. data/lib/avm/tools/version.rb +1 -1
  5. data/sub/avm/avm.gemspec +1 -1
  6. data/sub/avm/lib/avm/scms/base.rb +13 -0
  7. data/sub/avm/lib/avm/sources/base/configuration.rb +2 -1
  8. data/sub/avm/lib/avm/sources/base/parent.rb +31 -0
  9. data/sub/avm/lib/avm/sources/base.rb +4 -6
  10. data/sub/avm/lib/avm/sources/configuration/{_locale.rb → locale.rb} +5 -3
  11. data/sub/avm/lib/avm/sources/configuration/rubocop.rb +26 -0
  12. data/sub/avm/lib/avm/sources/configuration/tests.rb +29 -0
  13. data/sub/avm/lib/avm/sources/configuration.rb +5 -1
  14. data/sub/avm/lib/avm/version.rb +1 -1
  15. data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +1 -1
  16. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base/version_bump.rb +35 -0
  17. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +4 -1
  18. data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
  19. data/sub/avm-eac_generic_base0/locale/en.yaml +6 -0
  20. data/sub/avm-eac_generic_base0/locale/pt-BR.yaml +6 -0
  21. data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
  22. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/add_or_replace_gem_line.rb +56 -0
  23. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile/dependency.rb +19 -0
  24. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler/gemfile.rb +34 -0
  25. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/bundler.rb +11 -0
  26. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +23 -0
  27. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +11 -0
  28. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -1
  29. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
  30. data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +1 -3
  31. data/sub/avm-git/lib/avm/git/version.rb +1 -1
  32. data/sub/eac_cli/eac_cli.gemspec +1 -1
  33. data/sub/eac_cli/lib/eac_cli/definition.rb +0 -4
  34. data/sub/eac_cli/lib/eac_cli/parser/alternative/short_options.rb +1 -1
  35. data/sub/eac_cli/lib/eac_cli/runner/after_class_methods.rb +9 -22
  36. data/sub/eac_cli/lib/eac_cli/runner/class_runner.rb +50 -0
  37. data/sub/eac_cli/lib/eac_cli/runner/instance_methods.rb +0 -9
  38. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder/alternative.rb +12 -5
  39. data/sub/eac_cli/lib/eac_cli/runner_with/help/builder.rb +15 -6
  40. data/sub/eac_cli/lib/eac_cli/runner_with/help.rb +2 -2
  41. data/sub/eac_cli/lib/eac_cli/runner_with/subcommands.rb +1 -1
  42. data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
  43. data/sub/eac_cli/spec/lib/eac_cli/runner_with/help_spec.rb +26 -17
  44. data/sub/eac_cli/spec/lib/eac_cli/runner_with/subcommands_spec.rb +4 -1
  45. data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +2 -2
  46. data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  47. data/sub/eac_ruby_utils/lib/eac_ruby_utils/common_constructor.rb +2 -2
  48. data/sub/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb +1 -0
  49. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_all_gems.rb +4 -0
  50. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/from_gem.rb +47 -0
  51. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales/module_i18n_translate.rb +74 -0
  52. data/sub/eac_ruby_utils/lib/eac_ruby_utils/locales.rb +9 -0
  53. data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +35 -0
  54. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/i18n_translate.rb +2 -25
  55. data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/method_class.rb +9 -0
  56. data/sub/eac_ruby_utils/lib/eac_ruby_utils/require_sub.rb +86 -33
  57. data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  58. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/method_class_spec.rb +46 -0
  59. data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/method_class_spec.rb +20 -0
  60. metadata +31 -12
  61. data/lib/avm/projects/stereotypes/rails_application/update.rb +0 -14
  62. data/lib/avm/projects/stereotypes/ruby_gem/version_bump.rb +0 -60
  63. data/sub/avm/lib/avm/sources/configuration/_rubocop.rb +0 -24
  64. data/sub/avm/lib/avm/sources/configuration/_tests.rb +0 -27
  65. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches/i18n.rb +0 -7
  66. data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/patches.rb +0 -4
  67. data/sub/eac_cli/lib/eac_cli/definition/help_formatter.rb +0 -77
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9ade74f1c59b191c0af317c03f8acb00fffc0e2bcac3120b56a604ab72a31ac1
4
- data.tar.gz: 9d9967c47a11500142f7843b53ac7430f40fb191e441ce177ce583a58f46fffc
3
+ metadata.gz: 35fb18a5736eb65f686b0915a77da3f4e548a64b0ce7e0bd5bc754483c675757
4
+ data.tar.gz: 053eeec2795b4cf08660991b06d13127e1a66b112a084642f8213fbe89a82e59
5
5
  SHA512:
6
- metadata.gz: dae95c3e50159a7cd7a9c77745a106d462c2d5c8445a43f92f35cadeb42545509d83b53f2085a339b9dac930610a6cc68cb4551a2dd35e0a2566a1d07f932ce1
7
- data.tar.gz: 7dc23f20f7430e88fd0a75582a899df38a81eb6a102f948611c96d810d766032656c730395ef66f4a3f89a11ad4b84d429252dcbf8e58082777b632f5e2ad188
6
+ metadata.gz: 356218e0b80f21fbd6612ef6f88b49112ee7d97bff1c7b3ef21039964f024dffbcf0944d4ab01b82c6f919384b0bba401319572911599154a418f8a1e3d50c99
7
+ data.tar.gz: f290a18803f13ae99202ec10ee6106f267913a27b8537dd2fc3f6156151b6d0f01a34354c980de17885b85dc7614019adb7747c03e91ebe1038aca22c6d898a5
@@ -10,8 +10,6 @@ module Avm
10
10
  class InGemfile < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
11
  LINE_PARSER = /In Gemfile:/
12
12
  .to_parser { |_m| new }
13
-
14
- common_constructor
15
13
  end
16
14
  end
17
15
  end
@@ -8,14 +8,13 @@ module Avm
8
8
  class Runner
9
9
  class AppSrc
10
10
  class VersionBump
11
- runner_with :help do
11
+ runner_with :help, :confirmation do
12
12
  desc 'Bump version of a local project.'
13
13
  arg_opt '-n', '--new', 'Set new version.'
14
14
  arg_opt '-s', '--segment', 'Increment de <segment>-th segment (Left-most is 0)'
15
15
  bool_opt '-M', '--major', 'Same as --segment=0.'
16
16
  bool_opt '-m', '--minor', 'Same as --segment=1.'
17
17
  bool_opt '-p', '--patch', 'Same as --segment=2.'
18
- bool_opt '-y', '--yes', 'Bump without confirmation.'
19
18
  end
20
19
 
21
20
  def run
@@ -26,7 +25,7 @@ module Avm
26
25
  def run_version_changed
27
26
  infom 'Version changed'
28
27
  if confirm?
29
- runner_context.call(:instance).run_job(:version_bump, target_version)
28
+ runner_context.call(:subject).version_bump(target_version)
30
29
  success 'Bumped'
31
30
  else
32
31
  fatal_error 'Bump unconfirmed'
@@ -38,17 +37,13 @@ module Avm
38
37
  end
39
38
 
40
39
  def start_banner
41
- runner_context.call(:instance_banner)
40
+ infov 'Instance', runner_context.call(:subject)
42
41
  infov 'Current version', current_version.if_present('-')
43
42
  infov 'Target version', target_version.if_present('-')
44
43
  end
45
44
 
46
- def confirm?
47
- parsed.yes? || input('Confirm version bump?', bool: true)
48
- end
49
-
50
45
  def current_version_uncached
51
- runner_context.call(:instance).if_respond('version')
46
+ runner_context.call(:subject).if_respond('version')
52
47
  end
53
48
 
54
49
  def target_version_uncached
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.116.2'
5
+ VERSION = '0.117.2'
6
6
  end
7
7
  end
data/sub/avm/avm.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'eac_cli', '~> 0.23', '>= 0.23.1'
16
16
  s.add_dependency 'eac_docker', '~> 0.3'
17
17
  s.add_dependency 'eac_git', '~> 0.6'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.80'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.95'
19
19
  s.add_dependency 'eac_templates', '~> 0.1', '>= 0.1.1'
20
20
  s.add_dependency 'filesize', '~> 0.2'
21
21
  s.add_dependency 'htmlbeautifier', '~> 1.3', '>= 1.3.1'
@@ -6,6 +6,7 @@ module Avm
6
6
  module Scms
7
7
  class Base
8
8
  enable_abstract_methods
9
+ enable_simple_cache
9
10
  abstract_methods :update, :valid?
10
11
  common_constructor :path do
11
12
  self.path = path.to_pathname
@@ -28,6 +29,18 @@ module Avm
28
29
  def to_s
29
30
  name
30
31
  end
32
+
33
+ private
34
+
35
+ # @return [Avm::Scms::Base]
36
+ def parent_scm
37
+ parent_path = path.parent
38
+ until parent_path.root?
39
+ ::Avm::Registry.scms.detect_optional(parent_path).if_present { |v| return v }
40
+ parent_path = parent_path.parent
41
+ end
42
+ nil
43
+ end
31
44
  end
32
45
  end
33
46
  end
@@ -29,7 +29,8 @@ module Avm
29
29
 
30
30
  # @return [Avm::Sources::Configuration]
31
31
  def old_configuration_uncached
32
- ::Avm::Sources::Configuration.find_in_path(path)
32
+ ::Avm::Sources::Configuration.find_in_path(path) ||
33
+ ::Avm::Sources::Configuration.temp_instance
33
34
  end
34
35
  end
35
36
  end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Sources
7
+ class Base
8
+ module Parent
9
+ # @return [Avm::Sources::Base]
10
+ def parent
11
+ parent_by_option || parent_by_search
12
+ end
13
+
14
+ # @return [Avm::Sources::Base]
15
+ def parent_by_option
16
+ options[OPTION_PARENT]
17
+ end
18
+
19
+ # @return [Avm::Sources::Base]
20
+ def parent_by_search
21
+ parent_path = path.parent
22
+ until parent_path.root?
23
+ ::Avm::Registry.sources.detect_optional(parent_path).if_present { |v| return v }
24
+ parent_path = parent_path.parent
25
+ end
26
+ nil
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -21,12 +21,6 @@ module Avm
21
21
  abstract_methods :update, :valid?
22
22
 
23
23
  delegate :locale, to: :old_configuration
24
- delegate :to_s, to: :path
25
-
26
- # @return [Avm::Sources::Base]
27
- def parent
28
- options[OPTION_PARENT]
29
- end
30
24
 
31
25
  # @return [Pathname]
32
26
  def relative_path
@@ -35,6 +29,10 @@ module Avm
35
29
  path.relative_path_from(parent.path)
36
30
  end
37
31
 
32
+ def to_s
33
+ "#{self.class}[#{path}]"
34
+ end
35
+
38
36
  # @return [Enumerable<Avm::Sources::Base>]
39
37
  def subs
40
38
  scm.subs.map { |subrepo| ::Avm::Registry.sources.detect(subrepo.path, parent: self) }
@@ -6,10 +6,12 @@ require 'i18n'
6
6
  module Avm
7
7
  module Sources
8
8
  class Configuration < ::EacConfig::OldConfigs
9
- LOCALE_KEY = :locale
9
+ module Locale
10
+ LOCALE_KEY = :locale
10
11
 
11
- def locale
12
- read_entry(LOCALE_KEY) || ::I18n.default_locale
12
+ def locale
13
+ read_entry(LOCALE_KEY) || ::I18n.default_locale
14
+ end
13
15
  end
14
16
  end
15
17
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Avm
4
+ module Sources
5
+ class Configuration < ::EacConfig::OldConfigs
6
+ module Rubocop
7
+ RUBOCOP_COMMAND_KEY = 'ruby.rubocop.command'
8
+ RUBOCOP_GEMFILE_KEY = 'ruby.rubocop.gemfile'
9
+
10
+ def rubocop_command
11
+ read_command(RUBOCOP_COMMAND_KEY)
12
+ end
13
+
14
+ def rubocop_gemfile
15
+ gemfile_path = read_entry(RUBOCOP_GEMFILE_KEY)
16
+ return nil if gemfile_path.blank?
17
+
18
+ gemfile_path = gemfile_path.to_pathname.expand_path(storage_path.parent)
19
+ return gemfile_path if gemfile_path.file?
20
+
21
+ raise "Gemfile path \"#{gemfile_path}\" does not exist or is not a file"
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/patches/eac_ruby_gems_utils/gem'
4
+
5
+ module Avm
6
+ module Sources
7
+ class Configuration < ::EacConfig::OldConfigs
8
+ module Tests
9
+ BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
10
+ TEST_COMMAND_KEY = 'test.command'
11
+
12
+ def any_test_command
13
+ bundle_test_command || test_command
14
+ end
15
+
16
+ def test_command
17
+ read_command(TEST_COMMAND_KEY)
18
+ end
19
+
20
+ def bundle_test_command
21
+ read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
22
+ args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
23
+ ::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -7,7 +7,7 @@ require 'yaml'
7
7
  module Avm
8
8
  module Sources
9
9
  class Configuration < ::EacConfig::OldConfigs
10
- require_sub __FILE__
10
+ require_sub __FILE__, include_modules: true
11
11
 
12
12
  FILENAMES = %w[.avm.yml .avm.yaml].freeze
13
13
 
@@ -28,6 +28,10 @@ module Avm
28
28
  nil
29
29
  end
30
30
 
31
+ def temp_instance
32
+ new(::Tempfile.new(['.avm', '.yaml']))
33
+ end
34
+
31
35
  private
32
36
 
33
37
  def internal_find_path(absolute_pathname)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.18.1'
4
+ VERSION = '0.19.0'
5
5
  end
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.10'
15
+ s.add_dependency 'avm', '~> 0.19'
16
16
  s.add_dependency 'eac_ruby_utils', '~> 0.80'
17
17
 
18
18
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.4'
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/sources/base'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module EacGenericBase0
8
+ module Sources
9
+ class Base < ::Avm::Sources::Base
10
+ module VersionBump
11
+ def after_sub_version_bump_do_changes
12
+ # Do nothing
13
+ end
14
+
15
+ # @return [Avm::Scms::Commit, nil]
16
+ def version_bump(target_version)
17
+ scm.commit_if_change(version_bump_commit_message(target_version)) do
18
+ version_bump_do_changes(target_version)
19
+ parent.if_present(&:after_sub_version_bump_do_changes)
20
+ end
21
+ end
22
+
23
+ # @return [String]
24
+ def version_bump_commit_message(target_version)
25
+ i18n_translate(__method__, version: target_version, __locale: locale)
26
+ end
27
+
28
+ def version_bump_do_changes(_target_version)
29
+ raise_abstract_method(__METHOD__)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -8,13 +8,16 @@ module Avm
8
8
  module EacGenericBase0
9
9
  module Sources
10
10
  class Base < ::Avm::Sources::Base
11
+ require_sub __FILE__, include_modules: true
12
+ enable_abstract_methods
13
+
11
14
  # @return [Avm::EacGenericBase0::Sources::Tester]
12
15
  def tester_class
13
16
  Avm::EacGenericBase0::Sources::Tester
14
17
  end
15
18
 
16
19
  def valid?
17
- path.directory?
20
+ ::Avm::Registry.scms.detect_optional(path).present?
18
21
  end
19
22
  end
20
23
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacGenericBase0
5
- VERSION = '0.1.1'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -0,0 +1,6 @@
1
+ en:
2
+ avm:
3
+ eac_generic_base0:
4
+ sources:
5
+ base:
6
+ version_bump_commit_message: Bump to '%{version}'.
@@ -0,0 +1,6 @@
1
+ pt-BR:
2
+ avm:
3
+ eac_generic_base0:
4
+ sources:
5
+ base:
6
+ version_bump_commit_message: Versão para '%{version}'.
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib,locale}/**/*']
14
14
 
15
15
  s.add_dependency 'avm', '~> 0.9'
16
- s.add_dependency 'avm-eac_generic_base0', '~> 0.1'
16
+ s.add_dependency 'avm-eac_generic_base0', '~> 0.2'
17
17
  s.add_dependency 'eac_ruby_gems_utils', '~> 0.9', '>= 0.9.8'
18
18
  s.add_dependency 'eac_ruby_utils', '~> 0.80'
19
19
 
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Bundler
8
+ class Gemfile
9
+ class AddOrReplaceGemLine
10
+ enable_method_class
11
+ common_constructor :sender, :gem_name, :gem_specs
12
+ delegate :lines, to: :sender
13
+
14
+ def existing_gem_line_index
15
+ lines.index { |line| line.start_with?(gem_line_prefix) }
16
+ end
17
+
18
+ def result
19
+ if existing_gem_line_index.present?
20
+ replace_line
21
+ else
22
+ add_line
23
+ end
24
+ end
25
+
26
+ def add_line
27
+ lines.insert(add_line_index, new_gem_line)
28
+ end
29
+
30
+ def add_line_index
31
+ (gems_lines_start_index..(lines.count - 1)).each do |e|
32
+ return e if new_gem_line < lines[e]
33
+ end
34
+ lines.count
35
+ end
36
+
37
+ def gems_lines_start_index
38
+ lines.index { |line| line.start_with?('gem ') } || lines.count
39
+ end
40
+
41
+ def new_gem_line
42
+ ([gem_line_prefix] + gem_specs).join(', ')
43
+ end
44
+
45
+ def gem_line_prefix
46
+ "gem '#{gem_name}'"
47
+ end
48
+
49
+ def replace_line
50
+ lines[existing_gem_line_index] = new_gem_line
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Bundler
8
+ class Gemfile
9
+ class Dependency
10
+ common_constructor :gemfile, :gem_name
11
+
12
+ def version_specs=(version_specs)
13
+ gemfile.add_or_replace_gem_line(gem_name, version_specs)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Bundler
8
+ class Gemfile
9
+ require_sub __FILE__, require_dependency: true
10
+
11
+ class << self
12
+ def from_file(path)
13
+ new(path.read.each_line.map(&:rstrip))
14
+ end
15
+ end
16
+
17
+ common_constructor :lines
18
+
19
+ # @return [Avm::EacRubyBase1::Bundler::Gemfile::Dependency]
20
+ def dependency(gem_name)
21
+ ::Avm::EacRubyBase1::Bundler::Gemfile::Dependency.new(self, gem_name)
22
+ end
23
+
24
+ def write(path)
25
+ path.to_pathname.write(to_text)
26
+ end
27
+
28
+ def to_text
29
+ lines.map { |line| "#{line}\n" }.join
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module EacRubyBase1
7
+ module Bundler
8
+ require_sub __FILE__
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
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
+ module VersionBump
11
+ def after_sub_version_bump_do_changes
12
+ the_gem.bundle('install').chdir_root.execute!
13
+ end
14
+
15
+ def version_bump_do_changes(target_version)
16
+ self.version = target_version
17
+ the_gem.bundle('install').chdir_root.execute!
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -3,6 +3,7 @@
3
3
  require 'avm/eac_generic_base0/sources/base'
4
4
  require 'avm/eac_ruby_base1/sources/update'
5
5
  require 'avm/eac_ruby_base1/sources/tester'
6
+ require 'avm/version_number'
6
7
  require 'eac_ruby_gems_utils/gem'
7
8
  require 'eac_ruby_utils/core_ext'
8
9
 
@@ -10,6 +11,7 @@ module Avm
10
11
  module EacRubyBase1
11
12
  module Sources
12
13
  class Base < ::Avm::EacGenericBase0::Sources::Base
14
+ require_sub __FILE__, include_modules: :prepend, require_dependency: true
13
15
  delegate :gemspec_path, to: :the_gem
14
16
 
15
17
  def gemfile_path
@@ -33,6 +35,15 @@ module Avm
33
35
  def update
34
36
  ::Avm::EacRubyBase1::Sources::Update.new(self)
35
37
  end
38
+
39
+ # @return [Avm::VersionNumber]
40
+ def version
41
+ the_gem.version.if_present { |v| ::Avm::VersionNumber.new(v) }
42
+ end
43
+
44
+ def version=(value)
45
+ the_gem.version_file.value = value
46
+ end
36
47
  end
37
48
  end
38
49
  end
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_ruby_base1/patches/i18n'
4
3
  require 'eac_ruby_utils/core_ext'
5
4
 
6
5
  module Avm
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacRubyBase1
5
- VERSION = '0.4.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -8,9 +8,7 @@ module Avm
8
8
  module Git
9
9
  module Scms
10
10
  class GitSubrepo < ::Avm::Scms::Base
11
- def commit_if_change(_message)
12
- nyi
13
- end
11
+ delegate :commit_if_change, to: :parent_scm
14
12
 
15
13
  def update
16
14
  git_subrepo.command('clean').execute!
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Git
5
- VERSION = '0.3.2'
5
+ VERSION = '0.4.0'
6
6
  end
7
7
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.add_dependency 'colorize', '~> 0.8.1'
16
16
  s.add_dependency 'eac_config', '~> 0.8'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.83'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.95'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
20
20
  end
@@ -39,10 +39,6 @@ module EacCli
39
39
  self.description = description
40
40
  end
41
41
 
42
- def help_formatter
43
- @help_formatter ||= ::EacCli::Definition::HelpFormatter.new(self)
44
- end
45
-
46
42
  def main_alternative
47
43
  @main_alternative ||= begin
48
44
  r = ::EacCli::Definition::Alternative.new
@@ -33,7 +33,7 @@ module EacCli
33
33
  # @return [EacCli::Definition::BaseOption] The option collected.
34
34
  def short_option_collect_char(char)
35
35
  option = find_short_option(char)
36
- raise_error "Invalid short option \"#{char}\"" unless option
36
+ raise_argv_current_invalid_option unless option
37
37
 
38
38
  option_collect_option(option)
39
39
  end