Author: stack
Date: Tue Apr 19 17:17:46 2011
New Revision: 1095141
URL: http://svn.apache.org/viewvc?rev=1095141&view=rev
Log:
HBASE-3781 hbase shell cannot start NoMethodError: undefined method 'close' for
nil:NilClass
Modified:
hbase/branches/0.90/CHANGES.txt
hbase/branches/0.90/src/main/ruby/irb/hirb.rb
Modified: hbase/branches/0.90/CHANGES.txt
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/CHANGES.txt?rev=1095141&r1=1095140&r2=1095141&view=diff
==============================================================================
--- hbase/branches/0.90/CHANGES.txt (original)
+++ hbase/branches/0.90/CHANGES.txt Tue Apr 19 17:17:46 2011
@@ -23,6 +23,8 @@ Release 0.90.3 - Unreleased
HBASE-3708 createAndFailSilent is not so silent; leaves lots of logging in
ensemble logs (Dmitriy Ryaboy)
HBASE-3783 hbase-0.90.2.jar exists in hbase root and in 'lib/'
+ HBASE-3781 hbase shell cannot start "NoMethodError: undefined method
+ `close' for nil:NilClass" (Mikael Sitruk)
IMPROVEMENT
HBASE-3717 deprecate HTable isTableEnabled() methods in favor of HBaseAdmin
Modified: hbase/branches/0.90/src/main/ruby/irb/hirb.rb
URL:
http://svn.apache.org/viewvc/hbase/branches/0.90/src/main/ruby/irb/hirb.rb?rev=1095141&r1=1095140&r2=1095141&view=diff
==============================================================================
--- hbase/branches/0.90/src/main/ruby/irb/hirb.rb (original)
+++ hbase/branches/0.90/src/main/ruby/irb/hirb.rb Tue Apr 19 17:17:46 2011
@@ -17,8 +17,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+require 'rbconfig'
module IRB
+ WINDOZE = Config::CONFIG['host_os'] =~ /mswin|mingw/
+ # Map the '/dev/null' according to the runing platform
+ # Under Windows platform the 'dev/null' is not fully compliant with unix,
+ # and the 'NUL' object need to be use instead.
+
# Subclass of IRB so can intercept methods
class HIRB < Irb
def initialize
@@ -31,7 +37,9 @@ module IRB
# happen is the shell exiting because of failed IRB construction with
# no error (though we're not blanking STDERR)
begin
- f = File.open("/dev/null", "w")
+ devnull = "/dev/null"
+ devnull = "NUL" if WINDOZE
+ f = File.open(devnull, "w")
$stdout = f
super
ensure