Sha256: a13536f50ce95220c264c149e0517a863d570812fbb5a47e0ae16165f97c3203
Contents?: true
Size: 1.13 KB
Versions: 25
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true require_relative "base" module Neetob class CLI module Github class Search < Base attr_accessor :apps, :key_to_search, :search_file_path, :sandbox def initialize(apps, key_to_search, search_file_path, sandbox = false) super() @apps = apps @key_to_search = key_to_search @search_file_path = search_file_path @sandbox = sandbox end def run matching_apps = find_all_matching_apps(apps, :github, sandbox) matching_apps.each do |app| begin ui.info("\n Searching in \"#{app}/#{search_file_path}\" for \"#{key_to_search}\"\n") content = Base64.decode64(client.contents(app, path: search_file_path).content) ui.error("Keyword not found") and next unless content.include? key_to_search content.each_line do |line| ui.success(line) if line.include?(key_to_search) end rescue StandardError => e ExceptionHandler.new(e).process end end end end end end end
Version data entries
25 entries across 25 versions & 2 rubygems