Skip to main content

Turbine Ruby Beta Release

· 2 min read
@dianadoherty
Developer

We are excited to announce the Beta release of Turbine Ruby! All users are invited to participate in building new Data Applications using Ruby.

With an upgrade to Meroxa CLI v2.14.0, you can get started by running meroxa apps init my-ruby-app-name --lang ruby --path path/to/my-ruby-app.

For more information on how to get started, view our blog on Developing Turbine data apps with Ruby. For details on on how to update to the latest CLI version, see our CLI guide.

With this new release, you can begin creating more complex Data Applications. Checkout this Application that can write records to multiple destination, where one destination is processed by a function and the other is not.

# frozen_string_literal: true

require "rubygems"
require "bundler/setup"
require "turbine_rb"
require "digest"

class MyApp
def call(app)
database = app.resource(name: "pg")
records = database.records(collection: "users")

processed_records = app.process(records: records, process: Anonymize.new)
database.write(records: processed_records, collection: "users_anonymous")

database.write(records: records, collection: "users_copy")
end
end

class Anonymize < TurbineRb::Process
def call(records:)
records.map { |r| r.set('email', Digest::MD5.hexdigest(r.get("email"))) }
records
end
end

TurbineRb.register(MyApp.new)

Try it out today and let us know what you think :)