#sinatrarb — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #sinatrarb, aggregated by home.social.
-
small snippet to let sinatra work with unicode endpoints:
```
require 'cgi'
require 'mustermann/pattern'
class UnicodePattern < Mustermann::Pattern
register :unicode
def === string
CGI.unescape(string) == @string
endend
set mustermann_opts: {type: :unicode}
```
#SinatraRb #ruby -
OMFG can we just talk about how awesome #ruby #sinatrarb and #active_record is! I simply cannot get why Ruby is not a more popular #programming language
-
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?
-
@postmodern If you stub something out, I'll help. I use #SinatraRb often enough for #API wrappers that this would help me too.
-
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:
https://github.com/sdogruyol/kemal-github-api
#rubylang #crystallang #crystallanguage #ruby #crystal #SinatraRb #sinatra
-
I am playing around with an open API that provides power prices in #denmark in kWh/DKK. Below is my current UI. I find it found! I working with #apache echarts and #sinatrarb so Ruby! There is a large goal of the project but I will not reveal it yet. You can find the code here: https://codeberg.org/looopTools/powerpris #opensource #development
-
I playing a lot with #sinatrarb 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 #python with a #ruby alternative 😊 #development
-
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!
-
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!