restpack_service 0.0.45 → 0.0.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/restpack_service/loader.rb +14 -9
- data/lib/restpack_service/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bec0b10d2eb5b427542de2e71f54606449337562
|
4
|
+
data.tar.gz: 7cb2e1f25acd87b3a3cef8d0b2beda12d8e36189
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f915ea644e36a8960448160c9be5526fa8c27b2b09824a77f36c5f7792d247cc9de04a58b426139c85abb2f91aa7daceb073afe3d9f007aa0067646d436bb493
|
7
|
+
data.tar.gz: ee2997d73b7a1720031d8659a4fd0caf4816bfaf34d9728f8559aac081a18cf7ffdfc2577b98bc3d73472b02baffa9442a66a130510e1bd889d570420e035536
|
@@ -18,23 +18,28 @@ module RestPack::Service
|
|
18
18
|
require_service_module 'models', service_path, restpack_namespace
|
19
19
|
require_service_module 'serializers', service_path, restpack_namespace
|
20
20
|
require_service_module 'commands', service_path, restpack_namespace
|
21
|
+
require_service_module 'jobs', service_path, restpack_namespace
|
21
22
|
end
|
22
23
|
|
23
24
|
private
|
24
25
|
|
25
26
|
def self.require_service_module(module_name, service_path, restpack_namespace)
|
26
|
-
|
27
|
-
module_sym = module_name.capitalize.to_sym
|
27
|
+
path = "#{service_path}/#{module_name.downcase}"
|
28
28
|
|
29
|
-
|
29
|
+
if File.directory?(path)
|
30
|
+
require_all path
|
31
|
+
module_sym = module_name.capitalize.to_sym
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
33
|
+
existing_module = Object.const_defined?(module_sym) ? Object.const_get(module_sym) : nil
|
34
|
+
|
35
|
+
proxy_module = existing_module || Module.new
|
36
|
+
proxy_module.module_eval do
|
37
|
+
include Object.const_get("#{restpack_namespace}::Service::#{module_name.capitalize}")
|
38
|
+
end
|
35
39
|
|
36
|
-
|
37
|
-
|
40
|
+
unless existing_module
|
41
|
+
Object.const_set module_sym, proxy_module
|
42
|
+
end
|
38
43
|
end
|
39
44
|
end
|
40
45
|
|