restpack_service 0.0.52 → 0.0.53
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84652f92ea9880620294d24dbd3b1a3209f0cd1c
|
|
4
|
+
data.tar.gz: c8e07adc1114cbc3e211047828e5e0d512d1b65c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 55238c61e69c5365cee4ba22bc4c98d6c3627120fb4fe42ca721a514f0ae7120b67bce2974a94b7df57085ce7e8f10efd3f54e52625c7a4daaa351a2d848c661
|
|
7
|
+
data.tar.gz: 6b2a08d9088d7d26f65d881207eedcb22a04b89a29287cf50d52b0099006b66f7c40013e1f5c4579ac6ca9b934fc5e9f8112ba062e2639a81e79f89a9a352a82
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
module Models;end
|
|
2
|
+
module Serializers;end
|
|
3
|
+
module Commands;end
|
|
4
|
+
module Tasks;end
|
|
5
|
+
|
|
1
6
|
module RestPack::Service
|
|
2
7
|
class Loader
|
|
3
8
|
|
|
@@ -8,39 +13,23 @@ module RestPack::Service
|
|
|
8
13
|
require 'active_support/core_ext'
|
|
9
14
|
|
|
10
15
|
restpack_service_name = "restpack_#{name}_service"
|
|
11
|
-
restpack_namespace = "RestPack::#{name.capitalize}"
|
|
12
16
|
service_path = self.get_service_path(caller, restpack_service_name)
|
|
13
17
|
|
|
14
18
|
require "#{service_path}/version"
|
|
15
19
|
require "#{service_path}/configuration"
|
|
16
20
|
require_all "#{service_path}/tasks"
|
|
17
21
|
|
|
18
|
-
require_service_module 'models', service_path
|
|
19
|
-
require_service_module 'serializers', service_path
|
|
20
|
-
require_service_module 'commands', service_path
|
|
21
|
-
require_service_module 'jobs', service_path
|
|
22
|
+
require_service_module 'models', service_path
|
|
23
|
+
require_service_module 'serializers', service_path
|
|
24
|
+
require_service_module 'commands', service_path
|
|
25
|
+
require_service_module 'jobs', service_path
|
|
22
26
|
end
|
|
23
27
|
|
|
24
28
|
private
|
|
25
29
|
|
|
26
|
-
def self.require_service_module(module_name, service_path
|
|
30
|
+
def self.require_service_module(module_name, service_path)
|
|
27
31
|
path = "#{service_path}/#{module_name.downcase}"
|
|
28
|
-
|
|
29
|
-
if File.directory?(path)
|
|
30
|
-
require_all path
|
|
31
|
-
module_sym = module_name.capitalize.to_sym
|
|
32
|
-
|
|
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
|
|
39
|
-
|
|
40
|
-
unless existing_module
|
|
41
|
-
Object.const_set module_sym, proxy_module
|
|
42
|
-
end
|
|
43
|
-
end
|
|
32
|
+
require_all(path) if File.directory?(path)
|
|
44
33
|
end
|
|
45
34
|
|
|
46
35
|
def self.get_service_path(load_caller, restpack_service_name)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
def it_acts_as_create_command(type)
|
|
2
2
|
plural = "#{type}s".to_sym
|
|
3
|
+
namespaced_type = "#{plural.to_s.camelize}::#{type.to_s.camelize}"
|
|
3
4
|
|
|
4
|
-
model_class = "Models::#{
|
|
5
|
-
serializer_class = "Serializers::#{
|
|
5
|
+
model_class = "Models::#{namespaced_type}".constantize
|
|
6
|
+
serializer_class = "Serializers::#{namespaced_type}".constantize
|
|
6
7
|
|
|
7
8
|
let(:response) { subject.class.run(params) }
|
|
8
9
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: restpack_service
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.53
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gavin Joyce
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-11-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mutations
|