avm-tools 0.104.0 → 0.108.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/instances/entry.rb +3 -3
- data/lib/avm/launcher/context/instance_collector.rb +46 -0
- data/lib/avm/launcher/instances/runner_helper.rb +21 -15
- data/lib/avm/launcher/paths/logical.rb +5 -0
- data/lib/avm/patches/eac_ruby_gems_utils/gem.rb +2 -2
- data/lib/avm/ruby/rubocop/_configured.rb +2 -2
- data/lib/avm/tools/app_src.rb +68 -0
- data/lib/avm/tools/runner/app_src/info.rb +16 -2
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb +62 -0
- data/lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb +11 -41
- data/lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb +2 -4
- data/lib/avm/tools/runner/app_src.rb +2 -2
- data/lib/avm/tools/runner/config/load_path.rb +10 -5
- data/lib/avm/tools/runner/git/deploy.rb +2 -2
- data/lib/avm/tools/runner/launcher/instances.rb +7 -5
- data/lib/avm/tools/runner/launcher/projects.rb +2 -4
- data/lib/avm/tools/runner/launcher/publish.rb +2 -6
- data/lib/avm/tools/runner.rb +0 -4
- data/lib/avm/tools/version.rb +1 -1
- data/vendor/avm/avm.gemspec +3 -0
- data/{lib → vendor/avm/lib}/avm/data/instance/files_unit.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/instance/package.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/instance/unit.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/instance.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/package/dump.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/package/load.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/package.rb +0 -0
- data/{lib → vendor/avm/lib}/avm/data/unit.rb +0 -0
- data/vendor/avm/lib/avm/files/formatter/formats/base.rb +2 -2
- data/vendor/avm/lib/avm/files/formatter/formats/javascript.rb +1 -0
- data/vendor/avm/lib/avm/files/formatter/formats/php.rb +1 -0
- data/vendor/avm/lib/avm/files/formatter/formats/python.rb +1 -0
- data/vendor/avm/lib/avm/files/formatter/formats/xml.rb +1 -0
- data/vendor/avm/lib/avm/files/formatter/utf8_assert.rb +3 -1
- data/vendor/avm/lib/avm/git/issue/complete/test.rb +2 -2
- data/vendor/avm/lib/avm/git/revision_test.rb +2 -3
- data/vendor/avm/lib/avm/jobs/base.rb +62 -0
- data/vendor/avm/lib/avm/jobs/variables_source.rb +22 -0
- data/vendor/{avm-apps/lib/avm/apps.rb → avm/lib/avm/jobs.rb} +1 -1
- data/{lib → vendor/avm/lib}/avm/path_string.rb +0 -0
- data/vendor/avm/lib/avm/sources/base.rb +45 -0
- data/vendor/avm/lib/avm/sources/configuration/_locale.rb +16 -0
- data/vendor/avm/lib/avm/sources/configuration/_rubocop.rb +24 -0
- data/vendor/avm/lib/avm/sources/configuration/_tests.rb +27 -0
- data/vendor/avm/lib/avm/sources/configuration.rb +55 -0
- data/{lib/avm/eac_asciidoctor_base0.rb → vendor/avm/lib/avm/sources.rb} +1 -1
- data/{lib → vendor/avm/lib}/avm/sync.rb +0 -0
- data/vendor/avm/lib/avm/version.rb +1 -1
- data/vendor/avm/spec/lib/avm/git/auto_commit_path_spec.rb +4 -3
- data/vendor/avm/spec/lib/avm/git/commit/diff_tree_line_spec.rb +0 -1
- data/vendor/avm/spec/rubocop_spec.rb +1 -1
- data/vendor/avm/spec/spec_helper.rb +2 -17
- data/vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
- data/vendor/avm-eac_asciidoctor_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_asciidoctor_base0/spec/spec_helper.rb +2 -100
- data/vendor/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/vendor/avm-eac_rails_base1/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_rails_base1/spec/spec_helper.rb +2 -100
- data/vendor/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +3 -1
- data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/core_update.rb +3 -2
- data/vendor/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
- data/vendor/avm-eac_redmine_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_redmine_base0/spec/spec_helper.rb +2 -100
- data/vendor/avm-eac_redmine_base0/template/avm/eac_redmine_base0/deploy/config/install.sh.template +1 -0
- data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +2 -2
- data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_path.rb +2 -2
- data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/deploy.rb +2 -2
- data/vendor/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/vendor/avm-eac_webapp_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/avm-eac_webapp_base0/spec/spec_helper.rb +2 -100
- data/vendor/eac_cli/eac_cli.gemspec +3 -3
- data/vendor/eac_cli/lib/eac_cli/config.rb +6 -3
- data/vendor/eac_cli/lib/eac_cli/definition/argument_option.rb +1 -1
- data/vendor/eac_cli/lib/eac_cli/definition/base_option.rb +9 -1
- data/vendor/eac_cli/lib/eac_cli/definition/boolean_option.rb +6 -0
- data/vendor/eac_cli/lib/eac_cli/runner_with/help/builder.rb +3 -3
- data/vendor/eac_cli/lib/eac_cli/version.rb +1 -1
- data/vendor/eac_cli/spec/lib/eac_cli/runner_spec.rb +6 -5
- data/vendor/eac_cli/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_cli/spec/spec_helper.rb +2 -101
- data/vendor/eac_config/eac_config.gemspec +2 -2
- data/vendor/eac_config/lib/eac_config/version.rb +1 -1
- data/vendor/eac_config/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_config/spec/spec_helper.rb +2 -15
- data/vendor/eac_docker/eac_docker.gemspec +2 -2
- data/vendor/eac_docker/lib/eac_docker/container.rb +7 -3
- data/vendor/eac_docker/lib/eac_docker/images/templatized.rb +4 -0
- data/vendor/eac_docker/lib/eac_docker/rspec/setup.rb +17 -0
- data/vendor/eac_docker/lib/eac_docker/rspec.rb +2 -10
- data/vendor/eac_docker/lib/eac_docker/version.rb +1 -1
- data/vendor/eac_docker/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_docker/spec/spec_helper.rb +2 -104
- data/vendor/{avm-apps → eac_fs}/Gemfile +0 -0
- data/vendor/eac_fs/eac_fs.gemspec +20 -0
- data/vendor/{eac_ruby_utils/lib/eac_ruby_utils/filesystem_cache.rb → eac_fs/lib/eac_fs/cache.rb} +7 -2
- data/{lib/avm → vendor/eac_fs/lib/eac_fs}/cached_download.rb +4 -4
- data/vendor/eac_fs/lib/eac_fs/file_info.rb +29 -0
- data/vendor/eac_fs/lib/eac_fs/patches/module/fs_cache.rb +10 -0
- data/vendor/eac_fs/lib/eac_fs/patches/module.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches/object/fs_cache.rb +15 -0
- data/vendor/eac_fs/lib/eac_fs/patches/object.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches/pathname/info.rb +12 -0
- data/vendor/eac_fs/lib/eac_fs/patches/pathname.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/patches.rb +4 -0
- data/vendor/eac_fs/lib/eac_fs/version.rb +5 -0
- data/vendor/eac_fs/lib/eac_fs.rb +7 -0
- data/vendor/{eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb → eac_fs/spec/lib/eac_fs/cache_spec.rb} +2 -2
- data/vendor/eac_fs/spec/rubocop_spec.rb +3 -0
- data/vendor/eac_fs/spec/spec_helper.rb +4 -0
- data/vendor/eac_git/eac_git.gemspec +3 -3
- data/vendor/eac_git/lib/eac_git/local/commit/archive.rb +1 -1
- data/vendor/eac_git/lib/eac_git/local/commit.rb +3 -3
- data/vendor/eac_git/lib/eac_git/local.rb +13 -0
- data/vendor/eac_git/lib/eac_git/rspec/setup.rb +23 -0
- data/vendor/eac_git/lib/eac_git/rspec.rb +1 -14
- data/vendor/eac_git/lib/eac_git/version.rb +1 -1
- data/vendor/eac_git/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_git/spec/spec_helper.rb +2 -104
- data/vendor/eac_ruby_base0/eac_ruby_base0.gemspec +5 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/application.rb +4 -4
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/core_ext.rb +1 -0
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/runner.rb +16 -7
- data/vendor/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/vendor/eac_ruby_base0/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_ruby_base0/spec/spec_helper.rb +2 -101
- data/vendor/eac_ruby_gems_utils/eac_ruby_gems_utils.gemspec +2 -2
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/tests/base.rb +0 -5
- data/vendor/eac_ruby_gems_utils/lib/eac_ruby_gems_utils/version.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/code/rubocop_check_spec.rb +1 -1
- data/vendor/eac_ruby_gems_utils/spec/spec_helper.rb +2 -101
- data/vendor/eac_ruby_utils/eac_ruby_utils.gemspec +1 -1
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/envs/executable.rb +15 -3
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry/gem.rb +75 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +35 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb +20 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb +16 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/recursive_builder.rb +51 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/default_setup.rb +20 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup/conditionals.rb +17 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup.rb +12 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/setup_manager.rb +49 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb +70 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb +20 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb +34 -0
- data/vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb +65 -0
- data/vendor/eac_ruby_utils/spec/rubocop_check_spec.rb +1 -1
- data/vendor/eac_ruby_utils/spec/spec_helper.rb +6 -6
- data/vendor/eac_templates/lib/eac_templates/patches/module/erb_template.rb +9 -0
- data/vendor/eac_templates/lib/eac_templates/patches/module.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/patches/object/erb_template.rb +9 -0
- data/vendor/eac_templates/lib/eac_templates/patches/object.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/patches.rb +4 -0
- data/vendor/eac_templates/lib/eac_templates/version.rb +1 -1
- data/vendor/eac_templates/spec/rubocop_spec.rb +1 -1
- data/vendor/eac_templates/spec/spec_helper.rb +2 -100
- metadata +72 -198
- data/lib/avm/app_src.rb +0 -61
- data/lib/avm/fs_cache.rb +0 -11
- data/lib/avm/patches/object/fs_cache.rb +0 -16
- data/vendor/avm/lib/avm/files/info.rb +0 -24
- data/vendor/avm-apps/avm-apps.gemspec +0 -18
- data/vendor/avm-apps/lib/avm/apps/config.rb +0 -19
- data/vendor/avm-apps/lib/avm/apps/jobs/base.rb +0 -64
- data/vendor/avm-apps/lib/avm/apps/jobs/variables_source.rb +0 -24
- data/vendor/avm-apps/lib/avm/apps/jobs.rb +0 -11
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_locale.rb +0 -18
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_rubocop.rb +0 -26
- data/vendor/avm-apps/lib/avm/apps/sources/configuration/_tests.rb +0 -29
- data/vendor/avm-apps/lib/avm/apps/sources/configuration.rb +0 -57
- data/vendor/avm-apps/lib/avm/apps/version.rb +0 -7
- data/vendor/avm-apps/spec/rubocop_spec.rb +0 -3
- data/vendor/avm-apps/spec/spec_helper.rb +0 -103
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +0 -12
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/conditional.rb +0 -35
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/rspec/stubbed_ssh.rb +0 -44
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_fs/file_info'
|
4
4
|
require 'ostruct'
|
5
5
|
|
6
6
|
module Avm
|
@@ -50,7 +50,7 @@ module Avm
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def match_by_type?(file)
|
53
|
-
info = ::
|
53
|
+
info = ::EacFs::FileInfo.new(file)
|
54
54
|
return unless info.content_type.type == 'text'
|
55
55
|
|
56
56
|
valid_types.include?(info.content_type.subtype)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'eac_fs/file_info'
|
4
|
+
|
3
5
|
module Avm
|
4
6
|
module Files
|
5
7
|
class Formatter
|
@@ -37,7 +39,7 @@ module Avm
|
|
37
39
|
private
|
38
40
|
|
39
41
|
def original_info_uncached
|
40
|
-
::
|
42
|
+
::EacFs::FileInfo.new(path)
|
41
43
|
end
|
42
44
|
|
43
45
|
def original_charset_uncached
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/sources/configuration'
|
4
4
|
require 'avm/result'
|
5
5
|
require 'eac_ruby_utils/fs/temp'
|
6
6
|
|
@@ -36,7 +36,7 @@ module Avm
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def configuration_uncached
|
39
|
-
::Avm::
|
39
|
+
::Avm::Sources::Configuration.find_by_path(@git)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
end
|
@@ -1,6 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/fs_cache'
|
4
3
|
require 'eac_ruby_utils/core_ext'
|
5
4
|
require 'eac_ruby_utils/ruby'
|
6
5
|
|
@@ -53,8 +52,8 @@ module Avm
|
|
53
52
|
end
|
54
53
|
|
55
54
|
def root_cache
|
56
|
-
|
57
|
-
|
55
|
+
fs_cache.child(git_absolute_path.parameterize, sha1,
|
56
|
+
options.fetch(:test_command).to_s.parameterize)
|
58
57
|
end
|
59
58
|
|
60
59
|
def run_test
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/jobs/variables_source'
|
4
|
+
require 'eac_cli/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Jobs
|
8
|
+
module Base
|
9
|
+
common_concern do
|
10
|
+
include ::ActiveSupport::Callbacks
|
11
|
+
|
12
|
+
enable_speaker
|
13
|
+
enable_simple_cache
|
14
|
+
enable_listable
|
15
|
+
common_constructor :instance, :options, default: [{}] do
|
16
|
+
if option_list.present?
|
17
|
+
self.options = option_list.hash_keys_validate!(options.symbolize_keys)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
define_callbacks(*jobs)
|
21
|
+
end
|
22
|
+
|
23
|
+
module ClassMethods
|
24
|
+
def jobs
|
25
|
+
const_get('JOBS').dup
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
module InstanceMethods
|
30
|
+
def option_list
|
31
|
+
nil
|
32
|
+
end
|
33
|
+
|
34
|
+
def run
|
35
|
+
start_banner if respond_to?(:start_banner)
|
36
|
+
run_jobs
|
37
|
+
::Avm::Result.success('Done!')
|
38
|
+
rescue ::Avm::Result::Error => e
|
39
|
+
e.to_result
|
40
|
+
end
|
41
|
+
|
42
|
+
def variables_source
|
43
|
+
::Avm::Jobs::VariablesSource.new(self, instance)
|
44
|
+
end
|
45
|
+
|
46
|
+
protected
|
47
|
+
|
48
|
+
def run_jobs
|
49
|
+
jobs.each do |job|
|
50
|
+
run_callbacks job do
|
51
|
+
send(job)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def jobs
|
57
|
+
self.class.jobs
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Jobs
|
7
|
+
class VariablesSource
|
8
|
+
common_constructor :job, :instance
|
9
|
+
|
10
|
+
def read_entry(path, options = {})
|
11
|
+
entry_from_job(path) || instance.read_entry(path, options)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def entry_from_job(path)
|
17
|
+
method = path.gsub('.', '_').underscore
|
18
|
+
return job.send(method) if job.respond_to?(method, true)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
File without changes
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_git'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Sources
|
8
|
+
class Base
|
9
|
+
enable_simple_cache
|
10
|
+
enable_listable
|
11
|
+
lists.add_symbol :option, :parent
|
12
|
+
common_constructor :path, :options, default: [{}] do
|
13
|
+
self.path = path.to_pathname
|
14
|
+
self.options = self.class.lists.option.hash_keys_validate!(options)
|
15
|
+
end
|
16
|
+
|
17
|
+
delegate :to_s, to: :path
|
18
|
+
|
19
|
+
# @return [Avm::Sources::Base]
|
20
|
+
def parent
|
21
|
+
options[OPTION_PARENT]
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [Pathname]
|
25
|
+
def relative_path
|
26
|
+
return path if parent.blank?
|
27
|
+
|
28
|
+
path.relative_path_from(parent.path)
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Enumerable<Avm::Sources::Base>]
|
32
|
+
def subs
|
33
|
+
git_repo.subrepos
|
34
|
+
.map { |subrepo| self.class.new(subrepo.subpath.expand_path(path), parent: self) }
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
# @return [EacGit::Local]
|
40
|
+
def git_repo_uncached
|
41
|
+
::EacGit::Local.new(path)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/patches/eac_ruby_gems_utils/gem'
|
4
|
+
require 'i18n'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Sources
|
8
|
+
class Configuration < ::EacConfig::OldConfigs
|
9
|
+
LOCALE_KEY = :locale
|
10
|
+
|
11
|
+
def locale
|
12
|
+
read_entry(LOCALE_KEY) || ::I18n.default_locale
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avm
|
4
|
+
module Sources
|
5
|
+
class Configuration < ::EacConfig::OldConfigs
|
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 if gemfile_path.blank?
|
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,27 @@
|
|
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
|
+
BUNDLE_TEST_COMMAND_KEY = 'test.bundle_command'
|
9
|
+
TEST_COMMAND_KEY = 'test.command'
|
10
|
+
|
11
|
+
def any_test_command
|
12
|
+
bundle_test_command || test_command
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_command
|
16
|
+
read_command(TEST_COMMAND_KEY)
|
17
|
+
end
|
18
|
+
|
19
|
+
def bundle_test_command
|
20
|
+
read_entry(BUNDLE_TEST_COMMAND_KEY).if_present do |v|
|
21
|
+
args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
|
22
|
+
::EacRubyGemsUtils::Gem.new(::File.dirname(storage_path)).bundle(*args).chdir_root
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/old_configs'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Sources
|
9
|
+
class Configuration < ::EacConfig::OldConfigs
|
10
|
+
require_sub __FILE__
|
11
|
+
|
12
|
+
FILENAMES = %w[.avm.yml .avm.yaml].freeze
|
13
|
+
|
14
|
+
class << self
|
15
|
+
def find_by_path(path)
|
16
|
+
path = ::Pathname.new(path.to_s) unless path.is_a?(::Pathname)
|
17
|
+
internal_find_path(path.expand_path)
|
18
|
+
end
|
19
|
+
|
20
|
+
def find_in_path(path)
|
21
|
+
absolute_pathname = path.to_pathname.expand_path
|
22
|
+
if absolute_pathname.directory?
|
23
|
+
FILENAMES.each do |filename|
|
24
|
+
file = absolute_pathname.join(filename)
|
25
|
+
return new(file) if file.exist?
|
26
|
+
end
|
27
|
+
end
|
28
|
+
nil
|
29
|
+
end
|
30
|
+
|
31
|
+
private
|
32
|
+
|
33
|
+
def internal_find_path(absolute_pathname)
|
34
|
+
r = find_in_path(absolute_pathname)
|
35
|
+
return r if r.present?
|
36
|
+
|
37
|
+
internal_find_path(absolute_pathname.dirname) unless absolute_pathname.root?
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def initialize(path)
|
42
|
+
super(nil, storage_path: path)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Utility to read a configuration as a [EacRubyUtils::Envs::Command].
|
46
|
+
# @return [EacRubyUtils::Envs::Command]
|
47
|
+
def read_command(key)
|
48
|
+
read_entry(key).if_present do |v|
|
49
|
+
args = v.is_a?(::Enumerable) ? v.map(&:to_s) : ::Shellwords.split(v)
|
50
|
+
::EacRubyUtils::Envs.local.command(args).chdir(::File.dirname(storage_path))
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
File without changes
|
@@ -9,9 +9,10 @@ RSpec.describe ::Avm::Git::AutoCommitPath, git: true do
|
|
9
9
|
{
|
10
10
|
'app/models/mynamespace/the_class.rb' => 'Mynamespace::TheClass',
|
11
11
|
'lib/ruby/lib/cliutils/eac_redmine_base0/activity.rb' => 'Cliutils::EacRedmineBase0::Activity'
|
12
|
-
}.each do |
|
13
|
-
context "when path is \"#{
|
14
|
-
let(:
|
12
|
+
}.each do |relative_path, expected_class_name|
|
13
|
+
context "when path is \"#{relative_path}\"" do
|
14
|
+
let(:path) { git.root_path.join(relative_path) }
|
15
|
+
let(:instance) { described_class.new(git, path) }
|
15
16
|
|
16
17
|
it { expect(instance.class_name).to eq(expected_class_name) }
|
17
18
|
end
|
@@ -1,19 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
6
|
-
end
|
7
|
-
|
8
|
-
config.mock_with :rspec do |mocks|
|
9
|
-
mocks.verify_partial_doubles = true
|
10
|
-
end
|
11
|
-
|
12
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
13
|
-
|
14
|
-
require 'eac_ruby_gem_support/rspec'
|
15
|
-
::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__))
|
16
|
-
end
|
17
|
-
|
18
|
-
require 'eac_git/rspec'
|
19
|
-
::EacGit::Rspec.configure
|
3
|
+
require 'eac_ruby_utils/rspec/default_setup'
|
4
|
+
::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
|
@@ -1,102 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
6
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
7
|
-
# files.
|
8
|
-
#
|
9
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
10
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
11
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
12
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
13
|
-
# a separate helper file that requires the additional dependencies and performs
|
14
|
-
# the additional setup, and require it from the spec files that actually need
|
15
|
-
# it.
|
16
|
-
#
|
17
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
18
|
-
RSpec.configure do |config|
|
19
|
-
# rspec-expectations config goes here. You can use an alternate
|
20
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
21
|
-
# assertions if you prefer.
|
22
|
-
config.expect_with :rspec do |expectations|
|
23
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
24
|
-
# and `failure_message` of custom matchers include text for helper methods
|
25
|
-
# defined using `chain`, e.g.:
|
26
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
27
|
-
# # => "be bigger than 2 and smaller than 4"
|
28
|
-
# ...rather than:
|
29
|
-
# # => "be bigger than 2"
|
30
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
31
|
-
end
|
32
|
-
|
33
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
34
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
35
|
-
config.mock_with :rspec do |mocks|
|
36
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
37
|
-
# a real object. This is generally recommended, and will default to
|
38
|
-
# `true` in RSpec 4.
|
39
|
-
mocks.verify_partial_doubles = true
|
40
|
-
end
|
41
|
-
|
42
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
43
|
-
# have no way to turn it off -- the option exists only for backwards
|
44
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
45
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
46
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
47
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
48
|
-
|
49
|
-
# The settings below are suggested to provide a good initial experience
|
50
|
-
# with RSpec, but feel free to customize to your heart's content.
|
51
|
-
# # This allows you to limit a spec run to individual examples or groups
|
52
|
-
# # you care about by tagging them with `:focus` metadata. When nothing
|
53
|
-
# # is tagged with `:focus`, all examples get run. RSpec also provides
|
54
|
-
# # aliases for `it`, `describe`, and `context` that include `:focus`
|
55
|
-
# # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
56
|
-
# config.filter_run_when_matching :focus
|
57
|
-
#
|
58
|
-
# # Allows RSpec to persist some state between runs in order to support
|
59
|
-
# # the `--only-failures` and `--next-failure` CLI options. We recommend
|
60
|
-
# # you configure your source control system to ignore this file.
|
61
|
-
# config.example_status_persistence_file_path = "spec/examples.txt"
|
62
|
-
#
|
63
|
-
# # Limits the available syntax to the non-monkey patched syntax that is
|
64
|
-
# # recommended. For more details, see:
|
65
|
-
# # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
66
|
-
# # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
67
|
-
# # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
68
|
-
# config.disable_monkey_patching!
|
69
|
-
#
|
70
|
-
# # This setting enables warnings. It's recommended, but in some cases may
|
71
|
-
# # be too noisy due to issues in dependencies.
|
72
|
-
# config.warnings = true
|
73
|
-
#
|
74
|
-
# # Many RSpec users commonly either run the entire suite or an individual
|
75
|
-
# # file, and it's useful to allow more verbose output when running an
|
76
|
-
# # individual spec file.
|
77
|
-
# if config.files_to_run.one?
|
78
|
-
# # Use the documentation formatter for detailed output,
|
79
|
-
# # unless a formatter has already been configured
|
80
|
-
# # (e.g. via a command-line flag).
|
81
|
-
# config.default_formatter = "doc"
|
82
|
-
# end
|
83
|
-
#
|
84
|
-
# # Print the 10 slowest examples and example groups at the
|
85
|
-
# # end of the spec run, to help surface which specs are running
|
86
|
-
# # particularly slow.
|
87
|
-
# config.profile_examples = 10
|
88
|
-
#
|
89
|
-
# # Run specs in random order to surface order dependencies. If you find an
|
90
|
-
# # order dependency and want to debug it, you can fix the order by providing
|
91
|
-
# # the seed, which is printed after each run.
|
92
|
-
# # --seed 1234
|
93
|
-
# config.order = :random
|
94
|
-
#
|
95
|
-
# # Seed global randomization in this process using the `--seed` CLI option.
|
96
|
-
# # Setting this allows you to use `--seed` to deterministically reproduce
|
97
|
-
# # test failures related to randomization by passing the same `--seed` value
|
98
|
-
# # as the one that triggered the failure.
|
99
|
-
# Kernel.srand config.seed
|
100
|
-
require 'eac_ruby_gem_support/rspec'
|
101
|
-
::EacRubyGemSupport::Rspec.setup(::File.expand_path('..', __dir__))
|
102
|
-
end
|
3
|
+
require 'eac_ruby_utils/rspec/default_setup'
|
4
|
+
::EacRubyUtils::Rspec.default_setup_create(::File.expand_path('..', __dir__))
|