Граф коммитов

5864 Коммитов

Автор SHA1 Сообщение Дата
naruse 84d9d4857e Additional fix of r53450
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 06:51:09 +00:00
nobu f2ba23ace5 mkmf.rb: fix for ODE make
* lib/mkmf.rb (create_makefile): get rid of placing @ at the
  beginning of replacement, which is the loop expansion mechanism
  from the OSF Development Environment (ODE) make.  fix failures
  with bmake by r53448.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 06:37:44 +00:00
nobu b032d111ab mkmf.rb: library installation messages
* lib/mkmf.rb (configuration, dummy_makefile, create_makefile):
  show library installation messages only when any files need to
  be updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-07 03:06:58 +00:00
nobu 49684589cd optparse.rb: into kwdarg
* lib/optparse.rb (OptionParser#order!): add `into` optional
  keyword argument to store the results.  [Feature #11191]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-06 08:23:10 +00:00
nobu 8d66627161 leakchecker.rb: remove temporary measure
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#watcher):
  make watcher thread restartable.

* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#terminate):
  new method to terminate watcher thread.

* test/lib/leakchecker.rb (LeakChecker#find_threads): revert
  r46941.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-05 06:09:17 +00:00
nobu 192b63fd3e Fix defined? expressions
* lib/rubygems/security.rb (DIGEST_ALGORITHM, KEY_ALGORITHM):
  should check same name as the used constants.
  [ruby-core:72674] [Bug #11940]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-03 14:55:25 +00:00
seki 32b4a8b36b Allow ERB subclass to add token easily. [Feature #11936]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-02 07:19:58 +00:00
marcandre 9543908c9f * lib/ostruct.rb: Fix case of frozen object with initializer.
Bug revealed by RubySpec [ruby-core:72639]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-01 17:27:38 +00:00
jeg2 f18f940802 Adding a liberal_parsing option to CSV. Patch by Braden Anderson.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-01 02:44:48 +00:00
nobu 6e5967e2ae ostruct.rb: deferred accessors
* lib/ostruct.rb (freeze): define deferred accessors before
  freezing to get rid of an error when just reading frozen
  OpenStruct.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-31 18:26:46 +00:00
marcandre 2f2a5c3ae9 * lib/ostruct.rb: Fix new_ostruct_member to correctly avoid redefinition
[#11901]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-31 05:37:21 +00:00
hsbt 95aadb1426 * lib/net/http/responses.rb: Added new response class for 451 status code.
* lib/net/http.rb: documentation for HTTPUnavailableForLegalReasons

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30 11:53:15 +00:00
hsbt 27f00a7a22 * lib/webrick/httpstatus.rb: Added HTTP 451 Status Code.
[fix GH-1167] Patch by @MuhammetDilmac
  https://tools.ietf.org/html/draft-tbray-http-legally-restricted-status-00

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30 11:45:52 +00:00
nobu 6fd18ca51b forwardable.rb: adjust backtrace by tail call
* lib/forwardable.rb (def_instance_delegator): adjust backtrace of
  method body by tail call optimization.  adjusting the delegated
  target is still done by deleting backtrace.
* lib/forwardable.rb (def_single_delegator): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30 02:28:59 +00:00
nobu 986fb55961 Forwardable: Fix delegating to 'args' and 'block'
* lib/forwardable.rb (def_instance_delegator) fix delegating to
  'args' and 'block', clashing with local variables in generated
  methods.  [ruby-core:72579] [Bug #11916]

* lib/forwardable.rb (def_single_delegator): ditto.

If you have a class that uses Forwardable to delegate a method to
another object, and the method that returns the delegate object is
called `args` or `block`, then Forwardable will fail to work.

Here's a simple example:

    class ModelCreator
      extend Forwardable

      attr_reader :args

      def_delegator :args, :model_name

      def initialize(args)
        @args = args
      end
    end

    ModelCreator.new.model_name

If you run the last line above, then you'll get:

    NoMethodError: undefined method `model_name' for []:Array

This error occurs because `def_delegator` -- as it is written in Ruby --
uses metaprogramming to add methods to the class that will then delegate
to the delegate object. So it's as if we had written:

    class ModelCreator
      extend Forwardable

      attr_reader :args

      def model_name(*args, &block)
        args.model_name(*args, &block)
      end

      def initialize(args)
        @args = args
      end
    end

As you can see, `def_delegator` will not only forward the method call
onto the delegate object, it will also forward any arguments provided as
well. It is here that the bug arises: it splats all of the arguments
into a variable which is called `args`, and because of how variable
scope works in Ruby, it then attempts to call `model_name` on *this*
variable and *not* our delegate object method.

The fix is to call the delegate object method manually using `__send__`.
(This assumes, of course, that the given receiver is, in fact, the name
of a method and not the name of an instance variable, which is also a
possibility.) We use `__send__` because the delegate object method could
be private.

So, that looks like this:

    def model_name(*args, &block)
      __send__(:args).model_name(*args, &block)
    end

Because `def_delegators` and `delegate` use `def_delegator` internally,
they also get this fix as well.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-30 02:18:44 +00:00
nobu 15960b37e8 ostruct.rb: respond_to?
* lib/ostruct.rb (OpenStruct): make respond_to? working on
  just-allocated objects for workaround of Psych.
  [ruby-core:72501] [Bug #11884]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-29 03:48:36 +00:00
normal a3b53cd991 Resolv::IPv6.create: avoid modifying frozen string literal
* lib/resolv.rb (Resolv::IPv6.create): avoid modifying frozen
* test/resolv/test_dns.rb (test_ipv6_create): test for above
  [Bug #11910] [ruby-core:72559]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-28 20:31:10 +00:00
kou 3d8e4d6037 * lib/xmlrpc/client.rb: Support SSL options in async methods of
XMLRPC::Client.
  [Bug #11489]
  Reported by Aleksandar Kostadinov. Thanks!!!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-26 09:33:43 +00:00
a_matsuda 3a05da1321 [DOC] Fix typos
* benchmark.rb
* getoptlong.rb
* irb.rb
* net/http.rb
* net/http/header.rb
* net/imap.rb
* optparse.rb
* pstore.rb
* webrick.rb
* xmlrpc.rb

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23 03:43:23 +00:00
hsbt 145433d9a5 * lib/rdoc.rb: bump version to 4.2.1. It contains following fixes.
https://github.com/rdoc/rdoc/pull/340
  https://github.com/rdoc/rdoc/pull/341
  https://github.com/rdoc/rdoc/pull/367
  https://github.com/rdoc/rdoc/pull/368
* lib/rdoc/*: ditto.
* test/rdoc/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22 12:08:13 +00:00
normal 268da52347 lib/net/http.rb (open_timeout): update default value in RDoc [ci skip]
[ruby-core:72413]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-21 01:24:12 +00:00
nobu ce7f7f5e3d cgi/escape: Optimize CGI.escapeHTML
* cgi/escape/escape.c: Optimize CGI.escapeHTML for
  ASCII-compatible encodings.  [Fix GH-1164]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-20 11:54:54 +00:00
hsbt 0516a3378f * lib/erb.rb: revert r53123. It break compatibility like thor and rspec-rails.
We should try with Ruby 2.4 or 3.0.
  [Bug #11842][ruby-core:72374]
* lib/rdoc/erb_partial.rb: ditto.
* template/verconf.h.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-20 06:36:57 +00:00
nobu a5a9d421e7 webrick/utils.rb: get rid of thread leak checker
* lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
  use WEBrick::Utils::TimeoutHandler::Thread, which is ignored by
  LeakChecker#find_threads, instead of ::Thread to get rid of
  thread leak checker.  since this TimeoutHandler is resident
  during tests because of Singleton, it waits for the next timeout
  if it has any schedules.  in the case of nested timeouts, inner
  timeout does not cancel outer timeouts and then those schedules
  still remain.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-19 08:16:54 +00:00
nobu 0d1a243af1 csv.rb: Fix typo [ci skip
* lib/csv.rb (CSV#initialize): [DOC] Fix double-word typo.
  [Fix GH-1161]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-19 05:23:50 +00:00
nobu d660e06f28 timeout.rb: watcher thread name
* lib/timeout.rb (Timeout#timeout): set watcher thread name to
  caller location for debugging.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 15:46:50 +00:00
ngoto 0967c1e3ad * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): To prevent
potential deadlocks, Queue is used to tell update of @timeout_info
  instead of sleep and wakeup. [Bug #11742] [ruby-dev:49387]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 12:32:53 +00:00
nobu a6e055f4a1 csv.rb: tail commas
* lib/csv.rb (CSV::Converters, CSV::DEFAULT_OPTIONS): supply tail
  commas for further elements.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 03:55:29 +00:00
nobu 3bf1c09c7a csv.rb: fix typo
* lib/csv.rb (CSV#shift): fix typo.  [See GH-1160]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-18 03:55:08 +00:00
hsbt 6f04ae5688 * lib/irb/ruby-lex.rb: fixed parse error for striped heredocument syntax.
[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-18 01:25:08 +00:00
naruse 63f486f1db remove duplicated frozen_string_literal magic comment
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 09:25:48 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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
2015-12-16 05:07:31 +00:00
ngoto e337dc6517 * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler): Acquire
TimeoutMutex only when accessing @timeout_info for avoiding
  potential deadlock. [Bug #11742] [ruby-dev:49387]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 16:03:00 +00:00
ngoto 804720d2eb * lib/webrick/utils.rb (WEBrick::Utils::TimeoutHandler#initialize):
TimeoutMutex should be acquired when accessing @timeout_info.
  To avoid deadlock, interrupt() calls are delayed.
  Due to the mutex, it is safe to treat ary without ary.dup.
  [Bug #11742] [ruby-dev:49387]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 15:26:47 +00:00
hsbt ec7a964dca * lib/erb.rb: Render erb with array buffer for function call optimization.
[fix GH-1143]
* lib/rdoc/erb_partial.rb: ditto.
* template/verconf.h.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 07:20:07 +00:00
hsbt 1178a6fdba * lib/erb.rb: Simplify regexp to optimize erb scanner.
[fix GH-1144]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 03:20:36 +00:00
hsbt 68b69178f4 * lib/uri/common.rb: make code block for rdoc.
[ci skip][fix GH-1152] Patch by @Tonkpils

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-15 02:56:38 +00:00
hsbt 059c9c1cf3 * ext/socket/lib/socket.rb: use safe navigation operator.
[fix GH-1142] Patch by @mlarraz
* lib/drb/extservm.rb: ditto.
* lib/net/http.rb: ditto.
* lib/net/http/response.rb: ditto.
* lib/scanf.rb: ditto.
* lib/uri/generic.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 08:05:35 +00:00
hsbt 4f09696496 * lib/xmlrpc.rb: added documentation for parser details.
[ci skip][fix GH-1124] Patch by @jrafanie

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 05:33:42 +00:00
hsbt 53e4e7fc3d * lib/cgi.rb: fix a typo in documentation.
[ci skip][fix GH-1140] Patch by @jutaz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-14 02:51:34 +00:00
knu 273d5004be * lib/shellwords.rb (Shellwords#shellsplit): Document that this
method does not treat shell metacharacters as such.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 05:19:03 +00:00
normal bd13788fdb lib/shellwords.rb: do not change API with frozen-string-literal
This fixes a bug introduced in r53066 when attempting to
shellescape an empty string.

* lib/shellwords.rb (shellescape): duplicate frozen literal
* test/test_shellwords.rb (test_stringification): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 03:17:28 +00:00
knu fdfb8804c0 * lib/shellwords.rb: Turn on frozen-string-literal after fixing
shellsplit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 02:43:56 +00:00
marcandre 13d8bb0385 * lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbol
nor a string. See [#11762]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-12 21:40:50 +00:00
hsbt 0c5841bead * lib/rubygems: Update to RubyGems 2.5.1
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-11 02:53:09 +00:00
nobu 01c432169f disable frozen-string-literal
* lib/mkmf.rb, lib/shellwords.rb: disable frozen-string-literal.
  [ruby-core:72011] [Bug #11800]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-10 00:32:53 +00:00
normal f2b9563bb4 lib/uri/generic.rb: enable frozen_string_literal
* lib/uri/generic.rb: enable frozen_string_literal
  (split_userinfo): remove explicit .freeze for string literals
  (check_path): ditto
  (query): ditto
  (fragment): ditto
  (to_s): ditto
  [ruby-core:71910] [Bug #11759]

Patch-by: Colin Kelley <colindkelley@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 21:28:26 +00:00
nobu c84e62cd32 optparse.rb: Fix typo [ci skip]
* lib/optparse.rb: fix double word typo in the document.
  [Misc #10608] [Fix GH-1126]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08 01:19:04 +00:00
hsbt e2cf71a085 * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(fdab4c4).
this version includes #1396, #1397, #1398, #1399
* test/rubygems: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-04 06:21:53 +00:00
hsbt e2977fc8f3 * lib/scanf.rb: fixed double words typo.
[ci skip][fix GH-1123] Patch by @jwworth

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-03 06:39:26 +00:00