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

135 Коммитов

Автор SHA1 Сообщение Дата
tenderlove 2a58706e2d * ext/psych/lib/psych/visitors/yaml_tree.rb: fix symbol keys in coder
emission.  Thanks @tjwallace
* test/psych/test_coder.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 18:12:52 +00:00
tenderlove 0cb251e079 change test name to be more helpful
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 18:02:22 +00:00
tenderlove 7a7bb64464 * ext/psych/lib/psych/visitors/to_ruby.rb: correctly register
self-referential strings. Fixes tenderlove/psych #135

* test/psych/test_string.rb: appropriate test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05 17:11:21 +00:00
naruse 7a77e12488 Suppress warnings
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02 02:14:21 +00:00
xibbar d85bf93776 * test/psych/test_*.rb: use require_relative to require local library
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-26 14:55:04 +00:00
akr 052c0e67d9 * test/ruby/test_require.rb: Remove temporally files in the tests.
* test/ruby/test_rubyoptions.rb: Ditto.

* test/logger/test_logger.rb: Ditto.

* test/psych/test_psych.rb: Ditto.

* test/readline/test_readline.rb: Ditto.

* test/syslog/test_syslog_logger.rb: Ditto.

* test/webrick/test_httpauth.rb: Ditto.

* test/zlib/test_zlib.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24 02:06:32 +00:00
tenderlove 1c836f811c * ext/psych/lib/psych/visitors/yaml_tree.rb: fixing string quotation
when dumping Ruby strings. Thanks Ingy

* test/psych/test_psych.rb: appropriate tests.

* test/psych/test_yaml.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-07 23:54:29 +00:00
akr 2d55537dce * test/ruby/test_marshal.rb: remove temporally files early.
* test/ruby/test_process.rb: ditto.

* test/psych/test_exception.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29 03:06:40 +00:00
tenderlove 0a60805af5 * ext/psych/lib/psych/visitors/to_ruby.rb: merge key values that
contain something besides a hash should be left in tact.

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38788 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-12 00:00:12 +00:00
tenderlove b104e2524d * ext/psych/lib/psych/scalar_scanner.rb: strip trailing dots from
floats so that Float() will not raise an exception.

* test/psych/test_numeric.rb: test to ensure "1." can be loaded

* test/psych/test_string.rb: make sure "1." can round trip

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09 19:26:45 +00:00
tenderlove ac8b1869c0 * ext/psych/lib/psych/visitors/yaml_tree.rb: ascii only binary strings
will be dumped as unicode.  Thanks Paul Kunysch!

* test/psych/test_string.rb: appropriate test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-09 19:26:36 +00:00
tenderlove 8a4cc4e02a * ext/psych/lib/psych/visitors/yaml_tree.rb: quote strings that begin
with non-word characters.  Thanks Alex Tambellini!
* test/psych/test_yaml.rb: appropriate test case

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-13 22:45:16 +00:00
nobu 13d3f023c6 test: remove or replace trailing spaces
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-07 05:02:18 +00:00
tenderlove 653b0bcbaf * ext/psych/lib/psych/visitors/yaml_tree.rb: use literal YAML style
when emitting multi-line strings. Thanks @atambo

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-17 03:15:54 +00:00
tenderlove 24c6a7c368 * ext/psych/lib/psych/scalar_scanner.rb: avoid raising exceptions when
parsing Floats and Integers. Thanks riffraff [ruby-core:44426]
* test/psych/test_numeric.rb: associated test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-17 03:11:22 +00:00
naruse 58ef0f06c6 * ruby.c (load_file_internal): set default source encoding as
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679]

* parse.y (parser_initialize): set default parser encoding as
  UTF-8 instead of US-ASCII.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 00:49:57 +00:00
tenderlove 0f9307914b * ext/psych/lib/psych/handlers/recorder.rb: added a class for
recording YAML parse and emit events.

* ext/psych/lib/psych/handler.rb: adding a list of events so that
  handler classes can more easily be meta-programmed.

* test/psych/handlers/test_recorder.rb: tests for the change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-29 01:23:54 +00:00
tenderlove f8d34b2a75 * ext/psych/lib/psych/visitors/yaml_tree.rb: `tree` should return the
same thing on every call.

* test/psych/visitors/test_yaml_tree.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 01:13:09 +00:00
tenderlove dbe6250af2 * ext/psych/lib/psych/visitors/yaml_tree.rb: YAML Tree object should
be able to take an emitter object as it's output.

* test/psych/visitors/test_yaml_tree.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-28 01:06:09 +00:00
tenderlove 3c73f44c7f * ext/psych/parser.c: just get the constant defined in Ruby.
* ext/psych/lib/psych/syntax_error.rb: Psych::SyntaxError now inherits
  from StandardError rather than SyntaxError.  Thanks Eric Hodel!

* test/psych/test_exception.rb: tests for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-22 21:25:02 +00:00
tenderlove ec3056ae22 * ext/psych/lib/psych/scalar_scanner.rb: Ignore bad timestamps. If
something looks like a timestamp but has an invalid component, treat
  it as a string instead of throwing an ArgumentError.
  Thanks Rhett Sutphin!

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-22 21:09:56 +00:00
tenderlove c05952c6a1 * ext/psych/lib/psych/scalar_scanner.rb: Fix scalar_scanner to
understand strings starting with an underscore and containing only
  digits.  Thanks Kelley Reynolds.

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-22 21:06:25 +00:00
tenderlove 5571c7315e * ext/syck: removed. Fixes [ruby-core:43360]
* test/syck: removed.

* lib/yaml.rb: only require psych, show a warning if people try to set
  the engine to syck.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-22 17:43:16 +00:00
ayumin b69f55a673 * lib/open-uri.rb: delete space.
* test/psych/test_alias_and_anchor.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-17 16:13:10 +00:00
tenderlove 7d1f53e782 * ext/psych/lib/psych/visitors/to_ruby.rb: strings with YAML anchors
are properly referenced. Patched by Joe Rafaniello via Github:
    https://github.com/tenderlove/psych/pull/69
* ext/psych/lib/psych/visitors/yaml_tree.rb: ditto
* test/psych/test_alias_and_anchor.rb: test for change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-16 19:00:59 +00:00
tenderlove b4bdb2f2eb * ext/psych/lib/psych/visitors/to_ruby.rb: fix a bug with string
subclass dumping and loading.

* test/psych/test_array.rb: pertinent tests

* test/psych/test_string.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-15 20:13:21 +00:00
tenderlove 5341e3ccc4 * ext/psych/lib/psych/visitors/to_ruby.rb: convert omap tagged maps to
Psych::Omap objects rather than hashes. [Bug #6425]

* test/psych/test_omap.rb: pertinent test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-15 16:34:21 +00:00
tenderlove 75cff1d7d0 add a test for yaml ast roundtripping
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-28 22:24:01 +00:00
tenderlove 85e4c89675 * ext/psych/parser.c: fall back to any encoding if the external
encoding is wrong.  [ruby-core:44163]
* test/psych/test_encoding.rb: fix test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-06 17:09:03 +00:00
tenderlove 240c9acb5c * ext/psych/lib/psych.rb (load, parse): stop parsing or loading after
the first document has been parsed.

* test/psych/test_stream.rb: pertinent tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08 21:31:05 +00:00
tenderlove a2e3de1b3f * ext/psych/lib/psych.rb (parse_stream, load_stream): if a block is
given, documents will be yielded to the block as they are parsed.
  [ruby-core:42404] [Bug #5978]

* ext/psych/lib/psych/handlers/document_stream.rb: add a handler that
  yields documents as they are parsed

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34953 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08 21:21:52 +00:00
tenderlove 8456c0603e only run `test_key` on ruby 2.0.0 or up
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-05 21:48:49 +00:00
tenderlove 0cb987bc51 * ext/psych/lib/psych.rb: default open YAML files with utf8 external
encoding. [ruby-core:42967]
* test/psych/test_tainted.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-28 01:30:15 +00:00
tenderlove 0d1c8fd9d6 * ext/psych/parser.c: prevent a memory leak by protecting calls to
handler callbacks.
* test/psych/test_parser.rb: test to demonstrate leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-24 04:55:33 +00:00
tenderlove 774cf315e8 * ext/psych/parser.c: set parser encoding based on the YAML input
rather than user configuration.
* test/psych/test_encoding.rb: corresponding tests.
* test/psych/test_parser.rb: ditto
* test/psych/test_tainted.rb: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 23:12:57 +00:00
tenderlove 59a1344808 * ext/psych/parser.c: removed external encoding setter, allow parser
to be reused.
* ext/psych/lib/psych/parser.rb: added external encoding setter.
* test/psych/test_parser.rb: test parser reuse

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-09 18:44:27 +00:00
tenderlove 8cf05741bc * ext/psych/lib/psych/visitors/to_ruby.rb: Added support for loading
subclasses of String with ivars
* ext/psych/lib/psych/visitors/yaml_tree.rb: Added support for dumping
  subclasses of String with ivars
* test/psych/test_string.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 03:52:01 +00:00
tenderlove ee3ebc2de5 * ext/psych/lib/psych/visitors/to_ruby.rb: Added ability to load array
subclasses with ivars.
* ext/psych/lib/psych/visitors/yaml_tree.rb: Added ability to dump
  array subclasses with ivars.
* test/psych/test_array.rb: corresponding tests

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-18 01:44:21 +00:00
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
naruse 358216cf3f An address can be negative.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-27 05:20:31 +00:00
tenderlove b5907f7d46 infinite loop seems to be fixed, so I can uncomment this assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-17 01:42:54 +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
tenderlove 8ff37e3901 * test/psych/test_yamlstore.rb: make test case inherit from MiniTest,
load psych/helper so that psych is loaded.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:27:27 +00:00
tenderlove a27349a4cb * test/psych/test_yamldbm.rb: Test case should inherit from MiniTest,
load psych/helper so that psych and friends are loaded.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:22:22 +00:00
naruse a3ace91f3e Don't define tests if there is no psych.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-03 15:54:16 +00:00
ayumin aea9c733e8 * test/psych/test_yamldbm.rb: avoid platform dependency.
patch by Naohisa Goto. [ruby-dev:44763] [Bug #5535]
* test/syck/test_yamldbm.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01 15:52:48 +00:00