couchdb-extras 0.0.4 → 0.0.6

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.
Files changed (2) hide show
  1. data/bin/couchdb2couchdb-one +18 -0
  2. metadata +3 -1
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'couch_http'
4
+
5
+ couch=ARGV[0]
6
+ other_couch=ARGV[1]
7
+
8
+ puts "Server #{couch}"
9
+ get("#{couch}/_all_dbs")
10
+ .select { |db| !db.start_with?("_") && !db.end_with?("_history")}
11
+ .each { |db|
12
+ puts "Database #{couch}/#{db} to #{other_couch}/#{db}"
13
+ replication = {:source=>"#{couch}/#{db}",:target=>"#{db}",:continuous=>true,:create_target=>true}
14
+ puts "Replication #{replication}"
15
+ r = post("#{other_couch}/_replicator",replication)
16
+ puts "#{replication} = #{r}"
17
+ }
18
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: couchdb-extras
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,6 +15,7 @@ description: CouchDB to ElasticSearch, CouchDB to CouchDB History and CouchDB to
15
15
  email: diogo@diogok.net
16
16
  executables:
17
17
  - couchdb2couchdb
18
+ - couchdb2couchdb-one
18
19
  - couchdb2history
19
20
  - couchdb2elasticsearch
20
21
  - infinite-run
@@ -23,6 +24,7 @@ extra_rdoc_files: []
23
24
  files:
24
25
  - lib/couch_http.rb
25
26
  - bin/couchdb2couchdb
27
+ - bin/couchdb2couchdb-one
26
28
  - bin/couchdb2history
27
29
  - bin/couchdb2elasticsearch
28
30
  - bin/infinite-run