summaryrefslogtreecommitdiff
path: root/lib/irb
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 /lib/irb
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
Diffstat (limited to 'lib/irb')
-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
6 files changed, 0 insertions, 57 deletions
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 を追加する.