sqlconv 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sqlconv +16 -1
- data/sqlconv.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d715aaa4e6d949b4f0fe9b6aeafacf6bd4e3536b78b1b513ab0de5858a54e5a8
|
4
|
+
data.tar.gz: fdf83dee07706b27470f79049dccc0ca8c3e46c71e6c433f74ba11abfa61bde6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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