summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-20 09:11:36 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-04-20 09:11:36 +0000
commit6a08beef517fa766b276975cdb2619939c6f7779 (patch)
tree8c142e3d90ad0b9d8b5181ede70b39064a71943f
parent23e481e390ecf9b1ea438ab9a6cab0079f811e61 (diff)
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
-rw-r--r--doc/irb/irb.rd.ja5
-rw-r--r--lib/irb.rb2
-rw-r--r--lib/irb/context.rb1
-rw-r--r--lib/irb/ext/math-mode.rb48
-rw-r--r--lib/irb/extend-command.rb3
-rw-r--r--lib/irb/init.rb3
-rw-r--r--lib/irb/lc/help-message1
-rw-r--r--lib/irb/lc/ja/help-message1
-rw-r--r--man/irb.13
9 files changed, 0 insertions, 67 deletions
diff --git a/doc/irb/irb.rd.ja b/doc/irb/irb.rd.ja
index 416dec3906..85b6536ee4 100644
--- a/doc/irb/irb.rd.ja
+++ b/doc/irb/irb.rd.ja
@@ -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:
%
-
diff --git a/lib/irb.rb b/lib/irb.rb
index ca36acd569..3c7de05289 100644
--- a/lib/irb.rb
+++ b/lib/irb.rb
@@ -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
diff --git a/lib/irb/context.rb b/lib/irb/context.rb
index f5e1a7aa6f..9ccdf744fb 100644
--- a/lib/irb/context.rb
+++ b/lib/irb/context.rb
@@ -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]
diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb
deleted file mode 100644
index e409dbdc6a..0000000000
--- a/lib/irb/ext/math-mode.rb
+++ /dev/null
@@ -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
-
diff --git a/lib/irb/extend-command.rb b/lib/irb/extend-command.rb
index 6f15e6403a..064f21ba52 100644
--- a/lib/irb/extend-command.rb
+++ b/lib/irb/extend-command.rb
@@ -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
-
diff --git a/lib/irb/init.rb b/lib/irb/init.rb
index 1184db15ea..700466beda 100644
--- a/lib/irb/init.rb
+++ b/lib/irb/init.rb
@@ -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
diff --git a/lib/irb/lc/help-message b/lib/irb/lc/help-message
index 5853693eb0..d43c6a1695 100644
--- a/lib/irb/lc/help-message
+++ b/lib/irb/lc/help-message
@@ -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
diff --git a/lib/irb/lc/ja/help-message b/lib/irb/lc/ja/help-message
index 288eb5245c..1b24d14d28 100644
--- a/lib/irb/lc/ja/help-message
+++ b/lib/irb/lc/ja/help-message
@@ -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 を追加する.
diff --git a/man/irb.1 b/man/irb.1
index 9083fcdbe2..e980a2ebfd 100644
--- a/man/irb.1
+++ b/man/irb.1
@@ -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.