yarrow 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/yarrow/defaults.yml +6 -1
- data/lib/yarrow/server.rb +7 -16
- data/lib/yarrow/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71cc6bb31451de567a4dc5f5ef84df45855d3a21
|
|
4
|
+
data.tar.gz: 7ad6ffae5eeaec2084b50a295a10b07610f2fb5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b5e08f3edca9b08b59e7ed777e50b0e5b7e738a7e7c1f5a14440919e9d93c84ab4b5b5b55b46061d520deaebd7cee84c43dc7c6beff160c23a4b2c4643ff850
|
|
7
|
+
data.tar.gz: 378379ec11cb8944230afc693ca8b1df083e192e6ad53ddebc70d083bd26b2e63fc58b9c4690f7d848aa741edb86071c0f8f404cb34aa7c9264cfd29a18226c5
|
data/lib/yarrow/defaults.yml
CHANGED
data/lib/yarrow/server.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Yarrow
|
|
|
8
8
|
|
|
9
9
|
def initialize
|
|
10
10
|
if config.server.nil?
|
|
11
|
-
|
|
11
|
+
raise ConfigurationError.new('Missing server entry')
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -25,9 +25,9 @@ module Yarrow
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def call(env)
|
|
28
|
-
index_path =
|
|
29
|
-
if
|
|
30
|
-
return [200, {"Content-Type" => "text/html"}, [
|
|
28
|
+
index_path = File.join(@root, Rack::Request.new(env).path.split('/'), @index_file)
|
|
29
|
+
if File.exists?(index_path)
|
|
30
|
+
return [200, {"Content-Type" => "text/html"}, [File.read(index_path)]]
|
|
31
31
|
else
|
|
32
32
|
@app.call(env)
|
|
33
33
|
end
|
|
@@ -43,12 +43,13 @@ module Yarrow
|
|
|
43
43
|
# @return [Yarrow::Server::StaticFiles]
|
|
44
44
|
def app
|
|
45
45
|
root = docroot
|
|
46
|
+
index = @index_file || 'index.html'
|
|
46
47
|
|
|
47
48
|
Rack::Builder.new do
|
|
48
49
|
use Rack::ShowExceptions
|
|
49
50
|
use Rack::CommonLogger
|
|
50
51
|
use Rack::ContentLength
|
|
51
|
-
use DirectoryIndex, root: root, index:
|
|
52
|
+
use DirectoryIndex, root: root, index: index
|
|
52
53
|
run Rack::Directory.new(root)
|
|
53
54
|
end
|
|
54
55
|
end
|
|
@@ -72,16 +73,6 @@ module Yarrow
|
|
|
72
73
|
config.output_dir || Dir.pwd
|
|
73
74
|
end
|
|
74
75
|
|
|
75
|
-
##
|
|
76
|
-
# @return [Hash]
|
|
77
|
-
def default_server_config
|
|
78
|
-
{
|
|
79
|
-
port: 8888,
|
|
80
|
-
host: 'localhost',
|
|
81
|
-
handler: :thin
|
|
82
|
-
}
|
|
83
|
-
end
|
|
84
|
-
|
|
85
76
|
##
|
|
86
77
|
# Stub to fill in default Rack options that will eventually be
|
|
87
78
|
# provided by config.
|
|
@@ -91,7 +82,7 @@ module Yarrow
|
|
|
91
82
|
rack_options = {
|
|
92
83
|
:Port => config.server.port,
|
|
93
84
|
:Host => config.server.port,
|
|
94
|
-
:server => config.server.handler,
|
|
85
|
+
:server => config.server.handler.to_sym,
|
|
95
86
|
:daemonize => false,
|
|
96
87
|
:quiet => false,
|
|
97
88
|
:warn => true,
|
data/lib/yarrow/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: yarrow
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mark Rickerby
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hashie
|