Ruby/RoR News Digest 5 - 11.10

Minitest style guide, why RSpec tests fail algorithms behind RuboCop complexity metrics and much more in this week's Ruby\Rails news digest
11 October 2019   349

Greetings! I hope your week went great! Here's new "gemmy" programming news digest.

In this digest you will be able to check the minitest style guide, learn how to troubleshoot the RSpec test fail and get familiar with algorithms behind Rubocop complexity metrics. Also, there are two videos with tips and tricks and system test creating in Rails

Guides

  • The Minitest Style Guide

Style guide for the popular Ruby testing library

Articles

  • Ruby 2.7 deprecates automatic conversion from a hash to keyword arguments

Ruby 3.0, however, will have ‘real’ keyword arguments separated from the idea of hashes instead of initial Ruby's legacy approach in this field; so the automatic conversion of a supplied hash into keyword arguments will yield a warning in Ruby 2.7.

  • Why RSpec Tests Fail (and How To Fix Them)

Examples of where RSpec tests could fail and thoughts on fixing such issues.

  • Algorithms behind RuboCop complexity metrics

Learn how RuboCop calculates its complexity metrics on code.

Updates

  • Spree

4th major version of the "complete open source ecommerce solution for Ruby on Rails"

  • will_paginate

Update of the pagination library that works with Ruby on Rails, Sinatra, Hanami::View, Merb, DataMapper and Sequel.

  • PunyLinux

Build automation  for a minimal Linux system.

Video

  • Episode #210 - Rails Tips and Tricks

  • How to Write System Tests in Rails

Podcasts

  • 290: Ruby for Good with Polly Schandorf

Brittany Martin, host of the 5by5 Ruby on Rails podcasts talks with Polly Schandorf is an organizer of Ruby for Good, an hackathon-of-sorts about using Ruby to make the world “gooder”

GraalVM 19.0.3 to be Released

Along with a new update, virtual machine implementations for in JS, Python, Ruby and R received updates too
21 November 2019   62

Oracle has published the release of the universal virtual machine GraalVM 19.3.0, which supports running applications in JavaScript (Node.js), Python, Ruby, R, any languages ​​for JVM (Java, Scala, Clojure, Kotlin) and languages ​​for which the bitcode can be generated LLVM (C, C ++, Rust). Branch 19.3 is classified as long-term support (LTS) and is notable for JDK 11 support, including the ability to compile Java code into executable files (GraalVM Native Image). The project code is distributed under the GPLv2 license. At the same time, new versions of GraalVM-based implementations of the Python, JavaScript, Ruby, and R languages ​​— GraalPython, GraalJS, TruffleRuby, and FastR — have been released.

GraalVM provides a JIT compiler that can execute on-the-fly code of any scripting language in the JVM, including JavaScript, Ruby, Python, and R, and also makes it possible to run native code in the JVM, converted to LLVM bitcode. The tools provided by GraalVM include a language-independent debugger, a profiling system, and a memory allocation analyzer. GraalVM makes it possible to create combined applications with components in different languages, allowing you to access objects and arrays from code in other languages. For languages ​​based on the JVM, it is possible to create executable files compiled into machine code that can be executed directly with minimal memory consumption (memory and thread management are implemented through the connection of the Substrate VM framework).

GraalJS changes (full list):

  • Implemented the Promise.allSettled proposal. It is available in ECMAScript 2020 mode (--js.ecmascript-version=2020).
  • Implemented the nullish coalescing proposal. It is available in ECMAScript 2020 mode (--js.ecmascript-version=2020).
  • Updated ICU4J library to version 64.2.

GraalPython changes (full list):

  • Implement gc.{enable,disable,isenabled} as stubs
  • Implement charmap_build function
  • Implement hexversion in sys module

TruffleRuby changes (full list):

  • Compilation of C extensions is now done with an internal LLVM toolchain producing both native code and bitcode. This means more C extensions should compile out of the box and this should resolve most linker-related issues.
  • It is no longer necessary to install LLVM for installing C extensions on TruffleRuby.
  • It is no longer necessary to install libc++ and libc++abi for installing C++ extensions on TruffleRuby.

 And FastR chages (full list):

  • In this release, FastR does not ship with GCC runtime libraries. Use the following commands to install the necessary dependencies:
  • Preview of support for LLVM based execution of R native extensions
  • Fixed memory leaks reported on GitHub