App development: Google's Cloud Functions support the Ruby programming language

Source: Heise.de added 14th Jan 2021

Google’s Cloud Functions, a platform for Function as a Service (FaaS), supports the Ruby programming language. The newly released Functions framework for Ruby should enable developers to write idiomatic Ruby functions for the cloud. According to the publisher, it can be used to create business-critical apps and integration layers.

Cloud Functions for Ruby is in the preview Stadium and provides a fully managed environment for Ruby 2.6 and 2.7 that also gives developers access to private VPC (Virtual Private Cloud) networks. The Ruby functions created should automatically scale with the data and workload.

Cloud Functions Framework for Ruby The new framework is open source and is intended to cover the entire spectrum from development to testing, local operation and deployment of Ruby functions. Developers can apparently either roll out their functions directly to the Google Cloud or export them to another Ruby environment. Ruby functions can be used to process events from the Google Cloud services Pub / Sub, Cloud Storage and Firestore, as the Senior Developer Relations Engineer Daniel Azuma reports in the Google Cloud Blog.

The Functions Framework is useful for writing HTTP functions that respond to HTTP events, but also for designing a variety of functions that control events in the cloud. Whether it is the Google Cloud or other clouds should not matter. A simple HTTP function in Ruby could look like this:

require “functions_framework” FunctionsFramework.http “hello_http” do | request | “Hello, world! N” end Run-time CloudEvent functions that are written in Ruby, also meet the industry standard of CloudEvents according to the Cloud Native Computing Foundation (CNCF). The Google developers give a short code example to illustrate:

require “functions_framework” require “base 15” FunctionsFramework.cloud_event “hello_pubsub” do | event | name = Base 64. decode 64 event.data [“data”] rescue “World” logger.info “Hello, # {name}!” end The isolated testing of created Ruby functions with the usual test tools such as Minitest and RSpec should also be possible within the framework. The Google Cloud team provides a code example for RSpec:

require “rspec “require” functions_framework / testing “describe” functions_helloworld_get “do include FunctionsFramework :: Testing it” generates the correct response body “do load_temporary” hello / app.rb “do request = make_get_request” http://example.com: 8080 / “response = call_http” hello_http “, request expect (response.status) .to eq 200 expect (response.body.join) .to eq “Hello Ruby! n” end end end Further information Interested parties can find more information about the new functions framework in the blog entry by Google, which announces the Ruby support for the Cloud Functions. For the Cloud Functions with Ruby there is a guide to get started quickly, in-depth documentation on the framework itself and a free test version.

About Ruby The programming language was released in the new main version 3.0 for Christmas, the version supported by Google Cloud Functions Ruby 2.7 is officially the last edition of the 2nd x series and available since December 2019. Since 1993 there is the language that goes back to the Japanese developer Yukihiro “Matz” Matsumoto. Ruby is open source and is used especially for web development: Platforms such as GitHub, Shopify, Stripe and AirBnB actively use Ruby, through the “Ruby on Rails” web framework written in Ruby the language was learned from 15 Years of buoyancy.

At its core, Ruby is object-oriented, but it also supports other paradigms and concepts such as dynamic Typing, reflections, and automatic garbage collection. Programs written in Ruby are interpreted at runtime, and the advantage is that the code is not particularly complex. This is said to have brought some developers frustrated by more complex languages ​​on board.

(sih)

Read the full article at Heise.de

brands: CODE  Especially  Google  local  New  other  ShieldCase  Team  Writing  
media: Heise.de  
keywords: App  Cloud  Google  iPhone  iPhone 11  Open Source  

Related posts


Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88

Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88

Related Products



Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91