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

86 Коммитов

Автор SHA1 Сообщение Дата
naruse 66c9bb11aa Add missing :nodoc: comment
We were missing a `:nodoc:` magic comment that was making automated tools show
that this method was missing documentation, when it really didn't need to be
documented.
by Devon Estes <devon.c.estes@gmail.com>
https://github.com/ruby/ruby/pull/1482 fix GH-1482

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-10 18:23:33 +00:00
akr 19e6276125 Enable the document for Kernel[#.]pp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-11 03:04:38 +00:00
akr ea8990d867 pp prints a multiple lines string prettier.
* lib/pp.rb (String#pretty_print): Defined to print a string as
  multiple lines.
  [ruby-core:76800] [Feature#12664] proposed by Petr Chalupa.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-11 07:44:58 +00:00
akr 68ebbbfebe * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".
* lib/pp.rb: Ditto.

* lib/prettyprint.rb: Ditto.

* lib/resolv.rb: Ditto.

* lib/securerandom.rb: Ditto.

* lib/tmpdir.rb: Ditto.

* lib/unicode_normalize/tables.rb: Ditto.

* test/net/ftp/test_buffered_socket.rb: Ditto.

* test/net/ftp/test_mlsx_entry.rb: Ditto.

* test/open-uri/test_open-uri.rb: Ditto.

* test/open-uri/test_ssl.rb: Ditto.

* test/pathname/test_pathname.rb: Ditto.

* test/test_pp.rb: Ditto.

* test/test_prettyprint.rb: Ditto.

* tool/transcode-tblgen.rb: Ditto.

* ext/pathname/lib/pathname.rb: Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10 11:48:14 +00:00
akr 36ca18b847 Put an line before "frozen_string_literal: true" for emacs.
https://bugs.ruby-lang.org/issues/8976#note-49


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05 22:22:56 +00:00
akr 805c20a8e5 * lib/pp.rb: Use frozen_string_literal: true.
* lib/prettyprint.rb: Ditto.

* lib/resolv.rb: Ditto.

* lib/tmpdir.rb: Ditto.

* test/test_pp.rb: Ditto.

* test/test_prettyprint.rb: Ditto.

* tool/transcode-tblgen.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-05 13:27:48 +00:00
usa d2cee7828c * lib/pp.rb (File::Stat#pritty_print): some platforms (such as Windows)
does not have major/minor parts of device.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-05 19:35:19 +00:00
akr 4292fd7798 * lib/pp.rb (object_address_group): Use Kernel#to_s to obtain the class
name and object address.
  This fix a problem caused by %p in C generates variable length
  address.
  Reported by ko1 via IRC.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-22 09:29:53 +00:00
shugo c8151d1235 * bootstraptest/test_autoload.rb, bootstraptest/test_method.rb:
remove tests for $SAFE=4.

* lib/pp.rb: use taint instead of untrust to avoid warnings when
  $VERBOSE is set to true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13 02:01:42 +00:00
zzak a3672d4bf4 * lib/pp.rb: Revert part of r40834 and nodoc PP::ObjectMixin
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-20 02:52:29 +00:00
nobu d6d4573782 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 18:21:05 +00:00
zzak 18ffba64bd * lib/pp.rb: Document PP::ObjectMixin [Fixes GH-312]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19 18:17:51 +00:00
zzak 531d47d6c1 * lib/pp.rb: Update PP module overview by @geopet
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-28 14:19:18 +00:00
zzak 3952de50bf * lib/pp.rb, lib/prettyprint.rb: Documentation for PP and PrettyPrint
Based on a patch by Vincent Batts [ruby-core:51253] [Bug #7656]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-10 00:10:11 +00:00
eregon fd7dc23d28 Kernel#inspect: improve consistency and do not call #to_s.
* object.c (rb_obj_inspect): Kernel#inspect: do not call #to_s. A class
  can now benefit from the nice default #inspect even if it defines #to_s.
  Also, there is no more unexpected change in #inspect result.
* NEWS: Add note about the change.
* bignum.c, io.c, numeric.c, object.c, proc.c, vm.c (Init_*):
  Adapt internal structures (by aliasing #inspect to #to_s) so they
  don't rely on the removed behavior (#inspect calling overridden #to_s).
* test/ruby/test_object.rb (test_inspect): add tests for Kernel#inspect.
* lib/pp.rb (class PP): do not call #to_s anymore, as #inspect
  no more does (mame).
* test/test_pp.rb (class PPInspectTest): remove related assertion (mame).
  [ruby-core:43238][Feature #6130]
* test/drb/drbtest.rb (DRbCore#teardown, DRbAry#teardown):
  adapt DRb tests with the new change (shirosaki).
  [ruby-core:47182][Bug #6866]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15 11:50:01 +00:00
naruse 780e7d0951 Revert r36699 and r36700. [Feature #6130]
Revert "Kernel#inspect: improve consistency and do not call #to_s."
Revert "update PP with recent Kernel#inspect change. Patch by Yusuke Endoh."

r36699 cause test-all failure on test/drb/test_drb.rb and
test/drb/test_drbssl.rb. Run test-all before commit.

Moreover its ChangeLog formst is wrong: see CommitterHowto
https://bugs.ruby-lang.org/projects/ruby/wiki/CommitterHowto#ChangeLog

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36701 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-15 01:09:10 +00:00
eregon e1aa72d441 update PP with recent Kernel#inspect change. Patch by Yusuke Endoh.
* lib/pp.rb (class PP): do not call #to_s anymore, as #inspect no more does.
* test/test_pp.rb (class PPInspectTest): remove related assertion.
  [ruby-core:43238][Feature #6130]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-14 10:21:04 +00:00
ktsj 483fd7485b * lib/pp.rb: fix rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-04 03:12:54 +00:00
drbrain 627c179a99 * lib/pp.rb: Move PP documentation to top of class PP. Patch by
Sylvain Daubert.  [Ruby 1.9 - Bug #5430]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-10 21:10:02 +00:00
akr 33d848d841 * lib/pp.rb: describe superclasses explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-01 14:09:40 +00:00
akr 9ac224eb26 * lib/pp.rb: use [""].pack("p").size to detect the pointer size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-24 14:41:22 +00:00
akr 4319b48ab6 * lib/pp.rb (PP::ObjectMixin#pretty_print): use to_s regardless of
instance variables.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-07 12:05:38 +00:00
mame c979cbfcf6 * lib/pp.rb (Kernel#pp): returns its arguments, like Kernel#p.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 12:11:29 +00:00
akr 4319c0235d * lib/pp.rb (PP:ObjectMixin#pretty_print): delegates has no inspect
method.  [ruby-core:25804]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27 04:08:31 +00:00
mame 528574c2e2 * lib/pp.rb (guard_inspect_key): untrust internal hash to prevent
unexpected SecurityError.

* test/ruby/test_object.rb: add a test for [ruby-dev:38982].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-04 16:44:05 +00:00
nobu 46f23b51f6 * lib/pp.rb (Struct#pretty_print): coerce to a string since
anonymous class has name no longer.  [ruby-dev:38349]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-27 22:13:50 +00:00
akr 29f73c43a5 * test/test_pp.rb: extract from lib/pp.rb.
* test/test_prettyprint.rb: extract from lib/prettyprint.rb.

* test/test_tsort.rb: extract from lib/tsort.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-14 23:36:45 +00:00
akr f3d95cce97 trailing spaces removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-14 15:18:53 +00:00
akr 08eb58d3dd * re.c (rb_reg_names): new method Regexp#names.
(rb_reg_named_captures): new method Regexp#named_captures
  (match_regexp): new method MatchData#regexp.
  (match_names): new method MatchData#names.

* lib/pp.rb (MatchData#pretty_print): show names of named captures.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09 21:44:19 +00:00
akr 9bc20bef7a * lib/pp.rb: use Hash for recursion check as inspect.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-07 06:45:28 +00:00
akr 457686dd11 refine doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-11 12:48:39 +00:00
akr 9d326d261e * lib/pp.rb (PP::PPMethods#pp_hash): don't sort keys because hash is
ordered.
  (ENV.pretty_print): call pp_hash with sorted hash.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-14 02:14:16 +00:00
akr acbffce267 * lib/pp.rb (PP::PPMethods#pp_hash): sort condition changed:
all keys have a same class which is kind of Comparable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-07 13:02:35 +00:00
akr 174b77b280 * lib/pp.rb (PP::PPMethods#pp_hash): sort if
all keys are strings, symbols or integers.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-07 06:39:56 +00:00
akr 6f9ded1fb0 * lib/pp.rb: call original "method" method instead of redefined one.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-07 10:02:58 +00:00
matz 8ef2289a49 * lib/pp.rb (PP::PPMethods::seplist): revert last change to work
around wrapper bug.  [ruby-dev:30840]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-05 05:48:45 +00:00
matz 4bacdc1e46 * bignum.c (bignorm): sizeof(long) may be smaller than
sizeof(VALUE).  [ruby-dev:29013]

* ruby.h (FIXNUM_MAX): fixnum may be bigger than long.

* ruby.h (SIGNED_VALUE): signed integer of size of VALUE.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11 05:00:02 +00:00
ryan 2bf2f48a0b cached rdoc diagrams, private rdoc comments, minor clarifications in debug.rb and pp.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10491 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-08 23:17:53 +00:00
matz 7dd70df4b0 * lib/pp.rb (PP::PPMethods::seplist): should have preserved
original reference to the array.  [ruby-dev:28747]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-21 08:20:12 +00:00
akr eeda97f8e3 * lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
string.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-06-16 17:05:22 +00:00
akr 55fc4f0c27 * lib/pp.rb (PP.mcall): new method.
(Struct#pretty_print): call Kernel#class and Struct#members even if
  overriden.
  (Struct#pretty_print_cycle): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-13 07:35:50 +00:00
akr 1717014d72 A trick for negative address removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-30 05:02:37 +00:00
akr 1ebb904958 ChangeLog lib/pp.rb
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-30 04:44:12 +00:00
akr 5a6ed851fe * lib/pp.rb (PP::PPMethods#object_address_group): adjust address format.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9628 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-11-28 11:26:39 +00:00
akr 7935361d36 * lib/pp.rb (PP::PPMethods#guard_inspect_key): support
__recursive_key__.  [ruby-dev:25821]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-09 14:56:16 +00:00
matz 6645b92826 * object.c (inspect_obj): unintended space removal.
[ruby-dev:25810]

* eval.c (rb_exec_recursive): should not use NODE in disclosed
  context.  [ruby-dev:25812]

* io.c (rb_f_open): need not to check if to_open value is a
  T_FILE.  [ruby-dev:25812]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-07 02:05:08 +00:00
akr 1b178621c2 * lib/pp.rb: rdoced by Sam Roberts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-06 02:55:16 +00:00
akr 25d8e7a119 * lib/pp.rb (File::Stat#pretty_print): Etc.getpwuid and Etc.getgrgid
may return nil.  [ruby-talk:129826]
  reported by Daniel Berger.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-03-06 02:41:15 +00:00
nobu 5d581bc314 * lib/pp.rb (PP#object_address_group): remove odd number of 'f'
prefixed to negative address.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-14 04:27:39 +00:00
akr 4d664a098d * (lib/pp.rb, lib/prettyprint.rb): define seplist in PP::PPMethods
instead of PrettyPrint.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-03-27 01:46:05 +00:00