<commit_before>run -> env { [404, {}, ['Not found']] }<commit_msg>Redirect rack.rubyforge.org and treetop.rubyforge.org URLs correctly<commit_after>require 'rack/rewrite'

use Rack::Rewrite do
  # rack.rubyforge.org
  moved_permanently '/', 'http://rack.github.io/', host: 'rack.rubyforge.org'
  moved_permanently %r{^/doc/([A-Z]+)\.html$}, 'http://www.rubydoc.info/github/rack/rack/master/file/$1', host: 'rack.rubyforge.org'
  moved_permanently %r{^/doc/(.+)\.html$}, 'http://www.rubydoc.info/github/rack/rack/$1', host: 'rack.rubyforge.org'

  # treetop.rubyforge.org
  moved_permanently %r{^/(.*)$}, 'http://cjheath.github.io/treetop/$1', host: 'treetop.rubyforge.org'
end

run -> env { [404, {}, ['Not found']] }
{'fraction_non_alphanumeric': 0.22594142259414227, 'fraction_numerical': 0.012552301255230125, 'mean_word_length': 4.609375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7403407', 'n_tokens_mistral': 315, 'n_tokens_neox': 279, 'n_words': 42}