mongo-configure 0.1.3 → 0.1.4
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 +4 -4
- data/.travis.yml +3 -1
- data/Gemfile +4 -0
- data/lib/mongo/configure/version.rb +1 -1
- data/spec/mongo/configure/uri_spec.rb +72 -26
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e35ff567d3786ea6be16a320d1740f4d2910273b
|
4
|
+
data.tar.gz: 4a1e7f101cf949763e58b00e13187e2d1feb2006
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf651f421536f5b639933ebcf9ea6039c1144cfa1f217c04584d2b6dcde6235e73e279246b6a34706a9b60d36265460bbad0940a1aaedde3cf772c86a227994a
|
7
|
+
data.tar.gz: 1d83d69ef0173bfb45a7dac8877e5de1a446393dc89a1c749f1a77d6f53067059f821c2859ab1b910b397549579f9745353f2370618026f5ed8256805c36e24d
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,35 +2,81 @@ require 'mongo/configure/uri'
|
|
2
2
|
|
3
3
|
describe 'parsing Mongo URIs' do
|
4
4
|
describe 'falling back to defaults' do
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
let(:uri) { Mongo::Configure::URI.new }
|
6
|
+
it "sets scheme" do
|
7
|
+
expect(uri.scheme).to eq 'mongodb'
|
8
|
+
end
|
9
|
+
it "sets host" do
|
10
|
+
expect(uri.host).to eq 'localhost'
|
11
|
+
end
|
12
|
+
it "sets port" do
|
13
|
+
expect(uri.port).to eq '27017'
|
14
|
+
end
|
15
|
+
it "sets database" do
|
16
|
+
expect(uri.database).to eq ''
|
17
|
+
end
|
18
|
+
it "sets user" do
|
19
|
+
expect(uri.user).to eq nil
|
20
|
+
end
|
21
|
+
it "sets password" do
|
22
|
+
expect(uri.password).to eq nil
|
23
|
+
end
|
24
|
+
it "sets to_s" do
|
25
|
+
expect(uri.to_s).to eq 'mongodb://localhost:27017/'
|
26
|
+
end
|
13
27
|
end
|
14
28
|
describe 'setting elements' do
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
29
|
+
let(:uri) { Mongo::Configure::URI.new "secretsquirrel",'server.name','666','data','user','s3kr1t' }
|
30
|
+
it "sets scheme" do
|
31
|
+
expect(uri.scheme).to eq 'secretsquirrel'
|
32
|
+
end
|
33
|
+
it "sets host" do
|
34
|
+
expect(uri.host).to eq 'server.name'
|
35
|
+
end
|
36
|
+
it "sets port" do
|
37
|
+
expect(uri.port).to eq '666'
|
38
|
+
end
|
39
|
+
it "sets database" do
|
40
|
+
expect(uri.database).to eq 'data'
|
41
|
+
end
|
42
|
+
it "sets user" do
|
43
|
+
expect(uri.user).to eq 'user'
|
44
|
+
end
|
45
|
+
it "sets password" do
|
46
|
+
expect(uri.password).to eq 's3kr1t'
|
47
|
+
end
|
48
|
+
it "sets auth" do
|
49
|
+
expect(uri.auth).to eq 'user:s3kr1t@'
|
50
|
+
end
|
51
|
+
it "sets to_s" do
|
52
|
+
expect(uri.to_s).to eq 'secretsquirrel://user:s3kr1t@server.name:666/data'
|
53
|
+
end
|
24
54
|
end
|
25
55
|
describe 'parsing a supplied uri' do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
56
|
+
let(:uri) { Mongo::Configure::URI.parse "secretsquirrel://user:s3kr1t@server.name:666/data" }
|
57
|
+
it "sets scheme" do
|
58
|
+
expect(uri.scheme).to eq 'secretsquirrel'
|
59
|
+
end
|
60
|
+
it "sets host" do
|
61
|
+
expect(uri.host).to eq 'server.name'
|
62
|
+
end
|
63
|
+
it "sets port" do
|
64
|
+
expect(uri.port).to eq '666'
|
65
|
+
end
|
66
|
+
it "sets database" do
|
67
|
+
expect(uri.database).to eq 'data'
|
68
|
+
end
|
69
|
+
it "sets user" do
|
70
|
+
expect(uri.user).to eq 'user'
|
71
|
+
end
|
72
|
+
it "sets password" do
|
73
|
+
expect(uri.password).to eq 's3kr1t'
|
74
|
+
end
|
75
|
+
it "sets auth" do
|
76
|
+
expect(uri.auth).to eq 'user:s3kr1t@'
|
77
|
+
end
|
78
|
+
it "sets to_s" do
|
79
|
+
expect(uri.to_s).to eq 'secretsquirrel://user:s3kr1t@server.name:666/data'
|
80
|
+
end
|
35
81
|
end
|
36
82
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo-configure
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Rowe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: morphine
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.2.
|
109
|
+
rubygems_version: 2.2.2
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: A simple gem for configuring mongo databases.
|