couchdb-replicator 0.0.2 → 0.0.3

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.
@@ -1,48 +1,44 @@
1
- requires "./couch"
1
+ requires "../couch"
2
2
  module VagrantPlugins
3
3
  module CouchDB
4
4
  class Provisioner < Vagrant.plugin("2", :provisioner)
5
5
  def provision
6
- begin
7
- couchHosts = config.dbHosts
8
-
9
- firstDB = true
10
- couchHosts.each do |couchHost|
11
-
12
- firstCouch = Couch::Server.new(couchHost, "5984")
13
- if firstDB
14
- #res = firstCouch.get("/ss")
15
- #raise
16
- #json = res.body
17
- #puts json
18
- #firstCouch.put("/sofa/", "")
19
- #firstDB = false
20
- end
21
-
22
- replicateFromURL = "http://" + couchHost + ":5984/sofa"
23
- puts "createServer:" + couchHost + ":5984/sofa"
24
-
25
- couchHosts.each do |replicateTo|
26
- if replicateTo != couchHost
27
-
28
- #secondCouch = Couch::Server.new(replicateTo, "5984")
29
-
30
- replicateToURL = "http://" + replicateTo + ":5984/sofa"
31
- payload = '{ "source":' + '"' + replicateFromURL + '"' + ',' +
32
- ' "target":' + '"' + replicateToURL + '"' + ',' +
33
- ' "continuous": true,' +
34
- ' "create_target": true' +
35
- '}'
36
- replicateJSON = JSON.parse(payload)
37
- puts replicateJSON
38
-
39
- firstCouch.post("/_replicate", replicateJSON.to_json)
40
- end
41
- end
6
+ couchHosts = config.dbHosts
7
+
8
+ firstDB = true
9
+ couchHosts.each do |couchHost|
10
+
11
+ firstCouch = Couch::Server.new(couchHost, "5984")
12
+ if firstDB
13
+ #res = firstCouch.get("/ss")
14
+ #raise
15
+ #json = res.body
16
+ #puts json
17
+ #firstCouch.put("/sofa/", "")
18
+ #firstDB = false
19
+ end
20
+
21
+ replicateFromURL = "http://" + couchHost + ":5984/sofa"
22
+ puts "createServer:" + couchHost + ":5984/sofa"
23
+
24
+ couchHosts.each do |replicateTo|
25
+ if replicateTo != couchHost
26
+
27
+ #secondCouch = Couch::Server.new(replicateTo, "5984")
28
+
29
+ replicateToURL = "http://" + replicateTo + ":5984/sofa"
30
+ payload = '{ "source":' + '"' + replicateFromURL + '"' + ',' +
31
+ ' "target":' + '"' + replicateToURL + '"' + ',' +
32
+ ' "continuous": true,' +
33
+ ' "create_target": true' +
34
+ '}'
35
+ replicateJSON = JSON.parse(payload)
36
+ puts replicateJSON
37
+
38
+ firstCouch.post("/_replicate", replicateJSON.to_json)
42
39
  end
43
- rescue
44
- puts 'I am rescued.'
45
40
  end
41
+ end
46
42
 
47
43
  end
48
44
  end
@@ -1,5 +1,5 @@
1
1
  module Couchdb
2
2
  module Replicator
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,6 +1,3 @@
1
- require "couchdb/replicator/version"
2
- require "vagrant"
3
-
4
1
  module VagrantPlugins
5
2
  module Couchdb
6
3
  class Plugin < Vagrant.plugin("2")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchdb-replicator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-31 00:00:00.000000000 Z
12
+ date: 2014-09-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: This is a couchdb replicator
15
15
  email:
@@ -38,7 +38,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
38
38
  version: '0'
39
39
  segments:
40
40
  - 0
41
- hash: -3492428271439980191
41
+ hash: 1332916954806387323
42
42
  required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  segments:
49
49
  - 0
50
- hash: -3492428271439980191
50
+ hash: 1332916954806387323
51
51
  requirements: []
52
52
  rubyforge_project:
53
53
  rubygems_version: 1.8.23