jrubysql 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  JRubySQL Changelog
2
2
  ==================
3
3
 
4
+ 0.1.7
5
+ -----
6
+ * Fixed NoMethodError in JRuby 1.7+
7
+
4
8
  0.1.6
5
9
  -----
6
10
  * Bug fix: Fails to render data type with no assigned color
data/jrubysql.gemspec CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "guard-test"
26
26
 
27
27
  s.add_runtime_dependency "jdbc-helper", '~> 0.7.4'
28
- s.add_runtime_dependency "insensitive_hash", '~> 0.2.4'
28
+ s.add_runtime_dependency "insensitive_hash", '~> 0.3.0'
29
29
  s.add_runtime_dependency "tabularize", '~> 0.2.4'
30
30
  s.add_runtime_dependency "each_sql", '~> 0.3.1'
31
31
  s.add_runtime_dependency "highline", '~> 1.6.11'
@@ -14,10 +14,10 @@ module Messages
14
14
  end
15
15
 
16
16
  private
17
- MESSAGES =
17
+ MESSAGES =
18
18
  InsensitiveHash[
19
19
  YAML.load(File.read File.join( File.dirname(__FILE__), 'messages.yml' ))
20
- ].tap { |ih| ih.underscore = true }
20
+ ]
21
21
  end#Messages
22
22
  end#JRubySQL
23
23
 
@@ -11,8 +11,22 @@ class Term
11
11
 
12
12
  def initialize
13
13
  # Make use of JLine included in JRuby
14
- java_import 'jline.Terminal'
15
- @terminal = Terminal.getTerminal
14
+ terminal =
15
+ case JRUBY_VERSION
16
+ when /^1\.7/
17
+ Java::jline.console.ConsoleReader.new.getTerminal
18
+ when /^1\.6/
19
+ Java::jline.ConsoleReader.new.getTerminal
20
+ end
21
+
22
+ @get_terminal_size = lambda {
23
+ case JRUBY_VERSION
24
+ when /^1\.7/
25
+ [ terminal.width, terminal.height ]
26
+ when /^1\.6/
27
+ [ terminal.getTerminalWidth, terminal.getTerminalHeight ]
28
+ end
29
+ }
16
30
  trap 'INT' do
17
31
  Thread.main.raise Interrupt
18
32
  end
@@ -79,9 +93,10 @@ class Term
79
93
  private
80
94
  def print_table ret, tabularize_opts = {}
81
95
  cnt = 0
82
- lines = [(@terminal.getTerminalHeight rescue JRubySQL::Constants::MAX_SCREEN_ROWS) - 5,
96
+ term_size = @get_terminal_size.call
97
+ lines = [(term_size.call[1] rescue JRubySQL::Constants::MAX_SCREEN_ROWS) - 5,
83
98
  JRubySQL::Constants::MIN_SCREEN_ROWS].max
84
- cols = (@terminal.getTerminalWidth rescue nil)
99
+ cols = (term_size.call[0] rescue nil)
85
100
  ret.each_slice(lines) do |slice|
86
101
  cnt += slice.length
87
102
 
@@ -1,3 +1,3 @@
1
1
  module JRubySQL
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/test/bin_helper.rb CHANGED
File without changes
data/test/helper.rb CHANGED
@@ -23,7 +23,7 @@ module JRubySQLTestHelper
23
23
 
24
24
  return {
25
25
  :stdout => $stdout.string,
26
- :stderr => $stderr.string,
26
+ :stderr => $stderr.string,
27
27
  :return => ret
28
28
  }
29
29
  ensure
@@ -45,7 +45,7 @@ class TestJRubySQL < Test::Unit::TestCase
45
45
  create table if not exists jrubysql (a int) engine=innodb;
46
46
  autocommit
47
47
 
48
- insert
48
+ insert
49
49
  into /* ;;; */
50
50
  jrubysql
51
51
  values (1);
@@ -176,7 +176,7 @@ class TestJRubySQL < Test::Unit::TestCase
176
176
  drop table jrubysql;
177
177
  exit
178
178
  "
179
- ret = capture { JRubySQL.launch [] }
179
+ ret = capture { JRubySQL.launch [] }
180
180
  assert_equal '999', ret[:stdout].lines.map(&:chomp)[-1]
181
181
 
182
182
  assert_prev_conn /csv/
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: jrubysql
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.6
5
+ version: 0.1.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - Junegunn Choi
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-23 00:00:00.000000000 Z
12
+ date: 2013-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -17,13 +17,15 @@ dependencies:
17
17
  requirements:
18
18
  - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: !binary |-
21
+ MA==
21
22
  none: false
22
23
  requirement: !ruby/object:Gem::Requirement
23
24
  requirements:
24
25
  - - ! '>='
25
26
  - !ruby/object:Gem::Version
26
- version: '0'
27
+ version: !binary |-
28
+ MA==
27
29
  none: false
28
30
  prerelease: false
29
31
  type: :development
@@ -49,13 +51,15 @@ dependencies:
49
51
  requirements:
50
52
  - - ! '>='
51
53
  - !ruby/object:Gem::Version
52
- version: '0'
54
+ version: !binary |-
55
+ MA==
53
56
  none: false
54
57
  requirement: !ruby/object:Gem::Requirement
55
58
  requirements:
56
59
  - - ! '>='
57
60
  - !ruby/object:Gem::Version
58
- version: '0'
61
+ version: !binary |-
62
+ MA==
59
63
  none: false
60
64
  prerelease: false
61
65
  type: :development
@@ -65,13 +69,15 @@ dependencies:
65
69
  requirements:
66
70
  - - ! '>='
67
71
  - !ruby/object:Gem::Version
68
- version: '0'
72
+ version: !binary |-
73
+ MA==
69
74
  none: false
70
75
  requirement: !ruby/object:Gem::Requirement
71
76
  requirements:
72
77
  - - ! '>='
73
78
  - !ruby/object:Gem::Version
74
- version: '0'
79
+ version: !binary |-
80
+ MA==
75
81
  none: false
76
82
  prerelease: false
77
83
  type: :development
@@ -97,13 +103,13 @@ dependencies:
97
103
  requirements:
98
104
  - - ~>
99
105
  - !ruby/object:Gem::Version
100
- version: 0.2.4
106
+ version: 0.3.0
101
107
  none: false
102
108
  requirement: !ruby/object:Gem::Requirement
103
109
  requirements:
104
110
  - - ~>
105
111
  - !ruby/object:Gem::Version
106
- version: 0.2.4
112
+ version: 0.3.0
107
113
  none: false
108
114
  prerelease: false
109
115
  type: :runtime
@@ -235,13 +241,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
241
  requirements:
236
242
  - - ! '>='
237
243
  - !ruby/object:Gem::Version
238
- version: '0'
244
+ version: !binary |-
245
+ MA==
239
246
  none: false
240
247
  required_rubygems_version: !ruby/object:Gem::Requirement
241
248
  requirements:
242
249
  - - ! '>='
243
250
  - !ruby/object:Gem::Version
244
- version: '0'
251
+ version: !binary |-
252
+ MA==
245
253
  none: false
246
254
  requirements: []
247
255
  rubyforge_project: jrubysql
@@ -254,4 +262,3 @@ test_files:
254
262
  - test/helper.rb
255
263
  - test/test_jrubysql.rb
256
264
  - test/test_option_parser.rb
257
- ...