Guest User

Untitled

a guest
Jan 21st, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. # from the KNOWN_REGEXPS constant (by default)
  2. def get_meta_value(path, regexp, kregexp = KNOWN_REGEXPS)
  3. result = nil
  4.  
  5. txt = retrieve_content(path)
  6. if txt
  7. kregexp[regexp].each do |rp|
  8. mvalue = txt.scan(rp).flatten[0]
  9. if mvalue
  10. result = { :str => mvalue, :buf => txt }
  11. end
  12. end
  13. end
  14.  
  15. return result
  16. end
Add Comment
Please, Sign In to add comment