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[:IRB_NAME]="irb"
|
||||||
IRB.conf[:MATH_MODE]=false
|
|
||||||
IRB.conf[:USE_TRACER]=false
|
IRB.conf[:USE_TRACER]=false
|
||||||
IRB.conf[:USE_LOADER]=false
|
IRB.conf[:USE_LOADER]=false
|
||||||
IRB.conf[:IGNORE_SIGINT]=true
|
IRB.conf[:IGNORE_SIGINT]=true
|
||||||
|
@ -207,9 +206,6 @@ irb拡張コマンドは, 簡単な名前と頭に`irb_'をつけた名前と両
|
||||||
nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non
|
nil: 通常モードであれば, inspect modeとなり, mathモードの時は, non
|
||||||
inspect modeとなる.
|
inspect modeとなる.
|
||||||
|
|
||||||
--- conf.math_mode
|
|
||||||
参照のみ. bcモード(分数, 行列の計算ができます)かどうか?
|
|
||||||
|
|
||||||
--- conf.use_loader = true/false
|
--- conf.use_loader = true/false
|
||||||
load/require時にirbのfile読み込み機能を用いるモードのスイッチ(デフォ
|
load/require時にirbのfile読み込み機能を用いるモードのスイッチ(デフォ
|
||||||
ルトは用いない). このモードはIRB全体に反映される.
|
ルトは用いない). このモードはIRB全体に反映される.
|
||||||
|
@ -409,4 +405,3 @@ rubyでは, 以下のプログラムはエラーになります.
|
||||||
% comment-end: "\n"
|
% comment-end: "\n"
|
||||||
% End:
|
% End:
|
||||||
%
|
%
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,6 @@ require "irb/locale"
|
||||||
#
|
#
|
||||||
# Usage: irb.rb [options] [programfile] [arguments]
|
# Usage: irb.rb [options] [programfile] [arguments]
|
||||||
# -f Suppress read of ~/.irbrc
|
# -f Suppress read of ~/.irbrc
|
||||||
# -m Bc mode (load mathn, fraction or matrix are available)
|
|
||||||
# -d Set $DEBUG to true (same as `ruby -d')
|
# -d Set $DEBUG to true (same as `ruby -d')
|
||||||
# -r load-module Same as `ruby -r'
|
# -r load-module Same as `ruby -r'
|
||||||
# -I path Specify $LOAD_PATH directory
|
# -I path Specify $LOAD_PATH directory
|
||||||
|
@ -90,7 +89,6 @@ require "irb/locale"
|
||||||
# as follows in an +irb+ session:
|
# as follows in an +irb+ session:
|
||||||
#
|
#
|
||||||
# IRB.conf[:IRB_NAME]="irb"
|
# IRB.conf[:IRB_NAME]="irb"
|
||||||
# IRB.conf[:MATH_MODE]=false
|
|
||||||
# IRB.conf[:INSPECT_MODE]=nil
|
# IRB.conf[:INSPECT_MODE]=nil
|
||||||
# IRB.conf[:IRB_RC] = nil
|
# IRB.conf[:IRB_RC] = nil
|
||||||
# IRB.conf[:BACK_TRACE_LIMIT]=16
|
# IRB.conf[:BACK_TRACE_LIMIT]=16
|
||||||
|
|
|
@ -43,7 +43,6 @@ module IRB
|
||||||
@io = nil
|
@io = nil
|
||||||
|
|
||||||
self.inspect_mode = IRB.conf[:INSPECT_MODE]
|
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_tracer = IRB.conf[:USE_TRACER] if IRB.conf[:USE_TRACER]
|
||||||
self.use_loader = IRB.conf[:USE_LOADER] if IRB.conf[:USE_LOADER]
|
self.use_loader = IRB.conf[:USE_LOADER] if IRB.conf[:USE_LOADER]
|
||||||
self.eval_history = IRB.conf[:EVAL_HISTORY] if IRB.conf[:EVAL_HISTORY]
|
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 = [
|
@EXTEND_COMMANDS = [
|
||||||
[:eval_history=, "irb/ext/history.rb"],
|
[:eval_history=, "irb/ext/history.rb"],
|
||||||
[:use_tracer=, "irb/ext/tracer.rb"],
|
[:use_tracer=, "irb/ext/tracer.rb"],
|
||||||
[:math_mode=, "irb/ext/math-mode.rb"],
|
|
||||||
[:use_loader=, "irb/ext/use-loader.rb"],
|
[:use_loader=, "irb/ext/use-loader.rb"],
|
||||||
[:save_history=, "irb/ext/save-history.rb"],
|
[:save_history=, "irb/ext/save-history.rb"],
|
||||||
]
|
]
|
||||||
|
@ -223,7 +222,6 @@ module IRB # :nodoc:
|
||||||
#
|
#
|
||||||
# Context#eval_history=:: +irb/ext/history.rb+
|
# Context#eval_history=:: +irb/ext/history.rb+
|
||||||
# Context#use_tracer=:: +irb/ext/tracer.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#use_loader=:: +irb/ext/use-loader.rb+
|
||||||
# Context#save_history=:: +irb/ext/save-history.rb+
|
# Context#save_history=:: +irb/ext/save-history.rb+
|
||||||
def self.install_extend_commands
|
def self.install_extend_commands
|
||||||
|
@ -306,4 +304,3 @@ module IRB # :nodoc:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,6 @@ module IRB # :nodoc:
|
||||||
@CONF[:LOAD_MODULES] = []
|
@CONF[:LOAD_MODULES] = []
|
||||||
@CONF[:IRB_RC] = nil
|
@CONF[:IRB_RC] = nil
|
||||||
|
|
||||||
@CONF[:MATH_MODE] = false
|
|
||||||
@CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
|
@CONF[:USE_READLINE] = false unless defined?(ReadlineInputMethod)
|
||||||
@CONF[:INSPECT_MODE] = true
|
@CONF[:INSPECT_MODE] = true
|
||||||
@CONF[:USE_TRACER] = false
|
@CONF[:USE_TRACER] = false
|
||||||
|
@ -128,8 +127,6 @@ module IRB # :nodoc:
|
||||||
case opt
|
case opt
|
||||||
when "-f"
|
when "-f"
|
||||||
@CONF[:RC] = false
|
@CONF[:RC] = false
|
||||||
when "-m"
|
|
||||||
@CONF[:MATH_MODE] = true
|
|
||||||
when "-d"
|
when "-d"
|
||||||
$DEBUG = true
|
$DEBUG = true
|
||||||
$VERBOSE = true
|
$VERBOSE = true
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#
|
#
|
||||||
Usage: irb.rb [options] [programfile] [arguments]
|
Usage: irb.rb [options] [programfile] [arguments]
|
||||||
-f Suppress read of ~/.irbrc
|
-f Suppress read of ~/.irbrc
|
||||||
-m Bc mode (load mathn, fraction or matrix are available)
|
|
||||||
-d Set $DEBUG to true (same as `ruby -d')
|
-d Set $DEBUG to true (same as `ruby -d')
|
||||||
-r load-module Same as `ruby -r'
|
-r load-module Same as `ruby -r'
|
||||||
-I path Specify $LOAD_PATH directory
|
-I path Specify $LOAD_PATH directory
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#
|
#
|
||||||
Usage: irb.rb [options] [programfile] [arguments]
|
Usage: irb.rb [options] [programfile] [arguments]
|
||||||
-f ~/.irbrc を読み込まない.
|
-f ~/.irbrc を読み込まない.
|
||||||
-m bcモード(分数, 行列の計算ができる)
|
|
||||||
-d $DEBUG をtrueにする(ruby -d と同じ)
|
-d $DEBUG をtrueにする(ruby -d と同じ)
|
||||||
-r load-module ruby -r と同じ.
|
-r load-module ruby -r と同じ.
|
||||||
-I path $LOAD_PATH に path を追加する.
|
-I path $LOAD_PATH に path を追加する.
|
||||||
|
|
|
@ -69,9 +69,6 @@ Suppresses read of
|
||||||
.It Fl -help
|
.It Fl -help
|
||||||
Prints a summary of the options.
|
Prints a summary of the options.
|
||||||
.Pp
|
.Pp
|
||||||
.It Fl m
|
|
||||||
Bc mode (load mathn, fraction or matrix are available)
|
|
||||||
.Pp
|
|
||||||
.It Fl r Ar library
|
.It Fl r Ar library
|
||||||
Same as `ruby -r'.
|
Same as `ruby -r'.
|
||||||
Causes irb to load the library using require.
|
Causes irb to load the library using require.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue