mruby 1.3.0
mruby 1.3.0 is released. Download mruby 1.3.0 now.
mruby 1.3.0 by the numbers
- 1,175 commits
- 248 issues fixed
- 262 pull requests merged
- 14 contributors
- 221 changed files
- 12,760 additions(+)
- 3,734 deletions(-)
What’s new in mruby 1.3.0
The safe navigation operator (&.
)
mruby 1.3 now supports the safe navigation operator (&.
) to help handle nil
value returned from methods. This feature comes from Ruby 2.3.
By using the safe navigation operator, you can simply write
1
account&.owner&.address
Instead of writing
1
account && account.owner && account.owner.address
Or (with ActiveSupport)
1
account.try(:owner).try(:address)
Array#dig
, Hash#dig
#dig
is a method to retrieve a value from JSON-like nested Array/Hash structures.
This feature also comes from Ruby 2.3.
For example:
1
params.dig(:account, :owner, :address)
Instead of
1
2
3
account = params[:account]
owner = account[:owner]
owner[:address]
Object#freeze
You can now “freeze” an object by using Object#freeze.
Frozen objects cannot be modified.
Kernel#caller
You can retrieve call frame information by using Kernel#caller
.
Remaining Bugs
After the code-freeze of 1.3 release, following issues are filed and fixed in the master branch.
The following issues are not yet fixed as of 2017-07-04.