mongoid-shell 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f8d3471c6d71f5f41ca2c8e0b45f0188ffda678
4
- data.tar.gz: 3b5c41c1caba5e21f4803aece1b0f975c224c716
3
+ metadata.gz: f779020213e6c178fe2dec0cbb030d209d2c5b47
4
+ data.tar.gz: 46bd9d546b657ad4188123f8c5727206858afe18
5
5
  SHA512:
6
- metadata.gz: 4220dc0b160a4cda04b8c4d2361f4d4e4788d96dbd1a08bc6ce3835369ac68d5aa3741de636d531352db8432286788bdd428529ea30cb9c6f38b92d2f2bbf43a
7
- data.tar.gz: eb954eecda14094f4aaadf730ffb0c8419295eee358fa1e8daad220b901cbb10b40015c91b753075e9e3b75d19999b94cf0260301e51fd0850b4f26ce42066c4
6
+ metadata.gz: 21e8d86a04a5006b89b8c4eee444ae17b0b3cd69d5cdf7b1b31a7f36ca6909b8ecdb408f29ae4d38fee00135aa25fc8764dcb071abff0f0b5d101ea69e4d6c5b
7
+ data.tar.gz: 2fb0094bb3496331d8969fe8d9bf99adbfb2399f62a51e060b095c85385cd11c07a51c1a5e3381c403edf922c9242cacb097a469dc3a7d47408e64b06d248966
@@ -1,3 +1,8 @@
1
+ 0.4.2 (2/9/2015)
2
+ ================
3
+
4
+ * [#8](https://github.com/dblock/mongoid-shell/pull/7) - Support repeatable parameters; add `excludeCollection` and `excludeCollectionsWithPrefix` to `mongodump` - [@joeyAghion](https://github.com/joeyAghion).
5
+
1
6
  0.4.1 (10/25/2015)
2
7
  ==================
3
8
 
data/README.md CHANGED
@@ -36,6 +36,14 @@ mongodump = Mongoid::Shell::Commands::Mongodump.new(db: 'another_database', out:
36
36
  system mongodump.to_s # mongodump --db another_database --out /tmp/db_backup
37
37
  ```
38
38
 
39
+ To specify parameters multiple times, set them to arrays.
40
+
41
+ ``` ruby
42
+ mongodump = Mongoid::Shell::Commands::Mongodump.new(collection: %w(users products))
43
+ system mongodump.to_s # mongodump --collection users --collection products
44
+ ```
45
+
46
+
39
47
  Compatibility
40
48
  -------------
41
49
 
@@ -63,7 +71,7 @@ mongodump = Mongoid::Shell::Commands::Mongodump.new({ collection: 'test' })
63
71
  mongodump.to_s # mongodump --db test --collection test
64
72
  ```
65
73
 
66
- The `Mongoid::Shell::Commands::Mongodump` class supports `--db`, `--host`, `--username`, `--password`, `--query`, `--out`, `--collection`, `--directoryperdb`, `--journal`, `--oplog`, `--repair`, `--forceTableScan`, `--dbpath` and `--ipv6`.
74
+ The `Mongoid::Shell::Commands::Mongodump` class supports `--db`, `--host`, `--username`, `--password`, `--query`, `--out`, `--collection`, `--excludeCollection`, `--excludeCollectionsWithPrefix`, `--directoryperdb`, `--journal`, `--oplog`, `--repair`, `--forceTableScan`, `--dbpath` and `--ipv6`.
67
75
 
68
76
  ### Mongorestore
69
77
 
@@ -27,8 +27,9 @@ module Mongoid
27
27
  args.map do |key, property|
28
28
  value = send(property)
29
29
  next unless value
30
- if value.is_a?(Boolean) || value.is_a?(TrueClass)
31
- key
30
+ case value
31
+ when Boolean, TrueClass then key
32
+ when Array then value.map { |v| "#{key} #{v}" }.join(' ')
32
33
  else
33
34
  value = value.to_s
34
35
  # TODO: quote other special characters?
@@ -7,7 +7,8 @@ module Mongoid
7
7
  include Mongoid::Shell::Properties::Username
8
8
  include Mongoid::Shell::Properties::Password
9
9
 
10
- attr_accessor :collection, :query, :out, :directoryperdb, :journal, :oplog, :repair, :forceTableScan, :dbpath, :ipv6
10
+ attr_accessor :collection, :query, :out, :directoryperdb, :journal, :oplog, :repair, :forceTableScan, :dbpath, :ipv6, :excludeCollection,
11
+ :excludeCollectionsWithPrefix
11
12
 
12
13
  def initialize(attrs = {})
13
14
  super
@@ -20,6 +21,8 @@ module Mongoid
20
21
  '--username' => :username,
21
22
  '--password' => :password,
22
23
  '--collection' => :collection,
24
+ '--excludeCollection' => :excludeCollection,
25
+ '--excludeCollectionsWithPrefix' => :excludeCollectionsWithPrefix,
23
26
  '--query' => :query,
24
27
  '--out' => :out,
25
28
  '--directoryperdb' => :directoryperdb,
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Shell
3
- VERSION = '0.4.1'
3
+ VERSION = '0.4.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-25 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mongoid
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: i18n
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mongoid-compatibility
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description:
@@ -94,17 +94,17 @@ require_paths:
94
94
  - lib
95
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ">="
97
+ - - '>='
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: 1.3.6
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.4.8
107
+ rubygems_version: 2.4.5
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: Derive shell commands from Mongoid configuration options.