<commit_before>#!/usr/bin/env ruby

require 'rubygems'

missing_dep = false
missing_deps = []

puts "Verifying dependencies..."

begin
  require 'tzinfo'
rescue LoadError 
  missing_deps << "tzinfo"
  missing_dep = true
end 

begin
  require 'redcloth'
rescue LoadError
  missing_deps << "RedCloth"
  missing_dep = true
end 

begin
  require 'rake'
rescue LoadError
  missing_deps << "rake"
  missing_dep = true
end 

begin
  require 'ferret'
rescue LoadError
  missing_deps << "ferret"
  missing_dep = true
end 

begin
  require 'fastercsv'
rescue LoadError
  missing_deps << "fastercsv"
  missing_dep = true
end 

begin
  require 'eventmachine'
rescue LoadError
  missing_deps << "eventmachine"
  missing_dep = true
end 

begin
  require 'RMagick'
rescue LoadError
  missing_deps << "rmagick"
  missing_dep = true
end 

begin
  require 'icalendar'
rescue LoadError
  missing_deps << "icalendar"
  missing_dep = true
end 

begin
  require 'mongrel'
rescue LoadError
  missing_deps << "mongrel"
  missing_dep = true
end 

begin
  require 'zentest'
rescue LoadError
  missing_deps << "ZenTest"
  missing_dep = true
end 

begin
  require 'google_chart'
rescue LoadError
  missing_deps << "gchartrb"
  missing_dep = true
end 

begin
  require 'json'
rescue LoadError
  missing_deps << "json"
  missing_dep = true
end 

begin
  require 'test/spec'
rescue LoadError
  missing_deps << "test-spec"
  missing_dep = true
end 

if missing_dep
  puts "Please install required Ruby Gems:"
  puts "  sudo gem install #{missing_deps.join(" ")} -r"
  puts
  if missing_deps.include? "rmagick"
    puts "rmagick requires ImageMagick. If you're unable to install ImageMagick 6.3.0+, which the latest"
    puts "version of rmagick requires, please install version 1.5.14 instead: "
    puts "  sudo gem install rmagick --version=1.5.14 -r"
  end
  
  exit
end

puts "Dependencies verified..."
puts<commit_msg>Fix instructions for installing older rmagick gem<commit_after>#!/usr/bin/env ruby

require 'rubygems'

missing_dep = false
missing_deps = []

puts "Verifying dependencies..."

begin
  require 'tzinfo'
rescue LoadError 
  missing_deps << "tzinfo"
  missing_dep = true
end 

begin
  require 'redcloth'
rescue LoadError
  missing_deps << "RedCloth"
  missing_dep = true
end 

begin
  require 'rake'
rescue LoadError
  missing_deps << "rake"
  missing_dep = true
end 

begin
  require 'ferret'
rescue LoadError
  missing_deps << "ferret"
  missing_dep = true
end 

begin
  require 'fastercsv'
rescue LoadError
  missing_deps << "fastercsv"
  missing_dep = true
end 

begin
  require 'eventmachine'
rescue LoadError
  missing_deps << "eventmachine"
  missing_dep = true
end 

begin
  require 'RMagick'
rescue LoadError
  missing_deps << "rmagick"
  missing_dep = true
end 

begin
  require 'icalendar'
rescue LoadError
  missing_deps << "icalendar"
  missing_dep = true
end 

begin
  require 'mongrel'
rescue LoadError
  missing_deps << "mongrel"
  missing_dep = true
end 

begin
  require 'zentest'
rescue LoadError
  missing_deps << "ZenTest"
  missing_dep = true
end 

begin
  require 'google_chart'
rescue LoadError
  missing_deps << "gchartrb"
  missing_dep = true
end 

begin
  require 'json'
rescue LoadError
  missing_deps << "json"
  missing_dep = true
end 

begin
  require 'test/spec'
rescue LoadError
  missing_deps << "test-spec"
  missing_dep = true
end 

if missing_dep
  puts "Please install required Ruby Gems:"
  puts "  sudo gem install #{missing_deps.join(" ")} -r"
  puts
  if missing_deps.include? "rmagick"
    puts "rmagick requires ImageMagick. If you're unable to install ImageMagick 6.3.0+, which the latest"
    puts "version of rmagick requires, please install version 1.5.14 instead: "
    puts "  sudo gem install rmagick -v 1.5.14 -r"
  end
  
  exit
end

puts "Dependencies verified..."
puts
{'fraction_non_alphanumeric': 0.08186827604303333, 'fraction_numerical': 0.005772763054316453, 'mean_word_length': 3.8314321926489225, 'pattern_counts': {'":': 0, '<': 55, '<?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': '3556976', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1335, 'n_words': 398}