avm-eac_ruby_base1 0.7.0 → 0.8.2
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 +21 -14
- 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 +5 -2
- data/lib/avm/eac_ruby_base1/sources/update.rb +2 -6
- data/lib/avm/eac_ruby_base1/version.rb +1 -1
- metadata +20 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0106962ca818581f0dd82ee82c353a5fa57d5efaf6fdcce4720aa03338e284a6'
|
4
|
+
data.tar.gz: a8dbc993d011d675dd6b4de97a327027baabff052a7096a61066bcec9c1475db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e27dbf4568f773771d731751c3de489fb071c6132ba723de8f7cb9df8c57c05506a6aefff8caf81bb17a6d42446574bc8b76af0c065b391872acbd307f019d99
|
7
|
+
data.tar.gz: '0603932ec1dd377e0074a01725a72a724c67fdcc88c83459328f2c7abb975f7521ea12e730859f5862412d236afcecac13873a768bcdbd8d4e428e03a24184de'
|
@@ -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,14 +13,17 @@ 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
|
-
|
19
|
-
|
20
|
-
|
17
|
+
# To-do: dismiss this method at Avm::EacRailsBase1::Instance and remove.
|
18
|
+
# @return [EacRubyUtils::Envs::BaseEnv]
|
19
|
+
attr_reader :env
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
# To-do: dismiss this method at Avm::EacRailsBase1::Instance and remove.
|
22
|
+
# @return [Avm::EacRubyBase1::Sources::Base]
|
23
|
+
def env_set(env)
|
24
|
+
@env = env
|
25
|
+
|
26
|
+
self
|
24
27
|
end
|
25
28
|
|
26
29
|
def valid?
|
@@ -32,22 +35,26 @@ module Avm
|
|
32
35
|
Avm::EacRubyBase1::Sources::Tester
|
33
36
|
end
|
34
37
|
|
35
|
-
# @return [EacRubyGemsUtils::Gem]
|
36
|
-
def the_gem
|
37
|
-
@the_gem ||= ::EacRubyGemsUtils::Gem.new(path)
|
38
|
-
end
|
39
|
-
|
40
38
|
def update
|
41
39
|
::Avm::EacRubyBase1::Sources::Update.new(self)
|
42
40
|
end
|
43
41
|
|
44
42
|
# @return [Avm::VersionNumber]
|
45
43
|
def version
|
46
|
-
|
44
|
+
version_file.value.if_present { |v| ::Avm::VersionNumber.new(v) }
|
47
45
|
end
|
48
46
|
|
49
47
|
def version=(value)
|
50
|
-
|
48
|
+
version_file.value = value
|
49
|
+
end
|
50
|
+
|
51
|
+
# @return [Avm::EacRubyBase1::Rubygems::VersionFile]
|
52
|
+
def version_file
|
53
|
+
::Avm::EacRubyBase1::Rubygems::VersionFile.new(version_file_path)
|
54
|
+
end
|
55
|
+
|
56
|
+
def version_file_path
|
57
|
+
path.join('lib', *gem_namespace_parts, 'version.rb')
|
51
58
|
end
|
52
59
|
end
|
53
60
|
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,13 +30,14 @@ 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
|
36
39
|
source_update.i18n_translate(__method__, __locale: source.locale,
|
37
|
-
name: ruby_gem.
|
40
|
+
name: ruby_gem.gem_name,
|
38
41
|
version: ruby_gem.version)
|
39
42
|
end
|
40
43
|
|
@@ -15,9 +15,9 @@ module Avm
|
|
15
15
|
|
16
16
|
def bundle_update
|
17
17
|
infom 'Running "bundle update"...'
|
18
|
-
|
18
|
+
source.bundle('update').execute!
|
19
19
|
infom 'Running "bundle install"...'
|
20
|
-
|
20
|
+
source.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.2
|
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-06
|
11
|
+
date: 2022-07-06 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.23'
|
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.23'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: avm-eac_generic_base0
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -39,39 +39,25 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: eac_ruby_utils
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.95'
|
48
48
|
- - ">="
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: 0.
|
50
|
+
version: 0.95.1
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: '0.
|
57
|
+
version: '0.95'
|
58
58
|
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 0.
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: eac_ruby_utils
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '0.80'
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0.80'
|
60
|
+
version: 0.95.1
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: aranha-parsers
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,15 +115,26 @@ files:
|
|
129
115
|
- lib/avm/eac_ruby_base1/rubocop/configured.rb
|
130
116
|
- lib/avm/eac_ruby_base1/rubocop/envvar.rb
|
131
117
|
- lib/avm/eac_ruby_base1/rubocop/gemfile.rb
|
118
|
+
- lib/avm/eac_ruby_base1/rubygems.rb
|
119
|
+
- lib/avm/eac_ruby_base1/rubygems/version_file.rb
|
132
120
|
- lib/avm/eac_ruby_base1/sources.rb
|
133
121
|
- lib/avm/eac_ruby_base1/sources/base.rb
|
134
122
|
- lib/avm/eac_ruby_base1/sources/base/bundle_command.rb
|
135
123
|
- lib/avm/eac_ruby_base1/sources/base/bundler.rb
|
124
|
+
- lib/avm/eac_ruby_base1/sources/base/rake.rb
|
125
|
+
- lib/avm/eac_ruby_base1/sources/base/rubygems.rb
|
136
126
|
- lib/avm/eac_ruby_base1/sources/base/version_bump.rb
|
137
127
|
- lib/avm/eac_ruby_base1/sources/runners.rb
|
138
128
|
- lib/avm/eac_ruby_base1/sources/runners/bundler.rb
|
139
129
|
- lib/avm/eac_ruby_base1/sources/runners/bundler/incompatible.rb
|
140
130
|
- lib/avm/eac_ruby_base1/sources/tester.rb
|
131
|
+
- lib/avm/eac_ruby_base1/sources/tests.rb
|
132
|
+
- lib/avm/eac_ruby_base1/sources/tests/base.rb
|
133
|
+
- lib/avm/eac_ruby_base1/sources/tests/minitest.rb
|
134
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple.rb
|
135
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple/decorated_gem.rb
|
136
|
+
- lib/avm/eac_ruby_base1/sources/tests/multiple/result.rb
|
137
|
+
- lib/avm/eac_ruby_base1/sources/tests/rspec.rb
|
141
138
|
- lib/avm/eac_ruby_base1/sources/update.rb
|
142
139
|
- lib/avm/eac_ruby_base1/sources/update/sub_update.rb
|
143
140
|
- lib/avm/eac_ruby_base1/version.rb
|