yogi_berra 0.0.11 → 0.0.12
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 +8 -8
- data/lib/yogi_berra/catcher.rb +3 -0
- data/lib/yogi_berra/version.rb +1 -1
- data/spec/spec_helper.rb +2 -1
- data/spec/yogi_berra_catcher_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTJhMzExNWE5ZDk5Zjk3ZWQwMDhiM2JmZTBhZmQxMjkyNzE2MDdkNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODQ0OTUxZWFkNjFkNGY2ZTE1ZTgwMzk3ZmEzNGQ0ZmU4NTZmYjlmNA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjEwN2I5MThmNDM1ODZiZjljZTNiNTUyNzIxNWVjYjkzNjA4ZmQ1ZTAxNjNj
|
10
|
+
OWNkY2JmMTY4MGUzYWY4N2I5Mjc0YzMwMzQxMjk3ZjFjZDI1YzM1YjE1MDky
|
11
|
+
MTRhYjg4Zjk5ZGM3MjcyM2NhNzhkZjNmMTRjY2E5YzBmMDYwY2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2FkYTk0MTI0ZmUyNjc4OGEzYjAxYTUzMjNkN2ZmZmE5NmU1ZjFjOTFkNmZh
|
14
|
+
MGI2NDZhZTk3MGJmNTVmM2E4OWNkZjRhMzc3NDkwNzA2NDQ3N2NmYjk3NTQw
|
15
|
+
YWIyODQ0ZmM4YjExNmRkOGQ0OGNlNjIzMmM2YWEzMTVmM2U1ODA=
|
data/lib/yogi_berra/catcher.rb
CHANGED
@@ -64,6 +64,9 @@ module YogiBerra
|
|
64
64
|
client = db_client(host, port, replica_set)
|
65
65
|
if client
|
66
66
|
@@connection = client[@@settings["database"]]
|
67
|
+
if @@connection && @@settings["username"] && @@settings["password"]
|
68
|
+
@@connection.authenticate(@@settings["username"], @@settings["password"])
|
69
|
+
end
|
67
70
|
else
|
68
71
|
YogiBerra::Logger.log("Couldn't connect to the mongo database on host: #{host} port: #{port}.", :error)
|
69
72
|
end
|
data/lib/yogi_berra/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -20,11 +20,12 @@ def build_session
|
|
20
20
|
}
|
21
21
|
end
|
22
22
|
|
23
|
-
def mock_mongo_client(client_should = false, connection_should = false)
|
23
|
+
def mock_mongo_client(client_should = false, connection_should = false, auth = true)
|
24
24
|
mongo_client = double('mongo client')
|
25
25
|
mongo_connection = double('mongo connection')
|
26
26
|
Mongo::MongoClient.should_receive(:new) { mongo_client }
|
27
27
|
mongo_client.should_receive(:[]) { mongo_connection } if client_should
|
28
|
+
mongo_connection.should_receive(:authenticate) if auth
|
28
29
|
if connection_should
|
29
30
|
mongo_connection.should_receive(:[]) { mongo_connection }
|
30
31
|
mongo_connection.should_receive(:insert)
|
@@ -33,7 +33,7 @@ describe YogiBerra::Catcher do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should grab a connection to mongodb" do
|
36
|
-
mock_mongo_client
|
36
|
+
mock_mongo_client(false, false, false)
|
37
37
|
yaml = nil
|
38
38
|
yaml = YogiBerra::Catcher.load_db_settings(@test_yaml)
|
39
39
|
db_client = YogiBerra::Catcher.db_client(YogiBerra::Catcher.settings["host"], YogiBerra::Catcher.settings["port"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yogi_berra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Earl Krauss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|