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

256 Коммитов

Автор SHA1 Сообщение Дата
normal 778bbac8ac stdlib: avoid extra calls to eliminate "\n" from Base64
We may use the '0' (zero) to avoid adding the line feed.
Furthermore, the '*' (asterisk) modifier is not needed for
a single-element arrays.

* ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
  eliminate chomp
* lib/net/http.rb (connect): eliminate delete
* lib/net/http/header.rb (basic_encode): ditto
* lib/net/imap.rb (authenticate): eliminate gsub
  (self.encode_utf7): shorten delete arg
* lib/net/smtp.rb (base64_encode): eliminate gsub
* lib/open-uri.rb (OpenURI.open_http): eliminate delete
* lib/rss/rss.rb: ditto
* lib/securerandom.rb (base64): ditto
  (urlsafe_base64): eliminate delete!
* lib/webrick/httpauth/digestauth.rb (split_param_value):
  eliminate chop
* lib/webrick/httpproxy.rb (do_CONNECT): eliminate delete
  (setup_upstream_proxy_authentication): ditto
  [ruby-core:72666] [Feature #11938]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-10 00:35:43 +00:00
hsbt 618035b531 * ext/psych/lib/psych.rb: bump version to 2.0.17
* ext/psych/psych.gemspec: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-22 11:25:39 +00:00
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
nobu db48c30794 psych_emitter.c: check tags range
* ext/psych/psych_emitter.c (start_document): should not exceed
  tags array range.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:28:51 +00:00
nobu cc03134361 psych_emitter.c: check string
* ext/psych/psych_emitter.c (start_document): ensure string before
  encoding conversion.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-13 09:27:52 +00:00
tenderlove a34e45fd54 * ext/psych/*: update psych to 2.0.16
* test/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-07 16:58:10 +00:00
hsbt f1f790db39 * ext/psych/psych.gemspec: bump version to 2.0.15
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-13 01:08:45 +00:00
hsbt 3b3c323798 * ext/psych/psych_emitter.c: bakcport 5bd7744 from tenderlove/psych.
support backword compatibility of Ruby 2.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-08 05:01:33 +00:00
nobu 57e2877e7b ext: use RARRAY_AREF
* ext/**/*.c: prefer RARRAY_AREF to indexing RARRAY_CONST_PTR.
  pointed out by hanmac.
  https://github.com/ruby/ruby/commit/3553a86#commitcomment-14187670

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-05 01:09:17 +00:00
nobu 3553a86eb5 ext: use RARRAY_CONST_PTR
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore
  reference instead of RARRAY_PTR, to keep the array WB-protected.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04 07:27:10 +00:00
nobu 52912db4a8 ext: adjust index type
* ext: use long for index instead of int and RARRAY_LENINT.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04 07:18:01 +00:00
hsbt 4a14d94418 * ext/psych/*: merge psych master(8737e5b). It contains following fixes.
https://github.com/tenderlove/psych/pull/242
  https://github.com/tenderlove/psych/pull/246 [ruby-list:50219]
* test/psych/*: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02 09:50:00 +00:00
tenderlove 226c6a1bdc * ext/psych/*: update to Psych 2.0.14
* test/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-08-21 17:55:23 +00:00
nobu 5924f9a684 psych: allocate structs with wrapper
* ext/psych/psych_emitter.c (allocate): allocate structs with
  making new wrapper objects and get rid of potential memory leak.

* ext/psych/psych_parser.c (allocate): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-29 05:44:01 +00:00
tenderlove f595568e47 * ext/psych/lib/psych.rb: bump psych version.
* ext/psych/psych.gemspec: ditto
* ext/psych/yaml/scanner.c: add latest libyaml change.
* test/psych/helper.rb: support newer minitest
* test/psych/test_to_yaml_properties.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-17 18:17:46 +00:00
tenderlove ecbf835180 * ext/psych/lib/psych/visitors/yaml_tree.rb: register nodes when
dumping objects with custom coders. [ruby-core:66215] [Bug #10496]

* test/psych/test_coder.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06 08:50:00 +00:00
tenderlove 56d4257a67 * ext/psych/lib/psych/visitors/to_ruby.rb: fix support for regular
expressions with newlines. tenderlove/psych#222

* test/psych/test_yaml.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-06 08:00:54 +00:00
tenderlove 6ce27adabe * ext/psych/lib/psych/visitors/to_ruby.rb: fix parsing hashes with
instance variables when it is referenced multiple times.
* ext/psych/lib/psych.rb: bump version
* ext/psych/psych.gemspec: bump version
* test/psych/test_hash.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-28 17:37:09 +00:00
nobu f59ce53f26 yaml_tree.rb: fix anchor
* ext/psych/lib/psych/visitors/yaml_tree.rb (visit_String):
  anchors like `\Z` are not valid inside character class.  use
  negative-lookahead instead.
  Fixes: https://github.com/tenderlove/psych/issues/221

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-17 14:59:18 +00:00
tenderlove 136b07aec8 * ext/psych/lib/psych.rb: bump version
* ext/psych/psych.gemspec: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-16 06:43:08 +00:00
tenderlove fe0414b547 * ext/psych/lib/psych/visitors/yaml_tree.rb: only dump hash
subclasses. Thanks Joe Eli McIlvain <joe.eli.mac@gmail.com>

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-16 06:39:13 +00:00
tenderlove a5c577757e * ext/psych/lib/psych.rb: bump version
* ext/psych/lib/psych/visitors/yaml_tree.rb: fix line width wrapping
  for long strings.  Thanks Jakub Jirutka <jakub@jirutka.cz>

* test/psych/test_string.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-16 06:37:22 +00:00
tenderlove 344b8bbd69 * ext/psych/lib/psych/visitors/yaml_tree.rb: correctly quote non-ascii
letters. Thanks @jirutka for the patch.

* test/psych/test_string.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08 22:25:31 +00:00
tenderlove 5dabead187 * ext/psych/lib/psych/visitors/to_ruby.rb: call `allocate` on hash
subclasses.  Fixes github.com/tenderlove/psych/issues/196

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08 22:15:20 +00:00
tenderlove 8c08c8298a * ext/psych/lib/psych/visitors/to_ruby.rb: revive hashes with ivars
* ext/psych/lib/psych/visitors/yaml_tree.rb: dump hashes with ivars.
  Fixes github.com/psych/issues/43

* test/psych/test_hash.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-01-08 22:00:54 +00:00
hsbt e599d8d197 * ext/psych/lib/psych.rb: bump version to 2.0.8
* ext/psych/psych.gemspec: ditto.
* ext/psych/psych_emitter.c: ditto.
* ext/psych/psych_parser.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-05 13:43:13 +00:00
tenderlove 4297d55ca9 * ext/psych/lib/psych.rb: bumping version
* ext/psych/psych.gemspec: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 21:48:52 +00:00
tenderlove 12396fda40 * ext/psych/lib/psych/visitors/to_ruby.rb: support objects that are
marshalable, but inherit from basic object.
  Thanks Sean Griffin <sean@thoughtbot.com>

* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto

* test/psych/test_marshalable.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 21:35:11 +00:00
nobu e580a631be use 0 for reserved
use 0 for rb_data_type_t::reserved instead of NULL, since its type
may be changed in the future and possibly not a pointer type.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-01 06:38:04 +00:00
nobu acf1ea1ab4 psych: typed data
* ext/psych/psych_emitter.c (psych_emitter_type): turn into typed
  data.

* ext/psych/psych_parser.c (psych_parser_type): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:33:19 +00:00
nobu ba0655ebdd ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:29:24 +00:00
nobu 5540c1de81 ext: protoize no-arguments functions
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:09:32 +00:00
tenderlove e548c09d42 * ext/psych/lib/psych.rb: update version
* ext/psych/psych.gemspec: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-14 02:04:03 +00:00
tenderlove 66d3b9750b * ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping and
loading. Fixes GH #85. Thanks @brentdax for the patch!
* test/psych/test_exception.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29 21:41:02 +00:00
tenderlove 8662841a9b * ext/psych/lib/psych/scalar_scanner.rb: fix loading strings that
look like integers but have a newline. Fixes GH #189
* test/psych/test_string.rb: test for fix

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29 21:24:33 +00:00
tenderlove 73645bb8e5 * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys with a hash
should merge the hash in to the parent.
* test/psych/test_merge_keys.rb: test for change. Fixes GH #202

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29 21:11:47 +00:00
tenderlove 7a5dedf25c * ext/psych/lib/psych/visitors/to_ruby.rb: quoted "<<" strings
should not be treated as merge keys.
* ext/psych/lib/psych/visitors/yaml_tree.rb: hashes with keys
  containing "<<" should roundtrip.
* test/psych/test_merge_keys.rb: test for change. Fixes GH #203

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-29 21:02:19 +00:00
tenderlove 0b392535df * ext/psych/lib/psych/visitors/to_ruby.rb: backwards compatibility for
hashes emitted by Syck. Github #198
* test/psych/test_hash.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-08-05 18:41:46 +00:00
tenderlove 3f6eafaaa0 * ext/psych/lib/psych/visitors/yaml_tree.rb: dump empty symbols with a
tag so that they can be parsed on input. [Bug #9873] [ruby-core:62825]
* test/psych/test_symbol.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-05 22:42:58 +00:00
hsbt 3a78169e3f * ext/psych/lib/psych.rb: [DOC] Fix a dead link in Psych by @rochefort [ci skip][fix GH-593]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45577 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-04-13 00:59:40 +00:00
hsbt 7a01bfcdba * ext/psych/psych.gemspec: update gemspec for psych-2.0.5
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28 00:23:13 +00:00
hsbt e221c6cefc * ext/psych/lib/psych.rb: Merge psych-2.0.5. bump version to
libyaml-0.1.6 for CVE-2014-2525.
* ext/psych/yaml/config.h: ditto.
* ext/psych/yaml/scanner.c: ditto.
* ext/psych/yaml/yaml_private.h: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-28 00:19:15 +00:00
tenderlove db17d694ea * ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
objects.

* ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
  objects.

* test/psych/test_encoding.rb: add test

* ext/psych/lib/psych.rb: add version

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-01 02:09:53 +00:00
nobu 6ef6dab36d ext/psych/yaml: suppress warnings
* ext/psych/yaml/emitter.c (WRITE_BREAK, PUT_BREAK): suppress
  unused-value warnings.

* ext/psych/yaml/parser.c, ext/psych/yaml/scanner.c: suppress
  unused-but-set-variable warnings.

* ext/psych/yaml/yaml_private.h (STACK_EMPTY): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 07:53:20 +00:00
nobu 897a42b063 yaml/api.c: fix typo
* ext/psych/yaml/api.c (yaml_emitter_delete): fix typo 'empty'
  with 'emitter'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12 09:01:28 +00:00
nobu 5c0d438fd3 * ext/psych/yaml/config.h (PACKAGE_VERSION): update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:31 +00:00
nobu 215b9e760a yaml/yaml_private.h: include ruby/extconf.h
* ext/psych/yaml/yaml_private.h: need ruby/extconf.h for
  HAVE_CONFIG_H.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:29 +00:00
nobu 990ba47c24 yaml/api.c, yaml/loader.c: integer overflow
* ext/psych/yaml/api.c (yaml_scalar_event_initialize): fix possible
  integer overflow.
  (yaml_document_add_scalar): ditto.
  (yaml_document_add_sequence): ditto.
   (yaml_document_add_mapping): ditto.

* ext/psych/yaml/loader.c (yaml_parser_load_scalar): ditto.
  (yaml_parser_load_sequence): ditto.
  (yaml_parser_load_mapping): ditto.

* ext/psych/yaml/scanner.c (yaml_parser_roll_indent): suppress
  warnigs.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:28 +00:00
nobu 0483b29a8b yaml/emitter.c: constify, r37936
* ext/psych/yaml/emitter.c (yaml_emitter_write_indicator): constify.

* ext/psych/yaml/emitter.c (yaml_emitter_write_block_scalar_hints):
  ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:17:26 +00:00
nobu 1af28b7b7e * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-05 01:04:25 +00:00