ree 1.0.44 → 1.0.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ree/cli/indexing.rb +29 -27
- data/lib/ree/cli/spec_runner.rb +2 -0
- data/lib/ree/core/package_loader.rb +2 -2
- data/lib/ree/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6869080f11102de366ba140e8c536b26fb9e93d2cf40eba1b52cc7e83f29dc75
|
4
|
+
data.tar.gz: c08fa4bfd15149c74fbb3dc6457145aa151ff04a0cb06303eaddd3f36cfdb252
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 447f6346af9ee9ce78f71782942d07186465c57dd46b7cb9f1c867f0722dc90b02b491266ad6287bf7325ec455955aa9d34e1e07ef02c1d6c97fd16823283192
|
7
|
+
data.tar.gz: 19bc7cc90c483a0b4944905fe4ece109aba595129801656e0c8ee5175896c33be13528f9bf4c4de599cd42fd051fc6cd0a1196464e4718f17daa9fd671007397
|
data/Gemfile.lock
CHANGED
data/lib/ree/cli/indexing.rb
CHANGED
@@ -40,26 +40,26 @@ module Ree
|
|
40
40
|
if !object.fn?
|
41
41
|
return []
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
klass = object.klass
|
45
45
|
|
46
46
|
object_is_action = object.tags.include?("action")
|
47
47
|
action_caster = object.klass.const_get(:ActionCaster) if object.klass.const_defined?(:ActionCaster)
|
48
|
-
|
48
|
+
|
49
49
|
method_name = object_is_action ? :__original_call : :call
|
50
50
|
method_decorator = Ree::Contracts.get_method_decorator(
|
51
51
|
klass, method_name, scope: :instance
|
52
52
|
)
|
53
|
-
|
53
|
+
|
54
54
|
begin
|
55
55
|
if method_decorator.nil?
|
56
56
|
parameters = klass.instance_method(:call).parameters
|
57
|
-
|
57
|
+
|
58
58
|
args = parameters.inject({}) do |res, param|
|
59
59
|
res[param.last] = Ree::Contracts::CalledArgsValidator::Arg.new(
|
60
60
|
param.last, param.first, nil, nil
|
61
61
|
)
|
62
|
-
|
62
|
+
|
63
63
|
res
|
64
64
|
end
|
65
65
|
else
|
@@ -70,7 +70,7 @@ module Ree
|
|
70
70
|
raise Ree::Error.new("method call is not defined for #{klass}")
|
71
71
|
end
|
72
72
|
|
73
|
-
|
73
|
+
|
74
74
|
arg_list = parameters.map do |param|
|
75
75
|
arg = args[param.last]
|
76
76
|
validator = arg.validator
|
@@ -78,21 +78,21 @@ module Ree
|
|
78
78
|
|
79
79
|
type = if object_is_action && action_caster && arg.name == :attrs
|
80
80
|
map_mapper_fields(action_caster.fields).to_s.gsub(/\\*\"/, "").gsub(/\=\>/, ' => ')
|
81
|
-
else
|
81
|
+
else
|
82
82
|
if validator
|
83
83
|
validator.to_s
|
84
84
|
else
|
85
85
|
arg_type == :block ? "Block" : "Any"
|
86
86
|
end
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
{
|
90
90
|
Ree::ObjectSchema::Methods::Args::ARG => arg.name,
|
91
91
|
Ree::ObjectSchema::Methods::Args::ARG_TYPE => arg.type,
|
92
92
|
Ree::ObjectSchema::Methods::Args::TYPE => type
|
93
93
|
}
|
94
94
|
end
|
95
|
-
|
95
|
+
|
96
96
|
[
|
97
97
|
{
|
98
98
|
Ree::ObjectSchema::Methods::DOC => method_decorator&.doc || "",
|
@@ -106,6 +106,8 @@ module Ree
|
|
106
106
|
def index_public_methods_for_package_classes(package, index_hash)
|
107
107
|
package.objects.each do |obj|
|
108
108
|
klass = obj.klass
|
109
|
+
next if klass.nil?
|
110
|
+
|
109
111
|
klass_name = demodulize(klass.to_s)
|
110
112
|
obj_name = obj.name.to_s
|
111
113
|
rpath = obj.rpath
|
@@ -137,53 +139,53 @@ module Ree
|
|
137
139
|
def recursively_index_module(mod, index_hsh, package, mod_index)
|
138
140
|
return if !mod.is_a?(Module)
|
139
141
|
return if mod_index[mod]
|
140
|
-
|
142
|
+
|
141
143
|
mod_index[mod] = true
|
142
|
-
|
144
|
+
|
143
145
|
mod.constants.each do |const_name|
|
144
146
|
const = mod.const_get(const_name)
|
145
|
-
|
147
|
+
|
146
148
|
recursively_index_module(const, index_hsh, package, mod_index)
|
147
|
-
|
149
|
+
|
148
150
|
next if !const.is_a?(Class)
|
149
151
|
next if package.objects.any? { |o| o.klass == const }
|
150
152
|
next if index_hsh[:classes].has_key?(demodulize(const.name))
|
151
|
-
|
153
|
+
|
152
154
|
const_abs_path = mod.const_source_location(const.name)&.first
|
153
155
|
next if !const_abs_path
|
154
|
-
|
156
|
+
|
155
157
|
rpath = Pathname.new(const_abs_path).relative_path_from(Ree.root_dir).to_s
|
156
158
|
hsh = index_class(const, rpath, package.name)
|
157
159
|
class_name = demodulize(const.name)
|
158
|
-
|
160
|
+
|
159
161
|
index_hsh[:classes][class_name] ||= []
|
160
162
|
index_hsh[:classes][class_name] << hsh
|
161
163
|
end
|
162
164
|
end
|
163
|
-
|
165
|
+
|
164
166
|
def index_class(klass, rpath, package_name)
|
165
167
|
all_methods = klass.public_instance_methods(false)
|
166
168
|
orig_methods = all_methods.grep(/original/)
|
167
|
-
|
169
|
+
|
168
170
|
methods = (all_methods - orig_methods) # remove aliases defined by contracts
|
169
171
|
.map { |m|
|
170
172
|
orig_method_name = orig_methods.find { |om| om.match(/original_#{Regexp.escape(m.name)}_[0-9a-fA-F]+/) }
|
171
173
|
orig_method = orig_method_name ? klass.public_instance_method(orig_method_name) : nil
|
172
|
-
|
174
|
+
|
173
175
|
{
|
174
176
|
name: m,
|
175
177
|
parameters: orig_method&.parameters&.map { |param| { name: param.last, required: param.first } },
|
176
178
|
location: orig_method&.source_location&.last,
|
177
179
|
}
|
178
180
|
}
|
179
|
-
|
181
|
+
|
180
182
|
{
|
181
183
|
path: rpath,
|
182
184
|
package: package_name,
|
183
185
|
methods: methods
|
184
186
|
}
|
185
187
|
end
|
186
|
-
|
188
|
+
|
187
189
|
def index_dao(klass, rpath, package_name)
|
188
190
|
filters = (klass.instance_variable_get(:@filters) || []).map do
|
189
191
|
{
|
@@ -194,14 +196,14 @@ module Ree
|
|
194
196
|
location: _1.proc&.source_location&.last
|
195
197
|
}
|
196
198
|
end
|
197
|
-
|
199
|
+
|
198
200
|
{
|
199
201
|
path: rpath,
|
200
202
|
package: package_name,
|
201
203
|
methods: filters
|
202
204
|
}
|
203
205
|
end
|
204
|
-
|
206
|
+
|
205
207
|
def index_exceptions(errors_package, index_hash)
|
206
208
|
errors_package.objects.each do |obj|
|
207
209
|
const_name = demodulize(obj.class_name)
|
@@ -209,17 +211,17 @@ module Ree
|
|
209
211
|
Ree::PathHelper.abs_package_module_dir(errors_package),
|
210
212
|
obj.name.to_s + ".rb"
|
211
213
|
)
|
212
|
-
|
214
|
+
|
213
215
|
hsh = {
|
214
216
|
path: file_name,
|
215
217
|
package: errors_package.name,
|
216
218
|
methods: []
|
217
219
|
}
|
218
|
-
|
220
|
+
|
219
221
|
index_hash[:classes][const_name] ||= []
|
220
222
|
index_hash[:classes][const_name] << hsh
|
221
223
|
end
|
222
|
-
|
224
|
+
|
223
225
|
index_hash
|
224
226
|
end
|
225
227
|
|
@@ -262,4 +264,4 @@ module Ree
|
|
262
264
|
end
|
263
265
|
end
|
264
266
|
end
|
265
|
-
end
|
267
|
+
end
|
data/lib/ree/cli/spec_runner.rb
CHANGED
@@ -93,6 +93,8 @@ module Ree
|
|
93
93
|
@packages_to_run.each do |package|
|
94
94
|
ree_package = Ree.container.packages_facade.get_package(package)
|
95
95
|
|
96
|
+
next if ree_package.dir.nil?
|
97
|
+
|
96
98
|
Ree::SpecRunner::Runner.new(
|
97
99
|
path: Ree::PathHelper.project_root_dir(ree_package),
|
98
100
|
package: package,
|
@@ -47,7 +47,7 @@ class Ree::PackageLoader
|
|
47
47
|
|
48
48
|
if package.dir.nil?
|
49
49
|
package.set_schema_loaded
|
50
|
-
return package
|
50
|
+
return @loaded_packages[name] = package
|
51
51
|
end
|
52
52
|
|
53
53
|
not_loaded = Set.new(
|
@@ -92,4 +92,4 @@ class Ree::PackageLoader
|
|
92
92
|
|
93
93
|
@loaded_packages[name] = package
|
94
94
|
end
|
95
|
-
end
|
95
|
+
end
|
data/lib/ree/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.46
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ruslan Gatiyatov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|