Kamal has been positioned as the answer to a question Rails developers have asked for years: how do you deploy to your own servers without the overhead of Kubernetes or the cost of a managed platform? And in many ways, it delivers. But the gap between what Kamal promises and what it actually requires in…
Tag: ruby
Why Ruby Might Be the Most AI-Friendly Language Nobody’s Talking About
A few weeks ago, Martin Alderson published something that caught my attention: a systematic comparison of how token-efficient different programming languages are when fed to large language models. The findings were fascinating. And if you’ve been following my writing on Ruby, you won’t be surprised to hear that Ruby came out looking very good indeed….
What Makes Ruby Different: Unique Structures vs Python, Java, JavaScript
In my previous post on Ruby’s building blocks, I covered when to use Struct, Data, Class, and Module. But I glossed over something important: many of these constructs don’t exist in other languages – or exist in such diminished forms that they barely count. Ruby isn’t just another object-oriented language with different syntax. It has…
Ruby’s Building Blocks: When to Use What (And Why)
Ruby gives us an abundance of organizational tools. Struct, Data, classes, modules as namespaces, modules as mixins, service objects, and the include/extend/module_function trinity. Each is well-documented individually, but there’s a gap: when and why to choose one over another. This isn’t about rules. Ruby’s philosophy encourages pragmatism-take what you need and move forward. But pragmatism…
Ruby 5.0: What If Ruby Had First-Class Types?
The article envisions a reimagined Ruby with optional, inline type annotations called TypedRuby, addressing limitations of current solutions like Sorbet and RBS. It proposes a syntax that integrates seamlessly with Ruby’s philosophy, emphasizing readability and gradual typing while considering generics and union types. TypedRuby represents a potential evolution in Ruby’s design.
Working OAuth2 with Foursquare on Sinatra
require ‘rubygems’ require ‘sinatra’ require ‘oauth2’ require ‘json’ require ‘net/https’ require ‘foursquare2’ set :port, 80 CLIENT_ID = ‘****************************************************’ CLIENT_SECRET = ‘****************************************************’ CALLBACK_PATH = ‘/callbacks/foursquare’ def client OAuth2::Client.new(CLIENT_ID, CLIENT_SECRET, {:site => ‘https://foursquare.com/’, :token_url => “/oauth2/access_token”, :authorize_url => “/oauth2/authenticate?response_type=code”, :parse_json => true, :ssl => {:ca_path => ‘/etc/ssl/certs’ } }) end def redirect_uri() uri = URI.parse(request.url) uri.path =…