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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ac7d475a5d695a78ef24f94d64637deae4b2c70
4
- data.tar.gz: 243ea4a6f7db3dd7b9f2e414b2d2b6bb9e20963f
3
+ metadata.gz: 71cc6bb31451de567a4dc5f5ef84df45855d3a21
4
+ data.tar.gz: 7ad6ffae5eeaec2084b50a295a10b07610f2fb5f
5
5
  SHA512:
6
- metadata.gz: 286765ed5b70e517868705c25cc545fa31ff109bcbcd3f727e323be6e858bae8e8c9175f6d536cf422ed523516f9c457e79faaca65414e3ea5155d8a0f992f8a
7
- data.tar.gz: 2dc1154778db5e8ffc6656f0af62f1e7604ae0ba2ec0dde0d65fcb75af8ff8a7a796964e6493a21454dca9289d6222396c3a91510f7b4c01e6588fa1cbf2cff2
6
+ metadata.gz: 8b5e08f3edca9b08b59e7ed777e50b0e5b7e738a7e7c1f5a14440919e9d93c84ab4b5b5b55b46061d520deaebd7cee84c43dc7c6beff160c23a4b2c4643ff850
7
+ data.tar.gz: 378379ec11cb8944230afc693ca8b1df083e192e6ad53ddebc70d083bd26b2e63fc58b9c4690f7d848aa741edb86071c0f8f404cb34aa7c9264cfd29a18226c5
@@ -16,4 +16,9 @@ assets:
16
16
  append_paths:
17
17
  - css
18
18
  - js
19
- manifest_file: manifest.json
19
+ manifest_file: manifest.json
20
+ server:
21
+ port: 8888
22
+ host: localhost
23
+ handler: thin
24
+
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
- config.server = default_server_config
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 = ::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)]]
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: 'index.html'
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,
@@ -1,4 +1,4 @@
1
1
  module Yarrow
2
2
  APP_NAME = 'Yarrow'.freeze
3
- VERSION = '0.3.1'.freeze
3
+ VERSION = '0.3.2'.freeze
4
4
  end
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.1
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-04-08 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashie