mongo-configure 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4cfeda67c5301f0fd4caa5c94842451b51a49425
4
+ data.tar.gz: 242bad5ab5796ebe86eff752c3d1e3d548267764
5
+ SHA512:
6
+ metadata.gz: b488674649f604892c3f7b6d2dd84ed00e7e60869d56631cfe4756ae1ce1e3348e0db6d22be0fdc2025c93d32f6b769962d4d4cf11fdea22811724e6b0c0894a
7
+ data.tar.gz: 309424023e008d249b242e11c8a736276abc6d1dfad25f45fac3056d50b2cfbe302c247c0d716d27dc45f9034b0de69a89f502733a3d93bc117eb8695d36ea24
checksums.yaml.gz.sig ADDED
@@ -0,0 +1 @@
1
+ �Ëa�'"?Qę���rs�M����S��nز �����ُ$$V� <ٱ��9���$~�)�İ�����հ`�L����D����Ɖ����֖uc+o u@�"f��N�?$�9]��0\o����#}װBaLa���s �7�,1�N/:�LUcd�xi>M���:�K��U����dxV��u-�щ��0���nC��C���I���%�e�#�����W�ek��a�^_��j��� ��t|)�3�f�y
data.tar.gz.sig ADDED
Binary file
data/.travis.yml CHANGED
@@ -1,12 +1,16 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.0-preview2
4
+ - 2.0.0
3
5
  - 1.9.3
4
6
  - 1.9.2
5
7
  - jruby-18mode
6
8
  - jruby-19mode
7
9
  - rbx-18mode
8
10
  - rbx-19mode
9
- - ruby-head
10
- - 1.8.7
11
- - ree
12
11
  script: bundle exec rspec
12
+ matrix:
13
+ allow_failures:
14
+ - rvm: rbx-19mode
15
+ - rvm: rbx-18mode
16
+ - rvm: 2.1.0-preview2
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
- [![Build Status](https://secure.travis-ci.org/JonRowe/mongo-configure.png)](http://travis-ci.org/JonRowe/mongo-configure)
2
1
  # Mongo::Configure
2
+ [![Build Status](https://secure.travis-ci.org/JonRowe/mongo-configure.png)](http://travis-ci.org/JonRowe/mongo-configure) [![Code Climate](https://codeclimate.com/github/JonRowe/mongo-configure.png)](https://codeclimate.com/github/JonRowe/mongo-configure)
3
3
 
4
4
  A simple gem for configuring mongo databases.
5
5
 
@@ -28,7 +28,7 @@ module Mongo
28
28
  @config = Config.new URI.new.tap { |uri| uri.database = name }
29
29
  end
30
30
  def current
31
- @config ||= new
31
+ @config ||= Config.new 'localhost/database'
32
32
  end
33
33
 
34
34
  end
@@ -1,5 +1,5 @@
1
1
  module Mongo
2
2
  module Configure
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -2,42 +2,45 @@ require 'mongo/configure'
2
2
 
3
3
  describe 'configuring databases' do
4
4
  describe 'from a uri' do
5
- subject do
6
- Mongo::Configure.from_uri('secretsquirrel://server.name:666/data').uri
7
- end
8
- its(:scheme) { should == 'secretsquirrel' }
9
- its(:host) { should == 'server.name' }
10
- its(:port) { should == '666' }
11
- its(:database) { should == 'data' }
12
- its(:auth) { should == '' }
13
- its(:to_s) { should == 'secretsquirrel://server.name:666/data' }
5
+ let(:config) { Mongo::Configure.from_uri('secretsquirrel://server.name:666/data').uri }
6
+
7
+ example { expect(config.scheme).to eq 'secretsquirrel' }
8
+ example { expect(config.host).to eq 'server.name' }
9
+ example { expect(config.port).to eq '666' }
10
+ example { expect(config.database).to eq 'data' }
11
+ example { expect(config.auth).to eq '' }
12
+ example { expect(config.to_s).to eq 'secretsquirrel://server.name:666/data' }
14
13
 
15
14
  context "with authentication" do
16
- subject do
17
- Mongo::Configure.from_uri('secretsquirrel://squirrel:s3krit@server.name:666/data').uri
18
- end
19
- its(:user) { should == 'squirrel' }
20
- its(:password) { should == 's3krit' }
21
- its(:auth) { should == 'squirrel:s3krit@' }
22
- its(:to_s) { should == 'secretsquirrel://squirrel:s3krit@server.name:666/data' }
15
+ let(:config) { Mongo::Configure.from_uri('secretsquirrel://squirrel:s3krit@server.name:666/data').uri }
16
+
17
+ example { expect(config.user).to eq 'squirrel' }
18
+ example { expect(config.password).to eq 's3krit' }
19
+ example { expect(config.auth).to eq 'squirrel:s3krit@' }
20
+ example { expect(config.to_s).to eq 'secretsquirrel://squirrel:s3krit@server.name:666/data' }
23
21
  end
24
22
  end
25
23
 
26
24
  describe "configuration via database name" do
27
- subject do
28
- Mongo::Configure.from_database("test").uri
29
- end
30
- its(:scheme) { should == 'mongodb' }
31
- its(:host) { should == 'localhost' }
32
- its(:port) { should == '27017' }
33
- its(:database) { should == 'test' }
34
- its(:to_s) { should == 'mongodb://localhost:27017/test' }
25
+ let(:config) { Mongo::Configure.from_database("test").uri }
26
+
27
+ example { expect(config.scheme).to eq 'mongodb' }
28
+ example { expect(config.host).to eq 'localhost' }
29
+ example { expect(config.port).to eq '27017' }
30
+ example { expect(config.database).to eq 'test' }
31
+ example { expect(config.to_s).to eq 'mongodb://localhost:27017/test' }
35
32
  end
36
33
 
37
- describe 'accessing a configuration' do
38
- let!(:configuration) { Mongo::Configure.from_database("test") }
39
- subject { Mongo::Configure.current }
40
- it { should == configuration }
34
+ describe 'accessing an existing configuration' do
35
+ it "will create a configuration when one doesn't exist" do
36
+ Mongo::Configure.instance_variable_set('@config',nil)
37
+ expect(Mongo::Configure.current).to be_a Mongo::Configure::Config
38
+ end
39
+
40
+ it "will present the last configuration when one does exist" do
41
+ configuration = Mongo::Configure.from_database("test")
42
+ expect(Mongo::Configure.current).to eq configuration
43
+ end
41
44
  end
42
45
 
43
46
  describe 'loading a connection from the configuration' do
@@ -51,16 +54,18 @@ describe 'configuring databases' do
51
54
  configuration.connection = fake_connector
52
55
  end
53
56
 
54
- subject { configuration.load }
55
-
56
57
  it "loads the database from uri" do
57
- fake_connector.should_receive(:from_uri).with 'secretsquirrel://server.name:666/data'
58
- subject
58
+ expect(fake_connector).to receive(:from_uri).with 'secretsquirrel://server.name:666/data'
59
+ configuration.load
59
60
  end
61
+
60
62
  it "gets the database named" do
61
- fake_connection.should_receive(:db).with "data"
62
- subject
63
+ expect(fake_connection).to receive(:db).with "data"
64
+ configuration.load
65
+ end
66
+
67
+ it 'returns the database' do
68
+ expect(configuration.load).to eq database
63
69
  end
64
- it { should == database }
65
70
  end
66
71
  end
metadata CHANGED
@@ -1,78 +1,90 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongo-configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jon Rowe
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain: []
12
- date: 2012-10-01 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDVjCCAj6gAwIBAgIBADANBgkqhkiG9w0BAQUFADBRMQ4wDAYDVQQDDAVoZWxs
14
+ bzEXMBUGCgmSJomT8ixkARkWB2pvbnJvd2UxEjAQBgoJkiaJk/IsZAEZFgJjbzES
15
+ MBAGCgmSJomT8ixkARkWAnVrMB4XDTEzMDIwMzA4MTgwNloXDTE0MDIwMzA4MTgw
16
+ NlowUTEOMAwGA1UEAwwFaGVsbG8xFzAVBgoJkiaJk/IsZAEZFgdqb25yb3dlMRIw
17
+ EAYKCZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJ1azCCASIwDQYJKoZI
18
+ hvcNAQEBBQADggEPADCCAQoCggEBAMhs6ng/SRrYfG7RtQx8liJTZs8tpz7PBnlH
19
+ qyOwuU0weJc7nh6C9C8LGyJzpkbjJJo1rfTMg7huDyL14Py82dfMDomApif8jNNI
20
+ 8KtviAgB1DrWq0fCDLtu/M77+yuVV3OhDdrAFaBkT/euvdJ8cAKrLxbJ+klgvrcB
21
+ FK+c4PUV3/zBKghe0l7FuDhyQCsuLNDbWyFvDS97tPjeN6yWuszwg22vZMDdsuzN
22
+ Cj3M4LLSkbrt+AOUcysEJxI4t6uv2U1bRzHsDfAF0RI/Q7OMtUr+Dtz/2YJ47KKs
23
+ 51ZRjLLGHd10XrIfFSfGyJj1dMbDgLsEBj1sFH4e6dy7gau8TaUCAwEAAaM5MDcw
24
+ CQYDVR0TBAIwADAdBgNVHQ4EFgQULu5JH2g7RAjoXaZt+fbrfNDI9IkwCwYDVR0P
25
+ BAQDAgSwMA0GCSqGSIb3DQEBBQUAA4IBAQAf5A4kB769DPKGjPZ++v42FwVi7X7v
26
+ RpufPs6R4YHyzHXaJmAqnhleZhVJijBgsdb2SigNRbg+IK8XYHg7jkonMgO8OS3D
27
+ C6w8VB5bI0PqyDOwCGcQkYHYlZZWCghAyBTSBowHAekMb9V3QjJtJ8XkizjshETO
28
+ ZCVI2AObjlJi8I10aK2tSo9sv2riCKZ92BVSM13zYWn+C/eCP/m9BDiw37UQtuQq
29
+ 2feWfO4gCNmvfFjULOAYHq9JHEjN5SLSXvj5HdSnDcCyIfJKn5Ya3JahWQaWIsXf
30
+ /NPE/mB57TOwj+d7XUa2NC4HUadF8R51IYEcIB0PpIEzJlKtfXFcOZxO
31
+ -----END CERTIFICATE-----
32
+ date: 2013-11-25 00:00:00.000000000 Z
13
33
  dependencies:
14
34
  - !ruby/object:Gem::Dependency
15
35
  name: morphine
16
36
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
37
  requirements:
19
- - - ! '>='
38
+ - - '>='
20
39
  - !ruby/object:Gem::Version
21
40
  version: '0'
22
41
  type: :runtime
23
42
  prerelease: false
24
43
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
44
  requirements:
27
- - - ! '>='
45
+ - - '>='
28
46
  - !ruby/object:Gem::Version
29
47
  version: '0'
30
48
  - !ruby/object:Gem::Dependency
31
49
  name: mongo
32
50
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
51
  requirements:
35
- - - ! '>='
52
+ - - '>='
36
53
  - !ruby/object:Gem::Version
37
54
  version: '0'
38
55
  type: :runtime
39
56
  prerelease: false
40
57
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
58
  requirements:
43
- - - ! '>='
59
+ - - '>='
44
60
  - !ruby/object:Gem::Version
45
61
  version: '0'
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: rspec
48
64
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
65
  requirements:
51
- - - ! '>='
66
+ - - '>='
52
67
  - !ruby/object:Gem::Version
53
68
  version: '0'
54
69
  type: :development
55
70
  prerelease: false
56
71
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
72
  requirements:
59
- - - ! '>='
73
+ - - '>='
60
74
  - !ruby/object:Gem::Version
61
75
  version: '0'
62
76
  - !ruby/object:Gem::Dependency
63
77
  name: rake
64
78
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
79
  requirements:
67
- - - ! '>='
80
+ - - '>='
68
81
  - !ruby/object:Gem::Version
69
82
  version: '0'
70
83
  type: :development
71
84
  prerelease: false
72
85
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
86
  requirements:
75
- - - ! '>='
87
+ - - '>='
76
88
  - !ruby/object:Gem::Version
77
89
  version: '0'
78
90
  description: A simple gem for configuring mongo databases.
@@ -97,33 +109,26 @@ files:
97
109
  - spec/mongo/configure_spec.rb
98
110
  homepage: https://github.com/JonRowe/mongo-configure
99
111
  licenses: []
112
+ metadata: {}
100
113
  post_install_message:
101
114
  rdoc_options: []
102
115
  require_paths:
103
116
  - lib
104
117
  required_ruby_version: !ruby/object:Gem::Requirement
105
- none: false
106
118
  requirements:
107
- - - ! '>='
119
+ - - '>='
108
120
  - !ruby/object:Gem::Version
109
121
  version: '0'
110
- segments:
111
- - 0
112
- hash: 3998061049660393534
113
122
  required_rubygems_version: !ruby/object:Gem::Requirement
114
- none: false
115
123
  requirements:
116
- - - ! '>='
124
+ - - '>='
117
125
  - !ruby/object:Gem::Version
118
126
  version: '0'
119
- segments:
120
- - 0
121
- hash: 3998061049660393534
122
127
  requirements: []
123
128
  rubyforge_project:
124
- rubygems_version: 1.8.24
129
+ rubygems_version: 2.1.11
125
130
  signing_key:
126
- specification_version: 3
131
+ specification_version: 4
127
132
  summary: A simple gem for configuring mongo databases.
128
133
  test_files:
129
134
  - spec/mongo/configure/uri_spec.rb
metadata.gz.sig ADDED
Binary file