RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

avdi — 28 posts

http://avdi.org

Advanced gsub  devblog.avdi.org
Today I'm celebrating the two-year anniversary of RubyTapas today, and in honor of that I've freed up a short screencast about an advanced usage of String#gsub from the archives.
Ruby has both symbolic (&&/||) and English logical and/or operators. The differences between these operators can be confusing, to the point that many programmers simply avoid using the English versions entirely rather than deal with their sometimes surprising behavior. I've made a screencast which explains why the very features which make these operators problematic in a boolean logic setting also make them perfect for certain elegant control flow idioms.
Recently I added the first high-level test to a Sinatra app with no tests. This required a lot of initial setup, involving, among other things, RSpec, Rake::Test, Capybara, EmailSpec and Pony, mocking OmniAuth callbacks, and using DatabaseCleaner with Sequel. For the benefit of my future self and anyone else who needs to set up Sinatra for acceptance-level tests, I documented the whole process.
I just published a blog post with my 7-episode series on advanced Rake features all in once place.
The Changelog blog is hosting a video I did on using #seek and #tell to navigate files. It's the beginning of a series on cloning the UNIX tail(1) command in Ruby.
I just freed up another episode from the RubyTapas archives. This one talks about building a caching layer over an HTTP API, and touches on testing with WebMock as well.
Exception Causes in Ruby 2.1  devblog.avdi.org
I dug into the new Exception#cause feature in Ruby 2.1 and wrote about what I found.
Ruby's core collection classes have a number of methods which return an Enumerator if they are called without a block. A while back I made a quick video showing how to replicate this behavior in your own methods. It's now free to watch.
Newly freed from the RubyTapas archives, a <3min video about some Ruby tricks for avoiding tedious "incidental" changes that are semantically null and clutter up version diffs.
Struct Screencast  rubytapas.com
I just released an early RubyTapas episode on Ruby's Struct class for free. It's a quick intro to what the class does and how, if you aren't using it already, it may just be your new best friend. Also gets into some more advanced Struct features you might not be aware of, as well as a short discussion of Ruby's special treatment of anonymous classes.
Confident Ruby eBook  devblog.avdi.org
I've released the final version of Confident Ruby, a book of patterns for writing code that tells a clear story. A companion screencast is also available.
I just released a gem called Naught for implementing the Null Object pattern. While Null Objects aren't exactly difficult to create by hand, Naught has some features you may find helpful.
In celebration of the upcoming 100th episode of RubyTapas, I'm holding a drawing for a huge stack of Ruby and JavaScript ebooks, course subscriptions, and more. There will be 100 winners in total, and the prizes include books & discounts from Noel Rappin, Pat Shaughnessy, Jesse Storimer, Giles Bowkett, Thoughtbot, and much more--even tickets to the Barcelona Ruby Conference!
Today I'm launching RubyTapas, my subscription screencast series. These are short (1-5 minute) videos, released three days a week, demonstrating intermediate to advanced Ruby features, idioms, and libraries. The first episode is up and available for free!
FigLeaf gem now available  devblog.avdi.org
The FigLeaf library from my book "Objects on Rails" is now available as a RubyGem. FigLeaf helps you control the interface surface area of classes derived from e.g. ActiveRecord, by selectively hiding inherited methods from other objects.
"Objects on Rails", a developer notebook exploring ideas and techniques for applying classic OO thinking to Rails projects, is now available free to read online.
I just released Exceptional Ruby, an eBook about exceptions and failure handling in Ruby.
I didn't create the VCR gem, but I love it so much I had to create a long, rambling screencast about it. Check it out and learn how to test your interactions with external APIs in a fast and robust manner.
Check out this short presentation on a new Ruby gem that will quite possibly change your life forever.
Recently I noticed some consternation about "and" and "or" and how they differ from && and ||. So I wrote an article about when and how to use Ruby's "and" and "or" operators.
Drive complex command-line interactions from Ruby with Greenletters. Use for automating procedures, or for testing your apps. Cucumber step definitions included!
I just released a very rough but usable version of Firetower. You can use it to interact with Campfire chats from the command line, as well as to build arbitrary event-driven Campfire apps (bots, notifiers, etc.).
Announcing ruby-standard.org in hopes of fostering discussion of the Ruby ISO standardization effort.
The time has come to turn over NullDB maintainership to someone who uses it regularly.
Hammertime intercepts exceptions at the point they are raised. It then enables you to ignore the error, view a stack trace, debug the error, drop into an IRB console, and more.
New features include DataMapper 0.10 support, lazy loading, Serial properties, and more complete query support.
Null database adapters in DataMapper for fun, speed, and isolation.
HookR 1.0.0 released  hookr.rubyforge.org
HookR is a library for adding publish/subscribe callback "hooks" to your objects. It supports both Rails-style class-level event handlers and Observer-style subscriber notifications.