mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	Removed math mode from irb.
mathn is deprecated from Ruby 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									23e481e390
								
							
						
					
					
						commit
						6a08beef51
					
				
					 9 changed files with 0 additions and 67 deletions
				
			
		| 
						 | 
				
			
			@ -83,7 +83,6 @@ irb起動時に``~/.irbrc''を読み込みます. もし存在しない場合は
 | 
			
		|||
できます.
 | 
			
		||||
 | 
			
		||||
  IRB.conf[:IRB_NAME]="irb"
 | 
			
		||||
  IRB.conf[:MATH_MODE]=false
 | 
			
		||||
  IRB.conf[:USE_TRACER]=false
 | 
			
		||||
  IRB.conf[:USE_LOADER]=false
 | 
			
		||||
  IRB.conf[:IGNORE_SIGINT]=true
 | 
			
		||||
| 
						 | 
				
			
			@ -207,9 +206,6 @@ irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両
 | 
			
		|||
    nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non
 | 
			
		||||
	 inspect modeとなる.
 | 
			
		||||
 | 
			
		||||
--- conf.math_mode
 | 
			
		||||
    参照のみ. bcモード(分数, 行列の計算ができます)かどうか?
 | 
			
		||||
 | 
			
		||||
--- conf.use_loader = true/false
 | 
			
		||||
    load/require時にirbのfile読み込み機能を用いるモードのスイッチ(デフォ
 | 
			
		||||
    ルトは用いない). このモードはIRB全体に反映される.
 | 
			
		||||
| 
						 | 
				
			
			@ -409,4 +405,3 @@ rubyでは, 以下のプログラムはエラーになります.
 | 
			
		|||
% comment-end: "\n"
 | 
			
		||||
% End:
 | 
			
		||||
%
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,7 +48,6 @@ require "irb/locale"
 | 
			
		|||
#
 | 
			
		||||
#   Usage:  irb.rb [options] [programfile] [arguments]
 | 
			
		||||
#     -f                Suppress read of ~/.irbrc
 | 
			
		||||
#     -m                Bc mode (load mathn, fraction or matrix are available)
 | 
			
		||||
#     -d                Set $DEBUG to true (same as `ruby -d')
 | 
			
		||||
#     -r load-module    Same as `ruby -r'
 | 
			
		||||
#     -I path           Specify $LOAD_PATH directory
 | 
			
		||||
| 
						 | 
				
			
			@ -90,7 +89,6 @@ require "irb/locale"
 | 
			
		|||
# as follows in an +irb+ session:
 | 
			
		||||
#
 | 
			
		||||
#     IRB.conf[:IRB_NAME]="irb"
 | 
			
		||||
#     IRB.conf[:MATH_MODE]=false
 | 
			
		||||
#     IRB.conf[:INSPECT_MODE]=nil
 | 
			
		||||
#     IRB.conf[:IRB_RC] = nil
 | 
			
		||||
#     IRB.conf[:BACK_TRACE_LIMIT]=16
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,6 @@ module IRB
 | 
			
		|||
      @io = nil
 | 
			
		||||
 | 
			
		||||
      self.inspect_mode = IRB.conf[:INSPECT_MODE]
 | 
			
		||||
      self.math_mode = IRB.conf[:MATH_MODE] if IRB.conf[:MATH_MODE]
 | 
			
		||||
      self.use_tracer = IRB.conf[:USE_TRACER] if IRB.conf[:USE_TRACER]
 | 
			
		||||
      self.use_loader = IRB.conf[:USE_LOADER] if IRB.conf[:USE_LOADER]
 | 
			
		||||
      self.eval_history = IRB.conf[:EVAL_HISTORY] if IRB.conf[:EVAL_HISTORY]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,48 +0,0 @@
 | 
			
		|||
# frozen_string_literal: false
 | 
			
		||||
#
 | 
			
		||||
#   math-mode.rb -
 | 
			
		||||
#   	$Release Version: 0.9.6$
 | 
			
		||||
#   	$Revision$
 | 
			
		||||
#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
 | 
			
		||||
#
 | 
			
		||||
# --
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
require "mathn"
 | 
			
		||||
 | 
			
		||||
module IRB
 | 
			
		||||
  class Context
 | 
			
		||||
    # Returns whether bc mode is enabled.
 | 
			
		||||
    #
 | 
			
		||||
    # See #math_mode=
 | 
			
		||||
    attr_reader :math_mode
 | 
			
		||||
    # Alias for #math_mode
 | 
			
		||||
    alias math? math_mode
 | 
			
		||||
 | 
			
		||||
    # Sets bc mode, which loads +lib/mathn.rb+ so fractions or matrix are
 | 
			
		||||
    # available.
 | 
			
		||||
    #
 | 
			
		||||
    # Also available as the +-m+ command line option.
 | 
			
		||||
    #
 | 
			
		||||
    # See IRB@Command+line+options and the unix manpage <code>bc(1)</code> for
 | 
			
		||||
    # more information.
 | 
			
		||||
    def math_mode=(opt)
 | 
			
		||||
      if @math_mode == true && !opt
 | 
			
		||||
        IRB.fail CantReturnToNormalMode
 | 
			
		||||
        return
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      @math_mode = opt
 | 
			
		||||
      if math_mode
 | 
			
		||||
        main.extend Math
 | 
			
		||||
        print "start math mode\n" if verbose?
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    def inspect?
 | 
			
		||||
      @inspect_mode.nil? && !@math_mode or @inspect_mode
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -214,7 +214,6 @@ module IRB # :nodoc:
 | 
			
		|||
    @EXTEND_COMMANDS = [
 | 
			
		||||
      [:eval_history=, "irb/ext/history.rb"],
 | 
			
		||||
      [:use_tracer=, "irb/ext/tracer.rb"],
 | 
			
		||||
      [:math_mode=, "irb/ext/math-mode.rb"],
 | 
			
		||||
      [:use_loader=, "irb/ext/use-loader.rb"],
 | 
			
		||||
      [:save_history=, "irb/ext/save-history.rb"],
 | 
			
		||||
    ]
 | 
			
		||||
| 
						 | 
				
			
			@ -223,7 +222,6 @@ module IRB # :nodoc:
 | 
			
		|||
    #
 | 
			
		||||
    # Context#eval_history=::   +irb/ext/history.rb+
 | 
			
		||||
    # Context#use_tracer=::     +irb/ext/tracer.rb+
 | 
			
		||||
    # Context#math_mode=::      +irb/ext/math-mode.rb+
 | 
			
		||||
    # Context#use_loader=::     +irb/ext/use-loader.rb+
 | 
			
		||||
    # Context#save_history=::   +irb/ext/save-history.rb+
 | 
			
		||||
    def self.install_extend_commands
 | 
			
		||||
| 
						 | 
				
			
			@ -306,4 +304,3 @@ module IRB # :nodoc:
 | 
			
		|||
    end
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,6 @@ module IRB # :nodoc:
 | 
			
		|||
    @CONF[:LOAD_MODULES] = []
 | 
			
		||||
    @CONF[:IRB_RC] = nil
 | 
			
		||||
 | 
			
		||||
    @CONF[:MATH_MODE] = false
 | 
			
		||||
    @CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
 | 
			
		||||
    @CONF[:INSPECT_MODE] = true
 | 
			
		||||
    @CONF[:USE_TRACER] = false
 | 
			
		||||
| 
						 | 
				
			
			@ -128,8 +127,6 @@ module IRB # :nodoc:
 | 
			
		|||
      case opt
 | 
			
		||||
      when "-f"
 | 
			
		||||
        @CONF[:RC] = false
 | 
			
		||||
      when "-m"
 | 
			
		||||
        @CONF[:MATH_MODE] = true
 | 
			
		||||
      when "-d"
 | 
			
		||||
        $DEBUG = true
 | 
			
		||||
        $VERBOSE = true
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,7 +11,6 @@
 | 
			
		|||
#
 | 
			
		||||
Usage:  irb.rb [options] [programfile] [arguments]
 | 
			
		||||
  -f		    Suppress read of ~/.irbrc
 | 
			
		||||
  -m		    Bc mode (load mathn, fraction or matrix are available)
 | 
			
		||||
  -d                Set $DEBUG to true (same as `ruby -d')
 | 
			
		||||
  -r load-module    Same as `ruby -r'
 | 
			
		||||
  -I path           Specify $LOAD_PATH directory
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -10,7 +10,6 @@
 | 
			
		|||
#
 | 
			
		||||
Usage:  irb.rb [options] [programfile] [arguments]
 | 
			
		||||
  -f		    ~/.irbrc を読み込まない.
 | 
			
		||||
  -m		    bcモード(分数, 行列の計算ができる)
 | 
			
		||||
  -d                $DEBUG をtrueにする(ruby -d と同じ)
 | 
			
		||||
  -r load-module    ruby -r と同じ.
 | 
			
		||||
  -I path           $LOAD_PATH に path を追加する.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -69,9 +69,6 @@ Suppresses read of
 | 
			
		|||
.It Fl -help
 | 
			
		||||
Prints a summary of the options.
 | 
			
		||||
.Pp
 | 
			
		||||
.It Fl m
 | 
			
		||||
Bc mode (load mathn, fraction or matrix are available)
 | 
			
		||||
.Pp
 | 
			
		||||
.It Fl r Ar library
 | 
			
		||||
Same as `ruby -r'.
 | 
			
		||||
Causes irb to load the library using require.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue