summaryrefslogtreecommitdiff
path: root/lib/irb
AgeCommit message (Collapse)Author
2018-04-14irb.rb: restore the last errornobu
* lib/irb.rb (eval_input): restore the last error `$!`, as the previous result. [Feature #14684] * lib/irb/context.rb (evaluate): add `exception` keyword argument to set the last error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb/{context,workspace}.rb: use local_variable_setnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-14irb/context.rb: using input-methodnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13Hash instead of Setnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-13Speed up func1.func2 completion by using Set for ignored modulesnobu
And thus avoiding Module#name calls. Those are slow, especially in larger projects, with lots of anonymous modules. [Fix GH-1798] From: Dmitry Gutov <dgutov@yandex.ru> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-26proc.c (bind_location): Add Binding#source_locationmame
Fixes #14230 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Remove unnecessary `:`kazu
Before: `.../irb/init.rb:280: warning: :LoadError: cannot load such file -- hoge` After: `.../irb/init.rb:280: warning: LoadError: cannot load such file -- hoge` [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12Add uplevel keyword to Kernel#warn and use itshyouhei
If uplevel keyword is given, the warning message is prepended with caller file and line information and the string "warning: ". The use of the uplevel keyword makes Kernel#warn format output similar to how rb_warn formats output. This patch modifies net/ftp and net/imap to use Kernel#warn instead of $stderr.puts or $stderr.printf, since they are used for printing warnings. This makes lib/cgi/core and tempfile use $stderr.puts instead of warn for debug logging, since they are used for debug printing and not for warning. This does not modify bundler, rubygems, or rdoc, as those are maintained outside of ruby and probably wish to remain backwards compatible with older ruby versions. rb_warn_m code is originally from nobu, but I've changed it so that it only includes the path and lineno from uplevel (not the method), and also prepends the string "warning: ", to make it more similar to rb_warn. From: Jeremy Evans code@jeremyevans.net Signed-off-by: Urabe Shyouhei shyouhei@ruby-lang.org git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb/init.rb: make sure ARGV refers to toplevel onek0kubun
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-12irb.rb: preserve ARGV on binding.irbk0kubun
This is not perfectly good solution (at least we don't want to have ARGV as default value of `argv` argument), but unfortunately IRB.setup and IRB.parse_opts are public methods and we can't make breaking change to those methods. We may deprecate using them and then make them private in the future, but the removal should not be in Ruby 2.5. So I kept their interface for now. [Bug #14162] [close GH-1770] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24Fix TOCTTOU and avoid to read existing unreadable filekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24workspace.rb: one more spacenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24workspace.rb: fix SCRIPT_LINES__nobu
* lib/irb/workspace.rb (code_around_binding): `SCRIPT_LINES__` values are arrays of lines. get file and line at once. moved loop-invariant format string. join without extra strings by `$,`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-24irb.rb: show source around binding.irb on startk0kubun
[Feature #14124] [ruby-dev:50319] [close GH-1764] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-08Remove unnecessary `require 'thread'`kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-15Don't pollute toplevel by an IRB internal methoda_matsuda
There actually are some libraries that requires 'irb' such as byebug, and when 'irb' is required, it requires irb/src_encoding.rb, then it defines the toplevel default_src_encoding method that is visible from anywhere in the end users' apps. Here's a quick oneliner that shows what's happening. % ruby -rpry-byebug -e 'p private_methods(false)' [:include, :using, :define_method, :public, :private, :DelegateClass, :default_src_encoding] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20ruby-lex.rb: fix continued line conditionsnobu
* lib/irb/ruby-lex.rb (RubyLex#lex): fix conditions for continued line; empty lines, a semicolon, first line in `begin` block, just after `else` are not continued. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20ruby-lex.rb: merge regexpsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20Removed math mode from irb.hsbt
mathn is deprecated from Ruby 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-09slex.rb: japanese comment [ci skip]nobu
* lib/irb/slex.rb (postproc): translated a japanese comment in ISO-2022-JP. [ruby-core:79017] [Misc #13117] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57291 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-13require "irb/output-method" for StdioOutputMethodnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-08ruby-lex.rb: fix for labelnobu
* lib/irb/ruby-lex.rb (identify_identifier): treat identifier just followed by a colon as a lable. this is not a precise solution but enough for the time being. [ruby-core:78526] [Bug #13012] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-07* basictest/test.rb: Adjust spaces in class declarationshsbt
with inheritance. [fix GH-1227] Patch by @adrfer * lib/irb/*: ditto. * lib/prime.rb: ditto. * lib/shell/builtin-command.rb: ditto. * object.c: ditto. * sample/*.rb: ditto. * test/-ext-/method/test_arity.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-30Use qualified namesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15* lib/irb/ext/save-history.rb: Fix NoMethodError when method is not defined.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-14* lib/irb/ext/save-history.rb: suppress warning: method redefined;naruse
discarding old save_history=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18* lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.hsbt
[fix GH-1127] Patch by @koic git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-27* lib/drb/drb.rb: use attr_reader instead of Module#attr.hsbt
[Feature #10172][ruby-core:64582] * lib/irb/ruby-token.rb: ditto. * lib/net/telnet.rb: ditto. * lib/rdoc/ruby_token.rb: ditto. * lib/thwait.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-24* lib/e2mmap.rb: remove needless instance variables.hsbt
* lib/irb.rb: ditto. * lib/irb/**/*.rb: ditto. * lib/shell.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-13* lib/irb/completion.rb: reverted r47163.hsbt
because another case can't be show completion target. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-13* lib/irb/completion.rb: fixed broken completion list withhsbt
String including spaces. Contributed from @dunric. [fix GH-465] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-10* lib/irb/ext/multi-irb.rb: fixed indent.hsbt
* lib/irb/output-method.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-10* lib/irb/ext/multi-irb.rb: removed commented-out code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09* lib/irb.rb: removed commented-out code.hsbt
* lib/irb/**/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-09* lib/cmath.rb: fixed indent.hsbt
* lib/drb/ssl.rb: ditto. * lib/irb/**/*.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-08* lib/irb/init.rb: removed unreachable code.hsbt
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-08 * lib/irb/ruby-lex.rb: fix counting indent in identify_string_dvar.keiju
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-04lib/irb/locale.rb: fix typonobu
* lib/irb/locale.rb (IRB::Locale#modifier): fix wrong attr_reader `modifieer` => `modifier` from irb locale. [fix GH-656] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-30* lib/irb/inspector.rb: [DOC] Fix typo (s/dependant/dependent/)a_matsuda
* lib/irb/workspace.rb: [DOC] Fix typo (s/binging/binding/) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* lib/irb/notifier.rb: [Doc] Fix typoa_matsuda
* ext/json/lib/json/common.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-27* lib/irb/notifier.rb: Fix typoa_matsuda
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* lib/irb/lc/ja/help-message: update help messages.ayumin
following r41028. [ruby-dev:46707] [Feature #7510] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* lib/irb/completion.rb: Use %w literal construction for long lists.eregon
Patch by Dave Goodchild. [Fixes GH-299] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-02* lib/irb/lc/help-message: Apply english updates for irb --help #7510zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04* lib/irb.rb, lib/irb/ext/save-history.rb: Add documentation on how tozzak
enabled irb history [ruby-core:51347] [Bug #7679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04* lib/irb.rb, lib/irb/context.rb: Add documentation on how to enablezzak
auto-indentation and autocompletion using irbrc and irb_context [ruby-core:51209] [Bug #7642] and [ruby-core:51348] [Bug #7680] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-16* .document: Removed extra spacedrbrain
* lib/irb/lc/.document: Hide help-message * lib/minitest/.document: Hide README.txt * lib/rake/lib/.document: Hide project.rake * lib/rdoc/generator/template/json_index/.document: Hide JavaScript files * lib/rubygems/ssl_certs/.document: Hide PEM files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-15 * lib/irb/ext/save-history.rb: identify rightly a status of akeiju
history file that already exists [Bug #7694]. Thanks Nobuhiro IMAI for this patch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 * lib/irb/ext/save-history.rb: outputs its history tokeiju
owner-only-readable file and change the permission of a file that already exists [Bug #7694]. Thanks Nobuhiro IMAI for bug reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e