#sinatrarb

2025-02-11

Is there a way to only include certain Helper modules depending on the Sinatra view or view directory? Yes I know that Hanami does this, but is there a way to provide similar functionality in an existing Sinatra app?

#sinatra #sinatrarb

Todd A. Jacobs | Rubyisttodd_a_jacobs@ruby.social
2025-02-01

@postmodern If you stub something out, I'll help. I use #SinatraRb often enough for #API wrappers that this would help me too.

2025-01-23

It seems that @sdogruyol did another performance and memory #benchmark where he compared @ruby's Sinatra (#Ruby 3.4.0) against @CrystalLanguage's @crystalkemal.

However, I don't think it's entirely fair though. 😉

You can find the repository over here:

github.com/sdogruyol/kemal-git

#rubylang #crystallang #crystallanguage #ruby #crystal #SinatraRb #sinatra

Crystal 1.15.0 vs Ruby 3.4.0 Benchmark 👇

Kemal  - 174671 Requests per second (13.6 MB memory) 
Sinatra -    6014 Requests per second (27.6 MB memory)

Crystal is 2903% faster than Ruby in throughput, consumes less than 50% memory 🚀wrk -c 100 -d 40 http:/Nocalhost:3000/applications/123/tokens/123 Max
3.58k Running 40s test http://ocalhost : 3000/applications/123/tokens/123wrk -c 100 -d 40 http:/I/Nocalhost:3000/applications/123/tokens/123 Running 40s test http://localhost:3000/applications/123/tokens/123
looopToolslooopTools
2024-05-07

I am playing around with an open API that provides power prices in in kWh/DKK. Below is my current UI. I find it found! I working with echarts and so Ruby! There is a large goal of the project but I will not reveal it yet. You can find the code here: codeberg.org/looopTools/powerp

looopToolslooopTools
2024-05-05

I playing a lot with in my spare time. I really enjoy it. It is up there with flask it just need some love in terms of authentication gems and stuff. I could see myself fully replacing some fastAPI stuff written in with a alternative 😊

Todd A. Jacobs | Rubyisttodd_a_jacobs@ruby.social
2023-11-15

I actually prefer #HAML for markup because it essentially (although annoyingly) validates structure, but #ERB & #Slim are both much faster to render. ERB is generally the fastest, but is verbose and ugly IMHO.

What do other people prefer for #RubyLang, #RoR, or #SinatraRb templates, and why? Please comment; I'm interested in the "wisdom of the crowd" on this one!

Todd A. Jacobs | Rubyisttodd_a_jacobs@ruby.social
2023-07-13

TIL that you can run #SinatraRb from the #RubyLang to #JavaScript Opal transpiler. How well this works when serving from a CDN cache or S3 bucket is...well, undefined for me at the moment. But it looks like a really neat idea to play with!

github.com/opal/opal/blob/mast

Client Info

Server: https://mastodon.social
Version: 2025.07
Repository: https://github.com/cyevgeniy/lmst