aboutsummaryrefslogtreecommitdiffstats
path: root/lib/delegate.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* * lib/delegate.rb (Delegator.preserved, DelegateClass.methods): extendusa2008-02-041-3/+5
| | | | | | | | shouldn't be delegated. [ruby-dev:32987], etc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): move instance_eval and instance_exec tomatz2008-01-041-2/+4
| | | | | | | | BasicObject. [ruby-core:14747] * lib/delegate.rb: should preserve new methods in BasicObject. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_public_send): rename invoke_method to public_send.matz2007-12-101-2/+2
| | | | | | it now invokes public method only no matter how it's called. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send): allow send/__send__ to call methods of allmatz2007-11-041-4/+4
| | | | | | | | | | visibility again. we no longer provide __send, __send!. * eval.c (rb_invoke_method): new method to honor private visibility. if it's invoked in a function call style, it calls private methods as well (previous 1.9 send behavior). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_each_byte): caused infinite loop. [ruby-dev:31652]matz2007-08-261-2/+1
| | | | | | | | | | | | | * io.c (rb_io_getc): should return nil at EOF, not EOFError. * lib/delegate.rb (SimpleDelegator::__setobj__): use raise argument to specify backtrace. * test/ruby/test_fnmatch.rb (TestFnmatch::bracket_test): String#include? no longer works for Fixnum. use #chr. [ruby-dev:31652] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_f_send_bang): abandon the name funcall for privatematz2007-08-241-2/+2
| | | | | | aware method call. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb: catch up with class local variable (@_v) spec.ko12007-02-141-8/+8
| | | | | | | | * lib/singleton.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/weakref.rb (WeakRef::__setobj__): should supportmatz2006-12-071-1/+1
| | | | | | | marshaling. [ruby-talk:228508] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (sym_eql): fail early to gain performance.matz2006-09-201-3/+3
| | | | | | | | | | | | | | * string.c (sym_hash): cache hash value in aux.shared if possible. * gc.c (rb_obj_id): no need to treat symbols specially. * lib/fileutils.rb (FileUtils::FileUtils): singleton_methods() no longer return an array of strings, but of symbols. * lib/delegate.rb (DelegateClass): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (Init_eval): rename #invoke_method andmatz2006-07-261-4/+4
| | | | | | | | | | | | | | | #invoke_functional_method to __send and __send! respectively. * eval.c (remove_method): prohibit removing __send and __send!. * eval.c (rb_undef): prohibit undef'ing __send and __send!. * eval.c (rb_eval): prohibit redefining __send and __send!. * lib/delegate.rb (Delegator): preserve __send. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator): should not delegate "funcall".matz2006-02-201-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_mod_define_method): should save safe_level in thematz2005-12-291-82/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proc object. [ruby-dev:28146] * test/drb/drbtest.rb (DRbService::self.ext_service): increase timeout limit. a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>. [ruby-dev:28132] * eval.c (ev_const_get): fixed a bug in constant reference during instance_eval. [yarv-dev:707] * eval.c (ev_const_defined): ditto. * lib/yaml.rb (YAML::add_domain_type): typo fixed. a patch from Joel VanderWerf <vjoel at path.berkeley.edu>. [ruby-talk:165285] [ruby-core:6995] * ext/digest/sha2/sha2.c (ULL): support AIX C. a patch from Kailden <kailden at gmail.com>. [ruby-core:06984] * ext/syck/rubyext.c (rb_syck_compile): avoid potential memory leak. * ext/syck/rubyext.c (syck_set_ivars): avoid potential memory leak by explicit symbol allocation. * lib/delegate.rb (Delegator::method_missing): should delegate block as well. * lib/cgi.rb (CGI::QueryExtension::MorphingBody): fix criteria to use Tempfile. A fix from Zev Blut <rubyzbibd at ubit.com>. [ruby-core:06076] * string.c: remove global functions work on $_. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * range.c (rb_range_beg_len): should return Qfalse for non-rangematz2005-10-051-21/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | object. * pack.c (EXTEND16): [ruby-dev:27383] * eval.c (set_trace_func): add rb_secure(4) to prevent adding tracing function. * lib/delegate.rb: document update from James Edward Gray II <james@grayproductions.net>. [ruby-core:05942] * process.c (proc_daemon): should restrict execution on levels higher than $SAFE=2. suggested by URABE Shyouhei <shyouhei@ice.uec.ac.jp>. * lib/forwardable.rb: replaced by new implementation from <Daniel.Berger@qwest.com>. [ruby-core:05899] * file.c (path_check_0): disallow sticky world writable directory in PATH (and $LOAD_PATH). [ruby-dev:27226] * numeric.c (fix_idiv): 1.div(1.0) should return integer value. [ruby-dev:27235] * lib/yaml.rb: require 'yaml/constants'. [ruby-core:5776] * lib/xmlrpc/client.rb (XMLRPC::Client::do_rpc): add charset information to content-type header.[ruby-core:5127] * lib/xmlrpc/server.rb (CGIServer::serve): ditto. * lib/xmlrpc/server.rb (ModRubyServer::serve): ditto. * lib/xmlrpc/server.rb (WEBrickServlet::service): ditto. * test/dbm/test_dbm.rb (TestDBM::test_s_open_error): remove test_s_open_error test to detect duplicate open. [ruby-dev:27202] * eval.c (splat_value): use to_a to splat non Array object. * object.c (nil_to_a): remove nil.to_a. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * numeric.c (fix_equal, fix_cmp, fix_gt, fix_ge, fix_lt, fix_le):matz2005-08-121-45/+31
| | | | | | | | | | | reduce coercing when a method knows about a operand type. [ruby-dev:26789] * lib/delegate.rb: simplifies Delegator classes; SimpleDelegator now uses method_missing for all methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator::respond_to): respond_to? must checkmatz2005-06-301-0/+9
| | | | | | | destination object. [ruby-talk:146894] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_eval): pre-evaluate argument for unambiguousmatz2005-06-301-0/+8
| | | | | | | | | | | | | | evaluation order. [ruby-dev:26383] * lib/delegate.rb (Delegator::method_missing): forward unknown method to the destination. suggested by <christophe.poucet@gmail.com>. [ruby-talk:146776] * process.c (detach_process_watcher): terminate process watcher thread right after rb_waitpid() succeed. [ruby-talk:146430] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sigexit): call rb_thread_signal_exit() instead ofmatz2005-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_exit(). [ruby-dev:26347] * eval.c (rb_thread_signal_exit): a new function to exit on main thread. * eval.c (rb_thread_switch): exit status should be retrieved from ruby_errinfo. * eval.c (rb_f_exit): ensure exit(0) should call exit(EXIT_SUCCESS). * missing/mkdir.c: remove. [ruby-core:05177] * hash.c (env_aset): do not treat nil as key-removing value. [ruby-list:40865] * parse.y (method_call): allow aref expression ([]) to take a block. * parse.y (block_dup_check): a function to check duplication of a block argument and an actual block. * lib/delegate.rb (SimpleDelegator::__setobj__): need check for recursive delegation. [ruby-core:04940] * lib/cgi.rb: add underscore aliases CGI::escape_html, CGI::unescape_html, CGI::escape_element, CGI::unescape_element. [ruby-core:05058] * misc/ruby-mode.el (ruby-expr-beg): fix looking point drift. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* reverted (commit miss) [ruby-dev:26141]ocean2005-05-121-3/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (break_jump): break should not cross functions.matz2005-05-111-3/+3
| | | | | | | [ruby-list:40818] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (SimpleDelegator::dup): wrong number ofmatz2004-11-101-8/+8
| | | | | | | | | arguments. * lib/delegate.rb (DelegateClass::dup): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_times): Array#* should return an instance ofmatz2004-10-191-3/+11
| | | | | | | | | | | | | | | the class of right operand. [ruby-dev:24526] * ext/zlib/zlib.c (zstream_detach_buffer): should not expose class-less object to Ruby world. [ruby-dev:24530] * eval.c (proc_dup): provide Proc#dup as well. [ruby-talk:116915] * eval.c (ruby_exec): stack marking position may be higher than expected. thanks to Guy Decoux. [ruby-core:03527] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (read_all): block string buffer modification duringmatz2004-10-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_io_fread() by freezing it temporarily. [ruby-dev:24479] * dir.c (rb_push_glob): block call at once the end of method. [ruby-dev:24487] * ext/enumerator/enumerator.c (enum_each_slice): remove rb_gc_force_recycle() to prevent potential SEGV. [ruby-dev:24499] * ext/zlib/zlib.c (zstream_expand_buffer): hide internal string buffer by clearing klass. [ruby-dev:24510] * ext/socket/socket.c (sock_s_getservbyaname): protocol string might be altered. [ruby-dev:24503] * string.c (rb_str_upto): check if return value from succ is a string. [ruby-dev:24504] * io.c (rb_io_popen): get mode string via rb_io_flags_mode() to avoid mode string modification. [ruby-dev:24454] * io.c (rb_io_getline_fast): should take delim as unsigned char to distinguish EOF and '\377'. [ruby-dev:24460] * io.c (rb_io_getline): add check for RS modification. [ruby-dev:24461] * enum.c (enum_sort_by): use qsort() directly instead using rb_iterate(). [ruby-dev:24462] * enum.c (enum_each_with_index): remove rb_gc_force_recycle() to prevent access to recycled object (via continuation for example). [ruby-dev:24463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enum.c (enum_sort_by): do not use qsort directly. usematz2004-09-211-1/+0
| | | | | | | | | | | | | | | | | | | | rb_ary_sort_bang() instead. [ruby-dev:24291] * enum.c (enum_sort_by): pedantic type check added. [ruby-dev:24291] * hash.c (rb_hash_foreach_iter): check iter_lev after each iteration. [ruby-dev:24289] * array.c (rb_ary_and): element size might change during comparison. [ruby-dev:24290] * array.c (rb_ary_or): ditto. [ruby-dev:24292] * array.c (rb_ary_equal): wrong fix. [ruby-dev:24286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (string_content): turn off NODE_NEWLINE flag to avoidmatz2004-05-071-12/+19
| | | | | | | | | | | | | | | | | | | | | | | unnecessary line trace for inlined expression. (ruby-bugs PR#1320) * numeric.c (flo_to_s): tweak output string based to preserve decimal point and to remove trailing zeros. [ruby-talk:97891] * string.c (rb_str_index_m): use unsigned comparison for T_FIXNUM search. [ruby-talk:97342] * hash.c (rb_hash_equal): returns true if two hashes have same set of key-value set. [ruby-talk:97559] * hash.c (rb_hash_eql): returns true if two hashes are equal and have same default values. * string.c (rb_str_equal): always returns true or false, never returns nil. [ruby-dev:23404] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (DelegateClass): define internal methods of thenobu2004-03-311-7/+7
| | | | | | | result class, but not metaclass of the caller. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * exception message clean-up by Ian Macdonald <ian@caliban.org>.matz2004-03-291-0/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * misc/ruby-mode.el: better support for general delimitedmatz2004-01-271-1/+2
| | | | | | | | | | | | | | | | strings. [ruby-dev:22695] * lib/weakref.rb (WeakRef::initialize): set up @__id before calling "super". * lib/delegate.rb (Delegator::initialize): preserve singleton_method_added method [ruby-dev:22685] * lib/delegate.rb (Delegator::initialize): use Kernel::raise instead of mere raise. [ruby-dev:22681] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi.rb (CGI::QueryExtension::Value::[]): should work likematz2003-12-171-5/+8
| | | | | | | | | | | | | | | | | | | | String#[] if more than one arguments are specified. * lib/delegate.rb: avoid using common instance name as "@obj". * lib/cgi.rb (CGI::QueryExtension::Value): Value is no longer subclass of String, but DelegateClass(String). * ext/curses/extconf.rb: restore function check for init_color. [ruby-list:38905] * Makefile.in: need to specify $(MAINLIBS) for the miniruby generation rule. * configure.in: better FreeBSD -lc_r support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_read): should not terminate on empty string; waitmatz2003-12-031-1/+2
| | | | | | | | | | until real EOF. [ruby-dev:21969] * io.c (argf_read): should adjust length to read, when length is specified and read spans command line argument files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (marshal_dump, marshal_load: defined for Marshal.matz2003-08-041-0/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * error.c (syserr_initialize): prohibit specifying errno formatz2003-05-211-1/+1
| | | | | | | | | | | | subclasses of SystemCallError. in addition, if initialize is called for SystenCallError instance, its class be changed. [ruby-dev:20257] * gc.c (run_final): to protect thread context switch, finalizers are wrapped in DEFER_INTS/ENABLE_INTS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3839 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * class.c (rb_class_protected_instance_methods): now givesmatz2003-05-021-4/+4
| | | | | | | | | | warnings to show migration path. * lib/delegate.rb (Delegator::initialize): instance_methods etc. now recurse by default. need to specify false. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update NotImplementError to NotImplementedError.matz2003-03-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * math.c (math_acos): check errno after operation. ditto formatz2002-11-141-4/+4
| | | | | | | | | | | | | | | | | asin, acosh, atanh, log, log10 and sqrt. * eval.c (rb_add_method): initialize should always be private. * parse.y (expr): add rescue modifier rule. * parse.y (command_call): return, break and next with argument is now part of this rule. * parse.y (yylex): "a" in "a /5" should be considered as a local variable. [experimental] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/delegate.rb (Delegator::initialize): use Object#classnobu2002-10-021-2/+2
| | | | | | | instead of deprecated Object#type. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (str_extend): should check nesting parentheses in #{}.matz2001-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * process.c (pst_wstopsig): returns nil unless WIFSTOPPED() is non-zero. * process.c (pst_wtermsig): returns nil unless WIFSIGNALED() is non-zero. * process.c (pst_wexitstatus): returns nil unless WIFEXITED() is non-zero. * eval.c (rb_thread_select): tv_sec and tv_usec should not be negative. * signal.c (posix_signal): do not set SA_RESTART for SIGVTALRM. * parse.y (call_args2): block_arg may follow the first argument in call_args2. * eval.c (stack_check): should avoid stack length check during raising SystemStackError exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * signal.c (sighandle): should not re-register sighandler ifmatz2001-11-131-15/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX_SIGNAL is defined. * eval.c (error_print): errat array may be empty. * eval.c (rb_eval_cmd): should not upgrade safe level unless explicitly specified by argument newly added. * signal.c (sig_trap): should not allow tainted trap closure. * variable.c (rb_f_trace_var): should not allow trace_var on safe level higher than 3. * variable.c (rb_f_trace_var): should not allow tainted trace closure. * gc.c: do not use static stack until system stack overflows. * eval.c (eval): should call Exception#exception instead of calling rb_exc_new3() directly. * error.c (exc_exception): set "mesg" directly to the clone. it might be better to set mesg via some method for flexibility. * variable.c (cvar_override_check): should print original module name, if 'a' is T_ICLASS. * parse.y (yylex): float '1_.0' should not be allowed. * variable.c (var_getter): should care about var as Qfalse (ruby-bugs#PR199). * array.c (cmpint): <=> or block for {min,max} may return bignum. * array.c (sort_1): use rb_compint. * array.c (sort_2): ditto. * enum.c (min_ii): ditto. * enum.c (min_ii): ditto. * enum.c (max_i): ditto. * enum.c (max_ii): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_seek_m): wrong calling sequence of rb_io_seek().matz2001-03-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y (cond0): no special treatment of string literal in condition. * math.c: add acos, asin, atan, conh, sinh, tanh and hypot to Math. * configure.in: check hypot availablility. * missing/hypot.c: public domain rewrite of hypot. * parse.y (warn_unless_e_option): warning condition was wrong. * parse.y (warning_unless_e_option): ditto. * enum.c (enum_all): new method 'all?', which returns true if block returns true for all elements. * enum.c (enum_any): new method 'any?', which returns true if block retruns true for any of elements. * marshal.c (marshal_load): do not give warning unless explicitly set to verbose. * eval.c (rb_exit): give string value "exit" to SystemExit. * ruby.c (proc_options): -v should not print version if proc_options called via moreswitches(). * parse.y (stmt): while/until modifier must work for empty body. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* matzmatz2000-07-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 1.4.0matz1999-08-131-8/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* This commit was generated by cvs2svn to compensate for changes in r372,matz1999-01-201-9/+91
| | | | | | | which included commits to RCS files with non-trunk default branches. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Initial revisionmatz1998-01-161-0/+44
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8 b2dd03c8-39d4-4d8f-98ff-823fe69b080e