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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 34ff69301b9fa63b2c534550296f6767b08c665a
4
- data.tar.gz: 5a697f1cc539401d1d995645036f2c86b9c7bd38
3
+ metadata.gz: b109fb7ba14facabbfaeddc87357394a71ec0aa6
4
+ data.tar.gz: 1bf4f2b37733581ed770e45217c15fa0c9c6890a
5
5
  SHA512:
6
- metadata.gz: c9bd1f37f9fa5d99d83878f5a7f38eb64d4aa5ef485ec68c97c76d33f03a7c3bc0add05b33aa0dabf00effc479679111de903af04cff3d19bc44cd6df99a49e0
7
- data.tar.gz: b7a825749f86fc6e1f8bc2056740ecfda0c0391f4a81a9b4b2d4a49c4ac94de3e77559a473cbb9050518b58642cc79f03063b69cb0c15b67c573ea9b4958cf40
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 registered_service
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.2
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: 2017-12-29 00:00:00.000000000 Z
11
+ date: 2018-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec