<commit_before>require 'middleman-core'

module Middleman
  module S3Redirect
    class Options < Struct.new(
      :prefix,
      :public_path,
      :bucket,
      :region,
      :path_style,
      :aws_access_key_id,
      :aws_secret_access_key,
      :after_build
    )

      def initialize
        self.read_config
      end

      def redirect(from, to)
        redirects << RedirectEntry.new(from, to)
      end

      def redirects
        @redirects ||= []
      end

      protected

      def read_config(io = nil)
        unless io
          root_path = ::Middleman::Application.root
          config_file_path = File.join(root_path, ".s3_sync")

          # skip if config file does not exist
          return unless File.exists?(config_file_path)

          io = File.open(config_file_path, "r")
        end<commit_msg>Did I mention it was an attempt?<commit_after>require 'middleman-core'

module Middleman
  module S3Redirect
    class Options
      attr_accessor \
        :prefix,
        :public_path,
        :bucket,
        :region,
        :path_style,
        :aws_access_key_id,
        :aws_secret_access_key,
        :after_build

      def initialize
        self.read_config
      end

      def redirect(from, to)
        redirects << RedirectEntry.new(from, to)
      end

      def redirects
        @redirects ||= []
      end

      protected

      def read_config(io = nil)
        unless io
          root_path = ::Middleman::Application.root
          config_file_path = File.join(root_path, ".s3_sync")

          # skip if config file does not exist
          return unless File.exists?(config_file_path)

          io = File.open(config_file_path, "r")
        end
{'fraction_non_alphanumeric': 0.08084358523725835, 'fraction_numerical': 0.0023432923257176333, 'mean_word_length': 1.9347079037800687, 'pattern_counts': {'":': 0, '<': 8, '<?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': '1067507', 'n_tokens_mistral': 521, 'n_tokens_neox': 506, 'n_words': 119}