Commit c8e07c96 authored by Michael Witrant's avatar Michael Witrant
Browse files

added web server to run extraction

parent b9e29983
...@@ -4,3 +4,7 @@ gem "nokogiri" ...@@ -4,3 +4,7 @@ gem "nokogiri"
gem "htmldiff" gem "htmldiff"
gem "zippy" gem "zippy"
gem "clik" gem "clik"
gem "sinatra"
gem "haml"
gem "rb-inotify"
gem "rerun"
...@@ -2,9 +2,25 @@ GEM ...@@ -2,9 +2,25 @@ GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
clik (0.1.0) clik (0.1.0)
ffi (1.6.0)
haml (4.0.1)
tilt
htmldiff (0.0.1) htmldiff (0.0.1)
listen (0.7.3)
nokogiri (1.5.9) 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) 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) zippy (0.2.1)
rubyzip (>= 0.9.1) rubyzip (>= 0.9.1)
...@@ -13,6 +29,10 @@ PLATFORMS ...@@ -13,6 +29,10 @@ PLATFORMS
DEPENDENCIES DEPENDENCIES
clik clik
haml
htmldiff htmldiff
nokogiri nokogiri
rb-inotify
rerun
sinatra
zippy 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