<commit_before>require 'kramdown'
require 'fileutils'

module Everything
  class Blog
    module Source
      class FileBase
        def relative_dir_path
          # We can use an approach like the one here: http://stackoverflow.com/questions/11471261/ruby-how-to-calculate-a-path-relative-to-another-one
          @relative_dir_path ||= File.dirname(relative_file_path)
        end

        def relative_file_path
          @relative_file_path ||= Pathname.new(source_file_path)
            .sub(base_source_dir_path, '')
            .to_s
        end

        def content
          raise NotImplementedError
        end

        def file_name
          raise NotImplementedError
        end

      private

        def base_source_dir_path
          Fastenv.everything_path
        end

        def base_source_pathname
          @base_source_pathname ||= Pathname.new base_source_dir_path
        end

        def source_file_path
          File.join(base_source_dir_path, file_name)
        end
      end
    end
  end
end<commit_msg>Use Everything.path instead<commit_after>require 'kramdown'
require 'fileutils'

module Everything
  class Blog
    module Source
      class FileBase
        def relative_dir_path
          # We can use an approach like the one here: http://stackoverflow.com/questions/11471261/ruby-how-to-calculate-a-path-relative-to-another-one
          @relative_dir_path ||= File.dirname(relative_file_path)
        end

        def relative_file_path
          @relative_file_path ||= Pathname.new(source_file_path)
            .sub(base_source_dir_path, '')
            .to_s
        end

        def content
          raise NotImplementedError
        end

        def file_name
          raise NotImplementedError
        end

      private

        def base_source_dir_path
          Everything.path
        end

        def base_source_pathname
          @base_source_pathname ||= Pathname.new base_source_dir_path
        end

        def source_file_path
          File.join(base_source_dir_path, file_name)
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.05422264875239923, 'fraction_numerical': 0.007677543186180422, 'mean_word_length': 2.0130057803468207, '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': '2543261', 'n_tokens_mistral': 621, 'n_tokens_neox': 591, 'n_words': 129}