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

219 Коммитов

Автор SHA1 Сообщение Дата
tenderlove cf2bbc89d2 * ext/psych/lib/psych/visitors/to_ruby.rb: BigDecimals can be restored
from YAML.
* ext/psych/lib/psych/visitors/yaml_tree.rb: BigDecimals can be dumped
  to YAML.
* test/psych/test_numeric.rb: tests for BigDecimal serialization

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 03:44:09 +00:00
tenderlove 9f688d53c2 * ext/psych/lib/psych/scalar_scanner.rb: Strings that look like dates
should be treated as strings and not dates.

* test/psych/test_scalar_scanner.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-18 03:05:02 +00:00
tenderlove 54b214cc23 * ext/psych/lib/psych.rb (module Psych): parse and load methods take
an optional file name that is used when raising Psych::SyntaxError
  exceptions
* ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file
  names and handle nil file names in the exception message
* test/psych/test_exception.rb (module Psych): Tests for changes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 23:12:37 +00:00
tenderlove 0df90074c7 * ext/psych/parser.c (parse): parse method can take an option file
name for use in exception messages.
* test/psych/test_parser.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33900 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-30 00:10:31 +00:00
tenderlove daeaa65f08 * ext/psych/lib/psych.rb: remove autoload from psych
* ext/psych/lib/psych/json.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-21 19:47:09 +00:00
tenderlove 07636686da * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
also closed. [ruby-core:41088]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-17 01:38:16 +00:00
tenderlove 4c63e02740 * ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
rationals, etc with reference ids.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* ext/psych/lib/psych/visitors/to_ruby.rb: loading complex numbers,
  rationals, etc with reference ids.
* test/psych/test_object_references.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 19:54:44 +00:00
tenderlove e115627a18 * ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
like base 60 numbers are serialized as quoted strings.
* test/psych/test_string.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:33:39 +00:00
emboss 2b7bbe18b3 * ext/psych/parser.c: remove unused variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-26 23:49:49 +00:00
tenderlove 137c547c3e * ext/psych/lib/psych/syntax_error.rb: Add file, line, offset, and
message attributes during parse failure.
* ext/psych/parser.c: Update parser to raise exception with correct
  values.
* test/psych/test_exception.rb: corresponding tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 17:53:41 +00:00
tenderlove 77e58a3398 * ext/psych/parser.c (parse): Use context_mark for indicating error
line and column.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 16:53:14 +00:00
tenderlove b7c66e31de * ext/psych/lib/psych/scalar_scanner.rb: use normal begin / rescue
since postfix rescue cannot receive the exception class. Thanks
  nagachika!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-04 16:24:58 +00:00
tenderlove 9167328359 * ext/psych/lib/psych.rb: update psych version.
* ext/psych/psych.gemspec: generate new gemspec for new version.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:44:38 +00:00
tenderlove 1c60db55ac * ext/psych/lib/psych.rb: calling `yaml` rather than `to_yaml`.
* ext/psych/lib/psych/nodes/node.rb: Rename `to_yaml` to just `yaml`
  in order to avoid YAML::ENGINE switching from replacing this method.
* test/psych/helper.rb: fix tests for method name change.
* test/psych/test_document.rb: ditto
* test/psych/visitors/test_emitter.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:31:43 +00:00
tenderlove bd3b0d470c * ext/psych/lib/psych/scalar_scanner.rb: Match values against the
floating point spec defined in YAML to avoid erronious parses.
* test/psych/test_numeric.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:21:31 +00:00
tenderlove 1721fca3ad * ext/psych/lib/psych/visitors/to_ruby.rb: ToRuby visitor can be
constructed with a ScalarScanner.
* ext/psych/lib/psych/visitors/yaml_tree.rb: ScalarScanner can be
  passed to the YAMLTree visitor.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 21:00:50 +00:00
tenderlove bdadd49940 * ext/psych/lib/psych/visitors/to_ruby.rb: Define Regexp::NOENCODING
for 1.9.2 backwards compatibility.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Fix Date string
  generation for 1.9.2 backwards compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-03 20:49:19 +00:00
tenderlove 8659de2e0f * ext/psych/lib/psych/visitors/yaml_tree.rb: emit strings tagged as
ascii-8bit as binary in YAML.
* test/psych/test_string.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-01 19:07:44 +00:00
tenderlove 72107daf0e * ext/psych/lib/psych.rb: Fixing psych version number.
* ext/psych/psych.gemspec: updating the gemspec.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 21:54:27 +00:00
tenderlove 34f6671d68 * ext/psych/lib/psych/nodes/node.rb: default `to_yaml` encoding to be
UTF-8.
* test/psych/test_encoding.rb: test yaml dump encoding.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-24 21:14:44 +00:00
tenderlove 5339bbe2dc * ext/psych/lib/psych/core_ext.rb: Make Kernel#y private.
[ruby-core:38913]
* test/psych/test_yaml.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:27:44 +00:00
tenderlove b5f05971f5 * ext/psych/lib/psych/scalar_scanner.rb: Only consider strings
with fewer than 2 dots to be numbers. [ruby-core:38915]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-13 00:00:26 +00:00
nobu 1c647cc203 * ext/psych/psych.gemspec (files): remove extra commas.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-04 07:09:58 +00:00
tenderlove 92f3904534 oops, fix author in the psych gemspec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 18:08:48 +00:00
tenderlove 55d68f1160 installing psych as a gem
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32831 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-03 17:02:44 +00:00
tenderlove dc22968239 * ext/psych/lib/psych.rb: define a new BadAlias error class.
* ext/psych/lib/psych/visitors/to_ruby.rb: raise an exception when
  deserializing an alias that does not exist.
* test/psych/test_merge_keys.rb: corresponding test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-18 04:38:37 +00:00
tenderlove 40508ede73 * ext/psych/lib/psych/visitors/to_ruby.rb: Fix cyclic references of
objects.  Thanks to CvX for reporting the bug and a test case.
* test/psych/test_object.rb: test for cyclic object references.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-21 18:22:54 +00:00
naruse 69cb0ca3e4 * ext/psych/lib/psych/deprecated.rb (Object#to_yaml_properties):
undef to_yaml_properties before redefine it.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-13 03:54:53 +00:00
tenderlove 132161da69 * ext/psych/lib/psych.rb: updating version to match released gem.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-09 17:26:29 +00:00
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
tenderlove 6c56c40b44 * ext/psych/parser.c (parse): release event objects to plug memory
leak.  Thanks Mark J. Titorenko!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-06 00:41:24 +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 fe89874540 * ext/psych/lib/psych.rb: released a new gem, so increasing version.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-13 22:31:15 +00:00
tenderlove d3802d719c fix capture to avoid doing a sub on the useconds when parsing dates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04 23:07:58 +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
akr 4520a3408a * ext/psych/parser.c: parenthesize macro arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-22 11:10:34 +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 7b494b09a0 * ext/psych/lib/psych.rb: increase Psych to 1.1.0 for help with
debugging.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 18:09:47 +00:00
tenderlove 4ed82ae5cb * ext/psych/lib/psych/streaming.rb: refactor streaming methods to a
module.
* ext/psych/lib/psych/stream.rb: extracted streaming specific methods
  to a module.
* ext/psych/lib/psych/json/stream.rb: JSON stream inherits from
  JSONTree and includes streaming methods.
* ext/psych/lib/psych/visitors/json_tree.rb: JSON does not support
  object references, so remove object reference testing when building
  JSON trees.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 18:09:38 +00:00
tenderlove 10ec858f40 should have used anchor, not oid
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30935 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 18:09:27 +00:00
tenderlove 846b8118df * ext/psych/lib/psych/visitors/yaml_tree.rb (accept): use Hash#key?
when looking up object references to err on the side of cache
  misses.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 17:42:50 +00:00
tenderlove 8b5a3b7d39 * ext/psych/lib/psych/json/yaml_events.rb: refactoring JSON event
handling methods to a module for reuse.
* ext/psych/lib/psych/json/tree_builder.rb: AST builder uses JSON
  event methods.
* ext/psych/lib/psych/json/stream.rb: stream emitter uses JSON event
  methods.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 02:00:43 +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 816c7900fd moving autoload to require so that the correct files are required
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 01:49:41 +00:00
tenderlove 73af8137d9 * ext/psych/lib/psych/json/ruby_events.rb: DRY up ruby event handling
for JSON.
* ext/psych/lib/psych/visitors/json_tree.rb: use ruby events module
* ext/psych/lib/psych/json/stream.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-21 01:06:34 +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 b93c74c6e8 * ext/psych/lib/psych/visitors/to_ruby.rb: use Regexp::NOENCODING
rather than magic number.
* ext/syck/lib/syck/rubytypes.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02 22:22:26 +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 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
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 3d2e701396 * ext/psych/lib/psych/visitors/visitor.rb (initialize): push accessor
methods to subclass that actually uses them.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-02 21:25:27 +00:00
tenderlove ad9aa5368f * ext/psych/lib/psych/visitors/visitor.rb (accept): switch to
a dispatch cache rather than case / when statement.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-02 21:24:54 +00:00
naruse d074ef4d60 * string.c (tr_setup_table): fix bug in r29146.
Initialize table even if cflag is 0; tr_find see whether
  del is empty or not.

* string.c (tr_find): nodel can't be NULL; if NULL, it means
  it is not specified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-30 19:45:30 +00:00
tenderlove 4eec1b31b9 * ext/psych/lib/psych/visitors/yaml_tree.rb (format_time): use new
timezone format options.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-08 16:51:28 +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 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 f32ae44629 * ext/psych/lib/psych/scalar_scanner.rb: making the code more beautiful.
Thanks nobu!

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05 18:14:37 +00:00
tenderlove ce2e7368d7 * ext/psych/lib/psych/scalar_scanner.rb (parse_string): support
timezones that are not one hour off. [ruby-core:31023]
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-05 03:33:56 +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
usa df45be0472 * ext/psych/emitter: f..king C99(gcc)-ism.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-20 07:18:04 +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
mame e181ae5391 * process.c: suppress warning for signed and unsigned type
inconsistency.

* ext/psych/parser.c: ditto.

* ext/sdbm/_sdbm.c: ditto.

* ext/syck/rubyext.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 13:21:17 +00:00
tenderlove 2f39988511 * ext/psych/lib/psych/emitter.rb: removing unused file.
* ext/psych/lib/psych/json/tree_builder.rb: moving tree builder to an
  event based external class.
* ext/psych/lib/psych/tree_builder.rb: adding an end_stream event.
* ext/psych/lib/psych/visitors/json_tree.rb: using event based AST
  builder.
* ext/psych/lib/psych/visitors/yaml_tree.rb: using event based AST
  builder.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-16 23:50:23 +00:00
tenderlove 37910b13fb * ext/psych/lib/psych/visitors/json_tree.rb: using factory methods for
node creation
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-16 02:33:05 +00:00
nobu c20a118c50 * ext/psych/parser.c (PSYCH_TRANSCODE): get rid of bare use of gcc
extension.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11 00:53:16 +00:00
nobu 60d460ead9 * ext/psych/parser.c: fixed broken indent.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-11 00:53:11 +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
tenderlove 23f612d7bf * ext/psych/lib/psych/visitors/yaml_tree.rb: using more factory methods
for generating the YAML ast.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-03 15:39:59 +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 38297f330b * ext/psych/lib/psych.rb: removing unused code
* ext/psych/lib/psych/visitors/yaml_tree.rb: removing unused code

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 22:23:37 +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
tenderlove b57db764b0 * ext/psych/lib/psych/deprecated.rb: supporting detect_implicit method
* test/psych/test_deprecated.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 19:58:34 +00:00
tenderlove 7309f9cc00 * ext/psych/lib/psych.rb: supporting deprecated syck method
add_ruby_type
* ext/psych/lib/psych/visitors/to_ruby.rb: ditto
* test/psych/test_deprecated.rb: ditto
* test/psych/test_psych.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 04:11:27 +00:00
tenderlove edcaae9741 * ext/psych/lib/psych.rb: fixing documentation
* ext/psych/lib/psych/deprecated.rb: moving deprecated method to
  deprecated file

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 00:20:08 +00:00
tenderlove 2845bfa9dd * ext/psych/lib/psych/visitors/yaml_tree.rb: defaulting binary string
format to "literal" format.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-17 20:52:46 +00:00
tenderlove 94365e5345 * ext/psych/lib/psych/visitors/yaml_tree.rb (find_ivars): ignore
to_yaml_properties defined by syck.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-17 03:04:03 +00:00
tenderlove 5b5bbdbb35 * ext/psych/lib/psych/core_ext.rb (yaml_as): supporting deprecated
"yaml_as" method
* ext/syck/lib/syck/tag.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 20:31:59 +00:00
tenderlove 2db7b7f3fe * ext/psych/lib/psych/coder.rb (scalar): supporting deprecated methods
* ext/psych/lib/psych/deprecated.rb: supporting deprecated
  to_yaml_properties method

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-16 20:27:51 +00:00
tenderlove 3a1c0be67f * ext/psych/lib/psych/deprecated.rb: requiring 'date' for backwards
compatibility.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-11 19:05:53 +00:00
tenderlove b9617bf7cb * ext/psych/parser.c: Fixing a segv in test-all. Thanks Yusuke!
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-10 23:50:50 +00:00
tenderlove 6cfcb9d936 * ext/psych/lib/psych/deprecated.rb: implementing Psych.quick_emit and
adding deprecation warnings.
* ext/psych/lib/psych/visitors/to_ruby.rb: supporting deprecated
  yaml_initialize api.
* ext/psych/lib/psych/visitors/yaml_tree.rb: supporting deprecated
  to_yaml api.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 20:33:21 +00:00
tenderlove 186e575827 * ext/psych/lib/psych/deprecated.rb: implementing Psych.quick_emit and
adding deprecation warnings.
* ext/psych/lib/psych/visitors/to_ruby.rb: supporting deprecated
  yaml_initialize api.
* ext/psych/lib/psych/visitors/yaml_tree.rb: supporting deprecated
  to_yaml api.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 20:33:10 +00:00
tenderlove 052f204dcb * ext/psych/parser.c: parse raises a TypeError when nil is passed in.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-09 16:09:55 +00:00
nobu f3b9acda21 * ext/psych/*.c: not executable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-08 06:32:08 +00:00
naruse 10c9ed2493 * ext/psych/lib/psych/core_ext.rb: remove before alias.
* ext/syck/lib/syck.rb: don't warn called by itself.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-05 04:12:14 +00:00
tenderlove a4dbc2ea10 * ext/psych/lib/psych.rb: Syck api compatibility [ruby-core:29157]
* ext/psych/lib/psych/nodes/node.rb: ditto
* test/psych/test_psych.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 21:09:58 +00:00
tenderlove 69c6ee0b45 * ext/psych/lib/psych/coder.rb: Adding Syck compatibility to the yaml coder
* test/psych/test_coder.rb: test for syck compatibility

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-31 17:56:55 +00:00
naruse ee90d5d30e * ext/psych/extconf.rb: install psych .so to not psych/ but direct.
This prepends to install *.rb files to psych/psych.

* ext/psych/lib/psych.rb: require 'psych.so'.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 12:21:55 +00:00
nobu f1330fd124 * ext/psych/lib: moved external library dependent files from lib.
[ruby-core:29129]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-30 10:46:06 +00:00
tenderlove 9dd3af9ae7 * ext/psych/extconf.rb: Making library detection more agnostic.
[ruby-core:29118]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29 23:57:43 +00:00
naruse e43b94231b * ext/psych/{emitter,parser,psych}.c: move variable
declaration to the first of the block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-29 18:58:22 +00:00
tenderlove b9b923ca94 * ext/psych/*: importing Psych to trunk
* test/psych/*: ditto
* lib/psych/*: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-28 21:49:37 +00:00