← Back to Upcase

Share your favorite/useful gems!


(Parkerrr ) #1

Learning which gems to use has always lead to a couple hours of scouring github, or other blogs to find out which ones are most useful. I’d like to see which ones you use and how they’re useful. I’ll start with one:

“Did You Mean?” GEM. This bad boy is great for correcting misspelled methods or classes. Great for beginners to use in your test/production environment. It’s sort of like linting for Ruby, but for run-time fixes.
http://www.yukinishijima.net/2014/10/21/did-you-mean-experience-in-ruby.html


(Ben Orenstein) #2

I’ve really enjoyed using attr_extras: https://github.com/barsoom/attr_extras

From their readme:

Instead of

class InvoiceBuilder
  def initialize(invoice, employee)
    @invoice = invoice
    @employee = employee
  end

  private

  attr_reader :invoice, :employee
end

you can just do

class InvoiceBuilder
  pattr_initialize :invoice, :employee
end

(Geoff Harcourt) #3

I’ve enjoyed the convenience of seed_migrations, which creates a concept of data migrations you can use to separate modifying the structure of your database from setting up reference data or converting existing data. You can tie running data migrations to running schema migrations, or run them separately.


(Parkerrr ) #4

Wow that’s super useful for my workflow! Thanks for that Ben!


(Parkerrr ) #5

Really convenient Geoff! I think I’ll try this on my current project