<commit_before>module IStats
  # CPU Stats
  # Extend CPU_STATS C module (ext/osx_stats/smc.c)
  class Cpu
    extend CPU_STATS
    class << self
      include IStats::Color

      def delegate(stat)
        case stat
        when 'all'
          all
        when 'temp', 'temperature'
          cpu_temperature
        else
          Command.help "Unknown stat for CPU: #{stat}"
        end
      end

      def all
        cpu_temperature
      end

      def cpu_temperature
        t = get_cpu_temp
        message = "CPU temp: #{t}°C  "
        list = [0, 30, 55, 80, 100, 130]
        sparkline = Sparkr.sparkline(list) do |tick, count, index|
          if index.between?(0, 5) and t > 90
            flash_red(tick)
          elsif index.between?(0, 1)
            green(tick)
          elsif index.between?(2, 3) and t > 50
            light_yellow(tick)
          elsif index == 4 and t > 70
            yellow(tick)
          elsif index == 5 and t > 80
            red(tick)
          else
            tick
          end
        end
        puts message + sparkline
      end
    end
  end
end<commit_msg>Change temperature range<commit_after>module IStats
  # CPU Stats
  # Extend CPU_STATS C module (ext/osx_stats/smc.c)
  class Cpu
    extend CPU_STATS
    class << self
      include IStats::Color

      def delegate(stat)
        case stat
        when 'all'
          all
        when 'temp', 'temperature'
          cpu_temperature
        else
          Command.help "Unknown stat for CPU: #{stat}"
        end
      end

      def all
        cpu_temperature
      end

      def cpu_temperature
        t = get_cpu_temp
        message = "CPU temp: #{t}°C  "
        list = [0, 30, 55, 80, 100, 130]
        sparkline = Sparkr.sparkline(list) do |tick, count, index|
          if index.between?(0, 5) and t > 90
            flash_red(tick)
          elsif index.between?(0, 1)
            green(tick)
          elsif index.between?(2, 3) and t > 50
            light_yellow(tick)
          elsif index == 4 and t > 68
            yellow(tick)
          elsif index == 5 and t > 80
            red(tick)
          else
            tick
          end
        end
        puts message + sparkline
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07935800267498885, 'fraction_numerical': 0.025858225590726706, 'mean_word_length': 1.425945945945946, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '303085', 'n_tokens_mistral': 735, 'n_tokens_neox': 670, 'n_words': 211}