<commit_before>require 'rubygems'
require 'rspec'
require 'cgi'
require 'pry'
require 'vcr'
require 'fakefs/spec_helpers'

$:.unshift((File.join(File.dirname(__FILE__), '..', 'lib')))
require 'barometer'

Dir["./spec/support/**/*.rb"].sort.each {|f| require f}

WEATHERBUG_CODE = Barometer::KeyFileParser.find(:weather_bug, :code) || 'weatherbug'
YAHOO_KEY = Barometer::KeyFileParser.find(:yahoo, :app_id) || 'yahoo'
downcased_weatherbug_code = WEATHERBUG_CODE.to_s
downcased_weatherbug_code[0] = WEATHERBUG_CODE.to_s[0..0].downcase

# Barometer.debug!
Barometer.yahoo_placemaker_app_id = 'placemaker'

VCR.configure do |config|
  config.cassette_library_dir = 'spec/cassettes'
  config.hook_into :webmock
  config.default_cassette_options = { :record => :none, :serialize_with => :json }

  config.filter_sensitive_data('WEATHERBUG_CODE') { WEATHERBUG_CODE.to_s }
  config.filter_sensitive_data('WEATHERBUG_CODE') { downcased_weatherbug_code }
  config.filter_sensitive_data('<YAHOO_KEY>') { YAHOO_KEY.to_s }
  config.filter_sensitive_data('<PLACEMAKER_KEY>') { Barometer.yahoo_placemaker_app_id.to_s }

  config.configure_rspec_metadata!
end

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
end

include Barometer::Matchers
<commit_msg>document spec_helper<commit_after>require 'rubygems'
require 'rspec'
require 'cgi'
require 'pry'
require 'vcr'
require 'fakefs/spec_helpers'

$:.unshift((File.join(File.dirname(__FILE__), '..', 'lib')))
require 'barometer'

Dir["./spec/support/**/*.rb"].sort.each {|f| require f}

WEATHERBUG_CODE = Barometer::KeyFileParser.find(:weather_bug, :code) || 'weatherbug'
YAHOO_KEY = Barometer::KeyFileParser.find(:yahoo, :app_id) || 'yahoo'
downcased_weatherbug_code = WEATHERBUG_CODE.to_s
downcased_weatherbug_code[0] = WEATHERBUG_CODE.to_s[0..0].downcase

# Barometer.debug!
Barometer.yahoo_placemaker_app_id = 'placemaker'

VCR.configure do |config|
  config.cassette_library_dir = 'spec/cassettes'
  config.hook_into :webmock
  config.default_cassette_options = { :record => :none, :serialize_with => :json }

  config.filter_sensitive_data('WEATHERBUG_CODE') { WEATHERBUG_CODE.to_s }
  # weather bug uses api as host name.  this is downcased when the request it made
  config.filter_sensitive_data('WEATHERBUG_CODE') { downcased_weatherbug_code }
  config.filter_sensitive_data('<YAHOO_KEY>') { YAHOO_KEY.to_s }
  config.filter_sensitive_data('<PLACEMAKER_KEY>') { Barometer.yahoo_placemaker_app_id.to_s }

  config.configure_rspec_metadata!
end

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
end

include Barometer::Matchers

{'fraction_non_alphanumeric': 0.12886209495101733, 'fraction_numerical': 0.002260738507912585, 'mean_word_length': 6.996987951807229, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5244659', 'n_tokens_mistral': 1022, 'n_tokens_neox': 981, 'n_words': 146}