[ruby-cvs:67052] mame:r59874 (trunk): [EXPERIMENTAL] Extend the API of `Coverage.start` and `result`

mame at ruby-lang.org mame at ruby-lang.org
Thu Sep 14 11:36:27 JST 2017

mame	2017-09-14 11:36:26 +0900 (Thu, 14 Sep 2017)

  New Revision: 59874


    [EXPERIMENTAL] Extend the API of `Coverage.start` and `result`
    The old API:
        load "foo.rb"
        p Coverage.result #=> {"foo.rb" => [1, 2, nil]}
    The new API:
        Coverage.start(lines: true)
        load "foo.rb"
        p Coverage.result #=> {"foo.rb" => {:lines => [1, 2, nil]}}
    This new API allows us to add other measuring target types.
    * To keep compatibility, the old interface is still remained; passing no
      optional argument makes `Coverage.result` return the old format.
    * This feature is still experimental.  So, to enable the new API, the
      environment variable `COVERAGE_EXPERIMENTAL_MODE` must be set.  I plan
      to activate this feature by Ruby 2.5.

  Modified files:

More information about the ruby-cvs mailing list