aboutsummaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* * lib/net/ftp.rb (mtime): use usec instead of fractions to parseshugo2015-09-281-2/+1
| | | | | | | decimal fractions of a second correctly when the number of digits is not 6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (mtime): parse decimal fractions of a second asshugo2015-09-281-13/+10
| | | | | | specified in RFC 3659. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ostruct.rb: fix NameErrornobu2015-09-261-2/+7
| | | | | | | * lib/ostruct.rb (delete_field): do not raise NameError for existing keys. [Fix GH-1033] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/ostruct.rb: Move method definitions for getter/setter to be lazyzzak2015-09-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by @sferik in [GH-1033]: https://github.com/ruby/ruby/pull/1033 Instead of defining two methods -- a reader and writer -- for each OpenStruct attribute when it is initialized, define them lazily, the first time either one is called. This adheres to the principle of "pay for use": methods that are never accessed are never defined. This optimization makes initialization an order of magnitude faster for objects with 100 attributes. In the worst-case scenario, where every attribute is accessed, performance is no worse than it is today. Benchmark --------- require 'benchmark/ips' require 'ostruct' N = 100 ATTRS = (:aa..:zz).take(N) HASH = Hash[ATTRS.map { |x| [x, x] }] def ostruct OpenStruct.new(HASH) end Benchmark.ips do |x| x.report('ostruct') { ostruct } end ------------------------------------------------- before 2.279k (± 8.8%) i/s - 11.395k after 24.702k (±12.8%) i/s - 122.600k ------------------------------------------------- git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http.rb: removed unused variable. It's removed at r13648.hsbt2015-09-251-2/+0
| | | | | | [fix GH-1022] Patch by @nkondratyev git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames includingshugo2015-09-141-1/+1
| | | | | | space correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo in racc english documentation [ci skip]nobu2015-09-141-1/+1
| | | | | | | * lib/racc/rdoc/grammar.en.rdoc: [DOC] fix typo, "convertion" to "conversion". [Fix GH-1016] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (size, modify, create, type, unique, perm, lang,shugo2015-09-131-0/+8
| | | | | | media_type, charset): new methods to return standard facts. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2015-09-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (file?, directory?, appendable?, creatable?,shugo2015-09-121-1/+107
| | | | | | | deletable?, enterable?, renamable?, listable?, directory_makable?, purgeable?, readable?, writable?): new methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (FACT_PARSERS): support system dependent factsshugo2015-09-121-2/+8
| | | | | | UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoErrorshugo2015-09-121-1/+8
| | | | | | when parsing failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (TIME_PARSER): use "Z" instead of "00:00" toshugo2015-09-121-2/+1
| | | | | | get UTC time. Thanks, Wilson Bilkovich. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2015-09-121-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSDshugo2015-09-121-0/+74
| | | | | | specified in RFC 3659. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (size, mdtm, system): parse responses according toshugo2015-09-111-23/+28
| | | | | | | | RFC 959 and 3659, where reply codes must be followed by SP. * lib/net/ftp.rb (system): remove LF from the return value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (getmultiline): refactor.shugo2015-09-101-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems/stub_specification.rb (Gem::StubSpecification#data):usa2015-09-091-10/+15
| | | | | | | | should not change the value of $. when `require`ing gems. this fixed test failures introduced by r51813. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb: Remove backtrace cleaning for delegated methodszzak2015-09-091-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch was provided by Rafael França and greatly improves performance when an exception is raised. [Bug #11461] Before: Calculating ------------------------------------- default 86.209k i/100ms default raising 2.209k i/100ms ------------------------------------------------- default 1.953M (±11.0%) i/s - 9.655M default raising 21.826k (±13.5%) i/s - 108.241k After: Calculating ------------------------------------- default 72.211k i/100ms default raising 34.288k i/100ms ------------------------------------------------- default 2.013M (±18.7%) i/s - 9.460M default raising 623.950k (± 9.7%) i/s - 3.120M Benchmark: require 'delegate' require 'benchmark/ips' class Foo def name 'foo' end def bla raise end end class Bar < DelegateClass(Foo) end bar = Bar.new(Foo.new) Benchmark.ips do |b| b.report('default') { bar.name } b.report('default raising') { bar.bla rescue nil } end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rubygems: Update to RubyGems HEAD(fe61e4c112).hsbt2015-09-0810-78/+426
| | | | | | | | | this version contains new feature that warn invalid SPDX license identifiers. https://github.com/rubygems/rubygems/pull/1249 and #1032, #1023, #1332, #1328, #1306, #1321, #1324 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/ftp.rb (list): fetch all the lines before yielding a blockshugo2015-09-081-7/+6
| | | | | | | to allow other commands in the block. [Feature #11454] Patched by Srikanth Shreenivas. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rss.rb: don't substitute, just searchnobu2015-09-051-1/+1
| | | | | | | * lib/rss/rss.rb (Time#w3cdtf): don't substitute, just search zeros at EOS. [ruby-core:70667] [Bug #11509] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rss.rb: fix usec widthnobu2015-09-051-1/+1
| | | | | | | * lib/rss/rss.rb (Time#w3cdtf): fix zero-trimmed width of fraction digits. [ruby-core:70667] [Bug #11509] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mkmf.rb: remove unnecessary variablesnobu2015-09-041-2/+2
| | | | | | | * lib/mkmf.rb (configuration): remove unnecessary variables, top_srcdir is defined above, builddir is not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mkmf.rb: move r40537nobu2015-09-041-1/+1
| | | | | | * lib/mkmf.rb (create_makefile): move r40537 from extmk.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* session.rb: SHA512nobu2015-09-031-12/+14
| | | | | | | * lib/cgi/session.rb (create_new_id): use SHA512 instead of MD5. pointed out by SARWAR JAHAN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rdoc/*: Update rdoc master(cfffed5)hsbt2015-08-282-3/+7
| | | | | | | https://github.com/rdoc/rdoc/pull/337 https://github.com/rdoc/rdoc/pull/367 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb: use IO::NULL instead of '/dev/null'hsbt2015-08-271-3/+3
| | | | | | * test/ruby/test_string.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fileutils.rb: fix rename_cannot_overwrite_filenobu2015-08-261-1/+1
| | | | | | | * lib/fileutils.rb (rename_cannot_overwrite_file): File.rename on cygwin and mswin/mingw can overwrite the destination file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: freeze a string messagenobu2015-08-131-1/+1
| | | | | | | * lib/timeout.rb (Timeout#timeout): freeze a string message to reduce string allocations. [Fix GH-996] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http/response.rb (Net::HTTPResponse::Inflater#finish):ktsj2015-08-011-0/+1
| | | | | | | | | fix a bug that empty gzipped response body causes Zlib::BufError. [ruby-core:68846] [Bug #11058] * test/net/http/test_httpresponse.rb: tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http/response.rb (Net::HTTPResponse#inflater):ktsj2015-08-011-3/+3
| | | | | | | fix TypeError. An exception object might be nil. [ruby-core:68846] [Bug #11058] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: Module#deprecate_constantnobu2015-07-301-0/+3
| | | | | | | | * variable.c (rb_const_get_0): warn deprecated constant reference. * variable.c (rb_mod_deprecate_constant): mark constants to be warned as deprecated. [Feature #11398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/matrix/eigenvalue_decomposition.rb: refine code style.hsbt2015-07-221-1/+1
| | | | | | [fix GH-959][ci skip] Patch by @bogdanvlviv git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typo in OptionParser#complete docs [ci skip]nobu2015-07-211-1/+1
| | | | | | * lib/optparse.rb (complete): [DOC] fix typo. [Fix GH-973] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove unnecessary enumerator requiresnormal2015-07-171-1/+0
| | | | | | | | | | * lib/rinda/tuplespace.rb: remove enumerator require * test/pathname/test_pathname.rb: ditto Related to https://bugs.ruby-lang.org/issues/10902 but not a complete fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: suppress a warningnobu2015-07-141-1/+1
| | | | | | * lib/timeout.rb (Timeout): get rid of an argument prefix warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: wakeup immediatelynobu2015-07-141-3/+7
| | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#register): notify the handler thread of new timeout registration. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/utils.rb: adaptive sleepnobu2015-07-141-4/+12
| | | | | | | * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize): make sleep intervals adaptive than fixed period intervals. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* webrick/server.rb: stop immediatelynobu2015-07-141-11/+22
| | | | | | | | | * lib/webrick/server.rb (WEBrick::GenericServer#start): flush shutdown pipe. * lib/webrick/server.rb (WEBrick::GenericServer#stop): request the server to stop immediately by sending data via shutdown pipe. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* httpproxy.rb: fix typos [ci skip]nobu2015-07-131-2/+2
| | | | | | | * lib/webrick/httpproxy.rb (WEBrick::HTTPProxyServer#do_CONNECT): fix typos in debugger statements. [Fix GH-967] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: warn deprecated methodnobu2015-07-131-8/+3
| | | | | | * lib/timeout.rb (timeout): warn as deprecated for a long time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: internal constantsnobu2015-07-131-0/+1
| | | | | | * lib/timeout.rb (Timeout): make internal constants private. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: fix backtracenobu2015-07-111-3/+1
| | | | | | | * lib/timeout.rb (Timeout#timeout): remove regexp with wrong line nuber and fix caller depth. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* timeout.rb: removed and use Timeout::Errornobu2015-07-101-3/+1
| | | | | | | | * lib/timeout.rb (ExitException): removed internal exception class and use Timeout::Error instead, as using throw/catch to isolate each timeouts now. [ruby-dev:49179] [Bug #11344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/net/http/responses.rb: Added 308 status to CODE_TO_OBJ list.hsbt2015-07-091-0/+1
| | | | | | [fix GH-961] Patch by @billinghamj git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* resolver.rb: fix fd leaksnobu2015-07-081-0/+2
| | | | | | | * lib/rubygems/resolver.rb (resolve): close UI output unless debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/csv.rb: typo fix [ci skip][fix GH-958] Patch by @henrikhsbt2015-07-071-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typo in optparse library [ci skip] [Fix GH-956]nobu2015-07-051-1/+1
| | | | | | * lib/optparse.rb: [DOC] Fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_case.rb: fix multiple loadnobu2015-07-041-1/+12
| | | | | | | | | * lib/rubygems/test_case.rb (teardown): do not delete features loaded from the original load paths, the same libraries should be loaded again when the same features are required. [ruby-dev:49031] [Bug #11222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e