module Yamlook::Search

Searches for occurrences of dot-notated keys in all yaml files of current directory

Constants

EXTENSIONS
NoArgumentsError
PATTERN

Public Instance Methods

perform(keys) click to toggle source
# File lib/yamlook/search.rb, line 14
def perform(keys)
  raise NoArgumentsError, "Nothing to search for.\n" if keys.empty?

  findings = Dir.glob(PATTERN).flat_map do |filename|
    result = File.new(filename).search(keys)
    print_progress(result)
    result
  end

  print_result(findings.compact)
rescue NoArgumentsError => e
  puts e.message
end
print_failure() click to toggle source
print_progress(result) click to toggle source
print_result(findings) click to toggle source
print_success(findings) click to toggle source