<commit_before>require 'rubygems'
require 'sinatra'
require 'sinatra/activerecord'
require 'json'
require_relative 'lib/traders'

ActiveRecord::Base.include_root_in_json = false

class Cambio < ActiveRecord::Base
  serialize :currencies
end

set :database, ENV['DATABASE_URL'] || 'postgres://localhost/currencyja'

helpers do
  def h(text)
    Rack::Utils.escape_html(text)
  end

  def pretty_last_update
    Cambio.first.updated_at.strftime("%b %e, %Y %H:%M %Z")
  end

  def last_update
    Cambio.first.updated_at
  end
end


get '/' do
  @cambios = Cambio.all.to_json
  erb :index
end<commit_msg>Adjusted to pull last_update time from the updated_at with the lastest date.<commit_after>require 'rubygems'
require 'sinatra'
require 'sinatra/activerecord'
require 'json'
require_relative 'lib/traders'

ActiveRecord::Base.include_root_in_json = false

class Cambio < ActiveRecord::Base
  serialize :currencies
end

set :database, ENV['DATABASE_URL'] || 'postgres://localhost/currencyja'

helpers do
  def h(text)
    Rack::Utils.escape_html(text)
  end

  def pretty_last_update
    last_update.strftime("%b %e, %Y %H:%M %Z")
  end

  def last_update
    Cambio.first(:order => 'updated_at DESC').updated_at
  end
end


get '/' do
  @cambios = Cambio.all.to_json
  erb :index
end
{'fraction_non_alphanumeric': 0.11232449297971919, 'fraction_numerical': 0.0, 'mean_word_length': 4.727678571428571, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2792902', 'n_tokens_mistral': 474, 'n_tokens_neox': 462, 'n_words': 108}