service_manager 0.5 → 0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/service_manager.rb +11 -6
- metadata +3 -3
data/lib/service_manager.rb
CHANGED
@@ -9,16 +9,21 @@ module ServiceManager
|
|
9
9
|
|
10
10
|
def services
|
11
11
|
return @services if @services
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
|
13
|
+
(@services = []).tap do
|
14
|
+
load_services if service_files_loaded.empty?
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def service_files_loaded
|
19
|
+
@service_files_loaded ||= []
|
15
20
|
end
|
16
21
|
|
17
22
|
def load_services(path = nil)
|
18
|
-
path
|
19
|
-
return if
|
23
|
+
path = File.expand_path(path || SERVICES_PATH, Dir.pwd)
|
24
|
+
return if service_files_loaded.include?(path)
|
25
|
+
service_files_loaded << path
|
20
26
|
load path
|
21
|
-
@services_loaded = true
|
22
27
|
end
|
23
28
|
|
24
29
|
def define_service(name = nil, &block)
|
metadata
CHANGED