<commit_before>require 'sinatra/base'
require 'base64'
require 'uri'

module Monocle
  class Server < Sinatra::Base
    post '/:type/:id.:format' do
      view_object(params[:type], params[:id])
    end

    get '/:type/:id.:format' do
      view_object(params[:type], params[:id])
    end

    get '/:type/click/:id.:format' do
      click_object(params[:type], params[:id], params[:redirect_to])
    end<commit_msg>Serving back a gif for a get request.<commit_after>require 'sinatra/base'
require 'base64'
require 'uri'

module Monocle
  class Server < Sinatra::Base
    post '/:type/:id.:format' do
      view_object(params[:type], params[:id])
    end

    get '/:type/:id.gif' do
      view_object(params[:type], params[:id])
      content_type('image/gif')
      Base64.decode64('R0lGODlhAQABAPAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==')
    end

    get '/:type/click/:id.:format' do
      click_object(params[:type], params[:id], params[:redirect_to])
    end
{'fraction_non_alphanumeric': 0.15432098765432098, 'fraction_numerical': 0.0102880658436214, 'mean_word_length': 3.8407960199004973, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '2843116', 'n_tokens_mistral': 341, 'n_tokens_neox': 336, 'n_words': 68}