mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* hash.c (rb_env_size): Restored documentation for ENV.size
* lib/drb/drb.rb: Documented DRb::DRb#run. * lib/erb.rb (class ERB): Improved documentation of ERb. * transcode.c: Documented Encoding::Converter constants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6048f9a6cf
commit
0051369ba3
5 changed files with 100 additions and 11 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Sat Jan 26 12:54:40 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* hash.c (rb_env_size): Restored documentation for ENV.size
|
||||||
|
|
||||||
|
* lib/drb/drb.rb: Documented DRb::DRb#run.
|
||||||
|
|
||||||
|
* lib/erb.rb (class ERB): Improved documentation of ERb.
|
||||||
|
|
||||||
|
* transcode.c: Documented Encoding::Converter constants.
|
||||||
|
|
||||||
Sat Jan 26 10:09:57 2013 Eric Hodel <drbrain@segment7.net>
|
Sat Jan 26 10:09:57 2013 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* lib/webrick/accesslog.rb: Improved WEBrick documentation.
|
* lib/webrick/accesslog.rb: Improved WEBrick documentation.
|
||||||
|
|
18
hash.c
18
hash.c
|
@ -2566,15 +2566,6 @@ env_keys(void)
|
||||||
return ary;
|
return ary;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* call-seq:
|
|
||||||
* ENV.each_key { |name| } -> Hash
|
|
||||||
* ENV.each_key -> Enumerator
|
|
||||||
*
|
|
||||||
* Yields each environment variable name.
|
|
||||||
*
|
|
||||||
* An Enumerator is returned if no block is given.
|
|
||||||
*/
|
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_env_size(VALUE ehash)
|
rb_env_size(VALUE ehash)
|
||||||
{
|
{
|
||||||
|
@ -2593,6 +2584,15 @@ rb_env_size(VALUE ehash)
|
||||||
return LONG2FIX(cnt);
|
return LONG2FIX(cnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* call-seq:
|
||||||
|
* ENV.each_key { |name| } -> Hash
|
||||||
|
* ENV.each_key -> Enumerator
|
||||||
|
*
|
||||||
|
* Yields each environment variable name.
|
||||||
|
*
|
||||||
|
* An Enumerator is returned if no block is given.
|
||||||
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
env_each_key(VALUE ehash)
|
env_each_key(VALUE ehash)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1453,6 +1453,10 @@ module DRb
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
##
|
||||||
|
# Starts the DRb main loop in a new thread.
|
||||||
|
|
||||||
def run
|
def run
|
||||||
Thread.start do
|
Thread.start do
|
||||||
begin
|
begin
|
||||||
|
|
10
lib/erb.rb
10
lib/erb.rb
|
@ -257,7 +257,7 @@ require "cgi/util"
|
||||||
# Rails, the web application framework, uses ERB to create views.
|
# Rails, the web application framework, uses ERB to create views.
|
||||||
#
|
#
|
||||||
class ERB
|
class ERB
|
||||||
Revision = '$Date:: $' #'
|
Revision = '$Date:: $' # :nodoc: #'
|
||||||
|
|
||||||
# Returns revision information for the erb.rb module.
|
# Returns revision information for the erb.rb module.
|
||||||
def self.version
|
def self.version
|
||||||
|
@ -800,6 +800,9 @@ class ERB
|
||||||
@filename = nil
|
@filename = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Creates a new compiler for ERB. See ERB::Compiler.new for details
|
||||||
|
|
||||||
def make_compiler(trim_mode)
|
def make_compiler(trim_mode)
|
||||||
ERB::Compiler.new(trim_mode)
|
ERB::Compiler.new(trim_mode)
|
||||||
end
|
end
|
||||||
|
@ -847,8 +850,11 @@ class ERB
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
##
|
||||||
|
# Returns a new binding each time *near* TOPLEVEL_BINDING for runs that do
|
||||||
|
# not specify a binding.
|
||||||
|
|
||||||
def new_toplevel
|
def new_toplevel
|
||||||
# New binding each time *near* toplevel for unspecified runs
|
|
||||||
TOPLEVEL_BINDING.dup
|
TOPLEVEL_BINDING.dup
|
||||||
end
|
end
|
||||||
private :new_toplevel
|
private :new_toplevel
|
||||||
|
|
69
transcode.c
69
transcode.c
|
@ -4430,18 +4430,87 @@ Init_transcode(void)
|
||||||
rb_define_method(rb_cEncodingConverter, "replacement=", econv_set_replacement, 1);
|
rb_define_method(rb_cEncodingConverter, "replacement=", econv_set_replacement, 1);
|
||||||
rb_define_method(rb_cEncodingConverter, "==", econv_equal, 1);
|
rb_define_method(rb_cEncodingConverter, "==", econv_equal, 1);
|
||||||
|
|
||||||
|
/* Document-const: INVALID_MASK
|
||||||
|
*
|
||||||
|
* Mask for invalid byte sequences
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "INVALID_MASK", INT2FIX(ECONV_INVALID_MASK));
|
rb_define_const(rb_cEncodingConverter, "INVALID_MASK", INT2FIX(ECONV_INVALID_MASK));
|
||||||
|
|
||||||
|
/* Document-const: INVALID_REPLACE
|
||||||
|
*
|
||||||
|
* Replace invalid byte sequences
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "INVALID_REPLACE", INT2FIX(ECONV_INVALID_REPLACE));
|
rb_define_const(rb_cEncodingConverter, "INVALID_REPLACE", INT2FIX(ECONV_INVALID_REPLACE));
|
||||||
|
|
||||||
|
/* Document-const: UNDEF_MASK
|
||||||
|
*
|
||||||
|
* Mask for a valid character in the source encoding but no related
|
||||||
|
* character(s) in destination encoding.
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "UNDEF_MASK", INT2FIX(ECONV_UNDEF_MASK));
|
rb_define_const(rb_cEncodingConverter, "UNDEF_MASK", INT2FIX(ECONV_UNDEF_MASK));
|
||||||
|
|
||||||
|
/* Document-const: UNDEF_REPLACE
|
||||||
|
*
|
||||||
|
* Replace byte sequences that are undefined in the destination encoding.
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "UNDEF_REPLACE", INT2FIX(ECONV_UNDEF_REPLACE));
|
rb_define_const(rb_cEncodingConverter, "UNDEF_REPLACE", INT2FIX(ECONV_UNDEF_REPLACE));
|
||||||
|
|
||||||
|
/* Document-const: UNDEF_HEX_CHARREF
|
||||||
|
*
|
||||||
|
* Replace byte sequences that are undefined in the destination encoding
|
||||||
|
* with an XML hexadecimal character reference. This is valid for XML
|
||||||
|
* conversion.
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "UNDEF_HEX_CHARREF", INT2FIX(ECONV_UNDEF_HEX_CHARREF));
|
rb_define_const(rb_cEncodingConverter, "UNDEF_HEX_CHARREF", INT2FIX(ECONV_UNDEF_HEX_CHARREF));
|
||||||
|
|
||||||
|
/* Document-const: PARTIAL_INPUT
|
||||||
|
*
|
||||||
|
* Indicates the source may be part of a larger string. See
|
||||||
|
* primitive_convert for an example.
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "PARTIAL_INPUT", INT2FIX(ECONV_PARTIAL_INPUT));
|
rb_define_const(rb_cEncodingConverter, "PARTIAL_INPUT", INT2FIX(ECONV_PARTIAL_INPUT));
|
||||||
|
|
||||||
|
/* Document-const: AFTER_OUTPUT
|
||||||
|
*
|
||||||
|
* Stop converting after some output is complete but before all of the
|
||||||
|
* input was consumed. See primitive_convert for an example.
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "AFTER_OUTPUT", INT2FIX(ECONV_AFTER_OUTPUT));
|
rb_define_const(rb_cEncodingConverter, "AFTER_OUTPUT", INT2FIX(ECONV_AFTER_OUTPUT));
|
||||||
|
|
||||||
|
/* Document-const: UNIVERSAL_NEWLINE_DECORATOR
|
||||||
|
*
|
||||||
|
* Decorator for converting CRLF and CR to LF
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "UNIVERSAL_NEWLINE_DECORATOR", INT2FIX(ECONV_UNIVERSAL_NEWLINE_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "UNIVERSAL_NEWLINE_DECORATOR", INT2FIX(ECONV_UNIVERSAL_NEWLINE_DECORATOR));
|
||||||
|
|
||||||
|
/* Document-const: CRLF_NEWLINE_DECORATOR
|
||||||
|
*
|
||||||
|
* Decorator for converting LF to CRLF
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "CRLF_NEWLINE_DECORATOR", INT2FIX(ECONV_CRLF_NEWLINE_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "CRLF_NEWLINE_DECORATOR", INT2FIX(ECONV_CRLF_NEWLINE_DECORATOR));
|
||||||
|
|
||||||
|
/* Document-const: CR_NEWLINE_DECORATOR
|
||||||
|
*
|
||||||
|
* Decorator for converting LF to CR
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "CR_NEWLINE_DECORATOR", INT2FIX(ECONV_CR_NEWLINE_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "CR_NEWLINE_DECORATOR", INT2FIX(ECONV_CR_NEWLINE_DECORATOR));
|
||||||
|
|
||||||
|
/* Document-const: XML_TEXT_DECORATOR
|
||||||
|
*
|
||||||
|
* Escape as XML CharData
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "XML_TEXT_DECORATOR", INT2FIX(ECONV_XML_TEXT_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "XML_TEXT_DECORATOR", INT2FIX(ECONV_XML_TEXT_DECORATOR));
|
||||||
|
|
||||||
|
/* Document-const: XML_ATTR_CONTENT_DECORATOR
|
||||||
|
*
|
||||||
|
* Escape as XML AttValue
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "XML_ATTR_CONTENT_DECORATOR", INT2FIX(ECONV_XML_ATTR_CONTENT_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "XML_ATTR_CONTENT_DECORATOR", INT2FIX(ECONV_XML_ATTR_CONTENT_DECORATOR));
|
||||||
|
|
||||||
|
/* Document-const: XML_ATTR_QUOTE_DECORATOR
|
||||||
|
*
|
||||||
|
* Escape as XML AttValue
|
||||||
|
*/
|
||||||
rb_define_const(rb_cEncodingConverter, "XML_ATTR_QUOTE_DECORATOR", INT2FIX(ECONV_XML_ATTR_QUOTE_DECORATOR));
|
rb_define_const(rb_cEncodingConverter, "XML_ATTR_QUOTE_DECORATOR", INT2FIX(ECONV_XML_ATTR_QUOTE_DECORATOR));
|
||||||
|
|
||||||
rb_define_method(rb_eUndefinedConversionError, "source_encoding_name", ecerr_source_encoding_name, 0);
|
rb_define_method(rb_eUndefinedConversionError, "source_encoding_name", ecerr_source_encoding_name, 0);
|
||||||
|
|
Loading…
Reference in a new issue