avm-tools 0.94.1 → 0.97.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avm/app_src.rb +60 -0
  3. data/lib/avm/core_ext.rb +4 -0
  4. data/lib/avm/eac_asciidoctor_base0/deploy.rb +5 -5
  5. data/lib/avm/eac_webapp_base0/instance.rb +5 -2
  6. data/lib/avm/eac_webapp_base0/instance/subcommand_parent.rb +24 -0
  7. data/lib/avm/eac_webapp_base0/runner/data.rb +1 -0
  8. data/lib/avm/eac_webapp_base0/runner/data/dump.rb +1 -1
  9. data/lib/avm/eac_webapp_base0/runner/data/load.rb +1 -1
  10. data/lib/avm/git/issue/complete/_test.rb +2 -2
  11. data/lib/avm/instances/base.rb +6 -12
  12. data/lib/avm/instances/base/entry_keys.rb +17 -0
  13. data/lib/{eac_launcher → avm/launcher}/instances/error.rb +0 -0
  14. data/lib/avm/launcher/instances/runner_helper.rb +42 -0
  15. data/lib/avm/patches/class.rb +4 -0
  16. data/lib/avm/patches/eac_ruby_gems_utils.rb +4 -0
  17. data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
  18. data/lib/avm/patches/object.rb +4 -0
  19. data/lib/avm/patches/object/fs_cache.rb +16 -0
  20. data/lib/avm/ruby/bundler.rb +11 -0
  21. data/lib/avm/ruby/bundler/incompatible_parser.rb +25 -0
  22. data/lib/avm/ruby/bundler/incompatible_parser/depends_on.rb +25 -0
  23. data/lib/avm/ruby/bundler/incompatible_parser/gem_conflict.rb +39 -0
  24. data/lib/avm/ruby/bundler/incompatible_parser/in_gemfile.rb +19 -0
  25. data/lib/avm/ruby/bundler/incompatible_parser/line_buffer.rb +73 -0
  26. data/lib/avm/ruby/bundler/incompatible_parser/line_factory.rb +31 -0
  27. data/lib/avm/ruby/bundler/incompatible_parser/line_parser_base.rb +19 -0
  28. data/lib/avm/ruby/bundler/incompatible_parser/version_requirement.rb +26 -0
  29. data/lib/avm/ruby/gems/generator.rb +1 -5
  30. data/lib/avm/ruby/rubocop/_configured.rb +2 -2
  31. data/lib/avm/tools/runner/{local_project.rb → app_src.rb} +3 -3
  32. data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0.rb +1 -1
  33. data/lib/avm/tools/runner/{local_project → app_src}/eac_asciidoctor_base0/build.rb +19 -7
  34. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0.rb +1 -1
  35. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_chapters.rb +1 -1
  36. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/build_single.rb +1 -1
  37. data/lib/avm/tools/runner/{local_project → app_src}/eac_writings_base0/info.rb +1 -1
  38. data/lib/avm/tools/runner/{local_project → app_src}/info.rb +1 -1
  39. data/lib/avm/tools/runner/{local_project → app_src}/ruby.rb +1 -1
  40. data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler.rb +4 -8
  41. data/lib/avm/tools/runner/{local_project → app_src}/ruby/bundler/gemfile_lock.rb +11 -14
  42. data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +84 -0
  43. data/lib/avm/tools/runner/{local_project → app_src}/test.rb +1 -1
  44. data/lib/avm/tools/runner/{local_project → app_src}/update.rb +1 -1
  45. data/lib/avm/tools/runner/{local_project → app_src}/version_bump.rb +1 -1
  46. data/lib/avm/tools/runner/launcher.rb +3 -6
  47. data/lib/avm/tools/runner/launcher/instances.rb +10 -21
  48. data/lib/avm/tools/runner/launcher/projects.rb +10 -18
  49. data/lib/avm/tools/runner/launcher/publish.rb +18 -26
  50. data/lib/avm/tools/runner/ruby/rubocop.rb +9 -25
  51. data/lib/avm/tools/runner/self.rb +7 -15
  52. data/lib/avm/tools/runner/self/docker.rb +1 -1
  53. data/lib/avm/tools/version.rb +1 -1
  54. data/lib/eac_launcher/instances.rb +1 -1
  55. data/template/avm/ruby/gems/generator/static/spec/rubocop_spec.rb +1 -5
  56. data/template/avm/ruby/gems/generator/static/spec/spec_helper.rb +2 -0
  57. data/vendor/avm-apps/avm-apps.gemspec +1 -1
  58. data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +57 -0
  59. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +18 -0
  60. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +26 -0
  61. data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +29 -0
  62. data/vendor/avm-apps/lib/avm/apps/version.rb +1 -1
  63. data/vendor/avm-apps/spec/rubocop_spec.rb +1 -5
  64. data/vendor/avm-apps/spec/spec_helper.rb +3 -0
  65. data/vendor/avm-eac_asciidoctor_base0/Gemfile +5 -0
  66. data/vendor/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +19 -0
  67. data/{lib/avm/local_projects.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0.rb} +1 -1
  68. data/{lib/avm/eac_asciidoctor_base0/project.rb → vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources.rb} +2 -4
  69. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/base.rb +15 -0
  70. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build.rb +49 -0
  71. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb +30 -0
  72. data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +7 -0
  73. data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +3 -0
  74. data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +102 -0
  75. data/vendor/eac_cli/eac_cli.gemspec +1 -1
  76. data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +5 -1
  77. data/vendor/eac_cli/lib/eac_cli/docopt/doc_builder.rb +3 -1
  78. data/vendor/eac_cli/lib/eac_cli/runner/context.rb +2 -1
  79. data/vendor/eac_cli/lib/eac_cli/runner/instance_methods.rb +8 -1
  80. data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
  81. data/vendor/eac_cli/spec/rubocop_spec.rb +1 -5
  82. data/vendor/eac_cli/spec/spec_helper.rb +3 -0
  83. data/vendor/eac_docker/eac_docker.gemspec +1 -1
  84. data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
  85. data/vendor/eac_docker/spec/rubocop_spec.rb +1 -5
  86. data/vendor/eac_docker/spec/spec_helper.rb +3 -0
  87. data/vendor/eac_git/eac_git.gemspec +2 -1
  88. data/vendor/eac_git/lib/eac_git/local.rb +4 -0
  89. data/vendor/eac_git/lib/eac_git/local/commit.rb +53 -0
  90. data/vendor/eac_git/lib/eac_git/local/commit/changed_file.rb +46 -0
  91. data/vendor/eac_git/lib/eac_git/local/commit/diff_tree_line.rb +32 -0
  92. data/vendor/eac_git/lib/eac_git/rspec.rb +6 -1
  93. data/{lib/avm/git/spec_helper.rb → vendor/eac_git/lib/eac_git/rspec/stubbed_git_local_repo.rb} +16 -13
  94. data/vendor/eac_git/lib/eac_git/version.rb +1 -1
  95. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec.rb +13 -0
  96. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.source.out +1 -0
  97. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/add.target.yaml +7 -0
  98. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.source.out +1 -0
  99. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/modify.target.yaml +7 -0
  100. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.source.out +1 -0
  101. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/remove.target.yaml +7 -0
  102. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.source.out +2 -0
  103. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename.target.yaml +13 -0
  104. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.source.out +2 -0
  105. data/vendor/eac_git/spec/lib/eac_git/local/commit/diff_tree_line_spec_files/rename_modify.target.yaml +13 -0
  106. data/vendor/eac_git/spec/lib/eac_git/local/commit_spec.rb +58 -0
  107. data/vendor/eac_git/spec/rubocop_spec.rb +1 -5
  108. data/vendor/eac_git/spec/spec_helper.rb +3 -0
  109. data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
  110. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/input.rb +36 -0
  111. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner_with/output.rb +58 -0
  112. data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
  113. data/vendor/eac_ruby_base0/spec/lib/eac_ruby_base0/runner_with/output_spec.rb +81 -0
  114. data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -5
  115. data/vendor/eac_ruby_base0/spec/spec_helper.rb +3 -0
  116. data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +4 -3
  117. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +7 -10
  118. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/multiple.rb +9 -2
  119. data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
  120. data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -5
  121. data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +3 -0
  122. data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +2 -1
  123. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb +6 -0
  124. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs/logs.rb +63 -0
  125. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/inflector.rb +9 -1
  126. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/listable/list.rb +3 -2
  127. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/kernel/nyi.rb +4 -2
  128. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb +10 -0
  129. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb +4 -2
  130. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/regexp_parser.rb +34 -0
  131. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider.rb +10 -29
  132. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/settings_provider/setting_value.rb +69 -0
  133. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/simple_cache.rb +18 -5
  134. data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
  135. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/settings_provider_spec.rb +8 -0
  136. data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/simple_cache_spec.rb +9 -0
  137. data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -5
  138. data/vendor/eac_ruby_utils/spec/spec_helper.rb +3 -0
  139. metadata +90 -39
  140. data/lib/avm/eac_asciidoctor_base0/build.rb +0 -47
  141. data/lib/avm/eac_asciidoctor_base0/build/file.rb +0 -28
  142. data/lib/avm/instances/configuration.rb +0 -55
  143. data/lib/avm/instances/configuration/_locale.rb +0 -16
  144. data/lib/avm/instances/configuration/_rubocop.rb +0 -24
  145. data/lib/avm/instances/configuration/_tests.rb +0 -27
  146. data/lib/avm/local_projects/instance.rb +0 -62
  147. data/lib/eac_launcher/instances/runner_helper.rb +0 -42
  148. data/vendor/eac_cli/lib/eac_cli/runner_with/output_file.rb +0 -30
  149. data/vendor/eac_cli/spec/lib/eac_cli/runner_with/output_file_spec.rb +0 -53
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
+
6
+ module Avm
7
+ module Ruby
8
+ module Bundler
9
+ class IncompatibleParser
10
+ class InGemfile < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
+ LINE_PARSER = /In Gemfile:/
12
+ .to_parser { |_m| new }
13
+
14
+ common_constructor
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/gem_conflict'
5
+ require 'avm/ruby/bundler/incompatible_parser/line_factory'
6
+
7
+ module Avm
8
+ module Ruby
9
+ module Bundler
10
+ class IncompatibleParser
11
+ class LineBuffer
12
+ class << self
13
+ def from_file(path)
14
+ new(::File.read(path.to_s))
15
+ end
16
+ end
17
+
18
+ attr_reader :gems_in_conflict
19
+
20
+ def initialize(content)
21
+ self.gems_in_conflict = []
22
+ self.parsing_required = false
23
+ content.each_line { |string_line| add_line(LineFactory.new(string_line)) }
24
+ end
25
+
26
+ private
27
+
28
+ attr_accessor :parsing_required
29
+ attr_writer :gems_in_conflict
30
+
31
+ def add_line(line)
32
+ return if line.blank?
33
+
34
+ return if LineFactory::TYPES.any? do |type|
35
+ next false unless line.result.is_a?(type)
36
+
37
+ send("on_#{type.name.demodulize.underscore.variableize}_line", line.result)
38
+ true
39
+ end
40
+
41
+ return unless parsing_required
42
+
43
+ raise(::ArgumentError, "Unparsed line: \"#{line.content}\"")
44
+ end
45
+
46
+ def on_gem_conflict_line(result)
47
+ self.parsing_required = true
48
+ gems_in_conflict << result
49
+ end
50
+
51
+ def on_in_gemfile_line(result)
52
+ # Do nothing
53
+ end
54
+
55
+ def on_depends_on_line(result)
56
+ current_gem_conflict.add_depends_on(result)
57
+ end
58
+
59
+ def on_version_requirement_line(result)
60
+ current_gem_conflict.add_version_requirement(result)
61
+ end
62
+
63
+ def current_gem_conflict
64
+ raise 'No gems in conflict' if gems_in_conflict.none?
65
+ raise 'Last gem is blank' if gems_in_conflict.last.blank?
66
+
67
+ gems_in_conflict.last
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/depends_on'
5
+ require 'avm/ruby/bundler/incompatible_parser/gem_conflict'
6
+ require 'avm/ruby/bundler/incompatible_parser/in_gemfile'
7
+
8
+ module Avm
9
+ module Ruby
10
+ module Bundler
11
+ class IncompatibleParser
12
+ class LineFactory
13
+ TYPES = [GemConflict, InGemfile, DependsOn, VersionRequirement].freeze
14
+
15
+ enable_simple_cache
16
+ common_constructor :content do
17
+ self.content = content.strip
18
+ end
19
+
20
+ delegate :blank?, to: :content
21
+
22
+ private
23
+
24
+ def result_uncached
25
+ TYPES.lazy.map { |type| type.parse(content) }.find(&:present?)
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+
5
+ module Avm
6
+ module Ruby
7
+ module Bundler
8
+ class IncompatibleParser
9
+ class LineParserBase
10
+ class << self
11
+ def parse(line_content)
12
+ const_get('LINE_PARSER').parse(line_content)
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/core_ext'
4
+ require 'avm/ruby/bundler/incompatible_parser/line_parser_base'
5
+
6
+ module Avm
7
+ module Ruby
8
+ module Bundler
9
+ class IncompatibleParser
10
+ class VersionRequirement < ::Avm::Ruby::Bundler::IncompatibleParser::LineParserBase
11
+ LINE_PARSER = /\A([a-z][a-z_0-9]*)(?: \((.+)\))?\z/
12
+ .to_parser { |m| new(m[1], m[2]) }
13
+
14
+ enable_simple_cache
15
+ attr_accessor :stack
16
+
17
+ common_constructor :gem_name, :requirements_source
18
+
19
+ def data
20
+ { requirements_source: requirements_source, stack: stack.map(&:data) }
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -8,7 +8,7 @@ module Avm
8
8
  module Gems
9
9
  class Generator
10
10
  IDENT = ' '
11
- JOBS = %w[root_directory gemspec root_lib version_lib static gemfile_lock rspec].freeze
11
+ JOBS = %w[root_directory gemspec root_lib version_lib static gemfile_lock].freeze
12
12
  TEMPLATE_VARIABLES = %w[lib_path name root_module].freeze
13
13
 
14
14
  enable_console_speaker
@@ -92,10 +92,6 @@ module Avm
92
92
  template_apply('root_lib', "lib/#{lib_path}.rb")
93
93
  end
94
94
 
95
- def generate_rspec
96
- self_gem.bundle('exec', 'rspec').chdir_root.execute!
97
- end
98
-
99
95
  def generate_static
100
96
  template.child('static').apply(self, root_directory)
101
97
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/instances/configuration'
3
+ require 'avm/apps/sources/configuration'
4
4
 
5
5
  module Avm
6
6
  module Ruby
@@ -22,7 +22,7 @@ module Avm
22
22
  private
23
23
 
24
24
  def configuration_uncached
25
- ::Avm::Instances::Configuration.find_by_path(base_path)
25
+ ::Avm::Apps::Sources::Configuration.find_by_path(base_path)
26
26
  end
27
27
  end
28
28
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/local_projects/instance'
3
+ require 'avm/app_src'
4
4
  require 'eac_cli/core_ext'
5
5
 
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class LocalProject
9
+ class AppSrc
10
10
  require_sub __FILE__
11
11
  runner_with :help, :subcommands do
12
12
  desc 'Utilities for local projects.'
@@ -22,7 +22,7 @@ module Avm
22
22
  private
23
23
 
24
24
  def instance_uncached
25
- ::Avm::LocalProjects::Instance.new(instance_path)
25
+ ::Avm::AppSrc.new(instance_path)
26
26
  end
27
27
 
28
28
  def instance_path_uncached
@@ -6,7 +6,7 @@ require 'eac_ruby_utils/console/docopt_runner'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class LocalProject
9
+ class AppSrc
10
10
  class EacAsciidoctorBase0
11
11
  require_sub __FILE__
12
12
 
@@ -1,37 +1,49 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/eac_asciidoctor_base0/build'
4
- require 'avm/eac_asciidoctor_base0/project'
5
- require 'eac_cli/core_ext'
6
- require 'eac_ruby_utils/console/docopt_runner'
3
+ require 'avm/core_ext'
4
+ require 'avm/eac_asciidoctor_base0/sources/build'
5
+ require 'os'
7
6
 
8
7
  module Avm
9
8
  module Tools
10
9
  class Runner
11
- class LocalProject
10
+ class AppSrc
12
11
  class EacAsciidoctorBase0
13
12
  class Build
14
13
  runner_with :help do
15
14
  desc 'Build the project'
16
15
  arg_opt '-d', '--target-dir', 'Directory to build'
16
+ bool_opt '--open', 'Show the result.'
17
17
  end
18
18
 
19
19
  def run
20
20
  start_banner
21
21
  build.run
22
+ open
22
23
  end
23
24
 
24
25
  private
25
26
 
26
27
  def build_uncached
27
- ::Avm::EacAsciidoctorBase0::Build.new(runner_context.call(:project),
28
- target_directory: parsed.target_dir)
28
+ ::Avm::EacAsciidoctorBase0::Sources::Build.new(runner_context.call(:project),
29
+ target_directory: parsed.target_dir)
29
30
  end
30
31
 
31
32
  def default_target_directory
32
33
  runner_context.call(:project).root.join('build')
33
34
  end
34
35
 
36
+ def open
37
+ return unless parsed.open?
38
+
39
+ infom "Opening \"#{open_path}\"..."
40
+ ::EacRubyUtils::Envs.local.command(OS.open_file_command, open_path).system!
41
+ end
42
+
43
+ def open_path
44
+ build.source_files.first.target_path
45
+ end
46
+
35
47
  def start_banner
36
48
  runner_context.call(:project_banner)
37
49
  infov 'Target directory', build.target_directory
@@ -7,7 +7,7 @@ require 'eac_ruby_utils/console/docopt_runner'
7
7
  module Avm
8
8
  module Tools
9
9
  class Runner
10
- class LocalProject
10
+ class AppSrc
11
11
  class EacWritingsBase0
12
12
  require_sub __FILE__
13
13
  enable_simple_cache
@@ -7,7 +7,7 @@ require 'eac_ruby_utils/console/docopt_runner'
7
7
  module Avm
8
8
  module Tools
9
9
  class Runner
10
- class LocalProject
10
+ class AppSrc
11
11
  class EacWritingsBase0
12
12
  class BuildChapters
13
13
  runner_with :help do
@@ -7,7 +7,7 @@ require 'eac_ruby_utils/console/docopt_runner'
7
7
  module Avm
8
8
  module Tools
9
9
  class Runner
10
- class LocalProject
10
+ class AppSrc
11
11
  class EacWritingsBase0
12
12
  class BuildSingle
13
13
  runner_with :help do
@@ -7,7 +7,7 @@ require 'eac_ruby_utils/console/docopt_runner'
7
7
  module Avm
8
8
  module Tools
9
9
  class Runner
10
- class LocalProject
10
+ class AppSrc
11
11
  class EacWritingsBase0
12
12
  class Info
13
13
  runner_with :help do
@@ -6,7 +6,7 @@ require 'eac_ruby_utils/core_ext'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class LocalProject
9
+ class AppSrc
10
10
  class Info < ::EacRubyUtils::Console::DocoptRunner
11
11
  include ::EacCli::DefaultRunner
12
12
 
@@ -6,7 +6,7 @@ require 'eac_cli/core_ext'
6
6
  module Avm
7
7
  module Tools
8
8
  class Runner
9
- class LocalProject
9
+ class AppSrc
10
10
  class Ruby
11
11
  require_sub __FILE__
12
12
  runner_with :help, :subcommands do
@@ -1,19 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/default_runner'
4
- require 'eac_ruby_utils/console/docopt_runner'
5
- require 'eac_ruby_utils/core_ext'
3
+ require 'eac_ruby_base0/core_ext'
6
4
 
7
5
  module Avm
8
6
  module Tools
9
7
  class Runner
10
- class LocalProject
8
+ class AppSrc
11
9
  class Ruby
12
- class Bundler < ::EacRubyUtils::Console::DocoptRunner
10
+ class Bundler
13
11
  require_sub __FILE__
14
- include ::EacCli::DefaultRunner
15
-
16
- runner_definition do
12
+ runner_with :help, :subcommands do
17
13
  desc 'Ruby\'s bundler utitilies for local projects.'
18
14
  subcommands
19
15
  end
@@ -1,18 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'eac_cli/default_runner'
4
- require 'eac_ruby_utils/console/docopt_runner'
3
+ require 'eac_ruby_base0/core_ext'
5
4
 
6
5
  module Avm
7
6
  module Tools
8
7
  class Runner
9
- class LocalProject
8
+ class AppSrc
10
9
  class Ruby
11
- class Bundler < ::EacRubyUtils::Console::DocoptRunner
12
- class GemfileLock < ::EacRubyUtils::Console::DocoptRunner
13
- include ::EacCli::DefaultRunner
14
-
15
- runner_definition do
10
+ class Bundler
11
+ class GemfileLock
12
+ runner_with :help do
16
13
  desc 'Manipulage a "Gemfile.lock" file.'
17
14
  bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
18
15
  bool_opt '-i', '--install', 'Run "bundle install".'
@@ -34,7 +31,7 @@ module Avm
34
31
  private
35
32
 
36
33
  def complete?
37
- !option_or_all?('--recursive') || !conflict?
34
+ !option_or_all?(:recursive) || !conflict?
38
35
  end
39
36
 
40
37
  def rebasing?
@@ -51,21 +48,21 @@ module Avm
51
48
  end
52
49
 
53
50
  def bundle_install
54
- return unless check_capability(__method__, :ruby_gem, '--install')
51
+ return unless check_capability(__method__, :ruby_gem, :install)
55
52
 
56
53
  infom '"bundle install"...'
57
54
  bundle_run('install')
58
55
  end
59
56
 
60
57
  def bundle_update
61
- return unless check_capability(__method__, :ruby_gem, '--update')
58
+ return unless check_capability(__method__, :ruby_gem, :update)
62
59
 
63
60
  infom '"bundle update"...'
64
61
  bundle_run('update')
65
62
  end
66
63
 
67
64
  def git_continue
68
- return unless check_capability(__method__, :git_repo, '--continue')
65
+ return unless check_capability(__method__, :git_repo, :continue)
69
66
 
70
67
  infom "Adding \"#{gemfile_lock}\"..."
71
68
  instance.git_repo.command('add', gemfile_lock).execute!
@@ -115,11 +112,11 @@ module Avm
115
112
  end
116
113
 
117
114
  def option_or_all?(option)
118
- options.fetch(option) || options.fetch('--all')
115
+ parsed[option] || parsed.all?
119
116
  end
120
117
 
121
118
  def instance
122
- context(:instance)
119
+ runner_context.call(:instance)
123
120
  end
124
121
 
125
122
  def check_capability(caller, capability, option)