-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfmru.rb
78 lines (51 loc) · 1.1 KB
/
fmru.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
require 'rubygems'
require 'sinatra'
configure do
set :public_folder, Proc.new { File.join(root, "static") }
end
get '/form' do
erb:form
end
post '/form' do
peso=params[:peso].to_i
edad=params[:edad].to_i
hydration=peso*20
if hydration >1000
hydration =1000
end
size=((edad/4)+4)*2
dosis=peso
if dosis >20
dosis=20
end
flow=10
gadolinio=0.2 * peso
if gadolinio<2
gadolinio=2
end
if gadolinio>20
gadolinio=20
end
if peso<=27.5
flowga=0.1
elsif peso<=57.5
flowga=0.15
else
flowga=0.2
end
volume=12
erb:results, :locals => {:hydration => hydration,:size =>size,:flow =>flow,:gadolinio =>gadolinio,:flowga =>flowga, :volume =>volume, :dosis =>dosis}
end
get '/secret' do
erb:secret
end
post '/secret' do
params[:secret].reverse
end
get '/decrypt/:secret' do
params[:secret].reverse
end
not_found do
status 404
'not found'
end