<commit_before>#!ruby -I ../lib -I lib
require 'nyny'
require 'json'

#
# Every response of this app will be automatically converted to json
#
class App < NYNY::App
  before { headers['Content-Type'] = 'application/json' }

  helpers do
    def json data
      data.to_json
    end
  end

  get '/' do
    json :some => [:json, :mate!]
  end
end

App.run! 9000<commit_msg>Correct json examples according to latest code<commit_after>#!ruby -I ../lib -I lib
require 'nyny'
require 'json'

#
# Every response of this app will be automatically converted to json
#
class App < NYNY::App
  before { headers['Content-Type'] = 'application/json' }

  use BetterErrors::Middleware
  helpers do
    def json data
      data.to_json
    end
  end

  get '/' do
    raise 'chlen'
    json :some => [:json, :mate!]
  end
end

App.run! 9000
{'fraction_non_alphanumeric': 0.1162227602905569, 'fraction_numerical': 0.009685230024213076, 'mean_word_length': 3.0341463414634147, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1637619', 'n_tokens_mistral': 294, 'n_tokens_neox': 279, 'n_words': 97}