Pinned post

Obligatory . Started writing code for money in 2011, started writing Ruby in 2014 and hope for many more years of it.

Fan of programming, reading, videogames, going on walks, National Trust sites and much more. (jsrn.net/stuffthatilike)

Here because Twitter can be... Twitter, but I'm not ready to give up human contact altogether yet.

Devise's Authenticable module lets you set the message shown when `active_for_authentication?` is false, but I can't see the presumably obvious way of changing the controller to which inactive users are redirected.

rubydoc.info/github/plataforma

Anyone know how to do that?

I often hear that the increased hosting costs associated with Ruby on Rails' larger than average footprint is more than offset by the increased dev productivity. It follows that Rails salaries being pretty high at the moment is offset by being able to maintain a smaller, more productive team.

Does anyone know of any case studies where someone's actually done the numbers on that?

It "feels right" to me, but I'd be interested to read other's experiences.

jsrn boosted

So how do people test code that uses IO.select and IO#readpartial. I assume lots of gratuitous stubbing and mocking.

How're you deploying your applications these days?

I've been chucking stuff on k8s for so long at my job I've lost touch with what everyone else is doing.

Alternative: catching original exception & raising a custom class closer to the source of the error, and then at least the intent in application controller is clear.

Show thread

I'm trying to catch `Net::ReadTimeout`s from a specific API and present a nice error message to the user. This API is used throughout the app, so I'd prefer not to duplicate this error handling code more than necessary.

Is having a `rescue_from` in ApplicationController and checking the exception object to see if it originated in a certain class a clumsy way of doing that?

Obligatory . Started writing code for money in 2011, started writing Ruby in 2014 and hope for many more years of it.

Fan of programming, reading, videogames, going on walks, National Trust sites and much more. (jsrn.net/stuffthatilike)

Here because Twitter can be... Twitter, but I'm not ready to give up human contact altogether yet.

Chatted about this with a couple local Ruby programmers and the consensus seems to be "probably not."

Show thread

Is there ever a good time to define a custom `!` method on an object? Seems like setting up a footgun for people relying on the truthy/falsiness in a boolean expression.

class Thing; def !; true; end; end
my_thing = Thing.new

do_thing if my_thing# executes
do_thing if !my_thing # executes
do_thing unless my_thing # does not execute

Have you worked on anything cool lately?

I've been looking at a bunch of sites on neocities.org and it's making me want to make my own site much, much worse^H^H^H^H^Hcooler.

Hello. 👋

Thought I'd dip my toes back into Mastodon, and what better place to start than here?

Ruby.social

A Mastodon instance for Rubyists & friends