<commit_before># Executes ansible commands
module SmashingBoxer
class AnsibleRunner < ExecutionModule
  SmashingBoxer.register_module :ansible, self

  action :configure_dj_runner,
    proc {ansible '-tconfigure_dj_runner -e force_dj_runner_restart=true'},
    "Configures and restarts the delayed job runner"
  action :reload_unicorn,
    proc {ansible '-t unicorn_reload -e force_unicorn_reload'},
    "Reloads the unicorns running on the app servers"
  action :restart_unicorn,
    proc {ansible '-t unicorn_restart -e force_unicorn_restart=true'}
    "Restarts the unicorns running on the app servers"
  action :bundle,
    proc {ansible '-t bundle -e force_bundle=true'},
    "Bundles the gems running on the app servers"
  action :deploy,
    proc {ansible '-t deploy'},
    "Checks out app code, installs dependencies and restarts unicorns for "\
    "both FE and BE code."
  action :everything, ->{ansible}, "This does it all."

  def initialize(*args)
    ENV['SMASHING_BOXER_PATH'] = File.join(__dir__, '../')
    super
  end

  protected
  attr_reader :opts

  def ansible(cmd_str = '')
    cmd = "ansible-playbook -i #{inventory_file} site.yml #{cmd_str}"
    STDERR.puts "Executing: #{cmd}" if opts.verbose
    Kernel.exec(cmd)
  end

  def inventory_file
    opts.inventory_file || 'test_hosts'
  end<commit_msg>Some minor fixes for ansible everything task<commit_after># Executes ansible commands
module SmashingBoxer
class AnsibleRunner < ExecutionModule
  SmashingBoxer.register_module :ansible, self

  action :configure_dj_runner,
    proc {ansible '-tconfigure_dj_runner -e force_dj_runner_restart=true'},
    "Configures and restarts the delayed job runner"
  action :reload_unicorn,
    proc {ansible '-t unicorn_reload -e force_unicorn_reload'},
    "Reloads the unicorns running on the app servers"
  action :restart_unicorn,
    proc {ansible '-t unicorn_restart -e force_unicorn_restart=true'}
    "Restarts the unicorns running on the app servers"
  action :bundle,
    proc {ansible '-t bundle -e force_bundle=true'},
    "Bundles the gems running on the app servers"
  action :deploy,
    proc {ansible '-t deploy'},
    "Checks out app code, installs dependencies and restarts unicorns for "\
    "both FE and BE code."
  action :everything, proc {ansible}, "This does it all."

  def initialize(*args)
    ENV['SMASHING_BOXER_PATH'] = File.join(__dir__, '../../')
    super
  end

  protected
  attr_reader :opts

  def ansible(cmd_str = '')
    cmd = "ansible-playbook -i #{inventory_file} site.yml #{cmd_str}"
    STDERR.puts "Executing: #{cmd}" if opts.verbose
    Kernel.exec(cmd)
  end

  def inventory_file
    opts.inventory_file || 'test_hosts'
  end
{'fraction_non_alphanumeric': 0.09706210487169951, 'fraction_numerical': 0.0, 'mean_word_length': 3.96309963099631, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '4722251', 'n_tokens_mistral': 899, 'n_tokens_neox': 852, 'n_words': 268}