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

67 Коммитов

Автор SHA1 Сообщение Дата
naruse c4fdfabcc8 handle ext/ as r53141
g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts
fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&#
frozen_string_literal: false\n");f.rewind;f.write s}}'

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:31:54 +00:00
nobu ad48d99876 dbm: typed data
* ext/dbm/dbm.c (dbm_type): turn into typed data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-04 23:33:01 +00:00
zzak d075c430cb * ext/dbm/extconf.rb: [DOC] Hide from RDoc
Some libraries might want to document extconf.rb so RDoc treats it
  like any other ruby program. However, DBM users shouldn't care about
  these methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-12 03:59:50 +00:00
akr d07439d5fd Add a comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-23 13:49:10 +00:00
nobu af6c038b23 remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04 00:57:31 +00:00
akr a38958a521 * ext/dbm/extconf.rb (headers): try ambiguous headers at last.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25 08:42:00 +00:00
akr cd390b1ec5 * ext/dbm/extconf.rb: unused macro removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 14:02:01 +00:00
akr fd2e0e3dac * ext/dbm/extconf.rb: use DBM_SUFFIX only to detect header of
Berkeley DB.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23 03:23:40 +00:00
akr 8963f50f26 * ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.
Its ndbm.h doesn't include db.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 21:13:52 +00:00
akr eac1d9cfca * ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.
* ext/dbm/extconf.rb: check DBC type for above.

[ruby-dev:45269]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21 21:04:04 +00:00
akr a1292c72ef update comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 15:00:35 +00:00
akr faf4c9db80 * ext/dbm/extconf.rb: weaken header/library consistency check if db is
"ndbm".  It seems several (possibly historical) distributions
  provide libndbm.  However the content of libndbm vary: Berkeley DB,
  GDBM or even 4.3BSD NDBM.  (Mandriva, Tru64 UNIX, OpenSuSE,
  SCO OpenServer, ...)
  "ndbm" is not searched automatically now (dblib doesn't contain it)
  but configure --with-dbm-type=ndbm choose libndbm and ndbm.h.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 11:05:31 +00:00
akr f8015c23c4 * ext/dbm/extconf.rb: refine variable names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 10:16:25 +00:00
akr d7bf156afd * ext/dbm/extconf.rb: show header and library found.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-19 14:44:24 +00:00
akr 95f3f9829f * ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.
* ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-19 14:02:14 +00:00
akr 0187905af2 * ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr is
an empty macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 16:06:52 +00:00
akr fcd8f78ea3 * ext/dbm/extconf.rb: don't choose 'dbm' if _GDB_H_ is defined which
is available since GDBM 1.9 because 'gdbm_compat' is appropriate
  choise since GDBM 1.8.1.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 15:31:09 +00:00
akr fc0111cce1 * ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.
(have_declared_libvar): new function to check a declared variable
  exists in a library.
  (have_undeclared_libvar): renamed from renamed from have_libvar.
  (headers.db_check2): check that GDBM version variable if GDBM header
  is choosen.

* ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and
  HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18 09:47:07 +00:00
akr 92e7c2d3ea * ext/dbm/extconf.rb: remove dbm.
forgotten in r34666.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:41:54 +00:00
akr 6d1f751207 * ext/dbm/extconf.rb: refine header/libraty mismatch detection.
check only for ndbm.h except libc.  check _GDBM_H_ for gdbm.
  check _DBM_IOERR for the original ndbm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:29:50 +00:00
akr fbca1d0da1 * ext/dbm/extconf.rb: don't check libdbm. It is not a ndbm
implementation.  (libdbm in Version 7 Unix is database library
  for single database per process.)


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-17 12:10:32 +00:00
akr 2f92a267f4 * ext/dbm/extconf.rb: refactored to split too long conditions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-16 22:32:10 +00:00
akr 078b3cf95e * ext/dbm/extconf.rb: check _DB_H_ macro unavailable except
Berkeley DB library.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-16 15:05:46 +00:00
akr bb1875175b * ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING for
detect runtime Berkeley DB version.
  use dpversion instead of _QDBM_VERSION for detect runtime QDBM
  [ruby-dev:44948]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 10:21:12 +00:00
akr 2f49f5ee0b * ext/dbm/extconf.rb: detect gdbm_version in libgdbm.
* ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and
  Berkeley DB 1.x.  [ruby-dev:44944]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06 03:38:07 +00:00
akr 09d2180d2d * ext/dbm/extconf.rb: revert a part of the patch in [ruby-dev:41531].
don't use db.h with other headers.  [ruby-dev:44884].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-17 11:45:32 +00:00
akr 158a828c97 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14 11:22:15 +00:00
nobu 416778c5d8 * ext/dbm/extconf.rb: use convertible_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 14:47:31 +00:00
akr bfed16a21f * ext/dbm/extconf.rb: rollback for each headers for each libraries.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 10:58:18 +00:00
akr e8ca9cc343 * ext/dbm/extconf.rb: treat libc as a choice for a library which
provide ndbm API.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 07:25:40 +00:00
akr 3e5bff7ec1 * ext/dbm/extconf.rb: duplicate $libs and $defs when save them.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 06:41:19 +00:00
akr 2b2ef5cfce * ext/dbm/extconf.rb: rollback $libs and $defs when db detection is
failed.  It fixes -lgdbm -lqdbm when the system has qdbm and gdbm
  without gdbm_compat.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13 03:47:07 +00:00
nobu 521f420a77 * ext/dbm/extconf.rb (headers.db_check): reduce duplicated code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 08:01:51 +00:00
akr 0eb08aa068 update comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 07:50:12 +00:00
akr df2e1f85d2 * ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbm
implementation.  If it is not available, it is caused by
  header/library mismatch such that Berkeley DB header & gdbm library.

* ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally.
  gdbm 1.9 provides it as a real function instead of a empty macro.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12 07:06:09 +00:00
akr db48bbdf0b * ext/dbm/extconf.rb: db_prefix is not required now.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 14:01:25 +00:00
akr 266d09839b * ext/dbm/extconf.rb: fix dbm_pagfno and dbm_dirfno detection with
Berkeley DB.  Macro definitions needs arguments to detect correctly.
  SIZEOF_DSIZE needs -DDB_DBM_HSEARCH because db.h defines datum type
  only if DB_DBM_HSEARCH is defined. 



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 12:03:51 +00:00
akr 688e1b34a6 add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-11 03:35:49 +00:00
nobu 6c9a235938 * ext/dbm/extconf.rb: set DB_DBM_HSEARCH macro to check dbm_pagfno and
dbm_dirfno on older Debian.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10 06:43:46 +00:00
nobu fb1836ab48 * ext/dbm/extconf.rb: check for dsize as LONG_LONG.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10 06:43:44 +00:00
nobu 0e4c2ce841 * ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)
(fdbm_has_key, fdbm_has_value): get rid of overflow.
* ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey)
  (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto.
* ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects.
* ext/gdbm/gdbm.c (fgdbm_delete_if): ditto.
* ext/dbm/extconf.rb: check size of datum.dsize to get rid of
  overflow.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08 14:34:39 +00:00
akr e4e5b7df4c * ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().
* ext/dbm/dbm.c: use above to set close-on-exec flag.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07 11:17:17 +00:00
kosaki cb96213fad * ext/dbm/extconf.rb: Added new header places for Fedora13.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-28 12:58:15 +00:00
mame 8af5f01a17 * ext/dbm/extconf.rb: accept Berkley DB version 3, 4 and 5.
[ruby-dev:41531]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-11 15:40:39 +00:00
matz 54cf2fca17 * enum.c (enum_yield): when multiple values yielded from #each
pack them into an array.  [ruby-dev:32708]

* enum.c: all method but all?, any?, one? and none? passed packed
  multiple values to the block.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-25 06:01:22 +00:00
nobu 5e6bf721d5 * ext/dbm/extconf.rb: allow multiple candidates for dbm-type.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-16 07:14:37 +00:00
nobu eff9686ded * ext/dbm/extconf.rb: create makefile according to the result of check
for dbm header.  fixed: [ruby-dev:29445]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 12:44:33 +00:00
matz 52817c3654 * lib/cgi.rb (CGI::out): specify -x option for nkf.
* lib/cgi.rb (CGI::out): should not convert utf-8 implicitly using
  NKF.  it is too Japanese centric.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 07:40:46 +00:00
matz 25c50cd193 * ruby.h (struct RString): embed small strings.
(RSTRING_LEN): defined for accessing string members.
  (RSTRING_PTR): ditto.

* string.c: use RSTRING_LEN and RSTRING_PTR.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31 10:30:33 +00:00
nobu e34b2a73e6 * ruby.h, lib/mkmf.rb (create_header): clear command line options for
macros moved to extconf.h.

* ext/extmk.rb (extract_makefile, extmk): made RUBY_EXTCONF_H and
  EXTSTATIC permanent.

* ext/{dbm,digest/*,socket,zlib}/extconf.rb: used $defs and $INCFLAGS.

* {bcc32,win32,wince}/Makefile.sub (COMPILE_C, COMPILE_CXX): added
  $(INCFLAGS).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-25 23:44:08 +00:00