class Fack
Attributes
ignore[RW]
Public Instance Methods
help()
click to toggle source
# File lib/fack.rb, line 7 def help puts "To use: fack <search_string>" end
print_check(a, b)
click to toggle source
# File lib/fack.rb, line 11 def print_check(a, b) search=nil if @ignore search = a.to_enum(:scan, /#{b}/i).map { Regexp.last_match } #a.match(/#{b}/i) else search = a.to_enum(:scan, /#{b}/).map { Regexp.last_match } #match(/#{b}/) end search.each do |s| puts a.gsub(/#{s.to_s}/, s.to_s.colorize(:red)) end end
print_find(start, file)
click to toggle source
# File lib/fack.rb, line 26 def print_find(start, file) Dir.glob('**/*') { |f| print_check(f, file) } end