RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  
 

alindeman — 29 posts

http://www.andylindeman.com

upgradingtorails4.com is now open source: https://github.com/alindeman/upgradingtorails4. Feel free to read the source, adapt it for use elsewhere, and contribute.

Proceeds from sales of the PDF/ePub/mobi now benefit http://cfy.org. Retweets of my original tweet are appreciated as well.
The Plan for RSpec 3  myronmars.to
Myron Marston lays out the plan for RSpec 3. Feedback is welcomed, and if you are interested in helping, the blog post lists some ways to get started.
RSpec 2.14 Released  myronmars.to
RSpec 2.14 has been released. Highlights include improvements to the profiler, a --warnings flag, shared example groups scoped by context, a new message expectation syntax (expect(foo).to receive(:bar)), and test spies (expect(foo).to have_received(:bar)).
My talk "Building a Mocking Library" from Ancient City Ruby has been posted. Feedback welcomed.

This talk is not about testing, nor is it really about mocking. However, analyzing a mock object library is a great way to showcase advanced Ruby topics. Have you ever wondered exactly how a mock object library does what it does? You can understand it!
After learning about Clojure's `iterate` function, I wanted something similar in Ruby. I've also proposed it for Ruby 2.1.
After a discussion with a coworker, I decided to see if it was possible to extend Symbol#to_proc to invoke local methods (only for fun!). I discovered frame_binding from Ruby 2.0's RubyVM::DebugInspector while hacking something together.
RSpec 2.14.0.rc1  teaisaweso.me
RSpec 2.14.0.rc1 has been released. RSpec 2.14 introduces a new syntax for message expectations, bringing them in line with the new expect syntax for state based expectations.

Please try it out and let us know what you think.
When upgrading from Rails 3 to Rails 4, you need to add a couple of new settings; otherwise, JavaScript and CSS will no longer be minified in production.
Stafford Brooke writes about his first run in with turbolinks in Rails 4.
I posted a list of gems extracted from Rails 4. When upgrading a Rails 3 application, you may need to pull in a few of these.
Decoding Rails Session Cookies  alindeman.github.com
I wrote about how easy it is to decode and view the contents of session cookies in Rails 3. A fully encrypted cookie store is coming in Rails 4.
Upgrading to Rails 4 eBook (beta)  upgradingtorails4.com
I have released the first beta version of Upgrading to Rails 4. Rails 4 is not yet released, but might be soon. There are also certain features you can start using today in Rails 3.2 that have been extracted as gems.

I expect to release new content every 1-2 weeks as Rails 4 continues stabilizing.
I blog about some changes coming down the pipeline in capybara 2.0.
dumb_delegator  github.com
I've been using dumb_delegator for a while so I decided to release v0.5.0.
Introducing rake-rails  alindeman.github.com
Introducing rake-rails: run ALL the things with `rake`, avoiding confusion with `rails`
Highgroove released the 1.0 version of git_tracker, making it easier to format commit messages that reference Pivotal Tracker stories.

More details in the README on GitHub.
Highgroove just released the zonebie gem: it runs your Rails/ActiveSupport tests in a random timezone to prevent bugs where code wrongly depends on a certain zone being set.
writing readable ruby  highgroove.com
Over on the Highgroove blog, Brian posts some thoughts on writing readable ruby.
Over on the Highgroove blog, I posted about Rails and CanCan: Authorization for Specific Fields.
Just posted on the Highgroove blog about faking the filesystem in unit tests.
Be aware of database transactions when using callbacks to enqueue background jobs.
For those needing a really high level, quick start overview of testing authentication with RSpec request specs, I wrote up some examples.
Optimistic Locking with MongoDB  napkin.highgroove.com
Over on the Highgroove blog, I talk about optimistic locking with MongoDB and mongo_mapper.
An SQL Pattern in Rails  napkin.highgroove.com
Jonathan Wallace posts about one scenario when it makes sense to dip into SQL, even when using ActiveRecord.
Over on the Highgroove blog, I posted a small tip about using let and nested describe/context blocks with RSpec to DRY up test code.
Beware of Ruby Sugar  alindeman.github.com
Yesterday, I blogged about iterating through time with Rails; unfortunately at first I missed a terrible inefficiency in the code, which I explain in my next post, Beware of Ruby Sugar.
Cool tip I learned from @rjspotter: Iterating Through Time With Rails.
There are some potential gotchas when using instance_eval with a block to define methods (metaprogramming). I wrote a post exploring the details.
A closer look at blocks in Ruby and how they can sometimes produce unexpected results.