mongo-import 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -34,7 +34,7 @@ snapshot 'db_name.collection_name'
34
34
  ```
35
35
  or
36
36
  ```ruby
37
- snapshot 'file_name', :db => 'db_name', :collection => 'collection_name'
37
+ snapshot 'file_name', :db => 'db_name', :collection => 'collection_name', :path => 'spec/snapshots'
38
38
  ```
39
39
 
40
40
 
@@ -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 = {:host => 'localhost', :port => 27017, :exec => 'mongoimport'}
13
+ defaults = {host: 'localhost', port: 27017, exec: 'mongoimport', path: 'spec/snapshots'}
14
14
  @opts = OpenStruct.new(defaults.merge(opts))
15
- p @opts
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
@@ -1,3 +1,3 @@
1
1
  module MongoImport
2
- VERSION = "0.2.0"
2
+ VERSION = "0.4.0"
3
3
  end
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.2.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: 2012-12-15 00:00:00.000000000 Z
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