idata 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/iload +10 -8
- data/lib/idata/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45d9ad3aa3448f33bbae663345c40e37f2d93ab6
|
4
|
+
data.tar.gz: 55b2264c03d2554b5d784cb2bc30a1a1fa294555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f85c264b07d477ae9227f7732e47a2f81d78504fd947dee3615ca25c86d60e1b319452ee42a223ef2bdc8ecbb801b653ba008e19d726dd6924773418e03d4c1
|
7
|
+
data.tar.gz: a354d23e196ea2155f70be07d9239d96a96943e2e8b495c1a430034e689783fd2fcb2f00140c72d0ab2ff0a9ecd8b9772653a3a3dd99d50125d1d308f230bca9
|
data/bin/iload
CHANGED
@@ -22,7 +22,6 @@ CSV_DEFAULT_DELIMITER = ','
|
|
22
22
|
CSV_DEFAULT_QUOTE = '"'
|
23
23
|
CSV_DEFAULT_FORMAT = 'CSV'
|
24
24
|
|
25
|
-
|
26
25
|
def error(msg)
|
27
26
|
puts "Error: #{msg}"
|
28
27
|
exit(-1)
|
@@ -83,10 +82,6 @@ parser = OptionParser.new("", 24) do |opts|
|
|
83
82
|
opts.on("-l", "--listen PORT", "PostgreSQL listen port (default to 5432)") do |v|
|
84
83
|
$options[:listen] = v
|
85
84
|
end
|
86
|
-
|
87
|
-
opts.on("-c", "--client CLIENT", "Client name") do |v|
|
88
|
-
$options[:client] = v
|
89
|
-
end
|
90
85
|
|
91
86
|
opts.on_tail('--help', 'Displays this help') do
|
92
87
|
puts opts, "", help
|
@@ -125,6 +120,9 @@ $options[:delim] ||= CSV_DEFAULT_DELIMITER
|
|
125
120
|
$options[:quote] ||= CSV_DEFAULT_QUOTE
|
126
121
|
$options[:drop] ||= false
|
127
122
|
|
123
|
+
# extra options
|
124
|
+
$options[:client] = ARGV[0] if ARGV[0]
|
125
|
+
|
128
126
|
# validate parameters
|
129
127
|
if $options[:input].nil?
|
130
128
|
error "please specify input file: -i"
|
@@ -147,16 +145,20 @@ if $options[:table].nil?
|
|
147
145
|
end
|
148
146
|
|
149
147
|
if $options[:client] and ($options[:host] or $options[:database] or $options[:username] or $options[:password])
|
150
|
-
error "once
|
148
|
+
error "once client name (#{$options[:client]}) is specified, -h/-u/-d/-p is no longer needed"
|
149
|
+
end
|
150
|
+
|
151
|
+
if ARGV.count > 1
|
152
|
+
error "too many arguments!"
|
151
153
|
end
|
152
154
|
|
153
155
|
if $options[:client]
|
154
156
|
if ENV['MAINDBNAME'].blank?
|
155
|
-
error "
|
157
|
+
error "the environment variable MAINDBNAME is not present"
|
156
158
|
end
|
157
159
|
|
158
160
|
if ENV['MAINDBHOST'].blank?
|
159
|
-
error "
|
161
|
+
error "the environment variable MAINDBHOST is not present"
|
160
162
|
end
|
161
163
|
|
162
164
|
ActiveRecord::Base.establish_connection(
|
data/lib/idata/version.rb
CHANGED