arkaan 0.6.10 → 0.7.0

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: 88d335fe22ab617c79dcb9344eb80f2c5b633848
4
- data.tar.gz: e3fcbf1ede55a60043e6175deefc4d184c2a87f9
3
+ metadata.gz: 07b4489f79230ccb811f9d1ce8450b9d3b3f4f09
4
+ data.tar.gz: e9b8a2f2b4fc2077fbefb9c03f27deab149ac00b
5
5
  SHA512:
6
- metadata.gz: 38218bbfd872500781e4c89343da2810a1eb50c283be3b5ff5d14e55eeb00671ab24b8ffc159cf8d3049c9a160bc08df626911fbbf5e31c6084534166649bb38
7
- data.tar.gz: 0e11c06306721dc46167527c018140581a24ce19dff1d6c5cb57cdc90abf68a4658b73f8dafd0b962e5039a4972cb4fcd6ab149a0aa588ca7a027de96b09bcb6
6
+ metadata.gz: 27c4afac918bef59a56c8f6cba6b0b44d9c7e5433d1edf7fd25b6a7e0f87358ad8ff6028cc991f0f550af0cfb0050c886b10d1b8d27cbdd58c71b6bef2d74b1d
7
+ data.tar.gz: a60ed29bf413cd20889560f183058f36ad57094f2cbe809337d120d41f7ae38c95eea61b8b1795ef5ec93d9afd45490f3bc2f3b54748350002682c0f7826e1e6
@@ -1,6 +1,6 @@
1
1
  module Arkaan
2
2
  module Monitoring
3
- # A route is an endpoint accessible in a service. Each route has to have an associated endpoint in the deeeeployed instances.
3
+ # A route is an endpoint accessible in a service. Each route has to have an associated endpoint in the deployed instances.
4
4
  # @param Vincent Courtois <courtois.vincent@outlook.com>
5
5
  class Route
6
6
  include Mongoid::Document
@@ -9,16 +9,22 @@ module Arkaan
9
9
 
10
10
  # @!attribute [rw] path
11
11
  # @return [String] the path (URI) of the route in the service?
12
- field :path, type: String
12
+ field :path, type: String, default: '/'
13
13
  # @!attribute [rw] verb
14
14
  # @return [String] the verb (HTTP method) of this route in the service.
15
- field :verb, type: String
15
+ field :verb, type: String, default: 'get'
16
16
 
17
17
  make_premiumable
18
18
 
19
19
  # @!attribute [rw] service
20
20
  # @return [Arkaan::Monitoring::Service] the service in which this route is declared.
21
21
  embedded_in :service, class_name: 'Arkaan::Monitoring::Service', inverse_of: :routes
22
+
23
+ validates :path,
24
+ format: {with: /\A(\/[A-Za-z0-9\/])+\z/, message: 'route.path.format', if: :path?}
25
+
26
+ validates :verb,
27
+ inclusion: {message: 'route.verb.unknown', in: ['get', 'post', 'put', 'delete', 'patch', 'option']}
22
28
  end
23
29
  end
24
30
  end
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.6.10
4
+ version: 0.7.0
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-27 00:00:00.000000000 Z
11
+ date: 2017-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec