title: Write new gem for using command line on terminal
body: <p><em>Hi guys.</em>
  I wanna learn how to write a new gem by myself (I'm newbie).
  So I found some document to do it but it's quite hard for me.
  I want to write a gem. So when I install it, I can use it on terminal, for example:</p>
  
  <blockquote>
    <p>$ search key_work</p>
  </blockquote>
  
  <p>But all document just said that I have to use:</p>
  
  <blockquote>
    <p>$ irb -Ilib -rMygem </p>
  </blockquote>
  
  <p>And then I can use it with <code>Mygem.search</code>.But it's not my purpose.
  My question is "How I can write a code for key-word that can run on terminal?"
  Thanks for your help :)</p>