<commit_before>jane_lib_path =
  File.expand_path(
    File.join(
      ENV['JANE_PATH'], 'lib', 'jane'
    )
  )

require jane_lib_path

module Commander

  def self.execute(device, action)
    status_msg = ""
    addons_path = File.expand_path(File.join(ENV['JANE_PATH'], 'addons'))
    config = Jane.config
    config.each do |button|
      if button[:device] == device and button[:action] == action
        button[:commands].each do |command|
          addon = File.join(addons_path, command[:addon])
          require addon
          addon = addon.split('/')[-1]
          addon = addon.capitalize!
          mod = Object.const_get(addon)
          mod.run(command[:command_parameter])
          sleep(command[:sleep_after_command])
          status_msg += "[Executed] addon:#{addon} device:#{device} action:#{action} command_parameter:#{command[:command_parameter]}\n"
        end
        puts status_msg
        return status_msg
      end
    end
  end

end<commit_msg>adds timestamp to commander logs<commit_after>jane_lib_path =
  File.expand_path(
    File.join(
      ENV['JANE_PATH'], 'lib', 'jane'
    )
  )

require jane_lib_path
require "time"

module Commander

  def self.execute(device, action)
    status_msg = ""
    addons_path = File.expand_path(File.join(ENV['JANE_PATH'], 'addons'))
    config = Jane.config
    config.each do |button|
      if button[:device] == device and button[:action] == action
        button[:commands].each do |command|
          addon = File.join(addons_path, command[:addon])
          require addon
          addon = addon.split('/')[-1]
          addon = addon.capitalize!
          mod = Object.const_get(addon)
          mod.run(command[:command_parameter])
          sleep(command[:sleep_after_command])
          now = Time.now
          status_msg += "[#{now}] addon:#{addon} device:#{device} action:#{action} command_parameter:#{command[:command_parameter]}\n"
        end
        puts status_msg
        return status_msg
      end
    end
  end

end
{'fraction_non_alphanumeric': 0.1268025857782198, 'fraction_numerical': 0.000994530084535057, 'mean_word_length': 2.7467411545623834, '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': '3899551', 'n_tokens_mistral': 642, 'n_tokens_neox': 632, 'n_words': 125}