---
title: "Client-side Ruby with WebAssembly"
publication: "Ruby Weekly"
issue: 589
published_at: "2022-02-03"
canonical_url: "https://rubyweekly.com/issues/589"
---

Plus Bundler's new locking behavior, and fixing dependency problems at scale at Shopify. |        

#​589 — February 3, 2022 

[Read on the Web](https://rubyweekly.com/issues/589)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/xyzco5dkb9rf2lgksl7w.jpg)](https://github.com/Shopify/rfcs/blob/new-signing-mechanism/text/0000-introduce-a-new-signing-mechanism.md)  

🔒 [A Proposal for a New Ruby Gem Signing Mechanism](https://github.com/Shopify/rfcs/blob/new-signing-mechanism/text/0000-introduce-a-new-signing-mechanism.md) — A proposal has been made for a new way for signing gems since the currently available approach is ‘unwieldy and little-used’. The aim is to make the signing and verification of gems an ‘everyday experience’ to improve security and reliability for all Rubyists. The [resulting discussion is here](https://github.com/rubygems/rfcs/pull/37) if you want to have your say. 

Roch Lefebvre et al.   

['How I Got Ruby Snippets to Run Browser Side in Less Than a Day'](https://dev.to/taybenlor/how-i-got-ruby-snippets-to-run-client-side-in-less-than-a-day-4pbk) — Just two weeks ago we mentioned the [proposal to merge WebAssembly support](https://bugs.ruby-lang.org/issues/18462) into CRuby, and someone has already taken advantage of it. There’s a live demo too! 

Ben Taylor   [![\](https://copm.s3.amazonaws.com/e6605652.png)](https://buttercms.com/ruby-cms/?utm_source=rubyweekly&utm_medium=email&utm_campaign=code) 

[ButterCMS Melts into Your Ruby App: `$ ButterCMS::Post.list()`](https://buttercms.com/ruby-cms/?utm_source=rubyweekly&utm_medium=email&utm_campaign=code) — ButterCMS is your content backend. Enable your marketing team to update website + app content without needing you. Try the #1 rated Headless CMS for Ruby today. Free for 30 days. 

ButterCMS sponsor   

[How Shopify Fixed the Dependency Confusion Vulnerability in 600+ Ruby Apps](https://shopify.engineering/fixing-dependency-confusion-ruby-applications) — The story of how Shopify (big enough to have its own specialized ‘Ruby Conventions team’!) solved a dependency confusion vulnerability in over 600 Ruby applications and created tooling to make their work easier. 

Frederik Dudzik (Shopify)   

[Code Scanning and Ruby: Turning Source Code into a Queryable Database](https://github.blog/2022-02-01-code-scanning-and-ruby-turning-source-code-into-a-queryable-database/) — Github’s CodeQL engine scans code and creates a database schema that can be used to look for vulnerabilities, among other things. They recently added support for Ruby, which you can use on your own repos, too. 

Nick Rolfe (GitHub)   

**IN BRIEF:** 

- As of Bundler 2.3, [Bundler will 'lock' its version](https://bundler.io/blog/2022/01/23/bundler-v2-3.html) to the one in your `Gemfile.lock`.
- [Gosu](https://www.libgosu.org/), a popular 2D game development library for Ruby, is having [a game jam](https://itch.io/jam/gosu-game-jam-2) in two weeks, if you want to take part.
- [The early access program](https://blog.jetbrains.com/ruby/2022/01/rubymine-2022-1-eap-is-open/) for the next version of RubyMine (a commercial Ruby IDE) is now open.     

Jobs  

[Ruby/Rails Developer (Remote Friendly) in Beautiful Norway](https://startupmatcher.com/job/rubynor-as/ruby-on-rails-developer) — We build startups and do GOOD tech. A digital democracy startup, a renewable energy startup, a green airport taxi startup. Join us <3 
Rubynor   

[Senior Rails Developer @ Wherefour (100% Remote)](https://wherefour.com/careers-developer/) — Curious how stuff gets made? Come build great software that makes great products. 
Wherefour   

[Find Ruby Jobs Through Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-rubyweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired    

📕 Articles & Tutorials  

▶[Inline Editing with Turbo Frames in Rails](https://gorails.com/episodes/inline-editing-turbo-frames) — A 20-minute screencast demonstrating using Hotwire and Turbo Frames to implement inline editing in Rails apps. 

Go Rails   

[Solving Wordle in Ruby](https://kddnewton.com/2022/01/29/solving-wordle-in-ruby.html) — Not tired of [Wordle](https://www.powerlanguage.co.uk/wordle/) yet? Dazzle your friends with your Ruby-assisted Wordle superiority. 

Kevin Newton   

[Dynamic User Content in Rails with Liquid Tags](https://boringrails.com/tips/rails-liquid-dynamic-user-content) — Liquid is a simple and secure template engine, with some advanced features, that is used by Shopify so it’s certainly worth a look. 

Matt Swanson   

[JetBrains RubyMine 2022.1 Early Access Program is Open](https://blog.jetbrains.com/ruby/2022/01/rubymine-2022-1-eap-is-open/?utm_source=cooperpress&utm_medium=cpc&utm_campaign=rubyweekly_feb) — Support for new language features in Ruby 3.1, new inspections, UX improvements, and more. 

JetBrains sponsor   

[How to Safely Change the Argument Signature of a Sidekiq Job](https://keygen.sh/blog/how-to-change-the-signature-of-a-sidekiq-job/) — If you’re getting warnings as of Sidekiq 6.4, you’ll want to know this. 

Zeke Gabrielse   

[Rails 7's Automatic `inverse_of` Detection for Associations with Scopes](https://blog.saeloun.com/2022/02/01/rails-7-inverse-of-automatic-inference.html) — A potentially handy feature that _isn’t_ enabled by default in Rails 7. 

Swaathi Kakarla   

[Securing AWS S3 Assets with Cross-Account Backups](https://pawelurbanek.com/s3-secondary-backup) — If you’re using S3 to store your app’s assets, Paweł’s advice could save you some headaches one day. 

Paweł Urbanek  

🛠 Code & Tools 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/ibuhruar9w5sqmtrcjhu.jpg)](https://github.com/Inversion-des/paralines)   

[Paralines: Nicer Output to Console/File from Concurrent Threads](https://github.com/Inversion-des/paralines) — If you’ve got several threads running tasks and you want live output from each without said output tripping over the output from other threads, check out this new solution. 

Yuriy Babak   

[MiniSql: A Minimal, Safe SQL Executor for Postgres and SQLite](https://github.com/discourse/mini_sql) — Basically makes things nicer if you’re using `pg` or SQLite. If you get tangled up in the mildly crufty native APIs for those, this could help ease things a bit. 

Discourse   

[Spend Less Time Debugging and More Time Building with Scout APM](https://ter.li/lrlz90) 

Scout APM sponsor   

[Receipts: Easy Receipts and Invoices for Your Rails Apps](https://github.com/excid3/receipts) — Works with any payment provider and uses Prawn to generate PDFs. 

Chris Oliver   

[redis-rb 4.6: The Ruby Client Library for Redis](https://github.com/redis/redis-rb) — The official Ruby client for the [Redis](https://redis.io/) data structure server. 4.6 adds the `ZRANGESTORE`, `COPY`, `ZDIFF`, `ZUNION`, and `HRANDFIELD` commands amongst [other things](https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#460). 

Redis   

[A Tmux Launcher App Written in mruby](https://github.com/art-solopov/tmux-launcher) — The most interesting part of this, to me, is seeing a complete (but simple) [mruby](https://github.com/mruby/mruby)-based app. 

Artemiy Solopov   

[Vanity: A Datastore Agnostic A/B Testing Mechanism for Rails](https://github.com/assaf/vanity) 
Assaf Arkin   

[Rack::Attack 6.6: Rack Middleware for Blocking and Throttling](https://github.com/rack/rack-attack) 
Rack Project       

💡**Tip of the Week** 

   

## `__END__` 

Before I learned about `__END__` (a directive that causes Ruby to cease processing a source code file), whenever I was testing little snippets or scripts which relied on reading data from somewhere, I would keep a `test.csv` or something similar open while I was writing my code. I would switch between the Ruby file and the CSV (or alternative). Especially for small snippets, it sometimes felt like a cumbersome way to develop. 

However, `__END__` can often solve this problem. If you put an `__END__` in a Ruby file, everything after the `__END__` will be accessible as a file in the `DATA` variable. Let's say we have a file `example.rb`: 

```
puts "DATA is a #{DATA.class}"
puts DATA.read

__END__
here is some
data, that, i,
have
``` 

and we run it: 

```
$ ruby example.rb
DATA is a File
here is some
data, that, i,
have
``` 

We've confirmed both the class of `DATA` and that we can easily access it. 

I would not necessarily recommend storing any information past the `__END__` in production applications or environments, but I do find it useful for iterating on snippets of code which rely on some data. It's helpful to be able to edit sample data inline while having access to the code that's ingesting the data.    

This week’s tip was written by [Jemma Issroff](https://twitter.com/jemmaissroff).          

Curated by [Peter Cooper](https://twitter.com/peterc), [Glenn Goodrich](https://twitter.com/ruprict) and [Cooperpress](https://cooperpress.com/). 

[Change your email address](https://rubyweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
