arkaan 0.7.5 → 0.7.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.
- checksums.yaml +4 -4
- data/lib/arkaan/utils/micro_service.rb +14 -13
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd10beb54eb3bf3084e66dd2116638774086a903
|
4
|
+
data.tar.gz: 1773ac97cd2237923d42f7e71cad4697b0fb54fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e06f03c1e39e17a7fcac7d14c52408403bcda6bf178e72ce8b197e2f2a81064d25a435442e3419285543b809cb4603b4ab5344d0f260e0d04f3c1c9281a2e89d
|
7
|
+
data.tar.gz: d02e70b47ac48b7b8dde712027d889aaafbaced9e6a9e60f3278ad1121c0099f5880db4601ca773d847ac5733b549e0562d2526f753b9df0f157aacf83637803
|
@@ -11,10 +11,14 @@ module Arkaan
|
|
11
11
|
# @!attribute [r] location
|
12
12
|
# @return [String] the path to the file loading the whole application, used to deduce the loading paths.
|
13
13
|
attr_reader :location
|
14
|
+
# @!attribute [r] name
|
15
|
+
# @return [String] the name of the service, used later to instantiate it when the mongoid configuration is fully loaded.
|
16
|
+
attr_reader :name
|
14
17
|
|
15
18
|
def initialize
|
16
19
|
@location = false
|
17
20
|
@service = false
|
21
|
+
@name = false
|
18
22
|
end
|
19
23
|
|
20
24
|
# Determines if the application can be loaded (all the parameters have been correctly set)
|
@@ -29,19 +33,11 @@ module Arkaan
|
|
29
33
|
return service ? service.path : false
|
30
34
|
end
|
31
35
|
|
32
|
-
# Getter for the name of the service.
|
33
|
-
# @return [String, Boolean] the name of the service as it is registered in the database, or FALSE if it's not set already.
|
34
|
-
def name
|
35
|
-
return service ? service.key : false
|
36
|
-
end
|
37
|
-
|
38
36
|
# Look for the service and sets it if it's found in the database, or set it to nil if not found.
|
39
37
|
# @param [String] service_name - the name of the service to look for in the database.
|
40
38
|
# @return [Arkaan::utils::MicroService] the instance of the micro-service to chain other calls.
|
41
39
|
def register_as(service_name)
|
42
|
-
@
|
43
|
-
register_service if @service.nil?
|
44
|
-
register_instance
|
40
|
+
@name = service_name
|
45
41
|
return self
|
46
42
|
end
|
47
43
|
|
@@ -81,10 +77,15 @@ module Arkaan
|
|
81
77
|
end
|
82
78
|
|
83
79
|
def load_application(test_mode: false)
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
80
|
+
if !!(name && service && location)
|
81
|
+
@location = File.join(location, '..') if test_mode
|
82
|
+
load_mongoid_configuration
|
83
|
+
@service = Arkaan::Monitoring::Service.where(key: service_name).first
|
84
|
+
register_service if @service.nil?
|
85
|
+
register_instance
|
86
|
+
load_standard_files
|
87
|
+
load_test_files if test_mode
|
88
|
+
end
|
88
89
|
return self
|
89
90
|
end
|
90
91
|
|