class FindWish

Public Instance Methods

aliases() click to toggle source
# File lib/git_xplorer/wish/find_wish.rb, line 4
def aliases
    return ["find"]
end
description() click to toggle source
# File lib/git_xplorer/wish/find_wish.rb, line 8
def description
    return "Similar to \"find . -iregex PATTERN\""
end
execute(args, djinni_env = Hash.new) click to toggle source
# File lib/git_xplorer/wish/find_wish.rb, line 12
def execute(args, djinni_env = Hash.new)
    gitx = djinni_env["gitXplorer"]
    args.gsub!(/^(["'])(.*)\1$/, "\\2")
    dir = gitx.pwd.gsub(%r{^[^/]+(/|$)}, "")

    begin
        puts gitx.get_filenames(dir, args)
    rescue GitXplorer::Error => e
        puts e.message
    end
end
usage() click to toggle source
# File lib/git_xplorer/wish/find_wish.rb, line 24
def usage
    puts "#{aliases.join(", ")} [PATTERN]"
    puts "    #{description}."
end