<commit_before># vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
#
# Cookbook Name:: cpe_safari
# Resources:: cpe_safari
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#

resource_name :cpe_safari
default_action :config

action :config do
  safari_prefs = node['cpe_safari'].reject { |_k, v| v.nil? }
  return if safari_prefs.empty?
  prefix = node['cpe_profiles']['prefix']
  organization = node['organization'] ? node['organization'] : 'Facebook'
  node.default['cpe_profiles']["#{prefix}.browsers.safari"] = {
    'PayloadIdentifier'        => "#{prefix}.browsers.safari",
    'PayloadRemovalDisallowed' => true,
    'PayloadScope'             => 'System',
    'PayloadType'              => 'Configuration',
    'PayloadUUID'              => 'bf900530-2306-0131-32e2-000c2944c108',
    'PayloadOrganization'      => organization,
    'PayloadVersion'           => 1,
    'PayloadDisplayName'       => 'Safari',
    'PayloadContent'           => [
      {<commit_msg>warn and exit on 10.14 for cpe_safari<commit_after># vim: syntax=ruby:expandtab:shiftwidth=2:softtabstop=2:tabstop=2
#
# Cookbook Name:: cpe_safari
# Resources:: cpe_safari
#
# Copyright (c) 2016-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
#

resource_name :cpe_safari
default_action :config

action :config do
  safari_prefs = node['cpe_safari'].reject { |_k, v| v.nil? }
  return if safari_prefs.empty?
  if node.os_at_least?('10.14')
    Chef::Log.warn(
      'cpe_safari no longer works on 10.14 and higher.',
    )
    return
  end
  prefix = node['cpe_profiles']['prefix']
  organization = node['organization'] ? node['organization'] : 'Facebook'
  node.default['cpe_profiles']["#{prefix}.browsers.safari"] = {
    'PayloadIdentifier'        => "#{prefix}.browsers.safari",
    'PayloadRemovalDisallowed' => true,
    'PayloadScope'             => 'System',
    'PayloadType'              => 'Configuration',
    'PayloadUUID'              => 'bf900530-2306-0131-32e2-000c2944c108',
    'PayloadOrganization'      => organization,
    'PayloadVersion'           => 1,
    'PayloadDisplayName'       => 'Safari',
    'PayloadContent'           => [
      {
{'fraction_non_alphanumeric': 0.12795125666412796, 'fraction_numerical': 0.031226199543031227, 'mean_word_length': 3.430016863406408, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5904276', 'n_tokens_mistral': 904, 'n_tokens_neox': 850, 'n_words': 207}