Revision: 4316 http://trac.macosforge.org/projects/ruby/changeset/4316 Author: eloy.de.enige@gmail.com Date: 2010-07-02 06:13:23 -0700 (Fri, 02 Jul 2010) Log Message: ----------- Merge DietRB 0.4.7, for ticket #747 Modified Paths: -------------- MacRuby/trunk/bin/irb MacRuby/trunk/lib/irb/formatter.rb MacRuby/trunk/lib/irb/version.rb Modified: MacRuby/trunk/bin/irb =================================================================== --- MacRuby/trunk/bin/irb 2010-07-01 18:37:59 UTC (rev 4315) +++ MacRuby/trunk/bin/irb 2010-07-02 13:13:23 UTC (rev 4316) @@ -14,6 +14,7 @@ opt.on("-r load-lib", "Loads the given library (same as `ruby -r')") { |lib| require lib } opt.on("-d", "Set $DEBUG to true (same as `ruby -d')") { $DEBUG = true } opt.on("-I path", "Add path to $LOAD_PATH") { |path| $LOAD_PATH.unshift(path) } + opt.on("--noinspect", "Don't use inspect for output") { IRB.formatter.inspect = false } opt.on("--simple-prompt", "Simple prompt mode") { IRB.formatter.prompt = :simple } opt.on("--noprompt", "No prompt mode") { IRB.formatter.prompt = nil } opt.on("-v", "--version", "Print the version of #{bin}") do Modified: MacRuby/trunk/lib/irb/formatter.rb =================================================================== --- MacRuby/trunk/lib/irb/formatter.rb 2010-07-01 18:37:59 UTC (rev 4315) +++ MacRuby/trunk/lib/irb/formatter.rb 2010-07-02 13:13:23 UTC (rev 4316) @@ -17,11 +17,13 @@ SYNTAX_ERROR = "SyntaxError: compile error\n(irb):%d: %s" SOURCE_ROOT = /^#{File.expand_path('../../../', __FILE__)}/ - attr_writer :prompt - attr_reader :filter_from_backtrace + attr_writer :prompt + attr_accessor :inspect + attr_reader :filter_from_backtrace def initialize - @prompt = :default + @prompt = :default + @inspect = true @filter_from_backtrace = [SOURCE_ROOT] end @@ -35,7 +37,13 @@ end def inspect_object(object) - object.respond_to?(:pretty_inspect) ? object.pretty_inspect : object.inspect + if @inspect + object.respond_to?(:pretty_inspect) ? object.pretty_inspect : object.inspect + else + address = object.__id__ * 2 + address += 0x100000000 if address < 0 + "#<#{object.class}:0x%x>" % address + end end def result(object) Modified: MacRuby/trunk/lib/irb/version.rb =================================================================== --- MacRuby/trunk/lib/irb/version.rb 2010-07-01 18:37:59 UTC (rev 4315) +++ MacRuby/trunk/lib/irb/version.rb 2010-07-02 13:13:23 UTC (rev 4316) @@ -6,11 +6,16 @@ module IRB module VERSION #:nodoc: + NAME = 'DietRB' MAJOR = 0 MINOR = 4 - TINY = 5 + TINY = 7 STRING = [MAJOR, MINOR, TINY].join('.') - DESCRIPTION = "#{STRING} (DietRB)" + DESCRIPTION = "#{NAME} (#{STRING})" end -end \ No newline at end of file + + def self.version + IRB::VERSION::DESCRIPTION + end +end
participants (1)
-
source_changes@macosforge.org