<commit_before># enoding: utf-8

require 'sinatra'
require 'fluent/log'
require 'fluent/config'
require 'fluent/engine'
require 'fluent/parser'

set :haml, :format => :html5

get '/' do
  haml :index
end

get '/parse' do
  @regexp = params[:regexp]
  @input  = params[:input]

  begin
    parser = Fluent::TextParser::RegexpParser.new(Regexp.new(@regexp))
    @parsed = parser.call(@input)[1]
  rescue
    @parsed = nil
  end

  haml :index
end

__END__

@@ layout
!!!
%html
  %head
    %meta(charset='UTF-8')
    %title Fluentular: a Fluentd regular expression editor
    %link(rel='stylesheet' href='/stylesheets/font-awesome.css')
    %link(rel='stylesheet' href='/stylesheets/foundation.css')
    %link(rel='stylesheet' href='/stylesheets/app.css')

  %body
    %a(href='http://github.com/Tomohiro/fluentular')
      %img.github(src='http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png' alt='Fork me on GitHub')

    %header.row
      %section
        %h1
          %a(href='/') Fluentular
        %h4 a Fluentd regular expression editor

    %article
      = yield

    %footer.row
      %section.four.columns
        %p
          &copy; 2012
          %a(href='https://github.com/Tomohiro') Tomohiro, TAIRA
      %section.four.columns.offset-by-four<commit_msg>add google analytics<commit_after># enoding: utf-8

require 'sinatra'
require 'fluent/log'
require 'fluent/config'
require 'fluent/engine'
require 'fluent/parser'

set :haml, :format => :html5

get '/' do
  haml :index
end

get '/parse' do
  @regexp = params[:regexp]
  @input  = params[:input]

  begin
    parser = Fluent::TextParser::RegexpParser.new(Regexp.new(@regexp))
    @parsed = parser.call(@input)[1]
  rescue
    @parsed = nil
  end

  haml :index
end

__END__

@@ layout
!!!
%html
  %head
    %meta(charset='UTF-8')
    %title Fluentular: a Fluentd regular expression editor
    %link(rel='stylesheet' href='/stylesheets/font-awesome.css')
    %link(rel='stylesheet' href='/stylesheets/foundation.css')
    %link(rel='stylesheet' href='/stylesheets/app.css')
    :javascript
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', "#{ENV['UA_CODE']}"]);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script');
        ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();


  %body
    %a(href='http://github.com/Tomohiro/fluentular')
      %img.github(src='http://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png' alt='Fork me on GitHub')

    %header.row
      %section
        %h1
          %a(href='/') Fluentular
        %h4 a Fluentd regular expression editor

    %article
      = yield

    %footer.row
      %section.four.columns
        %p
          &copy; 2012
          %a(href='https://github.com/Tomohiro') Tomohiro, TAIRA
      %section.four.columns.offset-by-four
{'fraction_non_alphanumeric': 0.15904637491835402, 'fraction_numerical': 0.010124101894186806, 'mean_word_length': 3.0894526034712952, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, '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': '837951', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1071, 'n_words': 203}