<commit_before>require 'pathname'

module Gemjars
  module Deux
    class FileStore
      def initialize dir
        @dir = dir
      end

      def put name, opts = {}
        path = Pathname.new(File.expand_path(name, @dir))
        path.parent.mkpath
        path.open("w+")
      end
    end
  end
end<commit_msg>Filestore supports a get API.<commit_after>require 'pathname'

module Gemjars
  module Deux
    class FileStore
      def initialize dir
        @dir = dir
      end

      def put name, opts = {}
        path = Pathname.new(File.expand_path(name, @dir))
        path.parent.mkpath
        path.open("w+")
      end

      def get name
        path = Pathname.new(File.expand_path(name, @dir))
        if path.file?
          path.open
        else
          nil
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08424908424908426, 'fraction_numerical': 0.0, 'mean_word_length': 1.7424749163879598, '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': '3078216', 'n_tokens_mistral': 259, 'n_tokens_neox': 255, 'n_words': 70}