Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Scott Watermasysk
Scott Watermasysk

Posted on • Originally published atscottw.com on

     

My Favorite Ruby Gems For Development

There are many Ruby Gems you can use on a project. The following are my favorites for improving the development experience, primarily on Rails apps.

Faker - Generates fake data such as emails, business names, etc. It makes it easy to add some variety to your test data and gives you one less thing to think about

rack-mini-profiler - Middleware profiler for rack apps. It does quite a bit, but my primary use case is to stay on top of database queries in a given request. Its hidden superpower is it is safe to also use in production if you need help tracking down a bug.

pry andpry-rails - Amazing alternative to IRB. I have used it every day for years and still feel like I only 20% of its’ power. For better or worse, my best debugging is with a series ofbinding.pry statements.

pgsync - Makes it easy to sync data between two databases. My primary use case is grabbing specific subsets (groups) of production data for easy local debugging (without the need to download the entire database).

xray-rails - With a keyboard short-cut (cmd+shift+x) you get a visual representation of the layout, view, and partials used on the current page. Also, you also get the controller + action. Finally, you can click on any of them and quickly jump into the code and markup. One caveat is it depends on jQuery, so I have not been able to use on some recent projects.

RSpec - Every time I start a new project I tell myself I am going to stick with conventions and not use RSpec. Then 30 minutes later, I go back to it. This in no way means RSpec is better than Rails built-in testing. I am just more comfortable with RSpec, and it has a large and established community.

factory-bot (andfactory-bot-rails) - Similar to RSpec, this is not a knock against the built-in fixtures, I find the API and workflow more appealing.

Guard - Automates common tasks, usually related to a file change. to the spec is changed. There are 100s of plugins for various other tasks.

Timecop - Makes it easy(ier?) to test dates:

A gem providing “time travel”, “time freezing”, and “time acceleration” capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.

If I am missing others, please let me know athi@scottw.com or@scottw on Twitter.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Boostrapped Founder. In to Ruby, Rails, JavaScript, VSCode, React, Tailwind, and more.
  • Location
    New Jersey
  • Work
    Founder at KickoffLabs
  • Joined

More fromScott Watermasysk

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp