You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/04/18 21:46:29 UTC
svn commit: r1094711 - in /hbase/trunk: CHANGES.txt src/main/ruby/irb/hirb.rb
Author: stack
Date: Mon Apr 18 19:46:29 2011
New Revision: 1094711
URL: http://svn.apache.org/viewvc?rev=1094711&view=rev
Log:
HBASE-3781 hbase shell cannot start NoMethodError: undefined method 'close' for nil:NilClass
Modified:
hbase/trunk/CHANGES.txt
hbase/trunk/src/main/ruby/irb/hirb.rb
Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1094711&r1=1094710&r2=1094711&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Mon Apr 18 19:46:29 2011
@@ -76,6 +76,8 @@ Release 0.91.0 - Unreleased
HBASE-3758 Delete triggers pre/postScannerOpen upcalls of RegionObserver
(Mingjie Lai via garyh)
HBASE-3790 Fix NPE in ExecResult.write() with null return value
+ HBASE-3781 hbase shell cannot start "NoMethodError: undefined method
+ `close' for nil:NilClass" (Mikael Sitruk)
IMPROVEMENTS
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
Modified: hbase/trunk/src/main/ruby/irb/hirb.rb
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/ruby/irb/hirb.rb?rev=1094711&r1=1094710&r2=1094711&view=diff
==============================================================================
--- hbase/trunk/src/main/ruby/irb/hirb.rb (original)
+++ hbase/trunk/src/main/ruby/irb/hirb.rb Mon Apr 18 19:46:29 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