<commit_before># coding: utf-8
require 'bundler'
Bundler.require
require 'sinatra/reloader' if development?

require './model'

configure do
  Time.zone = 'Tokyo'
  ActiveRecord::Base.default_timezone = :local
  use Rack::Session::Cookie, :domain => 'proconist.net'
  set :session_secret, 'proconist.net'
end

configure :development do
  set :public_folder, settings.root + '/sample'
end

configure :production do
  set :static, false
end

helpers do
  def option_tag(label, val, selected=false)
    if selected
      "<option value=\"#{val}\" selected>#{label}</option>"
    else
      "<option value=\"#{val}\">#{label}</option>"
    end
  end

  def checkbox_tag(label, val, name, checked=false)
    if checked
      "<div class=\"checkbox\"><label><input type=\"checkbox\" value=\"#{val}\" id=\"#{name}\" name=\"#{name}\" checked>#{label}</label></div>"
    else
      "<div class=\"checkbox\"><label><input type=\"checkbox\" value=\"#{val}\" id=\"#{name}\" name=\"#{name}\">#{label}</label></div>"
    end<commit_msg>:bug: ローカルでもログイン出来る様に<commit_after># coding: utf-8
require 'bundler'
Bundler.require
require 'sinatra/reloader' if development?

require './model'

configure do
  Time.zone = 'Tokyo'
  ActiveRecord::Base.default_timezone = :local
end

configure :development do
  set :public_folder, settings.root + '/sample'
  enable :sessions
end

configure :production do
  set :static, false
  use Rack::Session::Cookie, :domain => 'proconist.net'
  set :session_secret, 'proconist.net'
end

helpers do
  def option_tag(label, val, selected=false)
    if selected
      "<option value=\"#{val}\" selected>#{label}</option>"
    else
      "<option value=\"#{val}\">#{label}</option>"
    end
  end

  def checkbox_tag(label, val, name, checked=false)
    if checked
      "<div class=\"checkbox\"><label><input type=\"checkbox\" value=\"#{val}\" id=\"#{name}\" name=\"#{name}\" checked>#{label}</label></div>"
    else
      "<div class=\"checkbox\"><label><input type=\"checkbox\" value=\"#{val}\" id=\"#{name}\" name=\"#{name}\">#{label}</label></div>"
    end
{'fraction_non_alphanumeric': 0.19652341863833897, 'fraction_numerical': 0.0009657170449058426, 'mean_word_length': 4.232323232323233, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '5458347', 'n_tokens_mistral': 674, 'n_tokens_neox': 700, 'n_words': 160}