<commit_before>#!/usr/bin/env/ruby
require 'rubygems'
require 'sinatra/base'
require 'models'
require 'autoforme'
require 'sinatra/flash'

Forme.register_config(:mine, :base=>:default, :serializer=>:html_usa, :labeler=>:explicit, :wrapper=>:div)
Forme.default_config = :mine

class AutoFormeDemo < Sinatra::Base
  disable :run
  enable :sessions

  register Sinatra::Flash

  get '/' do
    @page_title = 'AutoForme Demo Site'
    "Default Page"
  end

  AutoForme.for(:sinatra, self) do
    model_type :sequel
    autoforme(Artist)
    autoforme(Album)
    autoforme(Track) do
      columns [:number, :name, :length]<commit_msg>Add some language to root page on demo site<commit_after>#!/usr/bin/env/ruby
require 'rubygems'
require 'sinatra/base'
require 'models'
require 'autoforme'
require 'sinatra/flash'

Forme.register_config(:mine, :base=>:default, :serializer=>:html_usa, :labeler=>:explicit, :wrapper=>:div)
Forme.default_config = :mine

class AutoFormeDemo < Sinatra::Base
  disable :run
  enable :sessions

  register Sinatra::Flash

  get '/' do
    @page_title = 'AutoForme Demo Site'
    erb <<END
<p>This is the demo site for autoforme, an admin interface for ruby web applications which uses forme to create the related forms.</p>

<p>This demo uses Sinatra as the web framework and Sequel as the database library.</p>
END
  end

  AutoForme.for(:sinatra, self) do
    model_type :sequel
    autoforme(Artist)
    autoforme(Album)
    autoforme(Track) do
      columns [:number, :name, :length]
{'fraction_non_alphanumeric': 0.1185430463576159, 'fraction_numerical': 0.0, 'mean_word_length': 4.617100371747212, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, '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': '2944786', 'n_tokens_mistral': 529, 'n_tokens_neox': 512, 'n_words': 142}