<commit_before>require 'erb'

module Capistrano
  module Monit
    module HelperMethods

      def monit_config(name, destination = nil)
        destination ||= "/etc/monit/conf.d/#{name}.conf"
        template "monit/#{name}.erb", "/tmp/#{name}"

        execute :sudo, :mv, "/tmp/#{name} #{destination}"
        execute :sudo, :chown, "root #{destination}"
        execute :sudo, :chmod, "600 #{destination}"
      end

      def template(template_name, to)
        config_file = "#{fetch(:monit_templates_path)}/#{template_name}"
        # If there's no customized file in your rails app template directory,
        # proceed with the default.
        unless File.exists?(config_file)
          default_config_path = "../../generators/capistrano/monit/templates/#{template_name}"
          config_file = File.join(File.dirname(__FILE__), default_config_path)
        end
        template_file = ERB.new(File.read(config_file)).result(binding)
        upload! StringIO.new(template_file), to

        execute :sudo, :chmod, "644 #{to}"
      end
      <commit_msg>Corrected wrong path in monit config<commit_after>require 'erb'

module Capistrano
  module Monit
    module HelperMethods

      def monit_config(name, destination = nil)
        destination ||= "/etc/monit/conf.d/#{name}.conf"
        template name, "/tmp/#{name}"

        execute :sudo, :mv, "/tmp/#{name} #{destination}"
        execute :sudo, :chown, "root #{destination}"
        execute :sudo, :chmod, "600 #{destination}"
      end

      def template(template_name, to)
        config_file = "#{fetch(:monit_templates_path)}/#{template_name}"
        # If there's no customized file in your rails app template directory,
        # proceed with the default.
        unless File.exists?(config_file)
          default_config_path = "../../generators/capistrano/monit/templates/#{template_name}"
          config_file = File.join(File.dirname(__FILE__), default_config_path)
        end
        template_file = ERB.new(File.read(config_file)).result(binding)
        upload! StringIO.new(template_file), to

        execute :sudo, :chmod, "644 #{to}"
      end
      
{'fraction_non_alphanumeric': 0.13037383177570094, 'fraction_numerical': 0.005607476635514018, 'mean_word_length': 2.8507194244604315, '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': '2350479', 'n_tokens_mistral': 655, 'n_tokens_neox': 627, 'n_words': 149}