title: Ruby - How to skip/ignore specific lines when reading a file?
body: <p>What's the best approach for ignoring some lines when reading/parsing a file (using Ruby)?</p>
  
  <p>I'm trying to parse just the Scenarios from a Cucumber .feature file and would like to skip lines that doesn't start with the words Scenario/Given/When/Then/And/But.</p>
  
  <p>The code below works but it's ridiculous, so I'm looking for a smart solution :)</p>
  
  <pre><code>File.open(file).each_line do |line|
    line.chomp!
    next if line.empty? 
    next if line.include? "#"
    next if line.include? "Feature" 
    next if line.include? "In order" 
    next if line.include? "As a" 
    next if line.include? "I want"
  </code></pre>