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: 5d2cafce8dad346b82d0e0b2a38cf998008f0e33
4
- data.tar.gz: af860fad3af73ab504481627ce52d4254e084597
3
+ metadata.gz: 1f57ef7f8b1b0c6477c34d78e1c9bd3b8c196e99
4
+ data.tar.gz: cea393abcae13ee1dffb0a69c2ab2be4ab4ae9ba
5
5
  SHA512:
6
- metadata.gz: 889058ce3e9dc5544165723c3b5389fa01162991c5c6f0899a80d86131b824b2063f02a758c26ff7d4932446ffd4b826736e3ef44d9a777d4049f4a735c0f5c7
7
- data.tar.gz: 51d82ac272afb413d58542f51dd023d1783b203ed3837fd5c71674940944f31400f821082561f5e7f2c20119c07a1a7d50390c7399161a105875000485ea1f16
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
- modularize "Models"
17
- modularize "Serializers"
18
- modularize "Commands"
19
- modularize "Tasks"
20
- modularize "Jobs"
21
- modularize "Commands::#{module_name}"
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 = "#{type}s".to_sym
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
 
@@ -1,5 +1,5 @@
1
1
  module RestPack
2
2
  module Service
3
- VERSION = "0.0.58"
3
+ VERSION = "0.0.59"
4
4
  end
5
5
  end
@@ -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.58
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-14 00:00:00.000000000 Z
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