<commit_before># osx-defaults.rb

meta :defaults do
  accepts_value_for :domain
  accepts_value_for :key
  accepts_value_for :type
  accepts_value_for :value
  accepts_value_for :global?
  accepts_value_for :doSudo?

  template do
    global = 'NSGlobalDomain'
    setup { @key = key || name }
    met? { shell?("defaults read #{global? ? global : ''} #{domain} #{@key}", sudo: doSudo?) && shell("defaults read #{global? ? global : ''} #{domain} #{@key}", sudo: doSudo?) == value }
    meet { shell("defaults write #{global? ? global : ''} #{domain} #{@key} -#{type} #{value}", sudo: doSudo?) }
  end
end<commit_msg>First pass refactor of osx_defaults template.<commit_after>meta :defaults do
  accepts_value_for :domain
  accepts_value_for :key
  accepts_value_for :type
  accepts_value_for :value
  accepts_value_for :global?
  accepts_value_for :doSudo?

  template do
    global = 'NSGlobalDomain'
    setup { @key = key || name }
    met? do
      command = "defaults read #{global? ? global : ''} #{domain} #{@key}"
      shell?(command, sudo: doSudo?) && shell(command, sudo: doSudo?) == value
    end
    meet do
      command = "defaults write #{global? ? global : ''} #{domain} #{@key} -#{type} #{value}"
      shell(command, sudo: doSudo?)
    end
  end
end
{'fraction_non_alphanumeric': 0.15220820189274448, 'fraction_numerical': 0.0, 'mean_word_length': 3.95703125, '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': '5799927', 'n_tokens_mistral': 425, 'n_tokens_neox': 431, 'n_words': 117}