<commit_before>require 'hive/diagnostic'
module Hive
  class Diagnostic
    class Android
      class Screenshot < Diagnostic
        
        def diagnose
          screenshot_file = "#{__dir__}/#{@device_api.serial}-screenshot.png"
          @device_api.screenshot(filename: screenshot_file)
          hive_device = Hive.hive_mind.device_details['connected_devices'].select { |d| d['serial'] == @device_api.serial }.first
          Hive.hive_mind.send_screenshot( { device_id: hive_device[:id], screenshot: screenshot_file } ) unless hive_device.nil?
          File.delete(screenshot_file)
          self.pass('Screenshot captured', 'Screenshot')
        end
        
        def repair(result)

        end

      end
    end
  end
end<commit_msg>Updated screenshot to use a tempfile instead<commit_after>require 'hive/diagnostic'
module Hive
  class Diagnostic
    class Android
      class Screenshot < Diagnostic
        
        def diagnose
          screenshot_file = Tempfile.new(["#{@device_api.serial}-screenshot", '.png']).path
          @device_api.screenshot(filename: screenshot_file)
          hive_device = Hive.hive_mind.device_details['connected_devices'].select { |d| d['serial'] == @device_api.serial }.first
          Hive.hive_mind.send_screenshot( { device_id: hive_device[:id], screenshot: screenshot_file } ) unless hive_device.nil?
          self.pass('Screenshot captured', 'Screenshot')
        end
        
        def repair(result)

        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.099601593625498, 'fraction_numerical': 0.0, 'mean_word_length': 2.7769423558897244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5888161', 'n_tokens_mistral': 470, 'n_tokens_neox': 452, 'n_words': 89}