taps 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,9 +22,13 @@ or when you want to push a local database to a taps server
22
22
 
23
23
  $ taps push postgres://dbuser:dbpassword@localhost/dbname http://httpuser:httppassword@example.com:5000
24
24
 
25
- or when you want to transfer only 1 table
25
+ or when you want to transfer a list of tables
26
26
 
27
- $ taps push postgres://dbuser:dbpassword@localhost/dbname http://httpuser:httppassword@example.com:5000 --filter mytable
27
+ $ taps push postgres://dbuser:dbpassword@localhost/dbname http://httpuser:httppassword@example.com:5000 --tables logs,tags
28
+
29
+ or when you want to transfer tables that start with a word
30
+
31
+ $ taps push postgres://dbuser:dbpassword@localhost/dbname http://httpuser:httppassword@example.com:5000 --filter '^log_'
28
32
 
29
33
  == Known Issues
30
34
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- :major: 0
3
- :minor: 3
4
2
  :build:
5
- :patch: 1
3
+ :minor: 3
4
+ :patch: 2
5
+ :major: 0
@@ -127,6 +127,10 @@ EOHELP
127
127
  o.on("-c", "--chunksize=N", "Initial Chunksize") { |v| opts[:default_chunksize] = (v.to_i < 10 ? 10 : v.to_i) }
128
128
  o.on("-g", "--disable-compression", "Disable Compression") { |v| opts[:disable_compression] = true }
129
129
  o.on("-f", "--filter=regex", "Regex Filter for tables") { |v| opts[:table_filter] = v }
130
+ o.on("-t", "--tables=A,B,C", Array, "Shortcut to filter on a list of tables") do |v|
131
+ r_tables = v.collect { |t| "^#{t}$" }.join("|")
132
+ opts[:table_filter] = "(#{r_tables})"
133
+ end
130
134
  o.on("-d", "--debug", "Enable Debug Messages") { |v| opts[:debug] = true }
131
135
  o.parse!(argv)
132
136
 
@@ -0,0 +1,10 @@
1
+ require File.dirname(__FILE__) + '/base'
2
+ require 'taps/cli'
3
+
4
+ describe Taps::Cli do
5
+ it "translates a list of tables into a regex that can be used in table_filter" do
6
+ @cli = Taps::Cli.new(["-t", "mytable1,logs", "sqlite://tmp.db", "http://x:y@localhost:5000"])
7
+ opts = @cli.clientoptparse(:pull)
8
+ opts[:table_filter].should == "(^mytable1$|^logs$)"
9
+ end
10
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ricardo Chimal, Jr.
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-15 00:00:00 -07:00
17
+ date: 2010-04-16 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -133,6 +133,7 @@ files:
133
133
  - lib/taps/server.rb
134
134
  - lib/taps/utils.rb
135
135
  - spec/base.rb
136
+ - spec/cli_spec.rb
136
137
  - spec/data_stream_spec.rb
137
138
  - spec/operation_spec.rb
138
139
  - spec/server_spec.rb
@@ -170,7 +171,8 @@ specification_version: 3
170
171
  summary: simple database import/export app
171
172
  test_files:
172
173
  - spec/utils_spec.rb
173
- - spec/operation_spec.rb
174
+ - spec/cli_spec.rb
174
175
  - spec/data_stream_spec.rb
176
+ - spec/operation_spec.rb
175
177
  - spec/base.rb
176
178
  - spec/server_spec.rb