5 * New syntax and semantics
6 o Block arguments are always local
8 o New semantics for block arguments
9 o Block local variables
11 o Array#nitems was removed (use count {|i| !i.nil?})
12 o Array#choice was removed (use sample)
14 o No longer an Enumerable
16 o "One-char-wide" semantics for String#[] and String#[]= [Ruby2]
21 Incompatible (Trivial)
23 * New syntax and semantics
24 o Method used for splat arguments: #to_splat
25 o defined? and local variables
29 o Class variables behavior
30 o Module#attr is an alias of attr_reader
31 o Module#instance_methods, #private_instance_methods, #public_instance_methods
32 o Extra subclassing check when binding UnboundMethods
34 o Equality of exceptions
37 o Removed Exception#to_str [Ruby2]
39 o Array#[m,n] = nil places nil in the array.
41 o Hash#to_s is equivalent to Hash#inspect
42 o Semantics for Hash#each and Hash#each_pair
45 o Integer(nil) raises TypeError
48 * File and Dir operations
49 o #to_path in File.path, File.chmod, File.lchmod, File.chown, File.lchown, File.utime, File.unlink... [Ruby2]
54 o Kernel#open takes encoding specified
55 o IO#initialize now accepts an IO argument
56 o StringIO#readpartial
58 o Limit input in IO#gets, IO#readline, IO#readlines, IO#each_line, IO#lines, IO.foreach, IO.readlines, StringIO#gets, StringIO#readline, StringIO#each, StringIO#readlines
59 o IO#ungetc, StringIO#ungetc
60 o IO#internal_encoding, IO#external_encoding, IO#set_encoding
61 o IO.pipe takes encoding option
63 o New format in Time#to_s
64 o Timezone information preserved on Marshal.dump/load
65 * Symbols: restriction on literal symbols
67 o If Readline uses libedit, Readline::HISTORY[0] returns the first of the history.
68 * $SAFE and bound methods
77 o Removed Array and Hash #indices, #indexes
78 o libraries: base64, mailread, getopts, parsearg, soap, wsdl
82 * New syntax and semantics
83 o New literal hash syntax
84 o New syntax for lambdas
85 o .() and calling Procs without #call/#[]
86 o Mandatory arguments after optional arguments allowed
87 o Multiple splats allowed
89 o printf-style formatted strings (%)
90 o Newlines allowed before ternary colon
94 o Kernel#instance_variable_defined?
95 o Kernel#define_singleton_method
96 o Kernel#singleton_methods, Kernel#methods
98 o Module#const_defined?, #const_get and #method_defined?
99 o Module#class_variable_defined?
100 o #class_variable_{set,get}
101 o Class of singleton classes
104 o Arity of blocks without arguments
105 o proc is now a synonym of Proc.new
108 o Passing blocks to #[]
110 * Enumerable and Enumerator
111 o Enumerable#map,collect_all called without a block returns
113 * Regexp#match, String#match
114 o Regexp#match, String#match
115 * Fiber: coroutines/micro-threads
117 o Array#delete returns a deleted element rather than a given
119 o Array#to_s is equivalent to Array#inspect
122 o preserving item insertion order
123 o Hash#_compare_by_identity and Hash#compare_by_identity?
126 o Numeric#upto, #downto, #times, #step
127 o Numeric#scalar?, Complex#scalar?
133 o Range#min, Range#max
135 o Regexp#=== matches symbols
141 o String#force_encoding
142 o String#unpack with a block
145 o String.encoding, String#force_encoding, String#encode
147 o Zero-length symbols allowed
148 o Symbol#=== matches strings
151 o Symbol methods similar to those in String
153 o Math#log and Math#log2
154 * File and Dir operations
159 o Readline.vi_editing_mode?
160 o Readline.emacs_editing_mode?
161 o Readline.HISTORY::clear
165 o ObjectSpace.count_objects
166 o Method#hash, Proc#hash
171 * Object Compaction - Object, Array, String, Hash, Struct, Class, Module
172 * st_table compaction (inlining small tables)