Commit c8e07c96 authored by Michael Witrant's avatar Michael Witrant

added web server to run extraction

parent b9e29983
......@@ -4,3 +4,7 @@ gem "nokogiri"
gem "htmldiff"
gem "zippy"
gem "clik"
gem "sinatra"
gem "haml"
gem "rb-inotify"
gem "rerun"
......@@ -2,9 +2,25 @@ GEM
remote: http://rubygems.org/
specs:
clik (0.1.0)
ffi (1.6.0)
haml (4.0.1)
tilt
htmldiff (0.0.1)
listen (0.7.3)
nokogiri (1.5.9)
rack (1.5.2)
rack-protection (1.5.0)
rack
rb-inotify (0.9.0)
ffi (>= 0.5.0)
rerun (0.8.0)
listen
rubyzip (0.9.9)
sinatra (1.4.2)
rack (~> 1.5, >= 1.5.2)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
tilt (1.3.6)
zippy (0.2.1)
rubyzip (>= 0.9.1)
......@@ -13,6 +29,10 @@ PLATFORMS
DEPENDENCIES
clik
haml
htmldiff
nokogiri
rb-inotify
rerun
sinatra
zippy
#!/usr/bin/env ruby
require 'rubygems'
require 'bundler/setup'
require 'sinatra'
require 'haml'
get '/' do
haml :index
end
post '/extract' do
haml :extract, locals: {result: %x(ruby extract_amendments.rb #{params['file'][:tempfile].path})}
end
__END__
@@ layout
%html
%body
= yield
@@ index
%form{action: "/extract", method: "POST", enctype: 'multipart/form-data'}
%input{type: "file", name: "file"}
%input{type: "submit"}
@@ extract
%pre= Rack::Utils.escape_html(result)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment