arkaan 0.7.12 → 0.7.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78b02ea74a0581bb9a5eae9825bb990b304941e6
4
- data.tar.gz: 86aa52d2883254491261c4070ef42f8335b1e857
3
+ metadata.gz: c1f1e209b95f9eb060e34b7c4078d601f880ef9f
4
+ data.tar.gz: 86564f1d3282b2a95d7e15273636d490312285ef
5
5
  SHA512:
6
- metadata.gz: b25aef00de9b2246b48c024f1c68b2f6de273d81a1e046497432936e14ca6308ffcbd7215e869b3d7a95dd572247e8721d6b7af1ee3eb659689210809c78ddcd
7
- data.tar.gz: b6e14875914ca1ab025b470cb61a3713cb3181835da182c76d13e3334660d819f085d0f65fa870cdca7e43da9cb2b30164db2f02aaac4411acef74f78cfae862
6
+ metadata.gz: b793e8c3d05f7b98bd0c86db6c396ad4b16db2c19de6b6a64a570df790a18861bf3e925ab4cf7e3929cb90e7436126add00c50fea0459454e0911af00e7913a9
7
+ data.tar.gz: e1bf66feccaf301a0cb8671a79b2080b5ee8053fff3425dcad736b3eeecb9defda27ec183a5627463fc7b4f9ae078db9d94e8ef59c69da06bb2e48302af8e9c5
@@ -1,3 +1,5 @@
1
+ require 'pry'
2
+
1
3
  module Arkaan
2
4
  module Utils
3
5
  # Base controller to handle the standard error when accessing the API.
@@ -64,10 +64,13 @@ module Arkaan
64
64
 
65
65
  private
66
66
 
67
+ # Registers the service in the database if it has not been created already.
67
68
  def register_service
68
69
  @service = Arkaan::Monitoring::Service.create(key: @name, path: "/#{@name}")
69
70
  end
70
71
 
72
+ # Register the instance of the currently deployed service in the database.
73
+ # @return [Arkaan::Monitoring::Instance] the instance of the micro service currently running.
71
74
  def register_instance
72
75
  instance = @service.instances.where(url: ENV['SERVICE_URL']).first
73
76
  if instance.nil?
@@ -76,6 +79,9 @@ module Arkaan
76
79
  return instance
77
80
  end
78
81
 
82
+ # Loads the configuration for Mongoid, the files of the application, and registers the service and the instance in the database.
83
+ # @param test_mode [Boolean] TRUE to run in test mode (from /spec), FALSE otherwise.
84
+ # @return [Arkaan::Utils::MicroService] the current instance of the micro service to chain other calls.
79
85
  def load_application(test_mode: false)
80
86
  load_mongoid_configuration
81
87
  if !!(@name && location)
@@ -83,7 +89,6 @@ module Arkaan
83
89
  register_service if @service.nil?
84
90
  register_instance
85
91
  if service
86
- @location = File.join(location, '..') if test_mode
87
92
  load_standard_files
88
93
  load_test_files if test_mode
89
94
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arkaan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.12
4
+ version: 0.7.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Courtois