mongo-import 0.2.0 → 0.4.0
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.
- data/README.md +1 -1
- data/lib/mongo-import/snapshot.rb +3 -4
- data/lib/mongo-import/version.rb +1 -1
- metadata +8 -2
data/README.md
CHANGED
@@ -10,10 +10,9 @@ module MongoImport
|
|
10
10
|
def initialize(name, opts={})
|
11
11
|
raise ArgumentError, ':db is missing' unless opts[:db]
|
12
12
|
raise ArgumentError, ':collection is missing' unless opts[:collection]
|
13
|
-
defaults = {:
|
13
|
+
defaults = {host: 'localhost', port: 27017, exec: 'mongoimport', path: 'spec/snapshots'}
|
14
14
|
@opts = OpenStruct.new(defaults.merge(opts))
|
15
|
-
|
16
|
-
@path = 'spec/snapshots'
|
15
|
+
@path = @opts.path
|
17
16
|
@name = name
|
18
17
|
end
|
19
18
|
|
@@ -22,7 +21,7 @@ module MongoImport
|
|
22
21
|
raise "Could not find #{@opts.exec} in your PATH" unless system("which #{opts.exec} > /dev/null")
|
23
22
|
|
24
23
|
file = File.join(@path, "#{@name}.json")
|
25
|
-
cmd = "#{opts.exec} --host #{opts.host} --port #{opts.port} --drop --db #{opts.db} --collection #{opts.collection} #{file}"
|
24
|
+
cmd = "#{opts.exec} -q --host #{opts.host} --port #{opts.port} --drop --db #{opts.db} --collection #{opts.collection} #{file}"
|
26
25
|
system cmd
|
27
26
|
end
|
28
27
|
end
|
data/lib/mongo-import/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo-import
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
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:
|
12
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bson_ext
|
@@ -221,12 +221,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
221
221
|
- - ! '>='
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '0'
|
224
|
+
segments:
|
225
|
+
- 0
|
226
|
+
hash: -683661940017277411
|
224
227
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
225
228
|
none: false
|
226
229
|
requirements:
|
227
230
|
- - ! '>='
|
228
231
|
- !ruby/object:Gem::Version
|
229
232
|
version: '0'
|
233
|
+
segments:
|
234
|
+
- 0
|
235
|
+
hash: -683661940017277411
|
230
236
|
requirements: []
|
231
237
|
rubyforge_project:
|
232
238
|
rubygems_version: 1.8.23
|