avm-eac_ruby_base1 0.7.0 → 0.8.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/eac_ruby_base1/rubocop/gemfile.rb +4 -4
- data/lib/avm/eac_ruby_base1/rubygems/version_file.rb +43 -0
- data/lib/avm/eac_ruby_base1/rubygems.rb +11 -0
- data/lib/avm/eac_ruby_base1/sources/base/bundler.rb +14 -0
- data/lib/avm/eac_ruby_base1/sources/base/rake.rb +28 -0
- data/lib/avm/eac_ruby_base1/sources/base/rubygems.rb +43 -0
- data/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +2 -2
- data/lib/avm/eac_ruby_base1/sources/base.rb +17 -9
- data/lib/avm/eac_ruby_base1/sources/tester.rb +7 -9
- data/lib/avm/eac_ruby_base1/sources/tests/base.rb +59 -0
- data/lib/avm/eac_ruby_base1/sources/tests/minitest.rb +29 -0
- data/lib/avm/eac_ruby_base1/sources/tests/multiple/decorated_gem.rb +52 -0
- data/lib/avm/eac_ruby_base1/sources/tests/multiple/result.rb +29 -0
- data/lib/avm/eac_ruby_base1/sources/tests/multiple.rb +90 -0
- data/lib/avm/eac_ruby_base1/sources/tests/rspec.rb +25 -0
- data/lib/avm/eac_ruby_base1/sources/tests.rb +13 -0
- data/lib/avm/eac_ruby_base1/sources/update/sub_update.rb +4 -1
- data/lib/avm/eac_ruby_base1/sources/update.rb +2 -6
- data/lib/avm/eac_ruby_base1/version.rb +1 -1
- metadata +15 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 223dec7a0d27cbeaf67bec41ef954eac18910558dd8f486b32fc4ec222ed55c2
|
4
|
+
data.tar.gz: a5db9261c9655be977e05d6c79efce6433433495d6d90d5c276a99d1adb031ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b51af1af7eeab59c22a42e7d2596c47e30f6ae08519774fead23543519a4f8aa170f27f0f9bbd8845f858e55f6b92f6264685c57abd584cabef82787dde6528e
|
7
|
+
data.tar.gz: 1f0fe91f0a19f5caf0dd7b9c9cba4f27633cd8abcd64a40dcff9ddcb6c32718442a88eb7b00207ebb18af085bf2915a7bf596f5706459b08b5d2daa668bc0a89
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
4
|
require 'eac_ruby_utils/core_ext'
|
5
5
|
|
6
6
|
module Avm
|
@@ -10,11 +10,11 @@ module Avm
|
|
10
10
|
def gemfile_rubocop_command
|
11
11
|
return nil unless rubocop_gemfile?
|
12
12
|
|
13
|
-
rubocop_command_by_gemfile_path(mygem.
|
13
|
+
rubocop_command_by_gemfile_path(mygem.path)
|
14
14
|
end
|
15
15
|
|
16
16
|
def rubocop_command_by_gemfile_path(path)
|
17
|
-
::
|
17
|
+
::Avm::EacRubyBase1::Sources::Base.new(path).bundle('exec', 'rubocop').chdir_root
|
18
18
|
end
|
19
19
|
|
20
20
|
def rubocop_gemfile?
|
@@ -31,7 +31,7 @@ module Avm
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def find_gem(path)
|
34
|
-
r = ::
|
34
|
+
r = ::Avm::EacRubyBase1::Sources::Base.new(path)
|
35
35
|
return r if r.gemfile_path.exist?
|
36
36
|
return find_gem(path.dirname) unless path.root?
|
37
37
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
module Rubygems
|
8
|
+
class VersionFile
|
9
|
+
common_constructor :path
|
10
|
+
|
11
|
+
VERSION_LINE_PATTERN = /\A(\s*)VERSION\s*=\s*[\'\"]([^\'\"]+)[\'\"](\s*)\z/.freeze
|
12
|
+
|
13
|
+
def value
|
14
|
+
path.read.each_line.lazy.map { |line| line_value(line) }.find { |v| v }
|
15
|
+
end
|
16
|
+
|
17
|
+
def value=(new_value)
|
18
|
+
path.write(new_value_content(new_value))
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return Version found in line, nil otherwise.
|
24
|
+
def line_value(line)
|
25
|
+
VERSION_LINE_PATTERN.if_match(line.rstrip, false) { |m| ::Gem::Version.new(m[2]) }
|
26
|
+
end
|
27
|
+
|
28
|
+
def new_value_content(new_value)
|
29
|
+
path.read.each_line
|
30
|
+
.map { |line| new_value_line(line, new_value) }
|
31
|
+
.join
|
32
|
+
end
|
33
|
+
|
34
|
+
def new_value_line(line, new_value)
|
35
|
+
m = VERSION_LINE_PATTERN.match(line)
|
36
|
+
return line unless m
|
37
|
+
|
38
|
+
"#{m[1]}VERSION = '#{new_value}'#{m[3]}"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -28,6 +28,20 @@ module Avm
|
|
28
28
|
DEFAULT_GEMFILE_PATH
|
29
29
|
end
|
30
30
|
|
31
|
+
# @return [Bundler::LockfileParser]
|
32
|
+
def gemfile_lock_content
|
33
|
+
::Bundler::LockfileParser.new(::Bundler.read_file(gemfile_lock_path))
|
34
|
+
end
|
35
|
+
|
36
|
+
def gemfile_lock_gem_version(gem_name)
|
37
|
+
gemfile_lock_content.specs.find { |gem| gem.name == gem_name }.if_present(&:version)
|
38
|
+
end
|
39
|
+
|
40
|
+
# @return [Pathname]
|
41
|
+
def gemfile_lock_path
|
42
|
+
gemfile_path.basename_sub { |b| "#{b}.lock" }
|
43
|
+
end
|
44
|
+
|
31
45
|
# @return [Pathname]
|
32
46
|
def gemfile_path
|
33
47
|
path.join(configured_gemfile_path || default_gemfile_path)
|
@@ -0,0 +1,28 @@
|
|
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 Rake
|
11
|
+
RAKEFILE_BASENAME = 'Rakefile'
|
12
|
+
|
13
|
+
# @return [Avm::EacRubyBase1::Sources::Base::BundleCommand]
|
14
|
+
def rake(*args)
|
15
|
+
raise "File \"#{rakefile_path}\" does not exist" unless rakefile_path.exist?
|
16
|
+
|
17
|
+
bundle('exec', 'rake', '--rakefile', rakefile_path, *args)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Pathname]
|
21
|
+
def rakefile_path
|
22
|
+
path.join(RAKEFILE_BASENAME)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,43 @@
|
|
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 Rubygems
|
11
|
+
GEMSPEC_EXTNAME = '.gemspec'
|
12
|
+
|
13
|
+
def gem_name
|
14
|
+
gem_name_by_gemspec || gem_name_by_path
|
15
|
+
end
|
16
|
+
|
17
|
+
def gem_name_by_gemspec
|
18
|
+
gemspec_path.if_present { |v| v.basename(GEMSPEC_EXTNAME).to_path }
|
19
|
+
end
|
20
|
+
|
21
|
+
def gem_name_by_path
|
22
|
+
fullname = path.basename.to_s
|
23
|
+
/\A(.+)(?:-\d+(?:\.\d+)*)\z/.if_match(fullname, false) { |m| m[1] }.if_present(fullname)
|
24
|
+
end
|
25
|
+
|
26
|
+
def gem_namespace_parts
|
27
|
+
gem_name.split('-')
|
28
|
+
end
|
29
|
+
|
30
|
+
# @return [Gem::Specification]
|
31
|
+
def gemspec
|
32
|
+
::Gem::Specification.load(gemspec_path.to_path)
|
33
|
+
end
|
34
|
+
|
35
|
+
# @return [Pathname]
|
36
|
+
def gemspec_path
|
37
|
+
path.glob("*#{GEMSPEC_EXTNAME}").first
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -9,12 +9,12 @@ module Avm
|
|
9
9
|
class Base < ::Avm::EacGenericBase0::Sources::Base
|
10
10
|
module VersionBump
|
11
11
|
def after_sub_version_bump_do_changes
|
12
|
-
|
12
|
+
bundle('install').chdir_root.execute!
|
13
13
|
end
|
14
14
|
|
15
15
|
def version_bump_do_changes(target_version)
|
16
16
|
self.version = target_version
|
17
|
-
|
17
|
+
bundle('install').chdir_root.execute!
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'avm/eac_generic_base0/sources/base'
|
4
|
+
require 'avm/eac_ruby_base1/rubygems/version_file'
|
4
5
|
require 'avm/eac_ruby_base1/sources/update'
|
5
6
|
require 'avm/eac_ruby_base1/sources/tester'
|
6
7
|
require 'avm/eac_ruby_base1/sources/runners/bundler'
|
7
8
|
require 'avm/version_number'
|
8
|
-
require 'eac_ruby_gems_utils/gem'
|
9
9
|
require 'eac_ruby_utils/core_ext'
|
10
10
|
|
11
11
|
module Avm
|
@@ -13,12 +13,16 @@ module Avm
|
|
13
13
|
module Sources
|
14
14
|
class Base < ::Avm::EacGenericBase0::Sources::Base
|
15
15
|
require_sub __FILE__, include_modules: :prepend, require_dependency: true
|
16
|
-
delegate :gemspec_path, to: :the_gem
|
17
16
|
|
18
17
|
EXTRA_AVAILABLE_SUBCOMMANDS = {
|
19
18
|
'bundler' => ::Avm::EacRubyBase1::Sources::Runners::Bundler
|
20
19
|
}.freeze
|
21
20
|
|
21
|
+
# To-do: dismiss this method at Avm::EacRailsBase1::Instance and remove.
|
22
|
+
def env_set(env)
|
23
|
+
@env = env
|
24
|
+
end
|
25
|
+
|
22
26
|
def extra_available_subcommands
|
23
27
|
EXTRA_AVAILABLE_SUBCOMMANDS
|
24
28
|
end
|
@@ -32,22 +36,26 @@ module Avm
|
|
32
36
|
Avm::EacRubyBase1::Sources::Tester
|
33
37
|
end
|
34
38
|
|
35
|
-
# @return [EacRubyGemsUtils::Gem]
|
36
|
-
def the_gem
|
37
|
-
@the_gem ||= ::EacRubyGemsUtils::Gem.new(path)
|
38
|
-
end
|
39
|
-
|
40
39
|
def update
|
41
40
|
::Avm::EacRubyBase1::Sources::Update.new(self)
|
42
41
|
end
|
43
42
|
|
44
43
|
# @return [Avm::VersionNumber]
|
45
44
|
def version
|
46
|
-
|
45
|
+
version_file.value.if_present { |v| ::Avm::VersionNumber.new(v) }
|
47
46
|
end
|
48
47
|
|
49
48
|
def version=(value)
|
50
|
-
|
49
|
+
version_file.value = value
|
50
|
+
end
|
51
|
+
|
52
|
+
# @return [Avm::EacRubyBase1::Rubygems::VersionFile]
|
53
|
+
def version_file
|
54
|
+
::Avm::EacRubyBase1::Rubygems::VersionFile.new(version_file_path)
|
55
|
+
end
|
56
|
+
|
57
|
+
def version_file_path
|
58
|
+
path.join('lib', *gem_namespace_parts, 'version.rb')
|
51
59
|
end
|
52
60
|
end
|
53
61
|
end
|
@@ -9,27 +9,25 @@ module Avm
|
|
9
9
|
class Tester < ::Avm::EacGenericBase0::Sources::Tester
|
10
10
|
BUNDLE_TEST_COMMAND_CONFIGURATION_KEY = :bundle_test_command
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
# @return [EacRubyUtils::Envs::Command, nil]
|
12
|
+
# @return [Avm::EacRailsBase1::Sources::Base::BundleCommand, nil]
|
15
13
|
def test_command
|
16
14
|
bundle_test_command || super || default_test_command
|
17
15
|
end
|
18
16
|
|
19
|
-
# @return [
|
17
|
+
# @return [Avm::EacRailsBase1::Sources::Base::BundleCommand, nil]
|
20
18
|
def bundle_test_command
|
21
19
|
source.read_configuration_as_shell_words(BUNDLE_TEST_COMMAND_CONFIGURATION_KEY)
|
22
|
-
.if_present { |args|
|
20
|
+
.if_present { |args| source.bundle(*args).chdir_root }
|
23
21
|
end
|
24
22
|
|
25
|
-
# @return [
|
23
|
+
# @return [Avm::EacRailsBase1::Sources::Base::BundleCommand, nil]
|
26
24
|
def default_test_command
|
27
|
-
|
25
|
+
source.bundle('exec', 'rspec', '--fail-fast').chdir_root
|
28
26
|
end
|
29
27
|
|
30
28
|
def run_test_command
|
31
|
-
execute_command_and_log(
|
32
|
-
execute_command_and_log(
|
29
|
+
execute_command_and_log(source.bundle('install').chdir_root) ||
|
30
|
+
execute_command_and_log(source.bundle('update').chdir_root)
|
33
31
|
super
|
34
32
|
end
|
35
33
|
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
require 'eac_fs/logs'
|
5
|
+
require 'eac_ruby_utils/listable'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRubyBase1
|
9
|
+
module Sources
|
10
|
+
class Base
|
11
|
+
include ::EacRubyUtils::Listable
|
12
|
+
|
13
|
+
enable_simple_cache
|
14
|
+
lists.add_string :result, :failed, :nonexistent, :successful
|
15
|
+
|
16
|
+
common_constructor :gem
|
17
|
+
|
18
|
+
def elegible?
|
19
|
+
dependency_present? && gem.root.join(test_directory).exist?
|
20
|
+
end
|
21
|
+
|
22
|
+
def dependency_present?
|
23
|
+
gem.gemfile_path.exist? && gem.gemfile_lock_gem_version(dependency_gem).present?
|
24
|
+
end
|
25
|
+
|
26
|
+
def name
|
27
|
+
self.class.name.demodulize.gsub(/Test\z/, '')
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_s
|
31
|
+
"#{gem}[#{name}]"
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def logs_uncached
|
37
|
+
::EacFs::Logs.new.add(:stdout).add(:stderr)
|
38
|
+
end
|
39
|
+
|
40
|
+
def result_uncached
|
41
|
+
return RESULT_NONEXISTENT unless elegible?
|
42
|
+
|
43
|
+
exec_run_with_log ? RESULT_SUCCESSFUL : RESULT_FAILED
|
44
|
+
end
|
45
|
+
|
46
|
+
def exec_run
|
47
|
+
gem.bundle('exec', *bundle_exec_args).chdir_root.execute
|
48
|
+
end
|
49
|
+
|
50
|
+
def exec_run_with_log
|
51
|
+
r = exec_run
|
52
|
+
logs[:stdout].write(r[:stdout])
|
53
|
+
logs[:stderr].write(r[:stderr])
|
54
|
+
r[:exit_code].zero?
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/tests/base'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
module Sources
|
8
|
+
module Tests
|
9
|
+
class Minitest < ::Avm::EacRubyBase1::Sources::Tests::Base
|
10
|
+
def bundle_exec_args
|
11
|
+
%w[rake test]
|
12
|
+
end
|
13
|
+
|
14
|
+
def dependency_gem
|
15
|
+
'minitest'
|
16
|
+
end
|
17
|
+
|
18
|
+
def elegible?
|
19
|
+
super && gem.rakefile_path.exist?
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_directory
|
23
|
+
'test'
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
module Sources
|
8
|
+
module Tests
|
9
|
+
class Multiple
|
10
|
+
class DecoratedGem < ::SimpleDelegator
|
11
|
+
enable_speaker
|
12
|
+
|
13
|
+
def prepare
|
14
|
+
return unless gemfile_path.exist?
|
15
|
+
|
16
|
+
log('running "bundle install"...')
|
17
|
+
return if bundle('install').execute.fetch(:exit_code).zero?
|
18
|
+
|
19
|
+
unless can_remove_gemfile_lock?
|
20
|
+
raise '"bundle install" failed and the Gemfile.lock is part of gem' \
|
21
|
+
'(Should be changed by developer)'
|
22
|
+
end
|
23
|
+
|
24
|
+
prepare_with_removable_gemfile_lock
|
25
|
+
end
|
26
|
+
|
27
|
+
def tests
|
28
|
+
[::Avm::EacRubyBase1::Sources::Tests::Minitest.new(__getobj__),
|
29
|
+
::Avm::EacRubyBase1::Sources::Tests::Rspec.new(__getobj__)]
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def log(message)
|
35
|
+
infov self, message
|
36
|
+
end
|
37
|
+
|
38
|
+
def prepare_with_removable_gemfile_lock
|
39
|
+
log('"bundle install" failed, removing Gemfile.lock and trying again...')
|
40
|
+
gemfile_lock_path.unlink if gemfile_lock_path.exist?
|
41
|
+
bundle('install').execute!
|
42
|
+
end
|
43
|
+
|
44
|
+
def can_remove_gemfile_lock?
|
45
|
+
!files.include?(gemfile_lock_path.relative_path_from(root))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Avm
|
4
|
+
module EacRubyBase1
|
5
|
+
module Sources
|
6
|
+
module Tests
|
7
|
+
class Multiple
|
8
|
+
class Result
|
9
|
+
common_constructor :result
|
10
|
+
|
11
|
+
COLORS = {
|
12
|
+
::Avm::EacRubyBase1::Sources::Tests::Base::RESULT_FAILED => :red,
|
13
|
+
::Avm::EacRubyBase1::Sources::Tests::Base::RESULT_NONEXISTENT => :white,
|
14
|
+
::Avm::EacRubyBase1::Sources::Tests::Base::RESULT_SUCCESSFUL => :green
|
15
|
+
}.freeze
|
16
|
+
|
17
|
+
def tag
|
18
|
+
result.to_s.send(color)
|
19
|
+
end
|
20
|
+
|
21
|
+
def color
|
22
|
+
COLORS.fetch(result)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/tests/minitest'
|
4
|
+
require 'avm/eac_ruby_base1/sources/tests/rspec'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module EacRubyBase1
|
9
|
+
module Sources
|
10
|
+
module Tests
|
11
|
+
class Multiple
|
12
|
+
require_sub __FILE__
|
13
|
+
enable_speaker
|
14
|
+
enable_simple_cache
|
15
|
+
common_constructor :gems, :options, default: [{}]
|
16
|
+
set_callback :initialize, :after, :run
|
17
|
+
|
18
|
+
def ok?
|
19
|
+
failed_tests.none?
|
20
|
+
end
|
21
|
+
|
22
|
+
def only
|
23
|
+
options[:only]
|
24
|
+
end
|
25
|
+
|
26
|
+
private
|
27
|
+
|
28
|
+
def all_tests_uncached
|
29
|
+
decorated_gems.flat_map(&:tests)
|
30
|
+
end
|
31
|
+
|
32
|
+
def clear_logs
|
33
|
+
all_tests.each do |test|
|
34
|
+
test.logs.remove_all
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def prepare_all_gems
|
39
|
+
infom 'Preparing all gems...'
|
40
|
+
decorated_gems.each(&:prepare)
|
41
|
+
end
|
42
|
+
|
43
|
+
def decorated_gems_uncached
|
44
|
+
r = gems
|
45
|
+
r = r.select { |gem| only.include?(gem.name) } if only.present?
|
46
|
+
r.map { |gem| DecoratedGem.new(gem) }
|
47
|
+
end
|
48
|
+
|
49
|
+
def failed_tests_uncached
|
50
|
+
all_tests.select do |r|
|
51
|
+
r.result == ::Avm::EacRubyBase1::Sources::Tests::Base::RESULT_FAILED
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def final_results_banner
|
56
|
+
if failed_tests.any?
|
57
|
+
warn 'Some test did not pass:'
|
58
|
+
failed_tests.each do |test|
|
59
|
+
infov ' * Test', test
|
60
|
+
info test.logs.truncate_all
|
61
|
+
end
|
62
|
+
else
|
63
|
+
success 'All tests passed'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def run
|
68
|
+
start_banner
|
69
|
+
prepare_all_gems
|
70
|
+
test_all_gems
|
71
|
+
final_results_banner
|
72
|
+
ensure
|
73
|
+
clear_logs
|
74
|
+
end
|
75
|
+
|
76
|
+
def start_banner
|
77
|
+
infov 'Gems to test', decorated_gems.count
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_all_gems
|
81
|
+
infom 'Running tests...'
|
82
|
+
all_tests.each do |test|
|
83
|
+
infov test, Result.new(test.result).tag
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_ruby_base1/sources/tests/base'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module EacRubyBase1
|
7
|
+
module Sources
|
8
|
+
module Tests
|
9
|
+
class Rspec < ::Avm::EacRubyBase1::Sources::Tests::Base
|
10
|
+
def bundle_exec_args
|
11
|
+
%w[rspec]
|
12
|
+
end
|
13
|
+
|
14
|
+
def dependency_gem
|
15
|
+
'rspec-core'
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_directory
|
19
|
+
'spec'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'avm/eac_ruby_base1/sources/base'
|
4
|
+
|
3
5
|
module Avm
|
4
6
|
module EacRubyBase1
|
5
7
|
module Sources
|
@@ -28,8 +30,9 @@ module Avm
|
|
28
30
|
update_scm.if_present { |commit| on_scm_updated(commit) }
|
29
31
|
end
|
30
32
|
|
33
|
+
# @return [Avm::EacRubyBase1::Sources::Base]
|
31
34
|
def ruby_gem_uncached
|
32
|
-
::
|
35
|
+
::Avm::EacRubyBase1::Sources::Base.new(sub.path)
|
33
36
|
end
|
34
37
|
|
35
38
|
def no_scm_update_commit_message
|
@@ -15,9 +15,9 @@ module Avm
|
|
15
15
|
|
16
16
|
def bundle_update
|
17
17
|
infom 'Running "bundle update"...'
|
18
|
-
|
18
|
+
bundle('update').execute!
|
19
19
|
infom 'Running "bundle install"...'
|
20
|
-
|
20
|
+
bundle('install').execute!
|
21
21
|
end
|
22
22
|
|
23
23
|
protected
|
@@ -42,10 +42,6 @@ module Avm
|
|
42
42
|
::Avm::EacRubyBase1::Sources::Update::SubUpdate.new(self, sub)
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
46
|
-
def ruby_gem_uncached
|
47
|
-
::EacRubyGemsUtils::Gem.new(source.path)
|
48
|
-
end
|
49
45
|
end
|
50
46
|
end
|
51
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-eac_ruby_base1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Put here the authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avm
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.22'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.22'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: avm-eac_generic_base0
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,26 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.2'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: eac_ruby_gems_utils
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.9'
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 0.9.8
|
51
|
-
type: :runtime
|
52
|
-
prerelease: false
|
53
|
-
version_requirements: !ruby/object:Gem::Requirement
|
54
|
-
requirements:
|
55
|
-
- - "~>"
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: '0.9'
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 0.9.8
|
61
41
|
- !ruby/object:Gem::Dependency
|
62
42
|
name: eac_ruby_utils
|
63
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,15 +109,26 @@ files:
|
|
129
109
|
- lib/avm/eac_ruby_base1/rubocop/configured.rb
|
130
110
|
- lib/avm/eac_ruby_base1/rubocop/envvar.rb
|
131
111
|
- lib/avm/eac_ruby_base1/rubocop/gemfile.rb
|
112
|
+
- lib/avm/eac_ruby_base1/rubygems.rb
|
113
|
+
- lib/avm/eac_ruby_base1/rubygems/version_file.rb
|
132
114
|
- lib/avm/eac_ruby_base1/sources.rb
|
133
115
|
- lib/avm/eac_ruby_base1/sources/base.rb
|
134
116
|
- lib/avm/eac_ruby_base1/sources/base/bundle_command.rb
|
135
117
|
- lib/avm/eac_ruby_base1/sources/base/bundler.rb
|
118
|
+
- lib/avm/eac_ruby_base1/sources/base/rake.rb
|
119
|
+
- lib/avm/eac_ruby_base1/sources/base/rubygems.rb
|
136
120
|
- lib/avm/eac_ruby_base1/sources/base/version_bump.rb
|
137
121
|
- lib/avm/eac_ruby_base1/sources/runners.rb
|
138
122
|
- lib/avm/eac_ruby_base1/sources/runners/bundler.rb
|
139
123
|
- lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb
|
140
124
|
- lib/avm/eac_ruby_base1/sources/tester.rb
|
125
|
+
- lib/avm/eac_ruby_base1/sources/tests.rb
|
126
|
+
- lib/avm/eac_ruby_base1/sources/tests/base.rb
|
127
|
+
- lib/avm/eac_ruby_base1/sources/tests/minitest.rb
|
128
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple.rb
|
129
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple/decorated_gem.rb
|
130
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple/result.rb
|
131
|
+
- lib/avm/eac_ruby_base1/sources/tests/rspec.rb
|
141
132
|
- lib/avm/eac_ruby_base1/sources/update.rb
|
142
133
|
- lib/avm/eac_ruby_base1/sources/update/sub_update.rb
|
143
134
|
- lib/avm/eac_ruby_base1/version.rb
|