<commit_before>require 'stella/testplan/usecase'
require 'stella/testplan/stats'

module Stella
class Testplan
  include Gibbler::Complex
  
  attr_accessor :usecases
  attr_accessor :base_path
  attr_accessor :desc
  attr_reader :stats
  
  def initialize(uris=[], opts={})
    @desc, @usecases = "Test plan", []
    @testplan_current_ratio = 0
    @stats = Stella::Testplan::Stats.new

    unless uris.empty?
      uris = [uris] unless Array === uris
      usecase = Stella::Testplan::Usecase.new
      usecase.ratio = 1.0
      uris.each do |uri|
        uri = 'http://' << uri unless uri.match /^http:\/\//i
        uri = URI.parse uri
        uri.path = '/' if uri.path.nil? || uri.path.empty?
        req = usecase.add_request :get, uri.path
        req.wait = opts[:wait] if opts[:wait]
      end
      self.add_usecase usecase
    end<commit_msg>Fixed digest calculation for testplan<commit_after>require 'stella/testplan/usecase'
require 'stella/testplan/stats'

module Stella
class Testplan
  include Gibbler::Complex
  extend Attic
  
  attic :base_path
  
  attr_accessor :usecases
  attr_accessor :desc
  attr_reader :stats
  
  def initialize(uris=[], opts={})
    @desc, @usecases = "Test plan", []
    @testplan_current_ratio = 0
    @stats = Stella::Testplan::Stats.new

    unless uris.empty?
      uris = [uris] unless Array === uris
      usecase = Stella::Testplan::Usecase.new
      usecase.ratio = 1.0
      uris.each do |uri|
        uri = 'http://' << uri unless uri.match /^http:\/\//i
        uri = URI.parse uri
        uri.path = '/' if uri.path.nil? || uri.path.empty?
        req = usecase.add_request :get, uri.path
        req.wait = opts[:wait] if opts[:wait]
      end
      self.add_usecase usecase
    end
{'fraction_non_alphanumeric': 0.12629161882893225, 'fraction_numerical': 0.003444316877152698, 'mean_word_length': 2.7085106382978723, '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': '7449655', 'n_tokens_mistral': 597, 'n_tokens_neox': 608, 'n_words': 141}