<commit_before>module W2
  module Controller
    get '/style.css' do
      render :text, File.read(File.dirname) + '/public/style.css'
    end

    get '/app.js' do
      render :text, File.read(File.dirname) + '/public/app.js'
    end

    get %r'(.*)/edit' do |path|
      haml :edit, :locals => {:path => path, :text => wiki_text_for(path)}
    end

    get %r'(.*)/changes' do |path|
      haml :changes, :locals => {:path => path, :changes => changes(path)}
    end

    get %r'(.*)/(\d{10})' do |path, time|
      haml :diff, :locals => {:path => path, :time => time, :changes => changes(path)}
    end

    get %r'(.*)' do |path|
      path = '/' if path == ''
      if File.exist? file_path(path)
        haml :show, :locals => {:path => path, :text => parsed_wiki_text_for(path)}
      else 
        haml :edit, :locals => {:path => path, :text => wiki_text_for(path)}
      end
    end

    post %r'(.*)' do |path|
      save_file path, params['wiki_text']
      redirect show_path(path)
    end
  end
end
<commit_msg>Revert "Don't show empty paths"<commit_after>module W2
  module Controller
    get '/style.css' do
      render :text, File.read(File.dirname) + '/public/style.css'
    end

    get '/app.js' do
      render :text, File.read(File.dirname) + '/public/app.js'
    end

    get %r'(.*)/edit' do |path|
      haml :edit, :locals => {:path => path, :text => wiki_text_for(path)}
    end

    get %r'(.*)/changes' do |path|
      haml :changes, :locals => {:path => path, :changes => changes(path)}
    end

    get %r'(.*)/(\d{10})' do |path, time|
      haml :diff, :locals => {:path => path, :time => time, :changes => changes(path)}
    end

    get %r'(.*)' do |path|
      if File.exist? file_path(path)
        haml :show, :locals => {:path => path, :text => parsed_wiki_text_for(path)}
      else 
        haml :edit, :locals => {:path => path, :text => wiki_text_for(path)}
      end
    end

    post %r'(.*)' do |path|
      save_file path, params['wiki_text']
      redirect show_path(path)
    end
  end
end

{'fraction_non_alphanumeric': 0.18551150269211944, 'fraction_numerical': 0.002936857562408223, 'mean_word_length': 2.530224525043178, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, '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': '1638023', 'n_tokens_mistral': 763, 'n_tokens_neox': 725, 'n_words': 197}