hydeweb 0.0.1.pre2 → 0.0.1.pre3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/hyde/init.rb +10 -5
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.1.
|
1
|
+
0.0.1.pre3
|
data/lib/hyde/init.rb
CHANGED
@@ -6,14 +6,19 @@ $:.unshift File.dirname(__FILE__) + "/.."
|
|
6
6
|
require 'hyde'
|
7
7
|
|
8
8
|
class Main < Sinatra::Base
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
@@project ||= Hyde::Project.new
|
10
|
+
|
11
|
+
get '/-' do
|
12
|
+
@@project.files.inject("") do |a, path|
|
13
|
+
a << "<li><a href='#{path}'>#{path}</a></li>"
|
14
|
+
a
|
15
|
+
end
|
16
|
+
end
|
12
17
|
|
13
18
|
get '/*' do
|
14
19
|
begin
|
15
|
-
|
16
|
-
|
20
|
+
path = params[:splat][0]
|
21
|
+
@@project.render path
|
17
22
|
rescue Hyde::NotFound
|
18
23
|
raise Sinatra::NotFound
|
19
24
|
end
|