restpack_service 0.0.58 → 0.0.59
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f57ef7f8b1b0c6477c34d78e1c9bd3b8c196e99
|
4
|
+
data.tar.gz: cea393abcae13ee1dffb0a69c2ab2be4ab4ae9ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 081126a232498b8b2ef9e9fc364a8b09ef1cee217762786dca2f22fd5c4c85cc10e4d5a6e28abbd9abce5611eb201f9368849efe4e0c2e4ac3a8d23e36535ae2
|
7
|
+
data.tar.gz: 4f607e270ba231fe6a72077ddb30a5d84da3af363701baebdfca6edf7a987f137b900fc0cfcfc8e37b16ab48f96b3a932b55a71bc5f6cc620e016842a0216874
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'modularize'
|
2
|
+
|
1
3
|
module RestPack::Service
|
2
4
|
class Loader
|
3
5
|
|
@@ -13,12 +15,12 @@ module RestPack::Service
|
|
13
15
|
require "#{service_path}/configuration"
|
14
16
|
require_all "#{service_path}/tasks"
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
Modularize.create "Models"
|
19
|
+
Modularize.create "Serializers"
|
20
|
+
Modularize.create "Commands"
|
21
|
+
Modularize.create "Tasks"
|
22
|
+
Modularize.create "Jobs"
|
23
|
+
Modularize.create "Commands::#{module_name}"
|
22
24
|
|
23
25
|
require_service_module 'models', service_path
|
24
26
|
require_service_module 'serializers', service_path
|
@@ -28,20 +30,6 @@ module RestPack::Service
|
|
28
30
|
|
29
31
|
private
|
30
32
|
|
31
|
-
def self.modularize(path) #TODO: GJ: extract to a gem
|
32
|
-
root = Object
|
33
|
-
path.split('::').each do |name|
|
34
|
-
new_module = root.const_defined?(name) ? root.const_get(name) : nil
|
35
|
-
|
36
|
-
unless new_module
|
37
|
-
new_module = Module.new
|
38
|
-
root.const_set name, new_module
|
39
|
-
end
|
40
|
-
|
41
|
-
root = new_module
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
33
|
def self.require_service_module(module_name, service_path)
|
46
34
|
path = "#{service_path}/#{module_name.downcase}"
|
47
35
|
require_all(path) if File.directory?(path)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
def it_acts_as_create_command(namespace, type)
|
2
|
-
plural =
|
2
|
+
plural = type.to_s.pluralize.to_sym
|
3
3
|
namespaced_type = "#{namespace.to_s.camelize}::#{type.to_s.camelize}"
|
4
|
-
|
5
4
|
model_class = "Models::#{namespaced_type}".constantize
|
6
5
|
serializer_class = "Serializers::#{namespaced_type}".constantize
|
7
6
|
|
data/restpack_service.gemspec
CHANGED
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency "require_all", "~> 1.3.0"
|
25
25
|
spec.add_dependency "restpack_serializer"
|
26
26
|
spec.add_dependency "restpack_gem"
|
27
|
+
spec.add_dependency "modularize"
|
27
28
|
spec.add_dependency "sinatra", "~> 1.4.3"
|
28
29
|
spec.add_dependency "pg", "~> 0.16.0"
|
29
30
|
spec.add_dependency "sidekiq", "~> 2.15.1"
|
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.59
|
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-
|
11
|
+
date: 2013-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mutations
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: modularize
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: sinatra
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|