jrubysql 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/jrubysql/messages.yml +1 -1
- data/lib/jrubysql/version.rb +1 -1
- data/test/bin_helper.rb +10 -0
- data/test/test_option_parser.rb +15 -15
- metadata +239 -187
data/CHANGELOG.md
CHANGED
data/lib/jrubysql/messages.yml
CHANGED
@@ -9,7 +9,7 @@ invalid connection:
|
|
9
9
|
unsupported database:
|
10
10
|
$$ is not supported yet. Try with -c and -j options instead.
|
11
11
|
oracle service name required:
|
12
|
-
Oracle service name must be included in the hostname: e.g. localhost:1521/orcl
|
12
|
+
"Oracle service name must be included in the hostname: e.g. localhost:1521/orcl"
|
13
13
|
invalid output:
|
14
14
|
Invalid output type.
|
15
15
|
file not found:
|
data/lib/jrubysql/version.rb
CHANGED
data/test/bin_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
# junegunn.c@gmail.com
|
4
|
+
|
5
|
+
# DISCLAIMER:
|
6
|
+
# Not a real test!
|
7
|
+
# Just a helper script for running scripts with local source
|
8
|
+
|
9
|
+
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '../lib')
|
10
|
+
load File.join(File.dirname(__FILE__), '../bin/', File.basename(ARGV.shift))
|
data/test/test_option_parser.rb
CHANGED
@@ -5,15 +5,15 @@ class TestOptionParser < Test::Unit::TestCase
|
|
5
5
|
|
6
6
|
def test_dbms_type
|
7
7
|
# No host
|
8
|
-
assert_error /Invalid connection/,
|
9
|
-
assert_error /Invalid connection/,
|
8
|
+
assert_error /Invalid connection/, %w[-t mysql]
|
9
|
+
assert_error /Invalid connection/, %w[--type mysql]
|
10
10
|
|
11
11
|
# No type
|
12
|
-
assert_error /Invalid connection/,
|
13
|
-
assert_error /Invalid connection/,
|
12
|
+
assert_error /Invalid connection/, %w[-h localhost]
|
13
|
+
assert_error /Invalid connection/, %w[--host localhost]
|
14
14
|
|
15
15
|
# Invalid type
|
16
|
-
assert_error /not supported/,
|
16
|
+
assert_error /not supported/, %w[-t yoursql -h localhost]
|
17
17
|
|
18
18
|
# Optional options
|
19
19
|
opts = parse(%w[-t MySQL -h localhost])
|
@@ -47,12 +47,12 @@ class TestOptionParser < Test::Unit::TestCase
|
|
47
47
|
|
48
48
|
def test_class_name
|
49
49
|
# No JDBC URL
|
50
|
-
assert_error /Invalid connection/,
|
51
|
-
assert_error /Invalid connection/,
|
50
|
+
assert_error /Invalid connection/, %w[-c com.mysql.jdbc.Driver]
|
51
|
+
assert_error /Invalid connection/, %w[--class-name com.mysql.jdbc.Driver]
|
52
52
|
|
53
53
|
# No class name
|
54
|
-
assert_error /Invalid connection/,
|
55
|
-
assert_error /Invalid connection/,
|
54
|
+
assert_error /Invalid connection/, %w[-j jdbc:mysql://localhost/test]
|
55
|
+
assert_error /Invalid connection/, %w[--jdbc-url jdbc:mysql://localhost/test]
|
56
56
|
|
57
57
|
[
|
58
58
|
%w[-c com.mysql.jdbc.Driver -j jdbc:mysql://localhost -u username -p password -d database -o cterm],
|
@@ -70,18 +70,18 @@ class TestOptionParser < Test::Unit::TestCase
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def test_invalid_output
|
73
|
-
assert_error /Invalid output/,
|
73
|
+
assert_error /Invalid output/, %w[-t mysql -h localhost -o xml]
|
74
74
|
end
|
75
75
|
|
76
76
|
def test_invalid_combination
|
77
|
-
assert_error /Invalid connection/,
|
78
|
-
assert_error /Invalid connection/,
|
77
|
+
assert_error /Invalid connection/, %w[-t mysql -j jdbc:mysql://localhost]
|
78
|
+
assert_error /Invalid connection/, %w[-c com.mysql.jdbc.Driver -h localhost]
|
79
79
|
|
80
|
-
assert_error /both filename and script/,
|
80
|
+
assert_error /both filename and script/, %w[-f aaa -e bbb]
|
81
81
|
end
|
82
82
|
|
83
83
|
def test_filename
|
84
|
-
assert_error /File not found/,
|
84
|
+
assert_error /File not found/, %w[-t mysql -h localhost -f no-such-file.sql]
|
85
85
|
|
86
86
|
opts = parse(%w[-t mysql -h localhost -f] + [__FILE__])
|
87
87
|
assert_equal __FILE__, opts[:filename]
|
@@ -116,7 +116,7 @@ class TestOptionParser < Test::Unit::TestCase
|
|
116
116
|
def assert_error msg, argv
|
117
117
|
ret = parse_with_output argv
|
118
118
|
assert_equal 1, ret[:return]
|
119
|
-
assert
|
119
|
+
assert ret[:stdout] =~ msg, "Expected: #{msg.source}"
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
metadata
CHANGED
@@ -1,204 +1,256 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: jrubysql
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
version: 0.1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
8
|
-
|
9
|
-
autorequire:
|
7
|
+
authors:
|
8
|
+
- Junegunn Choi
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
12
|
+
date: 2012-04-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: test-unit
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :development
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: mocha
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ! '>='
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
none: false
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
none: false
|
44
|
+
prerelease: false
|
45
|
+
type: :development
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: guard
|
48
|
+
version_requirements: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
none: false
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
none: false
|
60
|
+
prerelease: false
|
61
|
+
type: :development
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: guard-test
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
none: false
|
70
|
+
requirement: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
none: false
|
76
|
+
prerelease: false
|
77
|
+
type: :development
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: jdbc-helper
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 0.7.2
|
85
|
+
none: false
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ~>
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: 0.7.2
|
91
|
+
none: false
|
92
|
+
prerelease: false
|
93
|
+
type: :runtime
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: insensitive_hash
|
96
|
+
version_requirements: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ~>
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: 0.2.3
|
101
|
+
none: false
|
102
|
+
requirement: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ~>
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: 0.2.3
|
107
|
+
none: false
|
108
|
+
prerelease: false
|
109
|
+
type: :runtime
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: tabularize
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ~>
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.1.1
|
117
|
+
none: false
|
118
|
+
requirement: !ruby/object:Gem::Requirement
|
119
|
+
requirements:
|
120
|
+
- - ~>
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: 0.1.1
|
123
|
+
none: false
|
124
|
+
prerelease: false
|
125
|
+
type: :runtime
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: each_sql
|
128
|
+
version_requirements: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 0.3.1
|
133
|
+
none: false
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.3.1
|
139
|
+
none: false
|
140
|
+
prerelease: false
|
141
|
+
type: :runtime
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: highline
|
144
|
+
version_requirements: !ruby/object:Gem::Requirement
|
145
|
+
requirements:
|
146
|
+
- - ~>
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 1.6.11
|
149
|
+
none: false
|
150
|
+
requirement: !ruby/object:Gem::Requirement
|
151
|
+
requirements:
|
152
|
+
- - ~>
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: 1.6.11
|
155
|
+
none: false
|
156
|
+
prerelease: false
|
157
|
+
type: :runtime
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: ansi
|
160
|
+
version_requirements: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ~>
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: 1.4.2
|
165
|
+
none: false
|
166
|
+
requirement: !ruby/object:Gem::Requirement
|
167
|
+
requirements:
|
168
|
+
- - ~>
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: 1.4.2
|
171
|
+
none: false
|
172
|
+
prerelease: false
|
173
|
+
type: :runtime
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: erubis
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ~>
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 2.7.0
|
181
|
+
none: false
|
182
|
+
requirement: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ~>
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: 2.7.0
|
187
|
+
none: false
|
188
|
+
prerelease: false
|
189
|
+
type: :runtime
|
136
190
|
description: An SQL client for any JDBC-compliant database. Written in JRuby.
|
137
|
-
email:
|
138
|
-
|
139
|
-
executables:
|
140
|
-
|
191
|
+
email:
|
192
|
+
- junegunn.c@gmail.com
|
193
|
+
executables:
|
194
|
+
- jrubysql
|
141
195
|
extensions: []
|
142
|
-
|
143
196
|
extra_rdoc_files: []
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
197
|
+
files:
|
198
|
+
- .gitignore
|
199
|
+
- CHANGELOG.md
|
200
|
+
- Gemfile
|
201
|
+
- Guardfile
|
202
|
+
- LICENSE.txt
|
203
|
+
- README.md
|
204
|
+
- Rakefile
|
205
|
+
- bin/jrubysql
|
206
|
+
- jrubysql.gemspec
|
207
|
+
- lib/jrubysql.rb
|
208
|
+
- lib/jrubysql/config.rb
|
209
|
+
- lib/jrubysql/constants.rb
|
210
|
+
- lib/jrubysql/controller.rb
|
211
|
+
- lib/jrubysql/doc/help.txt.erb
|
212
|
+
- lib/jrubysql/input/console.rb
|
213
|
+
- lib/jrubysql/input/input.rb
|
214
|
+
- lib/jrubysql/input/script.rb
|
215
|
+
- lib/jrubysql/messages.rb
|
216
|
+
- lib/jrubysql/messages.yml
|
217
|
+
- lib/jrubysql/option_parser.rb
|
218
|
+
- lib/jrubysql/output/csv.rb
|
219
|
+
- lib/jrubysql/output/cterm.rb
|
220
|
+
- lib/jrubysql/output/term.rb
|
221
|
+
- lib/jrubysql/rdbms.rb
|
222
|
+
- lib/jrubysql/version.rb
|
223
|
+
- test/bin_helper.rb
|
224
|
+
- test/helper.rb
|
225
|
+
- test/test_jrubysql.rb
|
226
|
+
- test/test_option_parser.rb
|
174
227
|
homepage: https://github.com/junegunn/jrubysql
|
175
228
|
licenses: []
|
176
|
-
|
177
|
-
post_install_message:
|
229
|
+
post_install_message:
|
178
230
|
rdoc_options: []
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
231
|
+
require_paths:
|
232
|
+
- lib
|
233
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
234
|
+
requirements:
|
235
|
+
- - ! '>='
|
236
|
+
- !ruby/object:Gem::Version
|
237
|
+
version: '0'
|
183
238
|
none: false
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
239
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - ! '>='
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0'
|
189
244
|
none: false
|
190
|
-
requirements:
|
191
|
-
- - ">="
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: "0"
|
194
245
|
requirements: []
|
195
|
-
|
196
246
|
rubyforge_project: jrubysql
|
197
247
|
rubygems_version: 1.8.21
|
198
|
-
signing_key:
|
248
|
+
signing_key:
|
199
249
|
specification_version: 3
|
200
250
|
summary: An SQL client for any JDBC-compliant database.
|
201
|
-
test_files:
|
202
|
-
|
203
|
-
|
204
|
-
|
251
|
+
test_files:
|
252
|
+
- test/bin_helper.rb
|
253
|
+
- test/helper.rb
|
254
|
+
- test/test_jrubysql.rb
|
255
|
+
- test/test_option_parser.rb
|
256
|
+
...
|