Module: XPGrep

Defined in:
lib/xpgrep.rb

Defined Under Namespace

Modules: CLI

Constant Summary collapse

VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.grep(expr, io) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/xpgrep.rb', line 9

def self.grep(expr, io)
  h = if CLI::Options.instance.parse_as_html
        Hpricot(io)
      else
        Hpricot::XML(io)
      end
  h.search(expr)
end