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

67 Коммитов

Автор SHA1 Сообщение Дата
tenderlove 8cd2bf0721 * ext/psych/lib/psych/visitors/to_ruby.rb: Hash subclasses can be read
from YAML files.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Hash subclasses can be
  dumped to YAML files.
* test/psych/test_hash.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 01:58:07 +00:00
tenderlove aaa52bf088 * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby modules can be loaded
from YAML files.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby modules can be
  dumped to YAML files.
* test/psych/test_class.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 00:22:33 +00:00
tenderlove c641e4b23e * ext/psych/lib/psych/visitors/to_ruby.rb: Ruby classes can be loaded
from YAML files.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby classes can be
  dumped to YAML files.
* test/psych/test_class.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 00:06:29 +00:00
nobu 3a47cf3395 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-15 11:55:52 +00:00
tenderlove d47073de04 * ext/psych/lib/psych/visitors/yaml_tree.rb: fix time dumping so that
Syck can load UTC times that Psych dumps.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-03 23:06:19 +00:00
tenderlove 8968bd14fa * ext/psych/parser.c (parse): strings from psych have proper taint
markings.
* test/psych/test_tainted.rb: test for string taint

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-21 19:17:46 +00:00
tenderlove 089462f592 fixing syntax error in 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-30 03:52:07 +00:00
tenderlove 9e448999a0 converting require_relative to just regular requires
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-30 03:38:53 +00:00
tenderlove 4df71924e4 * ext/psych/lib/psych/visitors/yaml_tree.rb: Rescue exceptions when
people implement the method method. Thanks Lin Jen-Shin.
  [ruby-core:35255]

* test/psych/visitors/test_yaml_tree.rb: test for implementation of
  method method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-09 03:51:39 +00:00
tenderlove 2695d032e3 * ext/psych/lib/psych/scalar_scanner.rb: fix parsing timezone's whose
whose format is (+/-)hhmm.  Thanks Gonçalo Silva!

* test/psych/test_scalar_scanner.rb: test for bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-25 22:12:46 +00:00
tenderlove 6f37c467d4 * ext/psych/lib/psych/json/stream.rb: do not emit custom tags in maps
or sequences when emitting JSON.
* ext/psych/lib/psych/json/tree_builder.rb: do not emit custom tags in
  sequences when emitting JSON.
* test/psych/json/test_stream.rb: tests for custom stream emits.
* test/psych/test_json_tree.rb: tests for JSON emits.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 01:56:10 +00:00
tenderlove 6673f4e8af * ext/psych/lib/psych/json/stream.rb: fix JSON stream emits to use
double quotes during stream.
* test/psych/json/test_stream.rb: tests to reflect changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 01:02:41 +00:00
tenderlove cc6b1b3c8d * ext/psych/lib/psych/visitors/to_ruby.rb: ARG_ENCODING_NONE regular
expressions can round trip. [ruby-core:34969]
* test/psych/test_yaml.rb: test for ARG_ENCODING_NONE regex
* ext/sych/lib/syck/rubytypes.rb: ARG_ENCODING_NONE regular
  expressions can round trip.
* test/syck/test_yaml.rb: test for ARG_ENCODING_NONE regex

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 22:05:15 +00:00
tenderlove 18e3c52bc4 reverting r30628 since this seems like a bug in libyaml
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 22:43:41 +00:00
tenderlove 6e5aa6311a * ext/psych/lib/psych/visitors/to_ruby.rb: fixing merge key support
when multiple merge keys are specified.
* test/psych/test_merge_keys.rb: tests for multi-merge key support

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30630 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 02:51:14 +00:00
tenderlove 5b1c06c74b * ext/psych/lib/psych/visitors/to_ruby.rb: merge keys are actually
part of YAML 1.1, so they should be supported.  Remove warning and
  merge keys to parent.  [ruby-core:34679]
* test/psych/test_merge_keys.rb: test for merge keys

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 02:34:50 +00:00
tenderlove 7b876e65ed * ext/psych/parser.c (parse): fixing off-by-one error on line numbers
in parse exceptions.  [ruby-core:34690]
* test/psych/test_parser.rb: test for error

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 02:23:12 +00:00
tenderlove cab95ab712 fixed a bug in the test suite. Thanks Benoit Daloze! [ruby-core:34641]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 02:18:21 +00:00
tenderlove 8dd3a4af66 * ext/psych/parser.c (parse): add the file name to the exception when
parse errors occur.
* test/psych/test_parser.rb: test for parse error file name

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 01:26:40 +00:00
tenderlove 0331314d27 * ext/psych/parser.c (parse): fix assertion error when reusing a
parser after an exception has been raised
* test/psych/test_parser.rb: test for assertion error

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-22 01:13:52 +00:00
tenderlove 960720ef4f * ext/psych/lib/psych/nodes/node.rb: Make Psych::Nodes::Node
enumerable.
* ext/psych/lib/psych/visitors/depth_first.rb: Add a depth-first
  visitor to enumerate over a YAML AST in a depth-first fashion
* test/psych/nodes/test_enumerable.rb: test for enumerating nodes
* test/psych/visitors/test_depth_first.rb: test for depth-first
  visitor

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-21 19:11:53 +00:00
kosaki 7fd0d4a4d3 revert unrelated fix from r30615. Sorry!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-20 15:40:04 +00:00
kosaki d41d2f26ce * configure.in: Add '#include <stdlib.h>' to
rb_cv_localtime_overflow test too. It's reported by Tomoyuki
	  Chikanaga. Thanks.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-20 14:34:39 +00:00
tenderlove 74b0a7a06f * ext/psych/lib/psych/visitors/json_tree.rb: Fix JSON emit for
DateTime and Time classes.
* test/psych/test_json_tree.rb: test for JSON emit

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-20 00:20:57 +00:00
tenderlove a17cdfdde2 * ext/psych/lib/psych/coder.rb (represent_object): arbitrary objects
may be passed to the Psych::Coder object.
* ext/psych/lib/psych/visitors/yaml_tree.rb: support for visiting
  arbitrary objects set on the coder.
* test/psych/test_coder.rb: supporting test case.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-19 23:05:53 +00:00
tenderlove 0b38e9bc9d * ext/psych/lib/psych/parser.rb (Mark): Adding a class to wrap
marker information
* ext/psych/parser.c (mark): Add a method to return the mark object
  for the parser
* test/psych/test_parser.rb: tests for the Mark class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-17 19:44:31 +00:00
tenderlove eacee9d95f * ext/psych/lib/psych/visitors/json_tree.rb (visit_String): JSON
strings should be dumped with double quotes. [ruby-core:34186]
* test/psych/test_json_tree.rb: test for double quotes

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-17 17:48:09 +00:00
tenderlove 10284a049a * ext/psych/lib/psych/json/tree_builder.rb (start_mapping): tags
should not be included in JSON mapping

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-06 02:29:18 +00:00
tenderlove e9e01ec4a0 * ext/psych/lib/psych/visitors/yaml_tree.rb: use YAML 1.0 output
format for serializing nil values.  Thanks Eric Hodel!
* test/psych/test_nil.rb: test for nil values

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-05 17:57:38 +00:00
tenderlove a5dec23045 * ext/psych/lib/psych/visitors/emitter.rb (initialize): line_width is
a valid option passed to the emitter.
* test/psych/test_psych.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 16:10:10 +00:00
tenderlove ba9a959a18 * ext/psych/emitter.c (line_width, set_line_width): preferred line may
be set on the emitter.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/test_emitter.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 16:02:26 +00:00
tenderlove 646b699536 * ext/psych/lib/psych/visitors/yaml_tree.rb (push): adding version
and header emit options.
* test/psych/test_psych.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07 23:18:27 +00:00
tenderlove 3a185ede69 * ext/psych/lib/psych/visitors/emitter.rb: sending emit options to
YAML emitter. [ruby-core:28318]
* ext/psych/emitter.c: updating documentation about emit options
* ext/psych/lib/psych/core_ext.rb: ditto
* ext/psych/lib/psych.rb (dump): passing emit options to emitter.
* ext/psych/lib/psych/nodes/node.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-07 23:05:45 +00:00
tenderlove 3b87ff32de * ext/psych/lib/psych/scalar_scanner.rb (parse_time): dealing with
negative partial hour time zones. [ruby-core:31064]
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/visitors/test_to_ruby.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-06 16:06:20 +00:00
tenderlove 13f5a607fb * test/psych/visitors/test_to_ruby.rb (test_time): time test must
respect non-whole timezone. Thanks akr! [ruby-core:31061]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-06 01:23:07 +00:00
tenderlove c27e0ebab6 * ext/psych/lib/psych/visitors/yaml_tree.rb (format_time): nanoseconds
require more digits when dumping. Thanks akr! [ruby-core:31047]
* test/psych/visitors/test_to_ruby.rb: adjusting tests for nanoseconds

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05 23:12:44 +00:00
tenderlove 59cad45f99 * ext/psych/lib/psych/visitors/to_ruby.rb(visit_Psych_Nodes_Scalar):
teaching Psych to deserialize DateTime objects. [Bug #1390]

* ext/psych/lib/psych/visitors/yaml_tree.rb(visit_DateTime): added a
  method for serializing DateTime objects.

* ext/psych/lib/psych/scalar_scanner.rb(parse_time): add method for
  parsing times objects from a string.

* test/psych/test_date_time.rb: tests for dumping DateTime objects.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-03 00:52:43 +00:00
tenderlove 6fe92a3cd6 * ext/psych/lib/psych/visitors/yaml_tree.rb (visit_Time): use
Time#nsec to accurately serialize time objects. [ruby-core:29233]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-03 00:15:51 +00:00
tenderlove b09ad2b847 * ext/psych/lib/psych/visitors/to_ruby.rb (resolve_klass): fix the
exception message when attempting to load an unknown class.  Thanks
  nobu! [ruby-dev:41399]

* test/psych/test_psych.rb: test for the exception message

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-18 18:38:19 +00:00
tenderlove 044d6010fd * ext/psych/lib/psych/json/stream.rb: adding a JSON streaming API
* ext/psych/lib/psych/stream.rb: ditto
* ext/psych/lib/psych.rb: using autoload
* ext/psych/lib/psych/json.rb: ditto
* ext/psych/lib/psych/json/tree_builder.rb: refactor
* ext/psych/lib/psych/visitors/json_tree.rb: refactor

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-22 22:12:39 +00:00
tenderlove 5256d10265 * ext/psych/lib/psych/stream.rb: adding YAML streaming API for
infinite length streams.
* ext/psych/lib/psych.rb: refactoring for streaming API
* ext/psych/lib/psych/{handler, stream, tree_builder}.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20 04:03:47 +00:00
tenderlove 383769068d * ext/psych/emitter.c: output strings are automatically transcoded
* test/psych/test_emitter.rb: supporting tests
* test/psych/test_encoding.rb: more supporting tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19 17:15:27 +00:00
tenderlove c1b29ff5c6 * ext/psych/lib/psych.rb: Adding Psych::Exception
* ext/psych/parser.c: Do not allow extern_encoding to be set twice
* test/psych/test_parser.rb: test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19 03:24:13 +00:00
tenderlove 15335f8aaa * ext/psych/emitter.c: using xmalloc and xfree for memory allocation
* ext/psych/lib/psych/nodes/stream.rb: encoding should be read / write
* ext/psych/parser.c: supporting UTF-16 and UTF-16 + BOM
* test/psych/test_parser.rb: testing UTF-16 and UTF-16 + BOM

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-19 03:12:03 +00:00
tenderlove 0de068d03e * ext/psych/parser.c (parse): Return strings encoded as
Encoding.default_internal if set.
* test/psych/test_encoding.rb: Tests for encoding change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-10 16:22:52 +00:00
mame e76a19ece3 * test/psych/visitors/test_yaml_tree.rb (test_struct_const): remove
Struct::Foo which affects test/ruby/test_struct to warn redefining
  constant.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-28 13:56:24 +00:00
tenderlove 430e0ce491 * ext/psych/lib/psych/deprecated.rb: adding deprecated object_maker
method,
* test/psych/test_deprecated.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27 20:40:12 +00:00
tenderlove ad3c1061a7 * ext/psych/lib/psych/deprecated.rb: adding deprecated "read_type_class"
method
* test/psych/test_deprecated.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-27 20:19:16 +00:00
tenderlove 63578c725c * ext/psych/lib/psych/deprecated.rb: adding deprecated tagurize method
* test/psych/test_deprecated.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 22:27:55 +00:00
tenderlove 2d9c054412 * ext/psych/lib/psych/deprecated.rb: adding support for deprecated
"add_private_type" function
* ext/psych/lib/psych.rb: ditto
* ext/psych/lib/psych/visitors/to_ruby.rb: ditto
* test/psych/test_deprecated.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 20:35:20 +00:00