avm-tools 0.105.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- 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/version.rb +1 -1
- data/vendor/avm/lib/avm/files/formatter/utf8_assert.rb +2 -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/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_ruby_utils/lib/eac_ruby_utils/compact.rb +22 -0
- data/vendor/eac_ruby_utils/lib/eac_ruby_utils/fs_cache.rb +1 -1
- 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/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
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a71fc17b60e581ba891e58d0b47ad9b4dbae79c2085540bb1816e02011e9af9
|
4
|
+
data.tar.gz: 15387681892ce7192edd15b0e68ee801ed0fca233454b802df21f7d5e0a211a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d61dadda2108d0d2b7a37f9ec55bbcbc73e222c87f463feec8b91d8f486b3869f1652849296a9bcb7c33e58fe65f1a99f5d12fe7e71c2b1fcf58231b2f453124
|
7
|
+
data.tar.gz: 13a712ee6f75e13797fcf5107ad9b0c72f730195d4264e36ea5368635205aa68c55deb88c8055f01381342cefe48bf74d0decba9d6fe5052df6c6571622a1daf
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_base0/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Tools
|
7
|
+
class Runner
|
8
|
+
class AppSrc
|
9
|
+
class Ruby
|
10
|
+
class Bundler
|
11
|
+
class GemfileLock
|
12
|
+
module Git
|
13
|
+
private
|
14
|
+
|
15
|
+
def git_continue
|
16
|
+
return unless check_capability(__method__, :git_repo, :continue)
|
17
|
+
|
18
|
+
infom "Adding \"#{gemfile_lock}\"..."
|
19
|
+
instance.git_repo.command('add', gemfile_lock).execute!
|
20
|
+
if rebase_conflict?
|
21
|
+
git_continue_run('rebase')
|
22
|
+
elsif cherry_conflict?
|
23
|
+
git_continue_run('cherry-pick')
|
24
|
+
else
|
25
|
+
raise 'Unknown how to continue'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def git_continue_run(command)
|
30
|
+
infom "\"#{command}\" --continue..."
|
31
|
+
cmd = instance.git_repo.command(command, '--continue')
|
32
|
+
.envvar('GIT_EDITOR', 'true')
|
33
|
+
return unless !cmd.system && !conflict?
|
34
|
+
|
35
|
+
fatal_error "\"#{cmd}\" failed and there is no conflict"
|
36
|
+
end
|
37
|
+
|
38
|
+
def git_reset_checkout
|
39
|
+
return unless check_capability(__method__, :git_repo, nil)
|
40
|
+
|
41
|
+
git_reset_gemfile_lock
|
42
|
+
git_checkout_gemfile_lock
|
43
|
+
end
|
44
|
+
|
45
|
+
def git_checkout_gemfile_lock
|
46
|
+
infom 'Checkouting...'
|
47
|
+
instance.git_repo.command('checkout', '--', gemfile_lock).system!
|
48
|
+
end
|
49
|
+
|
50
|
+
def git_reset_gemfile_lock
|
51
|
+
infom 'Reseting...'
|
52
|
+
instance.git_repo.command('reset', gemfile_lock).system! if
|
53
|
+
::File.exist?(gemfile_lock)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -9,18 +9,21 @@ module Avm
|
|
9
9
|
class Ruby
|
10
10
|
class Bundler
|
11
11
|
class GemfileLock
|
12
|
+
require_sub __FILE__, include_modules: true
|
12
13
|
runner_with :help do
|
13
14
|
desc 'Manipulage a "Gemfile.lock" file.'
|
14
15
|
bool_opt '-c', '--continue', 'Continue Git rebase/cherry-pick.'
|
15
16
|
bool_opt '-i', '--install', 'Run "bundle install".'
|
16
17
|
bool_opt '-u', '--update', 'Run "bundle update".'
|
17
18
|
bool_opt '-r', '--recursive', 'Run until Git rebase/cherry-pick is finished.'
|
18
|
-
bool_opt '-a', '--all', 'Same as "-
|
19
|
+
bool_opt '-a', '--all', 'Same as "-cirud".'
|
20
|
+
bool_opt '-d', '--delete', 'Delete Gemfile.lock'
|
19
21
|
end
|
20
22
|
|
21
23
|
def run
|
22
24
|
loop do
|
23
25
|
git_reset_checkout
|
26
|
+
delete_gemfile_lock
|
24
27
|
bundle_update
|
25
28
|
bundle_install
|
26
29
|
git_continue
|
@@ -34,17 +37,14 @@ module Avm
|
|
34
37
|
!option_or_all?(:recursive) || !conflict?
|
35
38
|
end
|
36
39
|
|
37
|
-
def
|
38
|
-
|
39
|
-
end
|
40
|
+
def delete_gemfile_lock
|
41
|
+
return unless check_capability(__method__, nil, :delete)
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
+
::FileUtils.rm_f(gemfile_lock)
|
44
|
+
end
|
43
45
|
|
44
|
-
|
45
|
-
instance.git_repo.
|
46
|
-
infom 'Checkouting...'
|
47
|
-
instance.git_repo.command('checkout', '--', gemfile_lock).system!
|
46
|
+
def rebasing?
|
47
|
+
instance.git_repo.root_path.join('.git', 'rebase-merge').exist?
|
48
48
|
end
|
49
49
|
|
50
50
|
def bundle_install
|
@@ -61,44 +61,14 @@ module Avm
|
|
61
61
|
bundle_run('update')
|
62
62
|
end
|
63
63
|
|
64
|
-
def git_continue
|
65
|
-
return unless check_capability(__method__, :git_repo, :continue)
|
66
|
-
|
67
|
-
infom "Adding \"#{gemfile_lock}\"..."
|
68
|
-
instance.git_repo.command('add', gemfile_lock).execute!
|
69
|
-
if rebase_conflict?
|
70
|
-
git_continue_run('rebase')
|
71
|
-
elsif cherry_conflict?
|
72
|
-
git_continue_run('cherry-pick')
|
73
|
-
else
|
74
|
-
raise 'Unknown how to continue'
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def git_continue_run(command)
|
79
|
-
infom "\"#{command}\" --continue..."
|
80
|
-
cmd = instance.git_repo.command(command, '--continue').envvar('GIT_EDITOR', 'true')
|
81
|
-
return unless !cmd.system && !conflict?
|
82
|
-
|
83
|
-
fatal_error "\"#{cmd}\" failed and there is no conflict"
|
84
|
-
end
|
85
|
-
|
86
64
|
def gemfile_lock
|
87
65
|
'Gemfile.lock'
|
88
66
|
end
|
89
67
|
|
90
|
-
def git_uncached
|
91
|
-
::EacGit::Local.new(git_path)
|
92
|
-
end
|
93
|
-
|
94
68
|
def bundle_run(*args)
|
95
69
|
instance.ruby_gem.bundle(*args).system!
|
96
70
|
end
|
97
71
|
|
98
|
-
def git_path
|
99
|
-
'.'
|
100
|
-
end
|
101
|
-
|
102
72
|
def conflict?
|
103
73
|
rebase_conflict? || cherry_conflict?
|
104
74
|
end
|
@@ -121,7 +91,7 @@ module Avm
|
|
121
91
|
|
122
92
|
def check_capability(caller, capability, option)
|
123
93
|
return false unless option.blank? || option_or_all?(option)
|
124
|
-
return true if instance.respond_to?(
|
94
|
+
return true if capability.if_present(true) { |v| instance.respond_to?(v) }
|
125
95
|
|
126
96
|
warn "Cannot run #{caller}: instance has no capability \"#{capability}\""
|
127
97
|
false
|
data/lib/avm/tools/version.rb
CHANGED
@@ -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
|
@@ -18,7 +18,7 @@ module EacCli
|
|
18
18
|
|
19
19
|
enable_listable
|
20
20
|
enable_abstract_methods :build_value, :default_value
|
21
|
-
lists.add_symbol :option, :optional, :usage, :repeat, :required
|
21
|
+
lists.add_symbol :option, :default, :optional, :usage, :repeat, :required
|
22
22
|
common_constructor :short, :long, :description, :options, default: [{}] do
|
23
23
|
raise 'Nor short neither long selector was set' if short.blank? && long.blank?
|
24
24
|
|
@@ -27,6 +27,14 @@ module EacCli
|
|
27
27
|
)
|
28
28
|
end
|
29
29
|
|
30
|
+
def default_value
|
31
|
+
default_value? ? options[OPTION_DEFAULT] : default_default_value
|
32
|
+
end
|
33
|
+
|
34
|
+
def default_value?
|
35
|
+
options.key?(OPTION_DEFAULT)
|
36
|
+
end
|
37
|
+
|
30
38
|
def identifier
|
31
39
|
[long, short].each do |v|
|
32
40
|
v.to_s.if_present { |vv| return vv.variableize.to_sym }
|
@@ -36,9 +36,9 @@ module EacCli
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def option_definition(option)
|
39
|
-
self.class.option_usage_full(option)
|
40
|
-
|
41
|
-
|
39
|
+
[self.class.option_usage_full(option), option.description,
|
40
|
+
option.default_value? ? "[Default: \"#{option.default_value}\"]" : nil]
|
41
|
+
.reject(&:blank?).join(OPTION_DESC_SEP)
|
42
42
|
end
|
43
43
|
|
44
44
|
def section(header, include_header = true)
|
@@ -13,6 +13,7 @@ RSpec.describe ::EacCli::Runner do
|
|
13
13
|
bool_opt '-p', '--opt2', 'A boolean option'
|
14
14
|
arg_opt '-q', '--opt4', 'A repeatable argument option.', repeat: true
|
15
15
|
bool_opt '-r', '--opt5', 'A repeatable boolean option', repeat: true
|
16
|
+
arg_opt '-s', '--opt6', 'A argument option with default value', default: 'DEFAULT'
|
16
17
|
pos_arg :pos1
|
17
18
|
pos_arg :pos2, repeat: true, optional: true
|
18
19
|
alt do
|
@@ -28,9 +29,9 @@ RSpec.describe ::EacCli::Runner do
|
|
28
29
|
let(:parsed_actual) { instance.parsed.to_h.symbolize_keys }
|
29
30
|
|
30
31
|
context 'when all args are supplied' do
|
31
|
-
let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd] }
|
32
|
+
let(:argv) { %w[--opt1 aaa --opt2 bbb ccc ddd --opt6 6] }
|
32
33
|
let(:parsed_expected) do
|
33
|
-
{ opt1: 'aaa', opt2: true, opt3: false, opt4: [], opt5: 0, pos1: 'bbb',
|
34
|
+
{ opt1: 'aaa', opt2: true, opt3: false, opt4: [], opt5: 0, opt6: '6', pos1: 'bbb',
|
34
35
|
pos2: %w[ccc ddd] }
|
35
36
|
end
|
36
37
|
|
@@ -65,7 +66,7 @@ RSpec.describe ::EacCli::Runner do
|
|
65
66
|
context 'when only required args are supplied' do
|
66
67
|
let(:argv) { %w[bbb] }
|
67
68
|
let(:parsed_expected) do
|
68
|
-
{ opt1: nil, opt2: false, opt3: false, opt4: [], opt5: 0, pos1: 'bbb',
|
69
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: 'bbb',
|
69
70
|
pos2: [] }
|
70
71
|
end
|
71
72
|
|
@@ -87,7 +88,7 @@ RSpec.describe ::EacCli::Runner do
|
|
87
88
|
context 'when alternative args are supplied' do
|
88
89
|
let(:argv) { %w[--opt3] }
|
89
90
|
let(:parsed_expected) do
|
90
|
-
{ opt1: nil, opt2: false, opt3: true, opt4: [], opt5: 0, pos1: nil,
|
91
|
+
{ opt1: nil, opt2: false, opt3: true, opt4: [], opt5: 0, opt6: 'DEFAULT', pos1: nil,
|
91
92
|
pos2: [] }
|
92
93
|
end
|
93
94
|
|
@@ -98,7 +99,7 @@ RSpec.describe ::EacCli::Runner do
|
|
98
99
|
context 'when repeated options are supplied' do
|
99
100
|
let(:argv) { %w[--opt5 -rrr --opt4=A -q B --opt4 C AAA] }
|
100
101
|
let(:parsed_expected) do
|
101
|
-
{ opt1: nil, opt2: false, opt3: false, opt4: %w[A B C], opt5: 4, pos1: 'AAA',
|
102
|
+
{ opt1: nil, opt2: false, opt3: false, opt4: %w[A B C], opt5: 4, opt6: 'DEFAULT', pos1: 'AAA',
|
102
103
|
pos2: [] }
|
103
104
|
end
|
104
105
|
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
class Compact
|
5
|
+
attr_reader :object, :attributes
|
6
|
+
|
7
|
+
def initialize(object, attributes)
|
8
|
+
@object = object
|
9
|
+
@attributes = attributes
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Array]
|
13
|
+
def to_a
|
14
|
+
attributes.map { |attr| object.send(attr) }
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Hash]
|
18
|
+
def to_h
|
19
|
+
attributes.map { |attr| [attr.to_sym, object.send(attr)] }.to_h
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -6,7 +6,7 @@ require 'tmpdir'
|
|
6
6
|
module EacRubyUtils
|
7
7
|
class << self
|
8
8
|
def fs_cache
|
9
|
-
@fs_cache ||= ::EacRubyUtils::FilesystemCache.new(::Dir.tmpdir, '
|
9
|
+
@fs_cache ||= ::EacRubyUtils::FilesystemCache.new(::Dir.tmpdir, 'eac_ruby_utils_fs_cache')
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/compact'
|
4
|
+
|
5
|
+
class Object
|
6
|
+
# @return [EacRubyUtils::Compact]
|
7
|
+
def compact(*attributes)
|
8
|
+
::EacRubyUtils::Compact.new(self, attributes)
|
9
|
+
end
|
10
|
+
|
11
|
+
# @return [Array]
|
12
|
+
def compact_to_a(*attributes)
|
13
|
+
compact(*attributes).to_a
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Hash]
|
17
|
+
def compact_to_h(*attributes)
|
18
|
+
compact(*attributes).to_h
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/string_delimited'
|
4
|
+
|
5
|
+
class String
|
6
|
+
# @return [EacRubyUtils::StringDelimited]
|
7
|
+
def delimited(begin_delimiter, end_delimiter)
|
8
|
+
::EacRubyUtils::StringDelimited.new(self, begin_delimiter, end_delimiter)
|
9
|
+
end
|
10
|
+
|
11
|
+
%w[inner outer without_inner without_outer].each do |method_suffix|
|
12
|
+
define_method "delimited_#{method_suffix}" do |begin_delimiter, end_delimiter|
|
13
|
+
delimited(begin_delimiter, end_delimiter).send(method_suffix)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
class StringDelimited
|
5
|
+
attr_reader :string, :begin_delimiter, :end_delimiter
|
6
|
+
|
7
|
+
def initialize(string, begin_delimiter, end_delimiter)
|
8
|
+
@string = string
|
9
|
+
@begin_delimiter = begin_delimiter
|
10
|
+
@end_delimiter = end_delimiter
|
11
|
+
end
|
12
|
+
|
13
|
+
def inner
|
14
|
+
between_indexes(content_index, end_index).to_s
|
15
|
+
end
|
16
|
+
|
17
|
+
def outer
|
18
|
+
between_indexes(begin_index, after_end_index).to_s
|
19
|
+
end
|
20
|
+
|
21
|
+
def without_inner
|
22
|
+
without_join(
|
23
|
+
between_indexes(sos_index, content_index), between_indexes(end_index, eos_index)
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
def without_outer
|
28
|
+
without_join(
|
29
|
+
between_indexes(sos_index, begin_index),
|
30
|
+
between_indexes(after_end_index, eos_index)
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def after_end_index
|
37
|
+
end_index.if_present { |v| v + end_delimiter.length }
|
38
|
+
end
|
39
|
+
|
40
|
+
def begin_index
|
41
|
+
string.index(begin_delimiter)
|
42
|
+
end
|
43
|
+
|
44
|
+
def between_indexes(a_begin_index, a_end_index)
|
45
|
+
a_begin_index && a_end_index ? string[a_begin_index, a_end_index - a_begin_index] : nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def content_index
|
49
|
+
begin_index.if_present { |v| v + begin_delimiter.length }
|
50
|
+
end
|
51
|
+
|
52
|
+
def without_join(*strings)
|
53
|
+
return string if strings.any?(&:nil?)
|
54
|
+
|
55
|
+
strings.join('')
|
56
|
+
end
|
57
|
+
|
58
|
+
def end_index
|
59
|
+
content_index.if_present { |_v| string.index(end_delimiter, content_index) }
|
60
|
+
end
|
61
|
+
|
62
|
+
def sos_index
|
63
|
+
0
|
64
|
+
end
|
65
|
+
|
66
|
+
def eos_index
|
67
|
+
string.length
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/compact'
|
4
|
+
|
5
|
+
::RSpec.describe ::EacRubyUtils::Compact do
|
6
|
+
let(:object) { ::OpenStruct.new(a_attr: 'a_value', b_attr: 'b_value') }
|
7
|
+
let(:instance) { described_class.new(object, %w[a_attr b_attr]) }
|
8
|
+
|
9
|
+
describe '#to_a' do
|
10
|
+
it do
|
11
|
+
expect(instance.to_a).to eq(%w[a_value b_value])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#to_h' do
|
16
|
+
it do
|
17
|
+
expect(instance.to_h).to eq(a_attr: 'a_value', b_attr: 'b_value')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/object/compact'
|
4
|
+
|
5
|
+
::RSpec.describe ::Object do
|
6
|
+
let(:instance) { ::OpenStruct.new(a_attr: 'a_value', b_attr: 'b_value') }
|
7
|
+
let(:attributes) { %w[a_attr b_attr] }
|
8
|
+
|
9
|
+
describe '#compact' do
|
10
|
+
it do
|
11
|
+
expect(instance.compact_to_a(*attributes)).to eq(%w[a_value b_value])
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '#to_h' do
|
16
|
+
it do
|
17
|
+
expect(instance.compact_to_h(*attributes)).to eq(a_attr: 'a_value', b_attr: 'b_value')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/patches/string/delimited'
|
4
|
+
|
5
|
+
::RSpec.describe ::String do
|
6
|
+
let(:instance) { 'A text with <b>content between</b> tags.' }
|
7
|
+
|
8
|
+
{
|
9
|
+
['<b>', '</b>'] => {
|
10
|
+
'inner' => 'content between',
|
11
|
+
'without_inner' => 'A text with <b></b> tags.',
|
12
|
+
'outer' => '<b>content between</b>',
|
13
|
+
'without_outer' => 'A text with tags.'
|
14
|
+
},
|
15
|
+
['<b>', '</br>'] => {
|
16
|
+
'inner' => '',
|
17
|
+
'without_inner' => 'A text with <b>content between</b> tags.',
|
18
|
+
'outer' => '',
|
19
|
+
'without_outer' => 'A text with <b>content between</b> tags.'
|
20
|
+
}
|
21
|
+
}.each do |delimiters, expected_values|
|
22
|
+
context "when delimiters are #{delimiters}" do
|
23
|
+
let(:bdel) { delimiters[0] }
|
24
|
+
let(:edel) { delimiters[1] }
|
25
|
+
|
26
|
+
expected_values.each do |method_suffix, expected_value|
|
27
|
+
method_name = "delimited_#{method_suffix}"
|
28
|
+
it "#{method_name} should return \"#{expected_value}\"" do
|
29
|
+
expect(instance.send(method_name, bdel, edel)).to eq(expected_value)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.106.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -513,6 +513,7 @@ files:
|
|
513
513
|
- lib/avm/tools/runner/app_src/ruby.rb
|
514
514
|
- lib/avm/tools/runner/app_src/ruby/bundler.rb
|
515
515
|
- lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock.rb
|
516
|
+
- lib/avm/tools/runner/app_src/ruby/bundler/gemfile_lock/git.rb
|
516
517
|
- lib/avm/tools/runner/app_src/ruby/bundler/incompatible.rb
|
517
518
|
- lib/avm/tools/runner/app_src/test.rb
|
518
519
|
- lib/avm/tools/runner/app_src/update.rb
|
@@ -1172,6 +1173,7 @@ files:
|
|
1172
1173
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/class_initialize.rb
|
1173
1174
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/instance_initialize.rb
|
1174
1175
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/common_constructor/super_args.rb
|
1176
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/compact.rb
|
1175
1177
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/context.rb
|
1176
1178
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/contextualizable.rb
|
1177
1179
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/core_ext.rb
|
@@ -1253,6 +1255,7 @@ files:
|
|
1253
1255
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/module/speaker.rb
|
1254
1256
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object.rb
|
1255
1257
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/asserts.rb
|
1258
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/compact.rb
|
1256
1259
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb
|
1257
1260
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_nil.rb
|
1258
1261
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/object/if_present.rb
|
@@ -1265,6 +1268,7 @@ files:
|
|
1265
1268
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/if_match.rb
|
1266
1269
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/regexp/to_parser.rb
|
1267
1270
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string.rb
|
1271
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/delimited.rb
|
1268
1272
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/string/inflector.rb
|
1269
1273
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time.rb
|
1270
1274
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/patches/time/required_zone.rb
|
@@ -1285,6 +1289,7 @@ files:
|
|
1285
1289
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker.rb
|
1286
1290
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/receiver.rb
|
1287
1291
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/speaker/sender.rb
|
1292
|
+
- vendor/eac_ruby_utils/lib/eac_ruby_utils/string_delimited.rb
|
1288
1293
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/struct.rb
|
1289
1294
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/version.rb
|
1290
1295
|
- vendor/eac_ruby_utils/lib/eac_ruby_utils/yaml.rb
|
@@ -1293,6 +1298,7 @@ files:
|
|
1293
1298
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/blank_not_blank_spec.rb
|
1294
1299
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_concern_spec.rb
|
1295
1300
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/common_constructor_spec.rb
|
1301
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/compact_spec.rb
|
1296
1302
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/custom_format_spec.rb
|
1297
1303
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/executable_spec.rb
|
1298
1304
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/envs/ssh_env_spec.rb
|
@@ -1312,10 +1318,12 @@ files:
|
|
1312
1318
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/listable_spec.rb
|
1313
1319
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/simple_cache_spec.rb
|
1314
1320
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/module/speaker_spec.rb
|
1321
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/compact_spec.rb
|
1315
1322
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/if_present_spec.rb
|
1316
1323
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/object/template_spec_files/path/my_stub_with_template
|
1317
1324
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/basename_sub_spec.rb
|
1318
1325
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/parent_n_spec.rb
|
1326
|
+
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/string/delimited_spec.rb
|
1319
1327
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/recursive_builder_spec.rb
|
1320
1328
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec.rb
|
1321
1329
|
- vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/require_sub_spec/stubbed_module_a.rb
|