From 9b4a5d57efe14bfdaa3fced5a6878493715fddd2 Mon Sep 17 00:00:00 2001 From: Matt Mullins Date: Tue, 5 Jul 2016 14:51:44 -0700 Subject: [PATCH] Update to JRuby 9.1.2.0 and JLine 2.12 The update to JLine 2.12 changed the factory methods to retrieve a Terminal and its width. This also fixes warnings when running `hbase shell` due to renamed Ruby APIs. --- hbase-shell/pom.xml | 4 ++++ hbase-shell/src/main/ruby/hbase.rb | 6 +++--- hbase-shell/src/main/ruby/hbase/security.rb | 2 +- hbase-shell/src/main/ruby/irb/hirb.rb | 2 +- hbase-shell/src/main/ruby/shell/formatter.rb | 2 +- pom.xml | 8 +++++++- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/hbase-shell/pom.xml b/hbase-shell/pom.xml index a394a9c..da31127 100644 --- a/hbase-shell/pom.xml +++ b/hbase-shell/pom.xml @@ -247,6 +247,10 @@ org.jruby jruby-complete + + jline + jline + org.apache.htrace diff --git a/hbase-shell/src/main/ruby/hbase.rb b/hbase-shell/src/main/ruby/hbase.rb index 2fd23d9..dcf7731 100644 --- a/hbase-shell/src/main/ruby/hbase.rb +++ b/hbase-shell/src/main/ruby/hbase.rb @@ -27,9 +27,9 @@ # whether the table exists and returns nil regardless. include Java -include_class('java.lang.Integer') {|package,name| "J#{name}" } -include_class('java.lang.Long') {|package,name| "J#{name}" } -include_class('java.lang.Boolean') {|package,name| "J#{name}" } +java_import('java.lang.Integer') {|package,name| "J#{name}" } +java_import('java.lang.Long') {|package,name| "J#{name}" } +java_import('java.lang.Boolean') {|package,name| "J#{name}" } module HBaseConstants COLUMN = "COLUMN" diff --git a/hbase-shell/src/main/ruby/hbase/security.rb b/hbase-shell/src/main/ruby/hbase/security.rb index f061e8c..356361b 100644 --- a/hbase-shell/src/main/ruby/hbase/security.rb +++ b/hbase-shell/src/main/ruby/hbase/security.rb @@ -155,7 +155,7 @@ module Hbase yield(user_name, "#{namespace},#{table},#{family},#{qualifier}: #{action.to_s}") else res[user_name] ||= {} - res[user_name][family + ":" +qualifier] = action + res[user_name][family + ":" + qualifier] = action end count += 1 end diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb b/hbase-shell/src/main/ruby/irb/hirb.rb index b32e691..4d6d277 100644 --- a/hbase-shell/src/main/ruby/irb/hirb.rb +++ b/hbase-shell/src/main/ruby/irb/hirb.rb @@ -19,7 +19,7 @@ require 'rbconfig' module IRB - WINDOZE = Config::CONFIG['host_os'] =~ /mswin|mingw/ + WINDOZE = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ # Subclass of IRB so can intercept methods class HIRB < Irb diff --git a/hbase-shell/src/main/ruby/shell/formatter.rb b/hbase-shell/src/main/ruby/shell/formatter.rb index 6e598fb..ec0901b 100644 --- a/hbase-shell/src/main/ruby/shell/formatter.rb +++ b/hbase-shell/src/main/ruby/shell/formatter.rb @@ -30,7 +30,7 @@ module Shell def refresh_width() if $stdout.tty? - @max_width = Java::jline.Terminal.getTerminal().getTerminalWidth() + @max_width = Java::jline.TerminalFactory.get().getWidth() else @max_width = 0 end diff --git a/pom.xml b/pom.xml index 6ede37b..e384cca 100644 --- a/pom.xml +++ b/pom.xml @@ -1159,7 +1159,8 @@ 6.1.26 6.1.14 1.9 - 1.6.8 + 9.1.2.0 + 2.12 4.12 1.3 3.1.0-incubating @@ -1521,6 +1522,11 @@ ${jruby.version} + jline + jline + ${jline.version} + + org.mortbay.jetty jetty ${jetty.version} -- 2.8.0.rc2