5
new option to specify warning level. -W0 to shut up warnings, -W1 for normal level,
6
-W2 for verbose level. -w equals to -W2.
10
: arbitrary delimited string array
12
%W(...) notation, word list literal like %w(...) with the
13
exception that #{} interpolation is allowed.
15
: arbitrary delimited symbol literl
17
:"foo", :"foo#{bar}", etc.
19
: expression interpolation in strings
21
Now arbitrary statements are allowed inside #{} interpolation
22
without escapes. In other hand, they can no longer access to
23
variables defined in eval.
25
: negative number literals
27
Digits preceded minus sign is a literal integer.
31
Fixed with the following behavior:
36
Now 1-element array in rhs is expanded properly.
43
Extended to take an optional expression, which is used as a value
46
: direct assignment to Foo::Bar is allowed
48
also, you can define "class Foo::Bar; end".
52
: $stdin, $stdout, $stderr
54
can be assignable again. the original stdio are preserved as STDIN,
57
: $VERBOSE now has 3 levels
59
nil - silence, false - medium (default), true - verbose
61
: allocation framework
63
any instance of class can be allocated by class.allocate,
64
(except for a few classes).
66
: comparison of exception classes in a rescue clause
68
changed to use Module#=== for comparing $! with the exception
69
class specified in each rescue clause.
71
as the previous behavior was to use kind_of?, the effect is limited
72
to the SystemCallError case. SystemCallError.=== has been newly
73
defined to return true when the two have the same errno. With this
74
change, SystemCallError's with the same errno, such as Errno::EAGAIN
75
and Errno::EWOULDBLOCK, can both be rescued by listing just one of
80
improved at the performance of searching by using an internal hash
83
calls const_missing method of the class/module, if constant is not
84
found in the look up path.
86
: expression parenthesis in the first argument
88
altered to get the following code (note the space after p):
100
: implicit comparison in conditional expressions
102
Obsoleted except when it is used in -e.
104
: between Range and $.
105
Use explicit comparison instead.
107
: between Regexp and $_
108
Use the unary method ~/re/ instead.
112
added to get objects which define to_str() treated as String's.
114
now almost all the built-in methods try each argument with to_str()
115
when they expect it to be a String.
124
=> -:7:in `open': wrong argument type Object (expected String) (TypeError)
125
ruby 1.6.4 (2001-04-19) [i586-linux]
126
=> -:7:in `open': No such file or directory - "foo" (Errno::ENOENT)
127
ruby 1.7.0 (2001-05-02) [i586-linux]
129
: multiple assignment behavior
131
Fixed so that "*a = nil" results in "a == []".
133
= changes in core class library
137
Extended so that when the third argument is permission flags it
138
calls open(2) instead of fopen(3).
142
new format specifier "%p" is available.
146
Proc object returns from these methods has the following attributes:
148
* strict argument number check
149
* break and return terminates the proc execution.
153
a method to give warnings.
157
takes optional terminate message argument.
159
: Object#initialize_copy
161
copy constructor for clone and dup.
163
: Object#instance_variable_set, Object#instance_variable_get
167
: Object#singleton_method_removed
168
: Object#singleton_method_undefined
176
: Array#fetch(index [, default])
178
Added. If a default value isn't given, raises index error if index
181
: Array#insert(n, other, ...)
183
Added. [ruby-talk:14289]
185
This is much the same as (({ary[n,0] = [other,...]})) except
189
ary[2, 0] = [4, 5, 6]
193
ary.insert(2, 4, 5, 6)
198
Changed to always return self without checking whether the sequence
199
of the elements was modified or not.
201
Beware that this behavior is not guaranteed to continue in the
202
future. Do not rely on its return value. [ruby-dev:12506]
206
Previously deprecated, now removed. Use Array#collect!.
208
: Array#pack, String#unpack
210
Allows comment in template strings.
212
: Array#pack, String#unpack
214
New templates 'q' and 'Q' for 64bit integer (signed and unsigned respectively).
218
Now takes block to fill initial values. E.g.
220
Array.new(10) { |i| i + 1 }
221
=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
225
Takes block to get the values to fill.
229
Takes block to get the default value.
237
Takes block to resolve key conflict.
239
: Hash#merge and Hash#merge!
241
update hash. Hash#merge! is a synonym of Hash#update.
245
if "sep" argument is a string, regular expression meta characters
246
are escaped internally.
250
chop off NULs at the end of strings.
254
Now accepts optional base argument.
256
"101".to_i(10) => 101
259
"101".to_i(16) => 257
261
A base argument of 0 guesses at the base.
266
"0x101".to_i(0) => 257
268
: String#[regexp, nth]
270
Extended to accepts optional second argument.
272
It tries match between self and REGEXP, then returns the
273
content of the NTH regexp register.
277
Added. This is a case insensitive version of String#<=>.
281
If $/ == "\n", chops off last newlines (any of \n, \r, \r\n).
285
Changed to be always case sensitive.
287
: String#insert(n, other)
291
This is much the same as (({str[n, 0] = other})) except returing
294
: String#lstrip, rstrip, lstrip!, rstrip!
296
Added. These strip only left or right part of a string.
302
: String/Array methods
304
Returns an instance of receivers class.
308
The first argument becomes optional.
316
Added. [ruby-dev:12921]
320
64bit off_t support by Janathan Baker.
325
takes optinal second argument for read buffer.
329
New method to get a raw file descriptor.
337
new method that copies all in-memory parts of a file to disk and
338
waits until the device reports that all parts are on stable storage.
339
Implemented with fsync(2) or equivalent.
343
Made public. Can only associate an IO object with a file number
344
like IO.new and IO.for_fd, but can take a block.
348
Added as a synonym for IO.new.
352
Added. Like IO.readlines, except it returns the entire file as a
353
string. [ruby-talk:9460]
355
: File#fnmatch, File::Constants::FNM_*
357
Added. Refer to the fnmatch(3) manpage for details.
359
Localism is FNM_DOTMATCH which has the opposite meaning of the
360
commonly known FNM_PERIOD, which does not exist in Ruby.
364
# exclude files matching "*.bak" case-insensitively.
365
files.reject! {|fn| File.fnmatch?("*.bak", fn, File::FNM_CASEFOLD) }
374
File mode can be specified by flags like open(2),
375
e.g. File::open(path, File::CREAT|File::WRONLY).
381
: Regexp.last_match(n)
383
Extended to take an optional argument.
395
Extended to take a block.
399
Made to support meta-character escaping by a backslash. Wildcards
400
and spaces may now be escaped using a backslash.
404
Changed to return what the block returns when a block is given, just
405
as File.open does. (It always returned (({nil})) in 1.6 and
410
Changed to warn only when invoked from multiple threads or no block
411
is given. [ruby-dev:13823]
414
Dir.chdir('bar') { # previously warned
421
Returns the new position instead of self.
425
Now accepts optional FNM_* flags via the second argument, whereas
428
Dir.glob("makefile", File::FNM_CASEFOLD) #=> ['Makefile', 'makefile']
432
Method is called when Class is inherited by another class.
436
puts "A inherited by #{by.inspect}"
440
Prints out "A inherited by B"
444
Added. [ruby-dev:13941]
448
Added. This is a hook called after Module#append_feature.
450
: Module#method_removed
451
: Module#method_undefined
455
: Module.new, Class.new
457
Extended to take block.
461
Extended to accept a negative time_t. (Only when the platform
465
=> Thu Jan 01 08:59:59 JST 1970
470
Made to return "UTC" under gmtime. It used to return a platform
471
dependent value, typically "GMT", in 1.6 and prior.
473
: Marshal to use marshal_dump and marshal_load
475
if a dumping object responds to 'marshal_dump', Marshal.dump calls
476
it, and dumps object returned. Marshal.load allocates a new instance
477
using "allocate", then calls its "marshal_load" with dumped data.
478
Marshal format version is now 4.8 (was 4.6 in 1.6.8).
482
Fixed not to dump anonymous classes/modules.
484
Fixed with loading modules.
488
new method to get belonging ThreadGroup.
492
synonym of Thread#exit
496
Optional argument limits maximum time to wait the thread in second.
497
And returns nil if timed out.
499
: ThreagGroup#enclose
501
prohibits thread movement from/to enclosed groups.
503
: Range#step([step=1])
509
SystemCallError's "===" match (used in rescue also) is now based on its errno.
513
Made a subclass of SignalException. (It was a subclass of
514
Exception in 1.6 and prior)
516
: NameError and NoMethodError
518
Moved and now NoMethodError < NameError < StandardError.
522
Added. [ruby-dev:12763]
526
Finally obsoleted. Use NotImplementedError.
528
: SystemCallError.===
530
Added. (See the "Comparison of exception classes in a rescue clause"
531
paragraph above) [ruby-dev:12670]
545
: UnboundMethod is no longer subclass of Method
547
class hierarchy changed.
569
synonym of Kernel#abort, and Kernel#exit respectively.
571
: Process::detach(pid)
573
new method to detach child process. child process will be "wait"ed
578
Moved from Time.times. (Time.times still remains but emits a
587
Added. (({$?})) is now an instance of this class.
589
: Process::UID, Process::GID, Process::Sys,
595
Added. This module has module functions Signal.trap and Signal.list.
597
= changes in bundled libraries
601
cgi[name] returns CGI::QueryExtension::Value that wraps string
602
value, no longer array.
606
timeout "function" wrapped in Timeout module.
608
: TCPServer#accept, UNIXServer#accept, Socket#accept
610
New methods to return an accepted socket fd.
614
lib/date.rb now provides both Date and DateTime.
616
Some methods have been renamed. But the old names are still alive.
618
Some new methods have been added (Date::parse, Date#strftime, etc.).
620
Date#mjd now returns the chronological modified Julian day number.
622
All facilities about tjd have been removed.
626
Updated. New methods and constants for using the mouse, character
627
attributes, colors and key codes have been added.
631
New version of Net::HTTP has introduced seriously incompatible
632
changes. For details, see document embedded in net/http.rb itself.
634
: Socket.pack_sockaddr_in, Socket.unpack_sockaddr_in
636
Added. Utility for direct Socket access.
638
: Socket.pack_sockaddr_un, Socket.unpack_sockaddr_un
640
Added. Utility for direct Socket access.
642
: TCPServer#listen, UNIXServer#listen
649
Extended to take an address and a port number for the local side in
650
optional 3rd and 4th arguments.
652
= newly bundled library
656
variable precision decimal number
660
an interface to the dynamic linker.
664
a helper module for the Enumerable interface.
672
wrapper library of (({iconv})).
680
Racc runtime library in C. (Racc is a parser generator for ruby)
684
Pseudo (({IO})) class from/to (({String})).
688
Fast string scanner library.
696
creates an abbreviation table from a list
700
Ruby scripts benchmarker
702
: lib/cgi/session/pstore
704
cgi/session back-end using pstore
708
reads/writes CSV files.
712
strftime for Date class
716
dRuby or distributed Ruby
720
file utility library.
724
converts an internal iterator to an external iterator
728
generic server used by xmlrpc
732
manipulates IP address.
736
to allow safe Tk, etc.
740
easy-to-use wrapper for net/http and net/ftp
744
command line options utility library
748
handles pathname in OO manner.
752
prettyprinter for Ruby objects
756
implements prettyprint algorithm.
760
library to implement -r "profile"
764
RACC parser generator runtime in Ruby.
768
scan string and retrieve object with format
776
RubyUnit compatible layer for test/unit
780
unit testing framework for Ruby
784
get temporary directory path.
788
topological sorting library.
796
generic internet server kit
804
used like 'ruby -run -e cp -- -p foo bar'. neat, isn't it?
808
win32/registry is registry accessor
812
YAML Ain't Mark-up Language
822
use net/telnet instead.
829
= interpreter implementation
833
faster, but uses more memory for the worst case.
835
: string concatenation
837
faster by avoiding too frequent realloc(3).