"Fossies" - the Fresh Open Source Software Archive

Member "ruby-2.6.5/doc/NEWS-2.0.0" (1 Oct 2019, 18450 Bytes) of package /linux/misc/ruby-2.6.5.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # -*- rdoc -*-
    2 
    3 = NEWS for Ruby 2.0.0
    4 
    5 This document is a list of user visible feature changes made between
    6 releases except for bug fixes.
    7 
    8 Note that each entry is kept so brief that no reason behind or
    9 reference information is supplied with.  For a full list of changes
   10 with all sufficient information, see the ChangeLog file.
   11 
   12 == Changes since the 1.9.3 release
   13 
   14 === Language changes
   15 
   16 * Added keyword arguments.
   17 
   18 * Added %i and %I for symbol list creation (similar to %w and %W).
   19 
   20 * Default source encoding is changed to UTF-8. (was US-ASCII)
   21 
   22 * No warning for unused variables starting with '_'
   23 
   24 === Core classes updates (outstanding ones only)
   25 
   26 * ARGF
   27   * added method:
   28     * added ARGF#codepoints and ARGF#each_codepoint, like the corresponding
   29       methods for IO.
   30 
   31 * Array
   32   * added method:
   33     * added Array#bsearch for binary search.
   34   * incompatible changes:
   35     * random parameter of Array#shuffle! and Array#sample now
   36       will be called with one argument, maximum value.
   37     * when given Range arguments, Array#values_at now returns nil for each
   38       value that is out-of-range.
   39 
   40 * Enumerable
   41   * added method:
   42     * added Enumerable#lazy method for lazy enumeration.
   43 
   44 * Enumerator
   45   * added method:
   46     * added Enumerator#size for lazy size evaluation.
   47   * extended method:
   48     * Enumerator.new accept an argument for lazy size evaluation.
   49   * new class Enumerator::Lazy for lazy enumeration
   50 
   51 * ENV
   52   * aliased method:
   53     * ENV.to_h is a new alias for ENV.to_hash
   54 
   55 * Fiber
   56   * incompatible changes:
   57     * Fiber#resume cannot resume a fiber which invokes "Fiber#transfer".
   58 
   59 * File
   60   * extended method:
   61     * File.fnmatch? now expands braces in the pattern if
   62       File::FNM_EXTGLOB option is given.
   63 
   64 * GC
   65   * improvements:
   66     * introduced the bitmap marking which suppresses to copy a memory page
   67       with Copy-on-Write.
   68     * introduced the non-recursive marking which avoids unexpected stack overflow.
   69 
   70 * GC::Profiler
   71   * added method:
   72     * added GC::Profiler.raw_data which returns raw profile data for GC.
   73 
   74 * Hash
   75   * added method:
   76     * added Hash#to_h as explicit conversion method, like Array#to_a.
   77   * extended method:
   78     * Hash#default_proc= can be passed nil to clear the default proc.
   79 
   80 * IO
   81   * deprecated methods:
   82     * IO#lines, #bytes, #chars and #codepoints are deprecated.
   83 
   84 * Kernel
   85   * added method:
   86     * added Kernel#Hash conversion method like Array() or Float().
   87     * added Kernel#__dir__ which returns the absolute path of the
   88       directory of the file from which this method is called.
   89     * added Kernel#caller_locations which returns an array of
   90       frame information objects.
   91   * extended method:
   92     * Kernel#warn accepts multiple args in like puts.
   93     * Kernel#caller accepts second optional argument `n' which specify
   94       required caller size.
   95     * Kernel#to_enum and enum_for accept a block for lazy size evaluation.
   96   * incompatible changes:
   97     * system() and exec() close non-standard file descriptors
   98       (The default of :close_others option is changed to true by default.)
   99     * respond_to? against a protected method now returns false unless
  100       the second argument is true.
  101     * __callee__ has returned to the original behavior, and now
  102       returns the called name but not the original name in an
  103       aliased method.
  104     * Kernel#inspect does not call #to_s anymore
  105       (it used to call redefined #to_s).
  106 
  107 * LoadError
  108   * added method:
  109     * added LoadError#path method to return the file name that could not be
  110       loaded.
  111 
  112 * Module
  113   * added method:
  114     * added Module#prepend which is similar to Module#include,
  115       however a method in the prepended module overrides the
  116       corresponding method in the prepending module.
  117     * added Module.prepended and Module.prepend_features, similar
  118       to included and append_features.
  119     * added Module#refine, which extends a class or module locally.
  120       [experimental]
  121   * extended method:
  122     * Module#define_method accepts a UnboundMethod from a Module.
  123     * Module#const_get accepts a qualified constant string, e.g.
  124       Object.const_get("Foo::Bar::Baz")
  125 
  126 * Mutex
  127   * added method:
  128     * added Mutex#owned? which returns the mutex is held by current
  129       thread or not. [experimental]
  130   * incompatible changes:
  131     * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize
  132       and Mutex#sleep are no longer allowed to be used from trap handler
  133       and raise a ThreadError in such case.
  134     * Mutex#sleep may spurious wakeup. Check after wakeup.
  135 
  136 * NilClass
  137   * added method:
  138     * added nil.to_h which returns {}
  139 
  140 * ObjectSpace::WeakMap
  141   * new low level class to hold weak references to objects.
  142 
  143 * Proc
  144   * incompatible change:
  145     * removed Proc#== and #eql? so two procs are == only when they are
  146       the same object.
  147 
  148 * Process
  149   * added method:
  150     * added getsid for getting session id (unix only).
  151 
  152 * Range
  153   * added method:
  154     * added Range#size for lazy size evaluation.
  155     * added Range#bsearch for binary search.
  156 
  157 * RubyVM (MRI specific)
  158   * added RubyVM::InstructionSequence.of to get the instruction sequence
  159     from a method or a block.
  160   * added RubyVM::InstructionSequence#path, #absolute_path, #label,
  161     #base_label and #first_lineno to retrieve information from where
  162     the instruction sequence was defined.
  163   * added Environment variables to specify stack usage:
  164     * RUBY_THREAD_VM_STACK_SIZE: vm stack size used at thread creation.
  165       default: 128KB (32bit CPU) or 256KB (64bit CPU).
  166     * RUBY_THREAD_MACHINE_STACK_SIZE: machine stack size used at thread
  167       creation. default: 512KB or 1024KB.
  168     * RUBY_FIBER_VM_STACK_SIZE: vm stack size used at fiber creation.
  169       default: 64KB or 128KB.
  170     * RUBY_FIBER_MACHINE_STACK_SIZE: machine stack size used at fiber
  171       creation. default: 256KB or 512KB.
  172     These variables are checked only at launched time.
  173   * added constant DEFAULT_PARAMS to get above default parameters.
  174 
  175 * Signal
  176   * added method:
  177     * added Signal.signame which returns signal name
  178 
  179   * incompatible changes:
  180     * Signal.trap raises ArgumentError when :SEGV, :BUS, :ILL, :FPE, :VTALRM
  181       are specified.
  182 
  183 * String
  184   * added method:
  185     * added String#b returning a copied string whose encoding is ASCII-8BIT.
  186   * change return value:
  187     * String#lines now returns an array instead of an enumerator.
  188     * String#chars now returns an array instead of an enumerator.
  189     * String#codepoints now returns an array instead of an enumerator.
  190     * String#bytes now returns an array instead of an enumerator.
  191 
  192 * Struct
  193   * added method:
  194     * added Struct#to_h returning values with keys corresponding to the
  195       instance variable names.
  196 
  197 * Thread
  198   * added method:
  199     * added Thread#thread_variable_get for getting thread local variables
  200       (these are different than Fiber local variables).
  201     * added Thread#thread_variable_set for setting thread local variables.
  202     * added Thread#thread_variables for getting a list of the thread local
  203       variable keys.
  204     * added Thread#thread_variable? for testing to see if a particular thread
  205       variable has been set.
  206     * added Thread.handle_interrupt as well as instance and singleton methods
  207       pending_interrupt? for asynchronous handling of exceptions
  208     * added Thread#backtrace_locations which returns similar information of
  209       Kernel#caller_locations.
  210   * new class Thread::Backtrace::Location to hold backtrace location
  211     information. These are returned by Thread#backtrace_locations and
  212     Kernel#caller_locations.
  213   * incompatible changes:
  214     * Thread#join and Thread#value now raises a ThreadError if target thread
  215       is the current or main thread.
  216 
  217 * Time
  218   * change return value:
  219     * Time#to_s now returns US-ASCII encoding instead of BINARY.
  220 
  221 * TracePoint
  222   * new class. This class is replacement of set_trace_func.
  223     Easy to use and efficient implementation.
  224 
  225 * toplevel
  226   * added method:
  227     * added main.define_method which defines a global function.
  228     * added main.using, which imports refinements into the current file or
  229       eval string. [experimental]
  230 
  231 === Core classes compatibility issues (excluding feature bug fixes)
  232 
  233 * Array#values_at
  234 
  235   See above.
  236 
  237 * String#lines
  238 * String#chars
  239 * String#codepoints
  240 * String#bytes
  241 
  242   These methods no longer return an Enumerator, although passing a
  243   block is still supported for backwards compatibility.
  244 
  245   Code like str.lines.with_index(1) { |line, lineno| ... } no longer
  246   works because str.lines returns an array.  Replace lines with
  247   each_line in such cases.
  248 
  249 * IO#lines
  250 * IO#chars
  251 * IO#codepoints
  252 * IO#bytes
  253 * ARGF#lines
  254 * ARGF#chars
  255 * ARGF#bytes
  256 * StringIO#lines
  257 * StringIO#chars
  258 * StringIO#codepoints
  259 * StringIO#bytes
  260 * Zlib::GzipReader#lines
  261 * Zlib::GzipReader#bytes
  262 
  263   These methods are deprecated in favor of each_line, each_byte,
  264   each_char and each_codepoint.
  265 
  266 * Proc#==
  267 * Proc#eql?
  268 
  269   These methods were removed. Two procs are == only when they are
  270   the same object.
  271 
  272 * Fixnum
  273 * Bignum
  274 * Float
  275 
  276   Fixnums, Bignums and Floats are frozen.
  277 
  278 * Signal.trap
  279 
  280   See above.
  281 
  282 * Merge Onigmo.
  283   https://github.com/k-takata/Onigmo
  284 
  285 * The :close_others option is true by default for system() and exec().
  286   Also, the close-on-exec flag is set by default for all new file descriptors.
  287   This means file descriptors doesn't inherit to spawned process unless
  288   explicitly requested such as system(..., fd=>fd).
  289 
  290 * Kernel#respond_to? against a protected method now returns false
  291   unless the second argument is true.
  292 
  293 * Kernel#respond_to_missing?
  294 * Kernel#initialize_clone
  295 * Kernel#initialize_dup
  296 
  297   These methods are now private.
  298 
  299 * Thread#join, Thread#value
  300 
  301   See above.
  302 
  303 * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep
  304 
  305   See above.
  306 
  307 === Stdlib updates (outstanding ones only)
  308 
  309 * cgi
  310   * Add HTML5 tag maker.
  311   * CGI#header has been renamed to CGI#http_header and
  312     aliased to CGI#header.
  313   * When HTML5 tagmaker called, overwrite CGI#header,
  314     CGI#header function is to create a <header> element.
  315 
  316 * CSV
  317   * Removed CSV::dump and CSV::load to protect users from dangerous
  318     serialization vulnerability
  319 
  320 * iconv
  321   * Iconv has been removed. Use String#encode instead.
  322 
  323 * io/console
  324   * new methods:
  325     * added IO#cooked which sets the terminal to cooked mode within the given block.
  326     * added IO#cooked! which sets the terminal to cooked.
  327   * extended method:
  328     * IO#raw, IO#raw!, and IO#getch accept keyword arguments, :min and :time.
  329 
  330 * io/wait
  331   * new features:
  332     * added IO#wait_writable method.
  333     * added IO#wait_readable method as alias of IO#wait.
  334 
  335 * json
  336   * updated to 1.7.7.
  337 
  338 * net/http
  339   * new features:
  340     * Proxies are now automatically detected from the http_proxy environment
  341       variable.  See Net::HTTP::new for details.
  342     * gzip and deflate compression are now requested for all requests by
  343       default.  See Net::HTTP for details.
  344     * SSL sessions are now reused across connections for a single instance.
  345       This speeds up connection by using a previously negotiated session.
  346     * Requests may be created from a URI which sets the request_uri and host
  347       header of the request (but does not change the host connected to).
  348     * Responses contain the URI requested which allows easier implementation of
  349       redirect following.
  350   * new methods:
  351     * Net::HTTP#local_host
  352     * Net::HTTP#local_host=
  353     * Net::HTTP#local_port
  354     * Net::HTTP#local_port=
  355   * extended method:
  356     * Net::HTTP#connect uses local_host and local_port if specified.
  357 
  358 * net/imap
  359   * new methods:
  360     * Net::IMAP.default_port
  361     * Net::IMAP.default_imap_port
  362     * Net::IMAP.default_tls_port
  363     * Net::IMAP.default_ssl_port
  364     * Net::IMAP.default_imaps_port
  365 
  366 * objspace
  367   * new method:
  368     * ObjectSpace.reachable_objects_from(obj)
  369 
  370 * openssl
  371   * Consistently raise an error when trying to encode nil values. All instances
  372     of OpenSSL::ASN1::Primitive now raise TypeError when calling to_der on an
  373     instance whose value is nil. All instances of OpenSSL::ASN1::Constructive
  374     raise NoMethodError in the same case. Constructing such values is still
  375     permitted.
  376   * TLS 1.1 & 1.2 support by setting OpenSSL::SSL::SSLContext#ssl_version to
  377     :TLSv1_2, :TLSv1_2_server, :TLSv1_2_client or :TLSv1_1, :TLSv1_1_server
  378     :TLSv1_1_client. The version being effectively used can be queried
  379     with OpenSSL::SSL#ssl_version. Furthermore, it is also possible to
  380     blacklist the new TLS versions with OpenSSL::SSL:OP_NO_TLSv1_1 and
  381     OpenSSL::SSL::OP_NO_TLSv1_2.
  382   * Added OpenSSL::SSL::SSLContext#renegotiation_cb. A user-defined callback
  383     may be set which gets called whenever a new handshake is negotiated. This
  384     also allows to programmatically decline (client) renegotiation attempts.
  385   * Support for "0/n" splitting of records as BEAST mitigation via
  386     OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
  387   * The default options for OpenSSL::SSL::SSLContext have changed to
  388     OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
  389     instead of OpenSSL::SSL::OP_ALL only. This enables the countermeasure for
  390     the BEAST attack by default.
  391   * OpenSSL requires passwords for decrypting PEM-encoded files to be at least
  392     four characters long. This led to awkward situations where an export with
  393     a password with fewer than four characters was possible, but accessing the
  394     file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA and
  395     OpenSSL::PKey::EC therefore now enforce the same check when exporting a
  396     private key to PEM with a password - it has to be at least four characters
  397     long.
  398   * SSL/TLS support for the Next Protocol Negotiation extension. Supported
  399     with OpenSSL 1.0.1 and higher.
  400   * OpenSSL::OPENSSL_FIPS allows client applications to detect whether OpenSSL
  401     is FIPS-enabled. OpenSSL.fips_mode= allows turning on and off FIPS mode
  402     manually in order to adapt to situations where FIPS mode would be an
  403     explicit requirement.
  404   * Authenticated Encryption with Associated Data (AEAD) is supported via
  405     Cipher#auth_data= and Cipher#auth_tag/Cipher#auth_tag=.
  406     Currently (OpenSSL 1.0.1c), only GCM mode is supported.
  407 
  408 * ostruct
  409   * new methods:
  410     * OpenStruct#[], []=
  411     * OpenStruct#each_pair
  412     * OpenStruct#eql?
  413     * OpenStruct#hash
  414     * OpenStruct#to_h converts the struct to a hash.
  415   * extended method:
  416     * OpenStruct.new also accepts an OpenStruct / Struct.
  417 
  418 * pathname
  419   * extended method:
  420     * Pathname#find returns an enumerator if no block is given.
  421 
  422 * rake
  423   * rake has been updated to version 0.9.5.
  424 
  425     This version is backwards-compatible with previous rake versions and
  426     contains many bug fixes.
  427 
  428     See
  429     http://rake.rubyforge.org/doc/release_notes/rake-0_9_5_rdoc.html for a list
  430     of changes in rake 0.9.3, 0.9.4 and 0.9.5.
  431 
  432 * RDoc
  433   * RDoc has been updated to version 4.0
  434 
  435     This version is largely backwards-compatible with previous rdoc versions.
  436     The most notable change is an update to the ri data format (ri data must
  437     be regenerated for gems shared across rdoc versions).  Further API changes
  438     are internal and won't affect most users.
  439 
  440     Notable changes include:
  441 
  442     * Page support for ri.  Try `ri ruby:` for a list of pages in ruby or
  443       `ri ruby:syntax/literals` for the syntax documentation for literals.
  444 
  445       This also works for gems such as `ri rspec:README` for the rspec gem's
  446       README file.
  447     * Markdown support.  See ri RDoc::Markdown for details.
  448 
  449     See https://github.com/rdoc/rdoc/blob/master/History.rdoc for a full list
  450     of changes in rdoc 4.0.
  451 
  452 * resolv
  453   * new methods:
  454     * Resolv::DNS#timeouts=
  455     * Resolv::DNS::Config#timeouts=
  456 
  457 * rexml
  458   * REXML::Document#write supports Hash arguments.
  459   * REXML::Document#write supports new :encoding option. It changes
  460     XML document encoding. Without :encoding option, encoding in
  461     XML declaration is used for XML document encoding.
  462 
  463 * RubyGems
  464   * Updated to 2.0.0
  465 
  466     RubyGems 2.0.0 features the following improvements:
  467 
  468     * Improved support for default gems shipping with ruby 2.0.0+
  469     * A gem can have arbitrary metadata through Gem::Specification#metadata
  470     * `gem search` now defaults to --remote and is anchored like gem list.
  471     * Added --document to replace --rdoc and --ri.  Use --no-document to
  472       disable documentation, --document=rdoc to only generate rdoc.
  473     * Only ri-format documentation is generated by default.
  474     * `gem server` uses RDoc::Servlet from RDoc 4.0 to generate HTML
  475       documentation.
  476 
  477     For an expanded list of updates and bug fixes see:
  478     https://github.com/rubygems/rubygems/blob/master/History.txt
  479 
  480 * shellwords
  481   * Shellwords#shellescape now stringifies the given object using to_s.
  482   * Shellwords#shelljoin accepts non-string objects in the given
  483     array, each of which is stringified using to_s.
  484 
  485 * stringio
  486   * deprecated methods:
  487     * StringIO#lines, #bytes, #chars and #codepoints are deprecated.
  488 
  489 * syslog
  490   * Added Syslog::Logger which provides a Logger API atop Syslog.
  491   * Syslog::Priority, Syslog::Level, Syslog::Option and Syslog::Macros
  492     are introduced for easy detection of available constants on a
  493     running system.
  494 
  495 * tmpdir
  496   * incompatible changes:
  497     * Dir.mktmpdir uses FileUtils.remove_entry instead of
  498       FileUtils.remove_entry_secure.  This means that applications should not
  499       change the permission of the created temporary directory to make
  500       writable from other users.
  501 
  502 * yaml
  503   * Syck has been removed.  YAML now completely depends on libyaml being
  504     installed.
  505   * libyaml is now bundled with ruby, for cases where the library is not
  506     installed locally.
  507 
  508 * zlib
  509   * Added streaming support for Zlib::Inflate and Zlib::Deflate.  This allows
  510     processing of a stream without the use of large amounts of memory.
  511   * Added support for the new deflate strategies Zlib::RLE and Zlib::FIXED.
  512   * Zlib streams are now processed without the GVL.  This allows gzip, zlib and
  513     deflate streams to be processed in parallel.
  514   * deprecated methods:
  515     * Zlib::GzipReader#lines and #bytes are deprecated.
  516 
  517 === Stdlib compatibility issues (excluding feature bug fixes)
  518 
  519 * OpenStruct new methods can conflict with custom attributes named
  520   "each_pair", "eql?", "hash" or "to_h".
  521 
  522 * Dir.mktmpdir in lib/tmpdir.rb
  523 
  524   See above.
  525 
  526 === C API updates
  527 
  528 * NUM2SHORT() and NUM2USHORT() added. They are similar to NUM2INT, but short.
  529 
  530 * rb_newobj_of() and NEWOBJ_OF() added. They create a new object of a given class.