service_manager 0.5 → 0.6
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.
- 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