redis-dump 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,5 +1,9 @@
1
1
  REDIS-DUMP, CHANGES
2
2
 
3
+ #### 0.3.1 (2012-01-05) ###############################
4
+
5
+ * ADDED: New global option for redis-dump: -f
6
+
3
7
  #### 0.3.0 (2012-01-05) ###############################
4
8
 
5
9
  * ADDED: Redis::Dump.dump_strings
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :MAJOR: 0
3
3
  :MINOR: 3
4
- :PATCH: 0
5
- :BUILD: '001'
4
+ :PATCH: 1
5
+ :BUILD: '000'
data/bin/redis-dump CHANGED
@@ -29,6 +29,7 @@ class Redis::Dump::CLI
29
29
  global :d, :database, Integer, "Redis database (e.g. -d 15)"
30
30
  global :s, :sleep, Integer, "Sleep for S seconds after dumping (for debugging)"
31
31
  global :c, :count, Integer, "Chunk size (default: #{Redis::Dump.chunk_size})"
32
+ global :f, :filter, String, "Filter selected keys (passed directly to redis' KEYS command)"
32
33
  global :O, :without_optimizations, "Disable run time optimizations"
33
34
  global :V, :version, "Display version" do
34
35
  puts "Version: #{Redis::Dump::VERSION.to_s}"
@@ -62,7 +63,9 @@ class Redis::Dump::CLI
62
63
  usage "redis-dump -d 15 -c 100_000 > dumpfile_db15.json"
63
64
  command :dump do |obj|
64
65
  rd = Redis::Dump.new obj.global.database, obj.global.uri
65
- rd.dump do |records|
66
+ obj.global.filter &&= '*%s*' % obj.global.filter
67
+ Redis::Dump.ld " filter #{obj.global.filter}"
68
+ rd.dump(obj.global.filter) do |records|
66
69
  puts records
67
70
  end
68
71
  end
data/lib/redis/dump.rb CHANGED
@@ -54,7 +54,8 @@ class Redis
54
54
  end
55
55
 
56
56
  # See each_key
57
- def dump filter='*'
57
+ def dump filter=nil
58
+ filter ||= '*'
58
59
  entries = []
59
60
  each_database do |redis|
60
61
  chunk_entries = []
data/redis-dump.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "redis-dump"
8
- s.version = "0.2.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Delano Mandelbaum"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: redis-dump
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.3.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Delano Mandelbaum