diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-09 11:17:17 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-09 11:17:17 +0000 |
commit | af064b04b1622897995fe1177aabfb60db90e6f7 (patch) | |
tree | 326cb343c08c55d2d93fa5223c01f940d3591f8b /lib/irb/ext/math-mode.rb | |
parent | 93602810e93b5da1c7161fb4b5c1a4025434a9ce (diff) | |
download | ruby-af064b04b1622897995fe1177aabfb60db90e6f7.tar.gz |
* irb 0.9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/ext/math-mode.rb')
-rw-r--r-- | lib/irb/ext/math-mode.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/irb/ext/math-mode.rb b/lib/irb/ext/math-mode.rb new file mode 100644 index 0000000000..a98664448e --- /dev/null +++ b/lib/irb/ext/math-mode.rb @@ -0,0 +1,37 @@ +# +# math-mode.rb - +# $Release Version: 0.9$ +# $Revision$ +# $Date$ +# by Keiju ISHITSUKA(Nihon Rational Software Co.,Ltd) +# +# -- +# +# +# +require "mathn" + +module IRB + class Context + attr_reader :math_mode + alias math? math_mode + + def math_mode=(opt) + if @math_mode == true && opt == false + IRB.fail CantRetuenNormalMode + 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 + |