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

11610 Коммитов

Автор SHA1 Сообщение Дата
matz 878bbd1199 * io.c (open_key_args): allow specifying both :mode and :encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 07:35:11 +00:00
akr 12b1578cab * string.c (rb_str_getbyte): new method.
(rb_str_setbyte): new method.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 06:35:20 +00:00
akr b0333388ab * lib/require_relative.rb: new file.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 06:29:32 +00:00
nobu 748beee825 * ext/iconv/iconv.c (iconv_convert): check upper bound. a patch from
Daniel Luz at [ruby-Bugs-17910].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 06:23:14 +00:00
nobu 17fb1248af * re.c (rb_reg_quote): set US-ACII for ASCII-only string.
[ruby-dev:33785]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 01:35:56 +00:00
nobu 5b7bdd56ad * {win,bcc}32/Makefile.sub (config.h): added HAVE_FTRUNCATE.
[ruby-dev:33786]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15480 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 01:27:48 +00:00
nobu 04e7cc6411 * parse.y (reg_compile_gen): reg_fragment_setenc might not raise an
exception before rb_reg_compile.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15479 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-15 00:44:13 +00:00
drbrain ab3e8e6143 Preserve ri compatibility with 1.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 22:38:20 +00:00
nobu 4804658649 * configure.in (ftruncate): check if available.
* file.c (rb_file_truncate): check if ftruncate instead of truncate.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 17:42:27 +00:00
nobu 82f631ac57 * configure.in (sigsetmask): check when signal semantics is not POSIX.
* signal.c (USE_TRAP_MASK): set true if sigprocmask or sigsetmask is
  available.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 17:40:56 +00:00
nobu 67d0ce36f5 * parse.y (reg_compile_gen): appends error message from
rb_reg_compile() to one from reg_fragment_setenc().


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 14:56:40 +00:00
nobu 5aa388c23c * eval_error.c (error_print): append a newline to rest lines.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 14:51:08 +00:00
akr 433fbebfbc * io.c (io_reopen): check STDIN, STDOUT and STDERR mode according to
stdio streams.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 12:01:50 +00:00
akr a5c05a9ace add a test for [ruby-dev:33072].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 08:23:56 +00:00
matz c4b18d3cc5 * test/ruby/test_math.rb: actual-expected argument ordering for
test_math.rb fixed.  a patch from Tadashi Saito
  <shiba AT mail2.accsnet.ne.jp> in [ruby-dev:33770].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 07:09:36 +00:00
nobu 3a9bf2f124 * file.c (rb_file_s_utime): inhibits with secure level 2 or higher.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 07:02:54 +00:00
akr 23db145b07 add a test for named class in regexp.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 06:01:05 +00:00
akr bf88192354 more tests for embedding regexps.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 05:03:07 +00:00
akr ec4756f633 * re.c (rb_reg_preprocess_dregexp): use non-preprocessed regexp source
for result.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-14 03:34:12 +00:00
nobu 8435c6bb8c * lib/timeout.rb (Timeout::timeout): made sensitive to location on the
stack.  [ruby-core:15458]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 16:43:18 +00:00
nobu c9c655bf2c * common.mk (INSTRUBY_ARGS): pass mode to install. [ruby-dev:33766]
* instruby.rb (parse_args): added --data-mode and --prog-mode options.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 15:49:56 +00:00
mame a707f6249f * eval.c (eval): allow to eval in a binding that has a singleton method.
[ruby-dev:33763]

* test/ruby/test_proc.rb: add tests to achieve over 70% test coverage
  of time.c.

* test/ruby/test_method.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15462 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 15:03:59 +00:00
akr 70f25096c0 * lib/pathname.rb (Pathname#sub_ext): new method. [ruby-list:44608]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 13:50:31 +00:00
akr 800ff52c17 wait signal arrival 10sec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 13:20:12 +00:00
mame cd6dcfb05b * proc.c (proc_curry): new method. [ruby-dev:33676]
* test/ruby/test_proc.rb: add tests for above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 12:51:31 +00:00
akr 8f842d71e9 * include/ruby/ruby.h (RObject): add iv_index_tbl for shortcut of
RCLASS_IV_INDEX_TBL(rb_obj_class(obj)).
  (ROBJECT_IV_INDEX_TBL): defined.

* object.c (init_copy): initialize iv_index_tbl in struct RObject.

* variable.c (ivar_get): use ROBJECT_IV_INDEX_TBL.
  (rb_ivar_defined): ditto.
  (obj_ivar_each): ditto.
  (rb_obj_remove_instance_variable): ditto.
  (rb_ivar_set): update iv_index_tbl in struct RObject.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 11:52:46 +00:00
naruse f09eb27660 * filenames need comma.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 07:29:44 +00:00
naruse a8739621cf * lib/uri/generic.rb: revert r15442. 2nd argument of String#sub parse
escapes. [ruby-dev:33726]

* bootstraptest/test_method.rb enc/depend instruby.rb lib/mkmf.rb
  mkconfig.rb: revert r15443. ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 07:26:52 +00:00
usa f6628871b5 * enc/depend: fix typo.
* lib/mkmf.rb: revert r15443. "\\1#{sep}\\2" is wrong if sep is ended
	  with "\\".



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-13 02:21:25 +00:00
drbrain bcd4deb6c5 Allow inline markup to have a leading '#' or '\', or trailing punctuation.
i.e. *#freeze?*, *\foo?*.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 23:59:03 +00:00
drbrain b797fdc7e8 Separate HTML linking and crossreferencing into separate files.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 22:23:00 +00:00
nobu 4660cc6fb9 * parse.y (stmt, arg): reverted r15450. [ruby-core:15526]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 19:15:46 +00:00
nobu 4aa1d12937 * parse.y (arg_append_gen): optimize only for array push.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 18:13:01 +00:00
nobu 552fa153f0 * parse.y (stmt, arg): concat opt_call_args only if non-null.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 16:27:22 +00:00
nobu 813fcf768e * parse.y (arg_concat_gen, arg_append_gen): optimize for array concat.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 16:26:47 +00:00
nobu 8a87655162 * parse.y (arg_add_gen): removed since identical to arg_append_gen.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 16:23:02 +00:00
nobu 55c4937048 * parse.y (exc_list): should use mrhs if non array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 12:04:53 +00:00
tadf 2b72892ac0 * lib/rational.rb (floor, ceil, truncate, round): do not use
definitions of Numeric.

	* lib/rational.rb (to_i): should returns truncated self.

	* lib/complex.rb (numerator): requires
	  Integer#{numerator,denominator}.

	* lib/complex.rb (quo): do not use definition of Numeric.

	* lib/complex.rb (>, >=, <, <=, between?, div, divmod, modulo,
	  floor, ceil, truncate, round): undef'ed.

	* lib/mathn.rb (Rational#inspect): removed.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15446 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 11:47:12 +00:00
nobu 7d4defbe1b * parse.y (exc_list): splat literal array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 07:48:37 +00:00
nobu 126297de15 * parse.y (args, mrhs): flattens literal array splats.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 07:18:49 +00:00
naruse a10ded3ba0 * bootstraptest/runner.rb, bootstraptest/test_method.rb, enc/depend,
instruby.rb, lib/mkmf.rb, lib/test/unit/util/procwrapper.rb,
mkconfig.rb, sample/test.rb, template/vm.inc.tmpl,
test/ruby/test_stringchar.rb: fixes arround String#gsub.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 06:28:23 +00:00
naruse 40d8d38909 * ext/json/lib/json/pure/generator.rb,
ext/json/lib/json/pure/parser.rb, ext/openssl/lib/openssl/x509.rb,
ext/win32ole/sample/olegen.rb, lib/date/format.rb, lib/irb/context.rb,
lib/irb/workspace.rb, lib/net/http.rb, lib/net/imap.rb,
lib/rdoc/generator.rb, lib/rdoc/markup/to_html.rb,
lib/rdoc/markup/to_latex.rb, lib/rdoc/parsers/parse_c.rb,
lib/rdoc/ri/formatter.rb, lib/rexml/parsers/baseparser.rb,
lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rss/parser.rb,
lib/uri/common.rb, lib/uri/generic.rb, lib/webrick/httpresponse.rb,
lib/webrick/httpservlet/filehandler.rb, lib/yaml/baseemitter.rb,
lib/yaml/encoding.rb: performance tuning arround String#gsub.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 06:18:06 +00:00
matz 38694016bc * string.c (rb_str_hash_cmp): lighter version of rb_str_cmp() for
hash comparison function.

* hash.c (rb_any_cmp): use rb_str_hash_cmp().

* string.c (rb_str_casecmp): should return nil for incompatible
  comparison.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 03:17:43 +00:00
matz ff15c72d69 * instruby.rb: specify file mode to install. a patch from
pegacorn  <subscriber.jp AT gmail.com> in [ruby-dev:33699].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 03:16:07 +00:00
matz f3ac3dc79c * numeric.c (rb_num_coerce_bin): add ID argument to specify
caller's method name.  [ruby-dev:33663]

* numeric.c (rb_num_coerce_cmp): ditto.

* numeric.c (rb_num_coerce_relop): ditto.

* ext/bigdecimal/bigdecimal.c (DoSomeOne): add function name argument.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 02:46:21 +00:00
drbrain 030a513a49 Wrap parse_files' read in a version check for backwards compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 01:27:52 +00:00
naruse dd738cd887 * ruby.c (load_file): enc must effect source encoding.
[ruby-core#15496]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 01:20:43 +00:00
drbrain 0ecb56f170 Restore require rubygems check
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12 01:17:39 +00:00
matz 0472db84c5 * range.c (range_include): specialize single character string
case (e.g. (?a ..?z).include(?x)) for performance.
  [ruby-core:15481]

* string.c (rb_str_upto): specialize single character case.

* string.c (rb_str_hash): omit coderange scan for performance.

* object.c (rb_check_to_integer): check Fixnum first.

* object.c (rb_to_integer): ditto.

* string.c (rb_str_equal): inline memcmp to avoid unnecessary
  rb_str_comparable(). 

* parse.y (rb_intern2): use US-ASCII encoding.

* parse.y (rb_intern_str): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-11 17:46:52 +00:00
kou 9d968bc221 * lib/rss/rss.rb (RSS::VERSION), test/rss/test_version.rb:
0.2.3 -> 0.2.4.

* lib/rss/maker.rb, lib/rss/maker/, test/rss/test_maker_2.0.rb:
  fixed a bug that RSS::Maker.make("0.9")'s item doesn't make some
  elements if description is missed.
  Reported by Michael Auzenne. Thanks!!!

* lib/rss/maker/0.9.rb, test/rss/test_maker_0.9.rb:
  RSS::Maker.make("0.9") generates RSS 0.92 not RSS 0.91.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-11 08:24:18 +00:00