genghis 1.2.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.rdoc +1 -0
  2. data/lib/genghis.rb +7 -2
  3. metadata +29 -52
@@ -55,6 +55,7 @@ If you are using replica sets, the configuration varies somewhat.
55
55
  The servers are specified in an array, and most importantly for resilience the max_retries
56
56
  entry is specified in connection options. This specifies how many times Genghis will try to establish
57
57
  a connection to one of the servers if it detects a connection error.
58
+ Anything listed under connection options is passed to ReplSetConnection or Connection.multi as options after the servers.
58
59
 
59
60
  === Initialization
60
61
 
@@ -80,7 +80,7 @@ class Genghis
80
80
  private
81
81
 
82
82
  def self.parse_connection_options
83
- @@connection_options ||= symbolize_keys(default_connection_options.merge(@@config['connection_options']))
83
+ @@connection_options = symbolize_keys(default_connection_options.merge(@@config['connection_options']))
84
84
  end
85
85
 
86
86
  def self.parse_mongo_urls(urls)
@@ -119,7 +119,12 @@ class Genghis
119
119
  opts = connection_options
120
120
  if self.hosts.size > 1
121
121
  servers = self.hosts.collect { |x| [x[:host], x[:port]] }
122
- connection = Connection.multi(servers, opts)
122
+ if defined?(Mongo::ReplSetConnection)
123
+ args = servers << opts
124
+ connection = Mongo::ReplSetConnection.new(*args)
125
+ else
126
+ connection = Connection.multi(servers, opts)
127
+ end
123
128
  else
124
129
  host = self.hosts.first
125
130
  connection = Connection.new(host[:host], host[:port], opts)
metadata CHANGED
@@ -1,83 +1,60 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: genghis
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
6
- segments:
7
- - 1
8
- - 2
9
- - 1
10
- version: 1.2.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.1
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Steve Cohen
14
9
  autorequire: genghis
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2010-11-30 00:00:00 -08:00
12
+ date: 2011-05-26 00:00:00.000000000 -07:00
19
13
  default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
22
16
  name: mongo
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &10658680 !ruby/object:Gem::Requirement
25
18
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 19
30
- segments:
31
- - 1
32
- - 1
33
- - 0
34
- version: 1.1.0
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 1.2.0
35
23
  type: :runtime
36
- version_requirements: *id001
24
+ prerelease: false
25
+ version_requirements: *10658680
37
26
  description:
38
27
  email: scohen@scohen.org
39
28
  executables: []
40
-
41
29
  extensions: []
42
-
43
- extra_rdoc_files:
30
+ extra_rdoc_files:
44
31
  - README.rdoc
45
- files:
32
+ files:
46
33
  - lib/genghis.rb
47
34
  - README.rdoc
48
35
  has_rdoc: true
49
36
  homepage: http://github.com/scohen/genghis
50
37
  licenses: []
51
-
52
38
  post_install_message:
53
39
  rdoc_options: []
54
-
55
- require_paths:
40
+ require_paths:
56
41
  - lib
57
- required_ruby_version: !ruby/object:Gem::Requirement
42
+ required_ruby_version: !ruby/object:Gem::Requirement
58
43
  none: false
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- hash: 3
63
- segments:
64
- - 0
65
- version: "0"
66
- required_rubygems_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
49
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
75
54
  requirements: []
76
-
77
55
  rubyforge_project:
78
- rubygems_version: 1.3.7
56
+ rubygems_version: 1.5.2
79
57
  signing_key:
80
58
  specification_version: 3
81
59
  summary: Genghis is a mongoDB configuration and resilience framework
82
60
  test_files: []
83
-