summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-12-15Prepare to release rubygems-3.2.1 and bundler-2.2.1Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3901
2020-12-11[ruby/reline] Fix breaking to input Emoji with ZWJ.ima1zumi
https://github.com/ruby/reline/commit/f21dfdbb11
2020-12-11Exclude parenthesized function declarations such as NORETURNNobuyoshi Nakada
Fixes https://github.com/ruby/ruby/pull/3883
2020-12-10Use `abort(message)` instead of `puts` and `exit`Kazuhiro NISHIYAMA
2020-12-10Fixed the test failures called WEBrick.new directlyHiroshi SHIBATA
2020-12-10Added help message for gem i webrick in rdocHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-12-10Added help message for gem i webrick in gem server commandHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-12-10Added help message for gem i webrick in un.rbHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-12-10Move webrick library into internal test toolchainHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3729
2020-12-09[ruby/matrix] v0.3.1Marc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3869
2020-12-09[ruby/matrix] Make frozen matrices Ractor shareableMarc-Andre Lafortune
Notes: Merged: https://github.com/ruby/ruby/pull/3869
2020-12-09[ruby/prime] Fix gemspecMarc-Andre Lafortune
2020-12-09[ruby/prime] v0.1.2Marc-Andre Lafortune
2020-12-09[ruby/prime] Optimize `Integer#prime?`Marc-Andre Lafortune
Miller Rabin algorithm can be used to test primality for integers smaller than a max value "MaxMR" (~3e24) It can be much faster than previous implementation: ~100x faster for numbers with 13 digits, at least 5 orders of magnitude for even larger numbers (previous implementation is so slow that it requires more patience than I have for more precise estimate). Miller Rabin test becomes faster than previous implementation at somewhere in the range 1e5-1e6. It seems that the range 62000..66000 is where Miller Rabin starts being always faster, so I picked 0xffff arbitrarily; before that, or above "MaxMR", the previous implementation remains. I compared the `faster_prime` gem too. It is slower than previous implementation up to ~1e4. After that it becomes faster and faster compared to previous implementation, but is still slower than Miller Rabin starting at ~1e5 and up to MaxMR. Thus, after this commit, builtin `Integer#prime?` will be similar or faster than `faster_prime` up to "MaxMR". Adapted from patch of Stephen Blackstone [Feature #16468] Benchmark results and code: https://gist.github.com/marcandre/b263bdae488e76dabdda84daf73733b9 Co-authored-by: Stephen Blackstone <sblackstone@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/3847
2020-12-08Merge prepare version of Bundler 2.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-12-08Merge prepare version of RubyGems 3.2.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3864
2020-12-08[ruby/reline] Editing to initial content is not just cursor movingaycabta
https://github.com/ruby/reline/commit/0a4f175b0a
2020-12-06RubyGems certs - remove AddTrust, add GlobalSign Root R3MSP-Greg
Notes: Merged: https://github.com/ruby/ruby/pull/3854
2020-12-05[ruby/matrix] Optimize **Marc-Andre Lafortune
Avoiding recursive call would imply iterating bits starting from most significant, which is not easy to do efficiently. Any saving would be dwarfed by the multiplications anyways. [Feature #15233] Notes: Merged: https://github.com/ruby/ruby/pull/3844
2020-12-05Cope with frozen-string-literalRobert Schulze
When running irb 1.2.1 (2019-12-24) with frozen-string-literal enabled, it crashes in reline with `can't modify frozen String (FrozenError)` Steps to reproduce: `RUBYOPT="--enable-frozen-string-literal" irb`
2020-12-05[ruby/reline] Process insertion buffer forciblyaycabta
https://github.com/ruby/reline/commit/89d49ec9e0
2020-12-05[ruby/reline] Support bracketed paste modeaycabta
https://github.com/ruby/reline/commit/d1a6869322
2020-12-05[ruby/reline] Forced newline insertion is not just cursor movingaycabta
https://github.com/ruby/reline/commit/0e30a49d03
2020-12-05[ruby/reline] Drop prompt list cache when num of lines is changedaycabta
https://github.com/ruby/reline/commit/1959e22043
2020-12-05[ruby/reline] Cache dynamic prompt for 0.5secaycabta
https://github.com/ruby/reline/commit/06b89d0e61
2020-12-05[ruby/reline] Stop rerendering if the cursor is only movedaycabta
https://github.com/ruby/reline/commit/30e8eaf855
2020-12-05[ruby/reline] Split #rerender method that is too hugeaycabta
https://github.com/ruby/reline/commit/d0fbc89253
2020-12-05[ruby/reline] Version 0.1.9aycabta
https://github.com/ruby/reline/commit/0b1b5e77ce
2020-12-05[ruby/reline] Stop rerendering whole screen when adding newline at end of bufferaycabta
The rendering time in IRB has been reduced as follows: start = Time.now def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else @line_no += l.count("\n") next if l == "\n" @line.concat l if @code_block_open or @ltype or @continue or @indent > 0 next end end if @line != "\n" @line.force_encoding(@io.encoding) yield @line, @exp_line_no end break if @io.eof? @line = '' @exp_line_no = @line_no @indent = 0 rescue TerminateLineInput initialize_input prompt end end end end puts "Duration: #{Time.now - start} seconds" 0.33sec -> 0.22sec https://github.com/ruby/reline/commit/496c6a1892
2020-12-05[ruby/reline] Optimize regexp handling for widthaycabta
The rendering time in IRB has been reduced as follows: start = Time.now [{"_id"=>"5f9072a4589a06d2d74b6028", "index"=>0, "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7", "isActive"=>true, "balance"=>"$1,442.84", "picture"=>"http://placehold.it/32x32", "age"=>34, "eyeColor"=>"blue", "name"=>{"first"=>"Ward", "last"=>"Levy"}, "company"=>"HYPLEX", "email"=>"ward.levy@hyplex.us", "phone"=>"+1 (867) 568-3319", "address"=>"867 Cobek Court, Clara, Maryland, 3254", "about"=> "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.", "registered"=>"Monday, May 25, 2015 6:51 AM", "latitude"=>"16.001127", "longitude"=>"-72.377848", "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"], "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "friends"=> [{"id"=>0, "name"=>"Alison Bryant"}, {"id"=>1, "name"=>"Ester Espinoza"}, {"id"=>2, "name"=>"Sullivan Kane"}], "greeting"=>"Hello, Ward! You have 7 unread messages.", "favoriteFruit"=>"apple"}] puts "Duration: #{Time.now - start} seconds" 0.47sec -> 0.34sec start = Time.now "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing." puts "Duration: #{Time.now - start} seconds" 0.11sec -> 0.08sec start = Time.now def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else @line_no += l.count("\n") next if l == "\n" @line.concat l if @code_block_open or @ltype or @continue or @indent > 0 next end end if @line != "\n" @line.force_encoding(@io.encoding) yield @line, @exp_line_no end break if @io.eof? @line = '' @exp_line_no = @line_no @indent = 0 rescue TerminateLineInput initialize_input prompt end end end end puts "Duration: #{Time.now - start} seconds" 0.40sec -> 0.33sec Co-authored-by: NARUSE, Yui <naruse@airemix.jp> https://github.com/ruby/reline/commit/a9e39ddcc4
2020-12-05[ruby/reline] Optimize ASCII character width calculationaycabta
The rendering time in IRB has been reduced as follows: start = Time.now [{"_id"=>"5f9072a4589a06d2d74b6028", "index"=>0, "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7", "isActive"=>true, "balance"=>"$1,442.84", "picture"=>"http://placehold.it/32x32", "age"=>34, "eyeColor"=>"blue", "name"=>{"first"=>"Ward", "last"=>"Levy"}, "company"=>"HYPLEX", "email"=>"ward.levy@hyplex.us", "phone"=>"+1 (867) 568-3319", "address"=>"867 Cobek Court, Clara, Maryland, 3254", "about"=> "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.", "registered"=>"Monday, May 25, 2015 6:51 AM", "latitude"=>"16.001127", "longitude"=>"-72.377848", "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"], "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "friends"=> [{"id"=>0, "name"=>"Alison Bryant"}, {"id"=>1, "name"=>"Ester Espinoza"}, {"id"=>2, "name"=>"Sullivan Kane"}], "greeting"=>"Hello, Ward! You have 7 unread messages.", "favoriteFruit"=>"apple"}] puts "Duration: #{Time.now - start} seconds" 0.73sec -> 0.43sec start = Time.now "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing." puts "Duration: #{Time.now - start} seconds" 0.15sec -> 0.10sec start = Time.now def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else @line_no += l.count("\n") next if l == "\n" @line.concat l if @code_block_open or @ltype or @continue or @indent > 0 next end end if @line != "\n" @line.force_encoding(@io.encoding) yield @line, @exp_line_no end break if @io.eof? @line = '' @exp_line_no = @line_no @indent = 0 rescue TerminateLineInput initialize_input prompt end end end end puts "Duration: #{Time.now - start} seconds" 0.59sec -> 0.38sec Co-authored-by: NARUSE, Yui <naruse@airemix.jp> https://github.com/ruby/reline/commit/36bc9e3abb
2020-12-05[ruby/reline] Key strokes like 2dl should behave d2laycabta
Key strokes, vi arg, operator, and motion should be treated as operator, vi arg, and motion. https://github.com/ruby/reline/commit/d1a7e74aa4
2020-12-05[ruby/reline] Fix crash to input `é`. refs #174manga_osyo
https://github.com/ruby/reline/commit/ba5e267e5f
2020-12-05[ruby/reline] Version 0.1.8aycabta
https://github.com/ruby/reline/commit/e79e402c01
2020-12-05[ruby/reline] Add alias vi-movement-mode to vi-command-mode for compatibilityaycabta
https://github.com/ruby/reline/commit/a79c297567
2020-12-05[ruby/reline] Move alias_method to right after original definitionaycabta
https://github.com/ruby/reline/commit/b7c8b93fa9
2020-12-05[ruby/reline] Call process_insert when the end of pasting plural fullwidth charsaycabta
https://github.com/ruby/reline/commit/594484d9f9
2020-12-05[ruby/reline] Motions e, E, t, f should include a char on cursor if follows ↵aycabta
operator https://github.com/ruby/reline/commit/86e9a76499
2020-12-05[ruby/reline] Implement vi_yankaycabta
https://github.com/ruby/reline/commit/164aaf9a5f
2020-12-05[ruby/reline] Operator with arg need to make sure that they take arg to ↵aycabta
avoid crashing https://github.com/ruby/reline/commit/1c0c06de1f
2020-12-05[ruby/reline] Unimplemented vi command should be no-opaycabta
https://github.com/ruby/reline/commit/abc90e6867
2020-12-05[ruby/reline] Keep operator proc as a local variable in the scopeaycabta
The proc variable will be used later so the instance variable will be changes. https://github.com/ruby/reline/commit/496c4361f6
2020-12-05[ruby/reline] Skip em_exchange_mark without markaycabta
https://github.com/ruby/reline/commit/abb56e5ec3
2020-12-05[ruby/reline] Backspace and C-h should be unassigned on vi command modeaycabta
https://github.com/ruby/reline/commit/28f4dae020
2020-12-05[ruby/reline] Version 0.1.7aycabta
https://github.com/ruby/reline/commit/710ca23427
2020-12-05[ruby/reline] Continuous insertion bufferingaycabta
The rendering time in IRB has been reduced as follows: start = Time.now [{"_id"=>"5f9072a4589a06d2d74b6028", "index"=>0, "guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7", "isActive"=>true, "balance"=>"$1,442.84", "picture"=>"http://placehold.it/32x32", "age"=>34, "eyeColor"=>"blue", "name"=>{"first"=>"Ward", "last"=>"Levy"}, "company"=>"HYPLEX", "email"=>"ward.levy@hyplex.us", "phone"=>"+1 (867) 568-3319", "address"=>"867 Cobek Court, Clara, Maryland, 3254", "about"=> "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.", "registered"=>"Monday, May 25, 2015 6:51 AM", "latitude"=>"16.001127", "longitude"=>"-72.377848", "tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"], "range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], "friends"=> [{"id"=>0, "name"=>"Alison Bryant"}, {"id"=>1, "name"=>"Ester Espinoza"}, {"id"=>2, "name"=>"Sullivan Kane"}], "greeting"=>"Hello, Ward! You have 7 unread messages.", "favoriteFruit"=>"apple"}] puts "Duration: #{Time.now - start} seconds" 2.17sec -> 0.92sec start = Time.now "Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing." puts "Duration: #{Time.now - start} seconds" 1.57sec -> 0.22sec start = Time.now def each_top_level_statement initialize_input catch(:TERM_INPUT) do loop do begin prompt unless l = lex throw :TERM_INPUT if @line == '' else @line_no += l.count("\n") next if l == "\n" @line.concat l if @code_block_open or @ltype or @continue or @indent > 0 next end end if @line != "\n" @line.force_encoding(@io.encoding) yield @line, @exp_line_no end break if @io.eof? @line = '' @exp_line_no = @line_no @indent = 0 rescue TerminateLineInput initialize_input prompt end end end end puts "Duration: #{Time.now - start} seconds" 0.88sec -> 0.77sec https://github.com/ruby/reline/commit/7d87ac5a12
2020-12-05[ruby/reline] Improve the performance of `get_mbchar_width`Yusuke Endoh
It is about three times faster to use one big regexp instead of sequential matching. https://github.com/ruby/reline/commit/e36f6c0707
2020-12-05[ruby/reline] Version 0.1.6aycabta
https://github.com/ruby/reline/commit/20a7806815
2020-12-05[ruby/reline] Update the generator script tooYusuke Endoh
https://github.com/ruby/reline/commit/8b0926820a
2020-12-05[ruby/reline] Suppress callbacks in pastingaycabta
IRB uses Reline's 3 dynamic real-time callbacks with calling Ripper; output_modifier_proc, prompt_proc, and auto_indent_proc. These processing times make the paste time too long. https://github.com/ruby/reline/commit/beec3399a8