title: How do I get Ruby to search for a pattern on the tail of a local file?
body: <p>Say I have a file <code>blah.rb</code> which is constantly written to somehow and has patterns like :</p>
  
  <pre><code>bagtagrag" " hellobello "  blah0 blah1 " trag kljesgjpgeagiafw blah2    " gneo" whatttjtjtbvnblah3
  </code></pre>
  
  <p>Basically, it's garbage. But I want to check for the blah that keeps on coming up and find the latest value i.e. number in front of the blah.</p>
  
  <p>Hence, something like :</p>
  
  <pre><code>grep "blah"{$1} | tail var/test/log
  </code></pre>
  
  <p>My file is at location <code>var/test/log</code> and as you can see, I need to get the number in front of the blah. </p>
  
  <pre><code>def get_last_blah("filename")
      // Code to get the number after the last blah in the less of the filename
  end
  
  def display_the_last_blah()
      puts get_last_blah("var/test/log")
  end
  </code></pre>
  
  <p>Now, I could just keep on reading the file and performing something akin to string pattern search on the entire file again and again. Obtaining the last value, I can then get the number. But what if I only want to look at the added text in the less and not the entire text. </p>
  
  <p>Moreover, is there a quick one-liner or smart command to get this?</p>