<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gem on @zhisme :: signal over noise</title><link>https://zhisme.com/tags/gem/</link><description>Recent content in Gem on @zhisme :: signal over noise</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 12 Jan 2020 00:00:00 +0000</lastBuildDate><atom:link href="https://zhisme.com/tags/gem/index.xml" rel="self" type="application/rss+xml"/><item><title>lazy_names gem, how much time do you spend in console?</title><link>https://zhisme.com/articles/lazy-names/</link><pubDate>Sun, 12 Jan 2020 00:00:00 +0000</pubDate><guid>https://zhisme.com/articles/lazy-names/</guid><description>&lt;p>I&amp;rsquo;m happy to share the &lt;a href="https://github.com/zhisme/lazy_names?tab=readme-ov-file#lazy_names">lazy_names&lt;/a> gem!&lt;br>
This gem allows you to define a config file that maps long, namespaced constants to something simpler and more intuitive:&lt;/p>
&lt;pre>&lt;code class="language-yml">'Models::Users::CreditCard': 'UserCard'
&lt;/code>&lt;/pre>
&lt;p>I spend a lot of time in the console, which is why I originally wrote this gem. Here’s a quick look at my most frequently run commands from my Zsh history:&lt;/p>
&lt;pre>&lt;code class="language-sh">$: history | awk '{$1=&amp;quot;&amp;quot;; print $0}' | sort | uniq -c | sort -nr
 647 gs
 135 rc # rails console
 135 ls
 134 gd
 ...
&lt;/code>&lt;/pre>
&lt;p>Do you use the Ruby console much while developing? I personally like to check my code directly in the console — calling methods to inspect return values — especially in the early development stage before tests are written. Sometimes, I need to drop records from the database or build some structs on the fly.&lt;/p></description></item></channel></rss>