sqlconv 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/sqlconv +16 -1
  3. data/sqlconv.gemspec +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff0bf4b12a25f67b6ce9096183f72b382761003af3ae2c8381ad030e797e9485
4
- data.tar.gz: 71f4f416585e7b63e4022b18da68913790a90a975bd5ed862a7637804335ef15
3
+ metadata.gz: d715aaa4e6d949b4f0fe9b6aeafacf6bd4e3536b78b1b513ab0de5858a54e5a8
4
+ data.tar.gz: fdf83dee07706b27470f79049dccc0ca8c3e46c71e6c433f74ba11abfa61bde6
5
5
  SHA512:
6
- metadata.gz: 7c7504113188e39febf08d952c3498d555fc1fe46fa36db1dab06ef5dbf3fb1b0f678c7214c354d96efea8b58a6d0ab1c1e502cccbeb13d574dc8b9f061bbc12
7
- data.tar.gz: b0a4fc4f97c3b40432e2dd014a3f1133b7609b8ce8a220878eae2081b9b9ac75c29b4780abc4ce5ee3b9fd5db17e9f74e9fa5935e9ab68d500f0d7ec7232c5e2
6
+ metadata.gz: defedd02d37ea90ca2de4d56d89d534b4fc2c59decf53fe086df56f79ec9ed0c61919f940923f934bb7a72d45ef5ab5d3b53004cfe68364f9a7ae4863021a18c
7
+ data.tar.gz: ef78e4e848cd23a98916219cbcb212289134052c76b1d197b919099c2c3f15b5776180f2793674999b9780ba7fdf1d8c13722d9522b039f89e94f54014ca5773
data/bin/sqlconv CHANGED
@@ -119,7 +119,9 @@ def conv(tab1, map1, tab2, map2, dump)
119
119
  case item.func
120
120
  when "rand" then ours.push("'random number here!'")
121
121
  when "n","null" then ours.push("null")
122
- else abort "undefined function '#{item.func}'"
122
+ else
123
+ defined?(item.func) == "method" or die "undefined function '#{item.func}'"
124
+ ours.push *(send item.func, *Array[cols[item.from-1]])
123
125
  end
124
126
  when item.text# literal
125
127
  ours.push(item.text)
@@ -158,6 +160,18 @@ end
158
160
 
159
161
  # ==[ invoke the cli ]==
160
162
 
163
+ argv = -1
164
+ ARGV.size.times do
165
+ if ARGV[argv += 1] == "-r"
166
+ begin
167
+ require plugin = ARGV[argv += 1]
168
+ rescue LoadError
169
+ die "unable to load the '#{plugin}' plugin"
170
+ end
171
+ ARGV.slice!((argv -= 2) + 1, 2)
172
+ end
173
+ end
174
+
161
175
  if ARGV.shift =~ /^([a-z][-\w]*):?(.+)?$/
162
176
  tab1 = $1
163
177
  map1 = $2
@@ -173,6 +187,7 @@ end
173
187
 
174
188
  tab1 or die [
175
189
  "Usage: #{File.basename $0}",
190
+ "[-r <plugin1.rb> [-r <plugin2.rb>]...]"
176
191
  "<src_table>(:[sel1,sel2,...])",
177
192
  "[dst_table][:][col1,col2,...] file"
178
193
  ] * ' '
data/sqlconv.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "sqlconv"
5
- s.version = "0.6.1"
5
+ s.version = "0.7.0"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "Handy utility to massage MySQL dump files"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlconv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve