arkaan 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/concerns.rb +1 -0
- data/lib/arkaan/concerns/activable.rb +18 -0
- data/lib/arkaan/monitoring/instance.rb +6 -0
- data/lib/arkaan/monitoring/service.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ab81c60f81276ca7e0405ba1a2d278d306bd16e
|
4
|
+
data.tar.gz: c37126260296a51411f8f667fe76d55c8c1f2eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48e83eb4063aabdaed703bc8c75d3f7485a88d7e396c66d48f388830a3380db9fc91ac1b6ca55cf79c234e25d99d1cd9882389143f5f02b8e2824e91da57be15
|
7
|
+
data.tar.gz: 203dbd24f11e37606a8615d23ffaa5b2372c6438f6405925fc45b701b3a72049eb1f06660a24c028f828039630a0c1303b8a4923f95c5a8607c4d119d5b49b39
|
data/lib/arkaan/concerns.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Arkaan
|
2
|
+
module Concerns
|
3
|
+
# Concerns for the objects that can be activated or deactivated, included the corresponding scopes.
|
4
|
+
# @author Vincent Courtois <courtois.vincent@outlook.com>
|
5
|
+
module Activable
|
6
|
+
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
included do
|
9
|
+
# @!attribute [rw] active
|
10
|
+
# @return [Boolean] the active status of the instance, indicating if someone has deactivated it or not.
|
11
|
+
field :active, type: Boolean, default: false
|
12
|
+
|
13
|
+
scope :active , ->{ where(active: true) }
|
14
|
+
scope :inactive, ->{ where(active: false) }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -5,10 +5,16 @@ module Arkaan
|
|
5
5
|
class Instance
|
6
6
|
include Mongoid::Document
|
7
7
|
include Mongoid::Timestamps
|
8
|
+
include Arkaan::Concerns::Activable
|
8
9
|
|
9
10
|
# @!attribute [rw] url
|
10
11
|
# @return [String] the URL of the instance, where the requests will be issued.
|
11
12
|
field :url, type: String
|
13
|
+
# @!attribute [rw] running
|
14
|
+
# @return [Boolean] the running status of the instance, indicating if it can be used or not.
|
15
|
+
field :running, type: Boolean, default: false
|
16
|
+
|
17
|
+
scope :running , ->{ where(running: true) }
|
12
18
|
|
13
19
|
# @!attribute [r] service
|
14
20
|
# @return [Arkaan::Monitoring::Service] the service this instance is linked to.
|
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.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/arkaan.rb
|
160
160
|
- lib/arkaan/account.rb
|
161
161
|
- lib/arkaan/concerns.rb
|
162
|
+
- lib/arkaan/concerns/activable.rb
|
162
163
|
- lib/arkaan/concerns/sluggable.rb
|
163
164
|
- lib/arkaan/monitoring.rb
|
164
165
|
- lib/arkaan/monitoring/instance.rb
|