All posts tagged with 'ruby'
Ruby 2.5: How’s That Backtrace looking?
It’s Christmas night, the air is cool and the stars are unseen through the heavy cloud. Children have left tablet and a nip of whisky out for Santa, and carrots out for the reindeer. One of the children wakes up! Rushing out of bed, she heads to the living room, curious to see if she can catch Santa and reindeer in the act of present delivery. When she gets there,… Continue reading
Ruby 2.5: Not Blocking My Rescue
Rescuing specific exceptions excessively can cause problems, but if you've ever had need to rescue within a do/end block, you might have found yourself using wordy syntax. Ruby 2.5 has a solution for you. In Ruby 2.5, we’ll get a little syntactic sugar for handling exceptions inside do/end blocks. You can see the feature discussion on Ruby’s Redmine instance. If you’ve ever used the shorthand for rescuing inside a method… Continue reading
Ruby 2.5: yield_self
yield_self is coming to Ruby 2.5. What is this long requested feature, and how does it work? Some features take a while to get into a Ruby release. As you can see from the original request on Ruby’s Redmine issue tracker, yield_self has been brewing for 5 years. It has been waiting on a good name, and the Ruby team has settled on one. But what is it? To understand… Continue reading
Ruby 2.5: The Christmas Present
Let's talk a wee bit about Ruby 2.5. This starts a week of looking at upcoming features in the language. Here at FreeAgent Towers, we use a lot of Ruby. The application itself is written in Rails, and our website is static HTML, CSS and JS, but is generated with Middleman. We love it, and so we follow its development closely. One of the exciting points in the Ruby year… Continue reading
Schrodinger’s Ruby array
When can a single array instance in Ruby both be empty and contain items simultaneously? Read on, and find out! Continue reading
Rest in peace, @mathie
There wasn't supposed to be anything particularly unusual about today. It started out as a typically drizzly Edinburgh summer morning, grey clouds hanging low above the castle, with just a hopeful glimpse of blue in the distance offering the prospect of a little respite later in the day. It wasn't until I arrived at my desk and checked our Slack channels that I first heard the shocking news of the… Continue reading
Querying the past
I’ve been learning to love the ActiveRecord query interface over the past few months. Whilst I find it infuriating when I’m battling it to do what I actually want, I also relish the power and convenience it gives me for many simple queries. So, when it came to designing a query language for historical data in our systems, ActiveRecord was a natural choice. We can now do queries like: FA::Subscriptions.… Continue reading
Upgrading to Ruby 2.1 (and other fun with YAML and complex regexes)
When we first launched FreeAgent, it ran on Ruby 1.8.6 MRI (and Rails 1.2!). We graduated to 1.8.7 REE when that became popular, then in the summer of 2011 we upgraded to Ruby 1.9.3. We've been running on that version (1.9.3-p194 to be specific) ever since. It has served us well, but performance is not one of Ruby 1.9.3's strong points and we've seen our application server response time gradually… Continue reading