zassets 0.2.11 → 0.2.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/rack/handler/unicorn.rb +33 -0
- data/lib/zassets/config.rb +0 -1
- data/lib/zassets/server.rb +3 -1
- data/lib/zassets/version.rb +1 -1
- metadata +17 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3891c8b6732591c840db3d0f0122a788d460a06
|
4
|
+
data.tar.gz: c3471f791af54d26ef93d9ecd3fc92513a315cff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a1ffb51298692e566b6de7b736774b3a3a4372e3c9842f29e93276db18c8b96ca81beea411e7fdd2926c468f8d021ece399394d8128011ca7f892a631a955d5
|
7
|
+
data.tar.gz: cc4fab73ad6bff445024534a91d8aee1503a1ce06d099c2d3319aae5640b6c5c8984994f6cfcd2b95c93acec5b102899869d0a1e8f9ea8804c3ba85546297638
|
data/README.md
CHANGED
@@ -147,7 +147,8 @@ plugins:
|
|
147
147
|
host: localhost
|
148
148
|
port: 8000
|
149
149
|
|
150
|
-
# Change rack handler (HTTP server) to unicorn (default is
|
150
|
+
# Change rack handler (HTTP server) to unicorn (default behavior is to
|
151
|
+
# try the following handlers in order: puma, unicorn, thin, webrick).
|
151
152
|
server: unicorn
|
152
153
|
|
153
154
|
# List of directories where assets will be searched for (load
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'unicorn'
|
2
|
+
require 'rack/handler'
|
3
|
+
|
4
|
+
module Rack
|
5
|
+
module Handler
|
6
|
+
class Unicorn
|
7
|
+
UNICORN_CONFIG_PATH = 'config/unicorn.rb'.freeze
|
8
|
+
|
9
|
+
class << self
|
10
|
+
def run app, **options
|
11
|
+
unicorn_options = {
|
12
|
+
listeners: [options[:Host], options[:Port]].join(':'),
|
13
|
+
worker_processes: 2
|
14
|
+
}
|
15
|
+
|
16
|
+
if ::File.exist?(UNICORN_CONFIG_PATH)
|
17
|
+
unicorn_options[:config_file] = UNICORN_CONFIG_PATH
|
18
|
+
end
|
19
|
+
|
20
|
+
if unicorn_options[:config_file]
|
21
|
+
if ::File.read(unicorn_options[:config_file]) =~ /^(\s+)listen\s/
|
22
|
+
unicorn_options.delete :listeners
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
::Unicorn::HttpServer.new(app, unicorn_options).start.join
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
register 'unicorn', 'Rack::Handler::Unicorn'
|
32
|
+
end
|
33
|
+
end
|
data/lib/zassets/config.rb
CHANGED
data/lib/zassets/server.rb
CHANGED
@@ -2,6 +2,8 @@ require 'rack'
|
|
2
2
|
|
3
3
|
module ZAssets
|
4
4
|
class Server
|
5
|
+
HANDLERS = %w[puma unicorn thin webrick].freeze
|
6
|
+
|
5
7
|
def initialize config
|
6
8
|
@config = config
|
7
9
|
end
|
@@ -15,7 +17,7 @@ module ZAssets
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def handler
|
18
|
-
Rack::Handler.get(@config[:server]) || Rack::Handler.
|
20
|
+
Rack::Handler.get(@config[:server]) || Rack::Handler.pick(HANDLERS)
|
19
21
|
end
|
20
22
|
|
21
23
|
def options
|
data/lib/zassets/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zassets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: puma
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.6'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '2.6'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: sass
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +136,20 @@ dependencies:
|
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
138
|
version: '3.2'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: unicorn
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '4.9'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '4.9'
|
153
153
|
description: Assets server and builder
|
154
154
|
email: tj@a13.fr
|
155
155
|
executables:
|
@@ -160,6 +160,7 @@ extra_rdoc_files:
|
|
160
160
|
files:
|
161
161
|
- README.md
|
162
162
|
- bin/zassets
|
163
|
+
- lib/rack/handler/unicorn.rb
|
163
164
|
- lib/zassets.rb
|
164
165
|
- lib/zassets/builder.rb
|
165
166
|
- lib/zassets/cli.rb
|
@@ -201,6 +202,6 @@ rubyforge_project:
|
|
201
202
|
rubygems_version: 2.4.5
|
202
203
|
signing_key:
|
203
204
|
specification_version: 4
|
204
|
-
summary: zassets-0.2.
|
205
|
+
summary: zassets-0.2.12
|
205
206
|
test_files: []
|
206
207
|
has_rdoc:
|