<commit_before>require 'logcabin'

##
# Tool and DSL for checking expected vs actual state
module Prospectus
  DEFAULT_FILE = './.prospectus'

  class << self
    ##
    # Insert a helper .new() method for creating a new Cache object
    def new(*args)
      self::List.new(*args)
    end

    ##
    # Method for loading list from DSL
    def load_from_file(params = {})
      params[:file] ||= DEFAULT_FILE
      list = List.new(params)
      dsl = ListDSL.new(list, params)
      dsl.instance_eval(File.read(params[:file]), params[:file])
      list
    end

    def modules
      @modules ||= LogCabin.new(load_path: load_path(:modules))
    end

    def helpers
      @helpers ||= LogCabin.new(load_path: load_path(:helpers))
    end

    def extra_dep(name, dep)
      require dep
    rescue LoadError
      raise("The #{name} module requires the #{dep} gem")
    end

    private

    def gem_dir
      Gem::Specification.find_by_name('prospectus').gem_dir
    end

    def load_path(type)
      File.join(gem_dir, 'lib', 'prospectus', type.to_s)
    end
  end
end

require 'prospectus/version'
require 'prospectus/list'
require 'prospectus/item'
require 'prospectus/state'
<commit_msg>adjust file eval<commit_after>require 'logcabin'

##
# Tool and DSL for checking expected vs actual state
module Prospectus
  DEFAULT_FILE = './.prospectus'

  class << self
    ##
    # Insert a helper .new() method for creating a new Cache object
    def new(*args)
      self::List.new(*args)
    end

    ##
    # Method for loading list from DSL
    def load_from_file(params = {})
      file = params[:file] || DEFAULT_FILE
      list = List.new(params)
      dsl = ListDSL.new(list, params)
      dsl.instance_eval(File.read(file), file)
      list
    end

    def modules
      @modules ||= LogCabin.new(load_path: load_path(:modules))
    end

    def helpers
      @helpers ||= LogCabin.new(load_path: load_path(:helpers))
    end

    def extra_dep(name, dep)
      require dep
    rescue LoadError
      raise("The #{name} module requires the #{dep} gem")
    end

    private

    def gem_dir
      Gem::Specification.find_by_name('prospectus').gem_dir
    end

    def load_path(type)
      File.join(gem_dir, 'lib', 'prospectus', type.to_s)
    end
  end
end

require 'prospectus/version'
require 'prospectus/list'
require 'prospectus/item'
require 'prospectus/state'

{'fraction_non_alphanumeric': 0.1110643668489693, 'fraction_numerical': 0.0, 'mean_word_length': 2.9047619047619047, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5785811', 'n_tokens_mistral': 796, 'n_tokens_neox': 777, 'n_words': 203}