* bin/erb (ARGV.switch, ERB::Main#run): allow variables to be set
from the command line. [ruby-core:65772] [Feature #10395]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/erb.rb (ERB#lineno): accessor for line number to eval.
* lib/erb.rb (ERB#location=): setter of file name and line number.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
use hostname= to detect and wrap IPv6 hosts.
Build is accepting URI components and users may not expect
that a host component needs to be wrapped with square brackets
since it's not providing a URI.
Note: initialize with arg_check => true does not wrap IPv6 hosts.
by Joe Rafaniello <jrafanie@redhat.com>
https://github.com/ruby/ruby/pull/765 fix GH-765
* test/uri/test_generic.rb: Add more tests
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rexml/dtd/elementdecl.rb (PATTERN_RE): comment out overridden
constant, and '_' is included in '\w'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Thanks Vit Ondruch for the patch! [ruby-core:65836]
* test/resolv/test_dns.rb: test for patch
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb (Timeout::ExitException.catch): do not freeze the
exception for tag, so that the same object can be passed to the
target fiber without duplication to attach backtrace at raise.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/timeout.rb (Timeout::ExitException#exception): rescue
UncaughtThrowError which is specific for throw, instead of
ArgumentError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
file contains path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
file contains path.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Tomas Hoger <thoger@redhat.com> and patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/tables.rb: commit not to download and
convert Unicode data files every time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
remove useless sort. show_files will sort the result and
another branch, files_in_gem, doesn't sort.
it should be removed for consistency.
* test/rubygems/test_gem_commands_contents_command.rb
(test_execute_default_gem): adjust the sort algorithm with
Gem::Commands::ContentsCommand#show_files, which sort items
as array of [prefix, basename] not strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
notify readability on the read side of the pipe.
write_nonblock() is not usable for pipe on Windows.
(cleanup_shutdown_pipe): Rescue IOError for @shutdown_pipe_w.close.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to avoid race condition.
(cleanup_shutdown_pipe): New private method.
(cleanup_listener): Extracted from shutdown method.
Call this method from start method to avoid race condition.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/securerandom.rb (SecureRandom.gen_random): separate
implementation details and select at the load time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/securerandom.rb: set the script encoding to make a string
literal in SecureRandom::Kernel32.last_error_message single byte
encoding so msg[] works in bytes, since FormatMessage() returns
the size in TCHARs, not in characters.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before cheking `/dev/urandom` because we know windows doesn't have it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* template/unicode_norm_gen.tmpl: expand kompatible_table so that
recursive expansion is not needed at runtime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/normalize.rb (canonical_ordering_one):
use explicit separator, not to depend on $,.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Reduce the initialize method from 2088 to 1332 bytes on 32-bit x86
Measurement obtained using `memsize_of_all', as `memsize_of'
is non-recursive:
a = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence)
RubyVM::InstructionSequence.compile(src)
b = ObjectSpace.memsize_of_all(RubyVM::InstructionSequence)
p(b - a)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rake/cpu_counter.rb (Rake::CpuCounter#count): separate
Etc.nprocessors implementation, and if is is available other
utility methods are never used.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/net/imap.rb (Net::IMAP#fetch): [DOC] Document that
Net::IMAP#fetch will return nil instead of an emtpy array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
reported by Willis Vandevanter <will@silentrobots.com> and
patched by nahi.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
as trivially supported encoding (is always normalized,
and may appear mixed in with UTF-8 or other Unicode
encodings).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rake/cpu_counter.rb (count): prefer Etc.nprocessors, which
is hundreds times faster.
* test/rake/test_rake_cpu_counter.rb: add tests for features, and
remove useless tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
bug that can't parse XML correctly when
Encoding.default_internal is different with XML
encoding. REXML::Source converts XML encoding on read. So IO
should not convert XML encoding.
Based on patch by NAKAMURA Usaku.
[ruby-dev:48686] [Bug #10418]
* test/rexml/test_encoding.rb
(REXMLTests::EncodingTester#test_parse_utf16_with_utf8_default_internal):
Add the for the above case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
update easier and more predictable, and reducing compilation
time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
relevant portion of Unicode standard for Hangul (de)composition
identifiers and algorithm.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/normalize.rb (hangul_decomp_one): use more
descriptive name. leave [SLVT]BASE and [LVTNS]COUNT as they are
vague names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
is not hungarian notation. The variable name sIndex is
directly taken from the relevant part of the Unicode
Standard, where it is written SIndex and stands for
'syllable index'. See pp. 144/145 of
http://www.unicode.org/versions/Unicode7.0.0/ch03.pdf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/normalize.rb (NF_HASH_{D,C,K}): remove
first element by Hash#shift.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/unicode_normalize/normalize.rb (UnicodeNormalize): use self
instead of module name and remove module name if unnecessary.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
catch up the method name change at r48014. [Feature #10084]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48027 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
File name change from lib/unicode_normalize/normalize_tables.rb
to lib/unicode_normalize/tables.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
uri doesn't respond to #to_str. [ruby-core:64453] [Bug #10150]
* test/uri/test_parser.rb: test for above.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
patch is from Andrew Vit. [ruby-core:63215] [Feature #9952]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
assumes it is present, and will refuse all values otherwise.
by Matthew Draper <matthew@trebex.net>
https://github.com/ruby/ruby/pull/718 fix GH-718
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
In addition to being unaffected by _offset_ correction,
CLOCK_MONOTONIC_RAW is also unaffected by _frequency_ correction,
making it unsuitable for measuring real time on systems where the
clock is always running too fast or slow.
CLOCK_MONOTONIC (without _RAW) is the correct clock, as it is unaffected
by _offset_ correction (due to human error or battery replacement), but
still takes _frequency_ correction into account for clocks which
consistently run too fast or slow.
Thanks to Vít Ondruch for reporting the issue on ARM [Bug #10202]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (MakeMakefile#pkg_config): separate -I flags to
$INCFLAGS, which is used by CPP.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (MakeMakefile#pkg_config): append --cflags to also
$CXXFLAGS, as they are often used by C++ compiler.
[ruby-core:54532] [Bug #8315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb (BENCHMARK_CLOCK): Process::CLOCK_MONOTONIC_RAW
is not supported on old linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/benchmark.rb (BENCHMARK_CLOCK): prefer Process::CLOCK_MONOTONIC_RAW
if available to more accurate measure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mathn.rb (Fixnum#**, Bignum#**, Float#**, Rational#**):
remove as these are now built-in. [ruby-core:63973] [Bug #10086]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/uri/common.rb (URI.decode_www_form_component): use negative
look-ahead instead of nested repeat operators, to get rid of
backtrack explosion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/logger.rb (format_datetime): simplify and freeze the default
format so that it can be shared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/logger.rb (format_datetime): use "%6N" to show microsecond.
[Fix GH-704]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rake/backtrace.rb (Rake::Backtrace): exclude mere prefix and
exec_prefix, which match too much.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/rake/backtrace.rb (Rake::Backtrace::SYS_KEYS): only names
end with prefix or libdir, not just include them. libdirname is
not a key of path name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/tempfile.rb: start rdoc parsing inside singleton class
definition to include the document there.
[ruby-core:64157] [Bug #10105]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
handle req['host'] in update_uri.
* lib/net/http/generic_request.rb
(Net::HTTP::GenericRequest#update_uri):
use req['host'] if it is explicitly set. Even if URI is given,
it is already used for the initial value of req['host'].
Therefore overwritten value should be respected. [Bug #10054]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Net::HTTP::GenericRequest#update_uri):
handle scheme, host, and port to reflect connection to @uri.
* lib/net/http.rb (Net::HTTP#begin_transport): move trivial handling
to Net::HTTP::GenericRequest#update_uri.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
decrease object allocation, and ensure always create at least one new
object for return value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/mkmf.rb (have_framework): try without -ObjC option first as
MacPorts GCCs do not support it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
before parsing a uri to avoid invalid characters. Reported by
Evgeniy Serykh.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and will output at least 4 digits as the year. Reported by Yury
Trofimenko [Bug #8941]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
are handled by RFC3986, originall reported by John Feminella.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
"UTF-8" is invalid encoding name in Emacs, use "utf-8" instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e