arkaan 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/utils/micro_service.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b109fb7ba14facabbfaeddc87357394a71ec0aa6
|
4
|
+
data.tar.gz: 1bf4f2b37733581ed770e45217c15fa0c9c6890a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cd75aa9edf81cc6a95ab59970ed815923d86ee9705161ce3a169beb2162eb61545d735b3038eb1972542c04d4d2483fd8532f27ae093f8a836949ac1356bb56
|
7
|
+
data.tar.gz: 4441e98f83bf4df315170d8ea61a7425c789e1b45b9743523ef184c4d21da97c1f564cab687e313d74ccc4fef120e44bdfd64ea5674c2bc7b997bceed84ef425
|
@@ -7,10 +7,15 @@ module Arkaan
|
|
7
7
|
# @!attribute [r] root
|
8
8
|
# @return [String] the root path of the application, from where each path is deduced.
|
9
9
|
attr_reader :root
|
10
|
-
|
10
|
+
# @!attribute [r] name
|
11
|
+
# @return [String] the name of the service, given when initializing it.
|
11
12
|
attr_reader :name
|
12
|
-
|
13
|
+
# @!attribute [r] test_mode
|
14
|
+
# @return [Boolean] TRUE if the micro service is initialized from a test suite, FALSE otherwise.
|
13
15
|
attr_reader :test_mode
|
16
|
+
# @!attribute [r] service
|
17
|
+
# @return [Arkaan::Monitoring::Service] the service stored in the database corresponding to this application.
|
18
|
+
attr_reader :service
|
14
19
|
|
15
20
|
# loads the application by requiring the files from the folders they're supposed to be in.
|
16
21
|
# @param name [String] the snake-cased name of the application, for service registration purpose mainly.
|
@@ -19,6 +24,7 @@ module Arkaan
|
|
19
24
|
@root = test_mode ? File.join(root, '..') : root
|
20
25
|
@name = name
|
21
26
|
@test_mode = test_mode
|
27
|
+
@service = register_service
|
22
28
|
end
|
23
29
|
|
24
30
|
# Loads the necessary components for the application by requiring the needed files.
|
@@ -36,7 +42,7 @@ module Arkaan
|
|
36
42
|
|
37
43
|
# Creates the service instance if necessary, and returns it.
|
38
44
|
# @return [Arkaan::Monitoring::Service] the service in the registry corresponding to this micro-service.
|
39
|
-
def
|
45
|
+
def register_service
|
40
46
|
service = Arkaan::Monitoring::Service.where(key: @name).first
|
41
47
|
if service.nil?
|
42
48
|
service = Arkaan::Monitoring::Service.create!(key: @name, path: "/#{@name}", premium: true, active: true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkaan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|