fork download
  1. #!/usr/local/bin/ruby -w
  2.  
  3. # Author: sholmes
  4. # ex) this.rb more_than looking_list search_targets [...search_targetsN]
  5.  
  6. class String
  7. def has?(item, min)
  8. has, pos = 0, 0
  9.  
  10. while index(item, pos)
  11. has += 1
  12. pos += item.length
  13. return true if has >= min
  14. end
  15.  
  16. false
  17. end
  18. end
  19.  
  20. MIN = Integer(ARGV.shift)
  21. LOOKING_LIST = File.readlines(ARGV.shift).map!(&:chomp)
  22.  
  23. ARGF.each do |line|
  24. if LOOKING_LIST.any?{|item|line.has? item, MIN}
  25. puts line
  26. end
  27. end
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty