#Ruby
63 notas · última:
In Praise of dhh
A remembrance of Ruby and Rails as joyful, welcoming tools, and a warning that David Heinemeier Hansson now uses his influence to exclude, dominate, and damage the community.
Replacing RVM/Rbenv/Nvm/etc for ASDF
The page recommends ASDF as a single version manager for Ruby and many other languages, with setup steps, plugin management, local and global versions, and notes on reshimming and Ruby build issues.
Creating Music with Ruby
The page prepares the reader to use Sonic Pi as the main tool for the guide, explains how to test it, mentions useful controls like Run, Dark Mode, and Rec, and says other free software will also be used for sound analysis.
Elixir obsoletes Ruby, Erlang and Clojure in one go
The author argues that Elixir combines Ruby-like developer experience, Erlang-style concurrency, and useful Clojure features, making Ruby, Erlang, and Clojure obsolete for most use cases.
Kill Your Dependencies
The post argues that dependencies bloat apps, add bugs, and waste memory, so developers should remove unnecessary gems, prefer stdlib or simpler options, and keep runtime dependencies minimal.
Upgrading to Rails 5 Beta - The Hard Way
Heroku describes a Rails 5 beta upgrade as a careful sequence of Gemfile updates, dependency checks, console and server boot tests, manual QA, and deprecation cleanup before deploy.
Replacing Pingdom with Ruby and Heroku
The post explains how to replace Pingdom with a self-hosted uptime checker built with Ruby, run it on Heroku for $7/month, and configure notifications and checks through a YAML file.
verbal_expressions
Ruby library that helps construct difficult regular expressions, with examples for URL matching, string replacement, and capturing, plus a note that documentation is limited and the JavaScript wiki covers most methods.
Peeking Under the Hood of ActionController Parameters, Part 2
The post explains why Rails params are not plain hashes, how ActionController::Parameters inherits HashWithIndifferentAccess, and how permit and permit! manage the permitted flag.
How to Test Multithreaded Code
Mike Perham says multithreaded code is hard to write and harder to test, and recommends separating threading from work and using callbacks to make threaded APIs testable without sleep calls.
Why Ruby’s Timeout is dangerous (and Thread.raise is terrifying)
Julia Evans argues that Ruby’s Timeout is unsafe because it can interrupt arbitrary code at any point via Thread.raise, which may break cleanup, rescue blocks, and stateful operations.
Machine Learning made simple with Ruby
The post shows how to add automatic announcement classification in Ruby with classifier-reborn, choosing an LSI classifier, training it from existing labeled items, and saving predictions back to the database.
Writing a Mumble Bot in Ruby
Explains how to use the mumble-ruby gem to connect to Mumble, join channels, send and receive messages, mute or deafen audio, and keep a bot running.
Scaling Ruby Apps to 1000 Requests per Minute - A Beginner's Guide
The post argues that scaling Ruby apps is mostly about throughput, request queues, and server choice. For sub-1000 rpm systems, it favors buffering and concurrency over adding dynos.
Secrets to Speedy Ruby Apps On Heroku
The article explains how to speed up Ruby and Rails apps on Heroku by managing memory, tuning worker count, reducing N+1 queries, caching more, and using CDN and frontend performance checks.
Making the best of private methods
The post argues that private methods help narrow public promises, keep code stable, and make it easier to focus on what a class does rather than how it does it. It also treats private methods as a safe place to test abstractions before promoting them.
Bringing the best of Bash scripting to Ruby (by @radekpazdera)
The post argues for keeping Ruby scripts as quick to start as Bash, while gaining flexibility and reuse. It recommends docopt for CLI parsing and Scriptster for running commands and logging.
Input fields in rake task
The post shows how to make a Rake task ask for a customer name and email at runtime by reading from STDIN and using chomp before saving the data to a YAML file.
To Serialize or Not to Serialize: ActiveModel Serializers
The post explains why a Rails API response should be serialized for a JavaScript front end, then shows how ActiveModel Serializers lets you whitelist fields, shape associations, and customize JSON output.
Closures: Elixir vs. Ruby vs. JavaScript
The page compares closure behavior in JavaScript, Ruby, and Elixir. JavaScript shows side effects from mutable state, Ruby is safer with iterators but not perfect, and Elixir benefits from immutability.
Brincando de Crawlers e algumas Dicas Úteis
O texto mostra um script Ruby para limpar arquivos no Slack e, a partir dele, recomenda Bundler, Faraday com Typhoeus, Oj e Parallel para lidar com crawling, JSON e trabalho paralelo com menos custo.
Why Erlang?
The post argues that Erlang fits concurrent network applications better than Ruby runtimes and libraries because its actor model avoids shared state and makes fault-tolerant systems easier to build.
How Ruby Uses Memory
The article explains how Ruby memory use grows through object retention, object creation hotspots, and heap growth, and shows when freezing or in-place changes can cut allocations and speed code up.
Benefits of Writing a DSL in Ruby
The article explains why ZenPayroll built a Ruby DSL for state-specific payroll logic, then walks through a CA example using blocks, instance_eval, method_missing, and validations.
Ruby and recursion - find out all possible chess knights movements using minimax algorithm
The post explains knight movement, recursion, and the minimax algorithm, then shows how a 4x4 Ruby program builds a move tree and uses ranks to choose the computer’s next move.
Introducing Transproc - functional data transformations for Ruby
The post presents Transproc as ROM’s data-transformation backend, built around stateless functions that compose left to right. It argues this fits data pipelines better than typical OO Ruby for handling hashes and nested transformations.
Ruby Metaprogramming - Method Missing
`method_missing` lets Ruby objects handle calls to undefined methods before raising an exception. The page shows delegation in a presenter and a custom alias system built on a lookup table.
A Monadic Approach to Error Handling in Collection Pipelines
Michael Feathers shows how chained computation can carry both results and errors in a single pipeline, using a Ruby version of Haskell’s Either to record validation failures while skipping later stages.
Ruby Concurrency and Parallelism: A Practical Primer
The article explains the difference between concurrency and parallelism in Ruby and compares forking, threading, thread pools, and background jobs, with performance and resource tradeoffs.
Ruby pioneers come clean on the language's shortcomings
Yukihiro Matsumoto and David Heinemeier Hansson praise Ruby for readable code, abstraction, community and programmer happiness, while also noting complexity, speed limits and weak spots outside the web.
Lembrando os Heróis Ruby que se foram em 2014
O texto lamenta as mortes de Jim Weirich, Ezra Zygmuntowicz e James Golick em 2014, destaca suas contribuições para Ruby e Rails e pede que seu trabalho siga inspirando a comunidade.
Um exemplo bacana de coerção em Ruby
O post mostra como Ruby trata operadores como métodos e usa a classe Intervalo para explicar to_s, +, coerce e to_i na soma entre tipos diferentes.
Goliath: Non-blocking, Ruby 1.9 Web Server
Goliath is presented as an asynchronous Ruby 1.9 app server and lightweight framework built on Rack, fibers, and EventMachine, with a synchronous-looking API, middleware support, and performance benchmarks across Ruby runtimes.
Twitter muda de Ruby para Java. Ruby é 3x mais lento que Java.
O texto critica a leitura apressada de um caso do Twitter como prova geral contra Ruby. Argumenta que a troca para Java refletiu arquitetura, débito técnico e escala, não uma lei universal de performance.
Issue 7.5: Exploring low-level computing concepts with Ruby
The article builds a stripped-down 6502 simulator in JRuby to run Snake6502, explaining machine code, memory, stack behavior, memory-mapped I/O, registers, flags, addressing modes, and the instruction loop.
What's Relevant in the Ruby Universe?
Omniref describes a rebuilt Ruby indexing pipeline that links every gem’s code and documentation, then uses that graph to improve cross references, symbol resolution, and search quality.
WebSockets in Ruby
The post describes moving a geocoding service in Ruby from HTTP to WebSockets, compares Ruby WebSocket options, and settles on webmachine-ruby with Celluloid actors for per-client CPU-heavy work.
Rumors of Ruby’s Demise
The post argues that Ruby is still a strong choice because developer joy and productivity matter, and that concurrency hype often reflects problems faced by only a small slice of teams.
Ruby Gotchas that will come back to haunt you
The page lists Ruby pitfalls that can change program behavior or hide bugs, from operator precedence and equality to `super`, exceptions, scope, bang methods, assignment return values, and class-method privacy.
Variáveis de classe e de instância de classe em Ruby
O texto explica a diferença entre variáveis de classe e variáveis de instância de classe em Ruby. Em herança, a primeira é compartilhada na hierarquia; a segunda fica associada a cada classe.
Dependency injection is not a virtue in Ruby
DHH argues that dependency injection is a Java habit that can be overvalued in Ruby. He says Ruby lets hard-coded references stay simple while still being easy to test, so language shape matters more than cross-language best practices.
How can I reduce my Ruby/Rails memory usage when running Redmine?
A wrapper script can reduce Redmine’s Ruby memory usage by setting Ruby heap and GC variables, then having nginx call that script instead of the Ruby executable. The setup may save about 20 MB.
Remote visual debugging with RubyMine
The post explains how to set up remote visual debugging for Ruby and Rails apps in RubyMine with Vagrant: forward a port, install debugger gems, configure remote roots, and run Rails through rdebug-ide.
OpenStruct no Ruby 2.0
A versão RC1 do Ruby 2.0.0 trouxe mudanças na OpenStruct: acesso por índice, atribuição por índice, conversão para Hash com `to_h` e criação a partir de OpenStruct ou Struct.
Criando seu próprio encurtador de URLs
O texto mostra como montar um encurtador de URLs com Ruby, Sinatra e Redis, usando base 36 para o id, MD5 para identificar a URL e uma gem chamada Dogo para simplificar a execução em produção.
Ruby (programming language): How does metaprogramming in Ruby work?
Fabio Akita says the topic has been explained many times and points readers to existing material on the Ruby object model and metaprogramming, including talks, articles, books, and tutorials.
Don't rescue Exception, rescue StandardError
The page says Ruby should almost never rescue Exception; the safer default is StandardError, unlike C# or Java where catch(Exception) covers all exception types.
Usando responders no Rails
O texto mostra como `respond_with` simplifica controllers que repetem `respond_to`, como a gem `responders` centraliza flash messages e como criar um responder próprio para casos fora do padrão.
Algumas Dicas da Linguagem Ruby
A página reúne truques de Ruby para troca de variáveis, interpolação de strings, condicionais que retornam valor, ranges, hashes, splat, joins e conversão entre bases.
Get Rid of That Code Smell – Primitive Obsession
Primitive Obsession happens when primitive Ruby objects are used in places where they do not fit the domain. The post recommends replacing them with rich objects that carry the right semantics and API.
15 Things for a Ruby Beginner
The post lists practical next steps for Ruby beginners, from basics and core tools to objects, immutability, metaprogramming, blocks, style guides, and community habits.
Ruby concurrency explained
The article explains concurrency in Ruby through threads, multiple processes, fibers, and non-blocking I/O, and argues that each approach trades simplicity, safety, memory use, and throughput.
Building Streaming REST APIs with Ruby
A short repost that points to “Building Streaming REST APIs with Ruby” as part of A Rubyist Railstastic Adventure, but the captured text itself gives no further argument or technical detail.
Usando Ruby para organizar a coleção de fotos – remoção de arquivos duplicados
O autor reuniu backups de fotos em um computador, passou a usar o Picasa para manter a mesma interface no Mac e no Windows e escreveu um script em Ruby para remover arquivos duplicados.
Codificar vídeo com filas de trabalho MongoDB
O texto explica filas de trabalho para tirar tarefas longas do ciclo solicitação-resposta e mostra um exemplo em Ruby que usa MongoDB, rb-inotify e FFmpeg para converter imagens em vídeo.
Introducing DCell: actor-based distributed objects for Ruby
Tweet announcing DCell, described as actor-based distributed objects for Ruby, with a link to the project and a timestamp from Twitter.
Free Course: An Introduction to JRuby
Online course for beginners with working knowledge of Ruby and Java. It covers JRuby basics, Java-Ruby integration, Rails, assignments, and forum participation over a one-week schedule.
Como implementar uma aplicação cliente-servidor usando Sockets em Ruby
O texto apresenta Sockets como canais de comunicação bidirecional e mostra um exemplo simples em Ruby em que um cliente envia uma mensagem a um servidor TCP, que responde e fecha a conexão.
Learning More About JRuby from Charles Nutter
Interview with Charles Nutter about JRuby 1.6.7, JRubyConf, why Rubyists use JRuby, Maven-based Java library access, JRuby internals, InvokeDynamic, and the IR compiler.
Ruby eBooks
A RubyLearning page that lists paid and free eBooks on Ruby, Sinatra, JRuby, Git, Facebook app development, mobile app development, Clojure, and regular expressions, with prices and download links.
Package Ruby Scripts as Executables with Ocra
Ocra packages a Ruby script and its dependencies into a Windows .exe. The writer shows using `ocra quickcheck.rb --gem-full` to include the Whois gem and notes the resulting executable is larger and slower to start.
Criando suas próprias gems
O texto mostra como criar uma gem simples em Ruby com Bundler, desde a estrutura inicial e o gemspec até versionamento, dependências, build e release.
Large Ruby File Downloads Done Right!
The post shows how to download very large files in Ruby without loading the full HTTP response into memory. It streams each response segment straight to disk to avoid running out of RAM.
