roadkill 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/files/sample_app/config.ru +1 -1
- data/files/sample_app/home.html +6 -1
- data/files/sample_app/todo_app.rb +6 -1
- data/lib/roadkill/version.rb +1 -1
- metadata +1 -1
data/files/sample_app/config.ru
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
load 'todo_app.rb'
|
2
|
-
run TodoApp.new
|
2
|
+
run TodoApp.new({base_dir: Dir.pwd})
|
data/files/sample_app/home.html
CHANGED
@@ -9,7 +9,12 @@
|
|
9
9
|
</head>
|
10
10
|
<body>
|
11
11
|
<div id="login">
|
12
|
-
|
12
|
+
<p>
|
13
|
+
Welcome!
|
14
|
+
</p>
|
15
|
+
<p>
|
16
|
+
Please login.
|
17
|
+
</p>
|
13
18
|
<input id="email" type="name" name="email" placeholder="email" />
|
14
19
|
<input id="password" type="password" name="password" />
|
15
20
|
<input id="submit" type="submit" value="Login" />
|
@@ -1,6 +1,11 @@
|
|
1
1
|
class TodoApp
|
2
|
+
attr_accessor :base_dir
|
3
|
+
def initialize(options)
|
4
|
+
@base_dir = options[:base_dir]
|
5
|
+
super()
|
6
|
+
end
|
2
7
|
def call env
|
3
|
-
html = File.open("home.html", "rb")
|
8
|
+
html = File.open("#{@base_dir}/home.html", "rb")
|
4
9
|
[200, {"Content-Type" => "text/html"}, [html.read]]
|
5
10
|
end
|
6
11
|
end
|
data/lib/roadkill/version.rb
CHANGED