<commit_before>require 'coercible'

class ENVied::Coercer::ENViedString < Coercible::Coercer::String
  def to_array(str)
    str.split(/(?<!\\),/).map{|i| i.gsub(/\\,/,',') }
  end

  def to_hash(str)
    require 'rack/utils'
    ::Rack::Utils.parse_query(str)
  end

  def to_uri(str)
    require 'uri'
    ::URI.parse(str)
  end
end<commit_msg>Stricter parsing of integers<commit_after>require 'coercible'

class ENVied::Coercer::ENViedString < Coercible::Coercer::String
  def to_array(str)
    str.split(/(?<!\\),/).map{|i| i.gsub(/\\,/,',') }
  end

  def to_hash(str)
    require 'rack/utils'
    ::Rack::Utils.parse_query(str)
  end

  def to_uri(str)
    require 'uri'
    ::URI.parse(str)
  end

  def to_integer(str)
    Integer(str)
  rescue ArgumentError
    raise_unsupported_coercion(str, __method__)
  end
end
{'fraction_non_alphanumeric': 0.17111650485436894, 'fraction_numerical': 0.0, 'mean_word_length': 3.76878612716763, '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': '4805248', 'n_tokens_mistral': 340, 'n_tokens_neox': 327, 'n_words': 56}