fuse 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fuse.rb +1 -1
- data/lib/fuse/server.rb +5 -8
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Yzc5OTM5ZjNmY2JjYzZhMjEzYzYwMmM4OTdlZGY2Mzg3OTA0MjkwOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTY2ZTkzODk5MTNhOGJmNGQ0MGI5ZjA4NzAxODRmYzEwNjNkYjZhYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGE5YjliMTM1MDJkNzU3OTIxZWVjOTMwMDYwNTQxZDBhNGU4YzUxNjE5ZDJh
|
10
|
+
MjMyZGZlM2U3MmQ0NDNiN2RiYmM2YTBjOWZmNjRjZWQzZGVlOTQyODFmODUy
|
11
|
+
NjhiMjFkNmEyZTI5MjNmY2M3YzEwNzdkYTc5YTBiODNlZTZkYmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NDEwMmU5ODE4ZGFlYjIxODU4YjU0MmIwMzA1NmRmMjE4YWM5MDk0YTIxNWI4
|
14
|
+
YzNiMmYxNjYyOTBhYTJhYmZiNWMzMDAzNmZhNjc0OTIyMTFkZjJkMDYzZThm
|
15
|
+
ODZjNTgxMGQ3NDBmMTFhZTFjOWFmNGU5YTA2YjE1YTc1YjIxODU=
|
data/lib/fuse.rb
CHANGED
data/lib/fuse/server.rb
CHANGED
@@ -8,18 +8,19 @@ class Fuse::Server
|
|
8
8
|
|
9
9
|
def call(env)
|
10
10
|
|
11
|
-
|
11
|
+
request = Rack::Request.new(env)
|
12
12
|
|
13
13
|
call_options = @options.merge Hash[request.GET.map{ |k, v| [k.to_sym, v] }]
|
14
14
|
|
15
|
-
if (asset = Fuse::Document::Asset.for(request.path
|
15
|
+
if @root && (asset = Fuse::Document::Asset.for(request.path))
|
16
16
|
return asset.call(env)
|
17
17
|
end
|
18
18
|
|
19
19
|
begin
|
20
20
|
doc = Fuse::Document.new(call_options)
|
21
|
+
@root = doc.root
|
21
22
|
rescue Fuse::Exception::SourceUnknown::TooManySources
|
22
|
-
doc = render_list($!.options, $!.option_name)
|
23
|
+
doc = render_list($!.options, $!.option_name, request)
|
23
24
|
rescue Fuse::Exception
|
24
25
|
if $!.message
|
25
26
|
doc = render_error($!.message)
|
@@ -34,17 +35,13 @@ class Fuse::Server
|
|
34
35
|
|
35
36
|
private
|
36
37
|
|
37
|
-
def request
|
38
|
-
Rack::Request.new(@env)
|
39
|
-
end
|
40
|
-
|
41
38
|
def render_error(text)
|
42
39
|
render_body do |h|
|
43
40
|
h.p { h.text text }
|
44
41
|
end
|
45
42
|
end
|
46
43
|
|
47
|
-
def render_list(assets, key)
|
44
|
+
def render_list(assets, key, request)
|
48
45
|
render_body do |h|
|
49
46
|
h.h3 { h.text "Choose #{key}:" }
|
50
47
|
h.ul {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuse
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neil E. Pearson
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ~>
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 2.12.2
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: capybara
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.2
|
97
111
|
description: ! 'Portable document authoring. Fuse HTML, JavaScript, CSS, images and
|
98
112
|
fonts into standalone HTML files.
|
99
113
|
|