rggen-core 0.31.2 → 0.32.2
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/README.md +0 -1
- data/lib/rggen/core/builder/builder.rb +5 -1
- data/lib/rggen/core/builder/component_registry.rb +5 -4
- data/lib/rggen/core/builder/feature_entry_base.rb +8 -0
- data/lib/rggen/core/builder/feature_registry.rb +31 -4
- data/lib/rggen/core/builder/general_feature_entry.rb +1 -1
- data/lib/rggen/core/builder/layer.rb +45 -37
- data/lib/rggen/core/builder/list_feature_entry.rb +8 -3
- data/lib/rggen/core/builder/simple_feature_entry.rb +8 -5
- data/lib/rggen/core/dsl.rb +4 -0
- data/lib/rggen/core/facets.rb +0 -1
- data/lib/rggen/core/input_base/feature.rb +4 -4
- data/lib/rggen/core/input_base/input_data.rb +2 -2
- data/lib/rggen/core/input_base/input_matcher.rb +1 -1
- data/lib/rggen/core/input_base/property.rb +6 -6
- data/lib/rggen/core/input_base/yaml_loader.rb +2 -19
- data/lib/rggen/core/options.rb +4 -5
- data/lib/rggen/core/utility/regexp_patterns.rb +6 -6
- data/lib/rggen/core/version.rb +1 -1
- metadata +5 -19
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b897f145f9e7be55cce8b15c95a7add4dfd7f57655298b80a90f5154ad60e93c
|
|
4
|
+
data.tar.gz: 04e1ee8e8fa111d2dcf536f07946058e08bc9593381940320a7fe1d2a1938a39
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 623b918aedc0536cdd4e03f2bbb0ae7a5d2c829bb51c3d6576604c14fecba01fca6578b50b84a780228a028cd7cc720e3951f4c004398896b9c51471c0de13bc
|
|
7
|
+
data.tar.gz: 5a4a34bf97c09f945256fc811f0e72afa411ad7c4c36a8d000f246bc92c83438832b758dbec055860777f8a81f83077b777b3c4a5da1c17d59507fcdba0437da
|
data/README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
[](https://github.com/rggen/rggen-core/actions?query=workflow%3ACI)
|
|
3
3
|
[](https://codeclimate.com/github/rggen/rggen-core/maintainability)
|
|
4
4
|
[](https://codecov.io/gh/rggen/rggen-core)
|
|
5
|
-
[](https://sonarcloud.io/dashboard?id=rggen_rggen-core)
|
|
6
5
|
[](https://gitter.im/rggen/rggen?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
7
6
|
|
|
8
7
|
# RgGen::Core
|
|
@@ -50,7 +50,11 @@ module RgGen
|
|
|
50
50
|
:define_feature,
|
|
51
51
|
:define_simple_feature,
|
|
52
52
|
:define_list_feature,
|
|
53
|
-
:define_list_item_feature
|
|
53
|
+
:define_list_item_feature,
|
|
54
|
+
:modify_feature,
|
|
55
|
+
:modify_simple_feature,
|
|
56
|
+
:modify_list_feature,
|
|
57
|
+
:modify_list_item_feature
|
|
54
58
|
].each do |method_name|
|
|
55
59
|
define_method(method_name) do |layer, *args, &body|
|
|
56
60
|
@layers[layer].__send__(__method__, *args, &body)
|
|
@@ -39,10 +39,11 @@ module RgGen
|
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def build_factories
|
|
42
|
-
factories =
|
|
43
|
-
|
|
44
|
-
.
|
|
45
|
-
.
|
|
42
|
+
factories = @entries.to_h do |entry|
|
|
43
|
+
entry
|
|
44
|
+
.build_factory
|
|
45
|
+
.then { |f| [f.layer, f] }
|
|
46
|
+
end
|
|
46
47
|
factories.each_value { |f| f.component_factories factories }
|
|
47
48
|
factories.values
|
|
48
49
|
end
|
|
@@ -12,6 +12,10 @@ module RgGen
|
|
|
12
12
|
attr_reader :registry
|
|
13
13
|
attr_reader :name
|
|
14
14
|
|
|
15
|
+
def modify(&body)
|
|
16
|
+
eval_body(&body)
|
|
17
|
+
end
|
|
18
|
+
|
|
15
19
|
def match_entry_type?(entry_type)
|
|
16
20
|
entry_type == entry_type_name
|
|
17
21
|
end
|
|
@@ -31,6 +35,10 @@ module RgGen
|
|
|
31
35
|
end
|
|
32
36
|
end
|
|
33
37
|
|
|
38
|
+
def eval_body(&body)
|
|
39
|
+
block_given? && Docile.dsl_eval(self, @name, &body)
|
|
40
|
+
end
|
|
41
|
+
|
|
34
42
|
def target_features(_tergets)
|
|
35
43
|
end
|
|
36
44
|
|
|
@@ -24,10 +24,23 @@ module RgGen
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def define_list_item_feature(list_name, feature_name, context = nil, &body)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
list_item_entry(list_name).define_feature(feature_name, context, &body)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def modify_feature(name, &body)
|
|
31
|
+
modify_entry(:general, name, &body)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def modify_simple_feature(name, &body)
|
|
35
|
+
modify_entry(:simple, name, &body)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def modify_list_feature(list_name, &body)
|
|
39
|
+
modify_entry(:list, list_name, &body)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def modify_list_item_feature(list_name, feature_name, &body)
|
|
43
|
+
list_item_entry(list_name).modify_feature(feature_name, &body)
|
|
31
44
|
end
|
|
32
45
|
|
|
33
46
|
def enable(list_name = nil, feature_names)
|
|
@@ -95,6 +108,20 @@ module RgGen
|
|
|
95
108
|
@feature_entries[name] = entry
|
|
96
109
|
end
|
|
97
110
|
|
|
111
|
+
def modify_entry(type, name, &body)
|
|
112
|
+
entry = @feature_entries[name]
|
|
113
|
+
entry&.match_entry_type?(type) ||
|
|
114
|
+
(raise BuilderError.new("unknown feature: #{name}"))
|
|
115
|
+
entry.modify(&body)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
def list_item_entry(list_name)
|
|
119
|
+
entry = @feature_entries[list_name]
|
|
120
|
+
entry&.match_entry_type?(:list) ||
|
|
121
|
+
(raise BuilderError.new("unknown feature: #{list_name}"))
|
|
122
|
+
entry
|
|
123
|
+
end
|
|
124
|
+
|
|
98
125
|
def enabled_list_features(list_name)
|
|
99
126
|
return [] unless enabled_list?(list_name)
|
|
100
127
|
features = @feature_entries[list_name].features
|
|
@@ -10,7 +10,7 @@ module RgGen
|
|
|
10
10
|
@feature = Class.new(base_feature)
|
|
11
11
|
@factory = Class.new(base_factory)
|
|
12
12
|
attach_shared_context(context, @feature, @factory, self)
|
|
13
|
-
|
|
13
|
+
eval_body(&body)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def define_factory(&body)
|
|
@@ -5,30 +5,27 @@ module RgGen
|
|
|
5
5
|
module Builder
|
|
6
6
|
class Layer
|
|
7
7
|
class Proxy
|
|
8
|
-
def initialize
|
|
9
|
-
|
|
8
|
+
def initialize(list_name, feature_name)
|
|
9
|
+
@list_name = list_name
|
|
10
|
+
@feature_name = feature_name
|
|
10
11
|
end
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
attr_setter :list_name
|
|
15
|
-
attr_setter :feature_name
|
|
13
|
+
attr_reader :list_name
|
|
14
|
+
attr_reader :feature_name
|
|
16
15
|
|
|
17
16
|
def register_execution(registry, &body)
|
|
18
17
|
@executions ||= []
|
|
19
18
|
@executions << { registry: registry, body: body }
|
|
20
19
|
end
|
|
21
20
|
|
|
22
|
-
def execute(layer)
|
|
21
|
+
def execute(layer, method_name, &body)
|
|
23
22
|
Docile.dsl_eval(layer, &body)
|
|
24
|
-
@executions
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
private
|
|
23
|
+
return unless @executions
|
|
28
24
|
|
|
29
|
-
def call_execution(layer, execution)
|
|
30
25
|
args = [list_name, feature_name, layer.shared_context].compact
|
|
31
|
-
|
|
26
|
+
@executions.each do |execution|
|
|
27
|
+
execution[:registry].__send__(method_name, *args, &execution[:body])
|
|
28
|
+
end
|
|
32
29
|
end
|
|
33
30
|
end
|
|
34
31
|
|
|
@@ -53,44 +50,55 @@ module RgGen
|
|
|
53
50
|
current_shared_context(false)
|
|
54
51
|
end
|
|
55
52
|
|
|
53
|
+
def component_defined?(component_name)
|
|
54
|
+
@feature_registries.key?(component_name)
|
|
55
|
+
end
|
|
56
|
+
|
|
56
57
|
def define_feature(feature_names, &body)
|
|
57
58
|
Array(feature_names).each do |feature_name|
|
|
58
|
-
do_proxy_call
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
do_proxy_call(__method__, nil, feature_name, &body)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def modify_feature(feature_names, &body)
|
|
64
|
+
Array(feature_names).each do |feature_name|
|
|
65
|
+
do_proxy_call(__method__, nil, feature_name, &body)
|
|
63
66
|
end
|
|
64
67
|
end
|
|
65
68
|
|
|
66
69
|
def define_simple_feature(feature_names, &body)
|
|
67
70
|
Array(feature_names).each do |feature_name|
|
|
68
|
-
do_proxy_call
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
do_proxy_call(__method__, nil, feature_name, &body)
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def modify_simple_feature(feature_names, &body)
|
|
76
|
+
Array(feature_names).each do |feature_name|
|
|
77
|
+
do_proxy_call(__method__, nil, feature_name, &body)
|
|
73
78
|
end
|
|
74
79
|
end
|
|
75
80
|
|
|
76
81
|
def define_list_feature(list_names, &body)
|
|
77
82
|
Array(list_names).each do |list_name|
|
|
78
|
-
do_proxy_call
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
do_proxy_call(__method__, list_name, nil, &body)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def modify_list_feature(list_names, &body)
|
|
88
|
+
Array(list_names).each do |list_name|
|
|
89
|
+
do_proxy_call(__method__, list_name, nil, &body)
|
|
83
90
|
end
|
|
84
91
|
end
|
|
85
92
|
|
|
86
93
|
def define_list_item_feature(list_name, feature_names, &body)
|
|
87
94
|
Array(feature_names).each do |feature_name|
|
|
88
|
-
do_proxy_call
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
do_proxy_call(__method__, list_name, feature_name, &body)
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def modify_list_item_feature(list_name, feature_names, &body)
|
|
100
|
+
Array(feature_names).each do |feature_name|
|
|
101
|
+
do_proxy_call(__method__, list_name, feature_name, &body)
|
|
94
102
|
end
|
|
95
103
|
end
|
|
96
104
|
|
|
@@ -122,9 +130,9 @@ module RgGen
|
|
|
122
130
|
end
|
|
123
131
|
end
|
|
124
132
|
|
|
125
|
-
def do_proxy_call(&
|
|
126
|
-
@proxy = Proxy.new(
|
|
127
|
-
@proxy.execute(self)
|
|
133
|
+
def do_proxy_call(method_name, list_name, feature_name, &body)
|
|
134
|
+
@proxy = Proxy.new(list_name, feature_name)
|
|
135
|
+
@proxy.execute(self, method_name, &body)
|
|
128
136
|
remove_instance_variable(:@proxy)
|
|
129
137
|
end
|
|
130
138
|
|
|
@@ -15,7 +15,7 @@ module RgGen
|
|
|
15
15
|
@base_feature = Class.new(base_feature)
|
|
16
16
|
@factory = Class.new(base_factory)
|
|
17
17
|
attach_shared_context(context, @base_feature, @factory, self)
|
|
18
|
-
|
|
18
|
+
eval_body(&body)
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def define_factory(&body)
|
|
@@ -31,8 +31,7 @@ module RgGen
|
|
|
31
31
|
alias_method :base_feature, :define_base_feature
|
|
32
32
|
|
|
33
33
|
def define_feature(feature_name, context = nil, &body)
|
|
34
|
-
@features[feature_name]
|
|
35
|
-
feature = @features[feature_name]
|
|
34
|
+
feature = @features[feature_name] = Class.new(@base_feature)
|
|
36
35
|
if context
|
|
37
36
|
feature.method_defined?(:shared_context) &&
|
|
38
37
|
(raise BuilderError.new('shared context has already been set'))
|
|
@@ -43,6 +42,12 @@ module RgGen
|
|
|
43
42
|
|
|
44
43
|
alias_method :feature, :define_feature
|
|
45
44
|
|
|
45
|
+
def modify_feature(feature_name, &body)
|
|
46
|
+
@features.key?(feature_name) ||
|
|
47
|
+
(raise BuilderError.new("unknown feature: #{feature_name}"))
|
|
48
|
+
body && @features[feature_name].class_exec(feature_name, &body)
|
|
49
|
+
end
|
|
50
|
+
|
|
46
51
|
def define_default_feature(&body)
|
|
47
52
|
@default_feature ||= Class.new(@base_feature)
|
|
48
53
|
body && @default_feature.class_exec(&body)
|
|
@@ -5,7 +5,7 @@ module RgGen
|
|
|
5
5
|
module Builder
|
|
6
6
|
class SimpleFeatureEntry < FeatureEntryBase
|
|
7
7
|
def setup(base_feature, factory, context, &body)
|
|
8
|
-
|
|
8
|
+
define_feature(base_feature, context, &body)
|
|
9
9
|
@factory = factory
|
|
10
10
|
end
|
|
11
11
|
|
|
@@ -16,15 +16,18 @@ module RgGen
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def define_feature(base, context, &body)
|
|
19
|
-
feature = Class.new(base)
|
|
20
|
-
attach_shared_context(context, feature)
|
|
21
|
-
|
|
22
|
-
feature
|
|
19
|
+
@feature = Class.new(base)
|
|
20
|
+
attach_shared_context(context, @feature)
|
|
21
|
+
eval_body(&body)
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def target_feature
|
|
26
25
|
@feature
|
|
27
26
|
end
|
|
27
|
+
|
|
28
|
+
def eval_body(&body)
|
|
29
|
+
block_given? && @feature.class_exec(@name, &body)
|
|
30
|
+
end
|
|
28
31
|
end
|
|
29
32
|
end
|
|
30
33
|
end
|
data/lib/rggen/core/dsl.rb
CHANGED
data/lib/rggen/core/facets.rb
CHANGED
|
@@ -9,8 +9,8 @@ module RgGen
|
|
|
9
9
|
include ConversionUtility
|
|
10
10
|
|
|
11
11
|
class << self
|
|
12
|
-
def property(name,
|
|
13
|
-
Property.define(self, name,
|
|
12
|
+
def property(name, ...)
|
|
13
|
+
Property.define(self, name, ...)
|
|
14
14
|
properties.include?(name) || properties << name
|
|
15
15
|
end
|
|
16
16
|
|
|
@@ -49,8 +49,8 @@ module RgGen
|
|
|
49
49
|
builders.nil?
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
def input_pattern(pattern_or_patterns,
|
|
53
|
-
@input_matcher = InputMatcher.new(pattern_or_patterns,
|
|
52
|
+
def input_pattern(pattern_or_patterns, ...)
|
|
53
|
+
@input_matcher = InputMatcher.new(pattern_or_patterns, ...)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
attr_reader :input_matcher
|
|
@@ -87,8 +87,8 @@ module RgGen
|
|
|
87
87
|
caller_location.path.include?('docile')
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
-
def create_child_data(layer,
|
|
91
|
-
child_data_class.new(layer, @valid_value_lists,
|
|
90
|
+
def create_child_data(layer, ...)
|
|
91
|
+
child_data_class.new(layer, @valid_value_lists, ...)
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
def child_data_class
|
|
@@ -23,16 +23,16 @@ module RgGen
|
|
|
23
23
|
|
|
24
24
|
def define(feature)
|
|
25
25
|
feature.class_exec(self) do |property|
|
|
26
|
-
define_method(property.name) do |*args, **
|
|
27
|
-
property.evaluate(self, *args, **
|
|
26
|
+
define_method(property.name) do |*args, **kwargs, &block|
|
|
27
|
+
property.evaluate(self, *args, **kwargs, &block)
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
def evaluate(feature,
|
|
32
|
+
def evaluate(feature, ...)
|
|
33
33
|
feature.verify(@options[:verify]) if @options.key?(:verify)
|
|
34
34
|
if proxy_property?
|
|
35
|
-
proxy_property(feature,
|
|
35
|
+
proxy_property(feature, ...)
|
|
36
36
|
else
|
|
37
37
|
default_property(feature)
|
|
38
38
|
end
|
|
@@ -55,7 +55,7 @@ module RgGen
|
|
|
55
55
|
].any?
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def proxy_property(feature,
|
|
58
|
+
def proxy_property(feature, ...)
|
|
59
59
|
receiver, method =
|
|
60
60
|
if @costom_property
|
|
61
61
|
[@costom_property.bind(feature), :call]
|
|
@@ -64,7 +64,7 @@ module RgGen
|
|
|
64
64
|
else
|
|
65
65
|
[feature, @options[:forward_to]]
|
|
66
66
|
end
|
|
67
|
-
receiver.__send__(method,
|
|
67
|
+
receiver.__send__(method, ...)
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def default_property(feature)
|
|
@@ -49,10 +49,8 @@ module RgGen
|
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
class Visitor < ::Psych::Visitors::ToRuby
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
super(scalar_scanner, class_loader, symbolize_names: true)
|
|
55
|
-
end
|
|
52
|
+
def initialize(scalar_scanner, class_loader)
|
|
53
|
+
super(scalar_scanner, class_loader, symbolize_names: true)
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
def accept(node)
|
|
@@ -79,7 +77,6 @@ module RgGen
|
|
|
79
77
|
def load_yaml(file)
|
|
80
78
|
parse_yaml(File.binread(file), file)
|
|
81
79
|
.then { |result| to_ruby(result) }
|
|
82
|
-
.then { |result| symbolize_names(result) }
|
|
83
80
|
end
|
|
84
81
|
|
|
85
82
|
def parse_yaml(yaml, file)
|
|
@@ -93,20 +90,6 @@ module RgGen
|
|
|
93
90
|
ss = ::Psych::ScalarScanner.new(cl)
|
|
94
91
|
Visitor.new(ss, cl).accept(result)
|
|
95
92
|
end
|
|
96
|
-
|
|
97
|
-
def symbolize_names(result)
|
|
98
|
-
return result if ::Psych::VERSION >= '3.2.0'
|
|
99
|
-
|
|
100
|
-
if result.match_class?(Hash)
|
|
101
|
-
result
|
|
102
|
-
.transform_keys!(&:to_sym)
|
|
103
|
-
.transform_values!(&method(:symbolize_names))
|
|
104
|
-
elsif result.match_class?(Array)
|
|
105
|
-
result.map! { |value| symbolize_names(value) }
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
result
|
|
109
|
-
end
|
|
110
93
|
end
|
|
111
94
|
end
|
|
112
95
|
end
|
data/lib/rggen/core/options.rb
CHANGED
|
@@ -105,15 +105,14 @@ module RgGen
|
|
|
105
105
|
option.long_option '--no-default-plugins'
|
|
106
106
|
option.default false
|
|
107
107
|
option.action { |_, options| options[:no_default_plugins] = true }
|
|
108
|
-
option.description '
|
|
108
|
+
option.description 'Not load default plugins'
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
Options.add_option(:plugins) do |option|
|
|
112
112
|
option.long_option '--plugin PLUGIN[:VERSION]'
|
|
113
113
|
option.default { [] }
|
|
114
114
|
option.action { |value, options| options[:plugins] << value.split(':', 2) }
|
|
115
|
-
option.description 'Load a RgGen plugin '
|
|
116
|
-
"(name of plugin/path to 'setup.rb' file)"
|
|
115
|
+
option.description 'Load a RgGen plugin (specify plugin name or path)'
|
|
117
116
|
end
|
|
118
117
|
|
|
119
118
|
Options.add_option(:configuration) do |option|
|
|
@@ -134,7 +133,7 @@ module RgGen
|
|
|
134
133
|
Options.add_option(:load_only) do |option|
|
|
135
134
|
option.long_option '--load-only'
|
|
136
135
|
option.default false
|
|
137
|
-
option.description 'Load
|
|
136
|
+
option.description 'Load plugins, configuration file and register map ' \
|
|
138
137
|
'files only; write no files'
|
|
139
138
|
end
|
|
140
139
|
|
|
@@ -176,7 +175,7 @@ module RgGen
|
|
|
176
175
|
option.action do |_value, options|
|
|
177
176
|
options[:runner] = VersionPrinter.new(true)
|
|
178
177
|
end
|
|
179
|
-
option.description '
|
|
178
|
+
option.description 'Display verbose version'
|
|
180
179
|
end
|
|
181
180
|
|
|
182
181
|
Options.add_option(:help) do |option|
|
|
@@ -12,17 +12,17 @@ module RgGen
|
|
|
12
12
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
|
-
VARIABLE_NAME_PATTERN = /[a-z_]\w*/i
|
|
15
|
+
VARIABLE_NAME_PATTERN = /[a-z_]\w*/i
|
|
16
16
|
|
|
17
17
|
def variable_name
|
|
18
18
|
VARIABLE_NAME_PATTERN
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
BINARY_PATTERN = /[+-]?0b[01](?:_?[01])*/i
|
|
21
|
+
BINARY_PATTERN = /[+-]?0b[01](?:_?[01])*/i
|
|
22
22
|
|
|
23
|
-
DECIMAL_PATTERN = /[+-]?(?:[1-9]_?(?:\d_?)*)?\d
|
|
23
|
+
DECIMAL_PATTERN = /[+-]?(?:[1-9]_?(?:\d_?)*)?\d/
|
|
24
24
|
|
|
25
|
-
HEXADECIMAL_PATTERN = /[+-]?0x\h(?:_?\h)*/i
|
|
25
|
+
HEXADECIMAL_PATTERN = /[+-]?0x\h(?:_?\h)*/i
|
|
26
26
|
|
|
27
27
|
INTEGER_PATTERN =
|
|
28
28
|
Regexp.union(
|
|
@@ -33,13 +33,13 @@ module RgGen
|
|
|
33
33
|
INTEGER_PATTERN
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
TRUTHY_PATTERN = /true|on|yes/i
|
|
36
|
+
TRUTHY_PATTERN = /true|on|yes/i
|
|
37
37
|
|
|
38
38
|
def truthy_pattern
|
|
39
39
|
TRUTHY_PATTERN
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
FALSEY_PATTERN = /false|off|no/i
|
|
42
|
+
FALSEY_PATTERN = /false|off|no/i
|
|
43
43
|
|
|
44
44
|
def falsey_pattern
|
|
45
45
|
FALSEY_PATTERN
|
data/lib/rggen/core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rggen-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.32.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Taichi Ishitani
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2024-01-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: docile
|
|
@@ -72,20 +72,6 @@ dependencies:
|
|
|
72
72
|
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
74
|
version: '2.0'
|
|
75
|
-
- !ruby/object:Gem::Dependency
|
|
76
|
-
name: bundler
|
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
|
78
|
-
requirements:
|
|
79
|
-
- - ">="
|
|
80
|
-
- !ruby/object:Gem::Version
|
|
81
|
-
version: '0'
|
|
82
|
-
type: :development
|
|
83
|
-
prerelease: false
|
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
85
|
-
requirements:
|
|
86
|
-
- - ">="
|
|
87
|
-
- !ruby/object:Gem::Version
|
|
88
|
-
version: '0'
|
|
89
75
|
description: Core library of RgGen tool.
|
|
90
76
|
email:
|
|
91
77
|
- rggen@googlegroups.com
|
|
@@ -215,15 +201,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
215
201
|
requirements:
|
|
216
202
|
- - ">="
|
|
217
203
|
- !ruby/object:Gem::Version
|
|
218
|
-
version:
|
|
204
|
+
version: 3.0.0
|
|
219
205
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
206
|
requirements:
|
|
221
207
|
- - ">="
|
|
222
208
|
- !ruby/object:Gem::Version
|
|
223
209
|
version: '0'
|
|
224
210
|
requirements: []
|
|
225
|
-
rubygems_version: 3.
|
|
211
|
+
rubygems_version: 3.5.3
|
|
226
212
|
signing_key:
|
|
227
213
|
specification_version: 4
|
|
228
|
-
summary: rggen-core-0.
|
|
214
|
+
summary: rggen-core-0.32.2
|
|
229
215
|
test_files: []
|