<commit_before>require 'curses'
require 'twterm/event/screen/resize'
require 'twterm/uri_opener'

module Twterm
  class App
    include Publisher
    include Singleton

    DATA_DIR = "#{ENV['HOME']}/.twterm"

    def initialize
      Dir.mkdir(DATA_DIR, 0700) unless File.directory?(DATA_DIR)

      Auth.authenticate_user(config) if config[:user_id].nil?

      Screen.instance
      FilterQueryWindow.instance

      timeline = Tab::Statuses::Home.new(client)
      TabManager.instance.add_and_show(timeline)

      mentions_tab = Tab::Statuses::Mentions.new(client)

      TabManager.instance.add(mentions_tab)
      TabManager.instance.recover_tabs

      Screen.instance.refresh

      client.connect_user_stream

      reset_interruption_handler

      URIOpener.instance

      resize = proc do
        next if Curses.closed?

        lines = `tput lines`.to_i
        cols = `tput cols`.to_i<commit_msg>Freeze String constant<commit_after>require 'curses'
require 'twterm/event/screen/resize'
require 'twterm/uri_opener'

module Twterm
  class App
    include Publisher
    include Singleton

    DATA_DIR = "#{ENV['HOME']}/.twterm".freeze

    def initialize
      Dir.mkdir(DATA_DIR, 0700) unless File.directory?(DATA_DIR)

      Auth.authenticate_user(config) if config[:user_id].nil?

      Screen.instance
      FilterQueryWindow.instance

      timeline = Tab::Statuses::Home.new(client)
      TabManager.instance.add_and_show(timeline)

      mentions_tab = Tab::Statuses::Mentions.new(client)

      TabManager.instance.add(mentions_tab)
      TabManager.instance.recover_tabs

      Screen.instance.refresh

      client.connect_user_stream

      reset_interruption_handler

      URIOpener.instance

      resize = proc do
        next if Curses.closed?

        lines = `tput lines`.to_i
        cols = `tput cols`.to_i
{'fraction_non_alphanumeric': 0.09184782608695652, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 3.109375, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6768478', 'n_tokens_mistral': 608, 'n_tokens_neox': 567, 'n_words': 101}