okcomputer 1.2.0 → 1.3.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: 24238bddd672bb4db2ca97ec0abd4460faff2da6
4
- data.tar.gz: fce0dba5d41e276557f3fbdbbc6824d91571d109
3
+ metadata.gz: 348a7006a93a67bfd12d4e4c67c955b29d810a0f
4
+ data.tar.gz: 72f3d48f7f3890f501e347b35c5d291bf8d18b19
5
5
  SHA512:
6
- metadata.gz: 74b1aca6e40aecbea93a345fd8ebe66adceee698266edc9f547f8526457fb63aa66445ede8df6d745925aad9e87b0bfb0f3fbaf80bb31b85186907e4da481a30
7
- data.tar.gz: eee8e54d589b97a9fd6773a8d08ffbaf4111972b4b6bf437161654b7b211ca9c360d9d2f4cc6d42fee108738f0c9f9a162f0b503a6a6ca49a0aa98186d1344e1
6
+ metadata.gz: b42f71808c913eb59b258654f17056c3927b17e0e13c0de1fabac2fe95fe21ab7ba1737af3f45655edc6296faef43d0625e6da4cba7b9afb33e5a994a317cdaf
7
+ data.tar.gz: 461fd07b2a27b6b36370ee96f8dd281a96a3e874d85a602c71c27eabafb51bceff41064ad348fc1f64f296cfc41600e20ad75d31f022b91ea79eb12f27dc7b47
@@ -1,5 +1,17 @@
1
1
  module OkComputer
2
2
  class MongoidCheck < Check
3
+ attr_accessor :session
4
+
5
+ # Public: Initialize a check for a Mongoid replica set
6
+ #
7
+ # session - The name of the Mongoid session to use. Defaults to the
8
+ # default session.
9
+ def initialize(session = :default)
10
+ if Mongoid.respond_to?(:sessions)
11
+ self.session = Mongoid::Sessions.with_name(session)
12
+ end
13
+ end
14
+
3
15
  # Public: Return the status of the mongodb
4
16
  def check
5
17
  mark_message "Connected to mongodb #{mongodb_name}"
@@ -12,8 +24,8 @@ module OkComputer
12
24
  #
13
25
  # Returns a hash with the status of the db
14
26
  def mongodb_stats
15
- if Mongoid.respond_to?(:default_session)
16
- Mongoid.default_session.command(dbStats: 1) # Mongoid 3+
27
+ if session
28
+ session.command(dbStats: 1) # Mongoid 3+
17
29
  else
18
30
  Mongoid.database.stats # Mongoid 2
19
31
  end
@@ -1,3 +1,3 @@
1
1
  module OkComputer
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: okcomputer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Byrne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3