module DataValidation
Constants
- VERSION
Public Class Methods
api_request_host()
click to toggle source
# File lib/data_validation.rb, line 12 def api_request_host 'https://awmobile.active.com' end
compare_national(season = '17')
click to toggle source
# File lib/data_validation.rb, line 40 def compare_national(season = '17') categories = %w|boy grl| metrics = %w|ccr poll rating sos rpi qwf -wl| categories.each do |category| metrics.each do |metric| compare_with_url "http://php.admin.laxpower.com/update#{season}/bin#{category}/natl#{metric}.php" end end end
compare_with_season(season = '17')
click to toggle source
# File lib/data_validation.rb, line 23 def compare_with_season(season = '17') compare_with_url(web_request_host + '/mll') compare_with_url(web_request_host + '/nll') compare_national(season) %w|men women boys girls|.each { |category| compare_with_season_and_category season, category } end
compare_with_season_and_category(season = '17', category = 'boys')
click to toggle source
# File lib/data_validation.rb, line 16 def compare_with_season_and_category(season = '17', category = 'boys') web_urls = DataAccess.get_high_school_div_stat_urls season, category web_urls.each do |url| compare_with_url url end end
compare_with_url(url)
click to toggle source
# File lib/data_validation.rb, line 30 def compare_with_url(url) puts "Start validation of web url: #{url}" comparison = DataValidation::Comparison::ComparisonFactory.get_comparison(url) comparison.compare puts "Complete validation of web url: #{url}" puts '==============================' end
web_request_host()
click to toggle source
# File lib/data_validation.rb, line 8 def web_request_host 'http://php.admin.laxpower.com' end
Public Instance Methods
determine_request_body_and_logger_name()
click to toggle source
# File lib/data_validation/comparison/conference_ranking_table_comparison.rb, line 51 def determine_request_body_and_logger_name category = if web_url.match /bingrl/ 'GIRLS' elsif web_url.match /binboy/ 'BOYS' elsif web_url.match /binmen/ 'MEN' elsif web_url.match /binwom/ 'WOMEN' end season = "20#{web_url.match(/update(..)/)[1]}" division_id = web_url.match(/(\d+)\.php/)[1].to_i operation = web_url.match(/\/([a-z]+)\d+.php/)[1] @logger_name = "log/#{season}/#{category.downcase}/#{operation}/#{operation}_#{season}_#{category}_#{division_id}.log" %Q|{"season":"#{season}", "conference": {"category": "#{category}",} "divisionId":#{division_id},"currPage":1,"pageSize":1000}| end