<commit_before>require 'lita'

module Lita
  module Handlers
    class Fortune < Handler
      route(/fortune/, :fortune, command: true, help: {
        'fortune' => 'Returns your fortune.'
      })

      def self.default_config(handler_config)
      end


      def fortune(response)
        if File.exist?('/usr/bin/fortune')
          cmd = '/usr/bin/fortune'
        elsif
          cmd = '/usr/local/bin/fortune'
        elsif
          cmd = '/usr/games/fortune'
        else
          cmd = nil
        end

        if cmd
          f = `#{cmd}`
          f = "No fortune for you!" unless f
        else
          f = "No fortune for you!" unless f
        end
        response.reply f
      end
    end

    Lita.register_handler(Fortune)
  end
end<commit_msg>really check for the fortune binary files :facepalm:<commit_after>require 'lita'

module Lita
  module Handlers
    class Fortune < Handler
      route(/fortune/, :fortune, command: true, help: {
        'fortune' => 'Returns your fortune.'
      })

      def self.default_config(handler_config)
      end


      def fortune(response)
        if File.exist?('/usr/bin/fortune')
          cmd = '/usr/bin/fortune'
        elsif File.exist?('/usr/local/bin/fortune')
          cmd = '/usr/local/bin/fortune'
        elsif File.exist?('/usr/games/fortune')
          cmd = '/usr/games/fortune'
        else
          cmd = nil
        end

        if cmd
          f = `#{cmd}`
          f = "No fortune for you!" unless f
        else
          f = "No fortune for you!" unless f
        end
        response.reply f
      end
    end

    Lita.register_handler(Fortune)
  end
end
{'fraction_non_alphanumeric': 0.10612492419648271, 'fraction_numerical': 0.0, 'mean_word_length': 1.6484751203852328, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2106789', 'n_tokens_mistral': 514, 'n_tokens_neox': 497, 'n_words': 136}