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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 323d8d4e0b559e1f3914ff27117143f15a17d24d
4
- data.tar.gz: b2dfb8c562c3e615403b58a329289d15d373e061
3
+ metadata.gz: c3891c8b6732591c840db3d0f0122a788d460a06
4
+ data.tar.gz: c3471f791af54d26ef93d9ecd3fc92513a315cff
5
5
  SHA512:
6
- metadata.gz: d7899d48b1de3c145349c3c06d529284458948279e88815b23cef0a83974aed41968ed8a0f86bc37a73956577787cfc5b4e4f90904ab00472502986aa6f40798
7
- data.tar.gz: cce98925320625cf2fc87fdb478f2cb42f7db99d04d108cbe519e40f598d59598f55a45f13a11c5d62c4e37a8a7fa2b5b40de929e87423c9562c689f2943dca9
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 puma).
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
@@ -8,7 +8,6 @@ module ZAssets
8
8
  verbose: false,
9
9
  host: '::1',
10
10
  port: 9292,
11
- server: :puma,
12
11
  plugins: [],
13
12
  engines: {},
14
13
  base_url: '/assets',
@@ -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.default
20
+ Rack::Handler.get(@config[:server]) || Rack::Handler.pick(HANDLERS)
19
21
  end
20
22
 
21
23
  def options
@@ -1,3 +1,3 @@
1
1
  module ZAssets
2
- VERSION = '0.2.11'
2
+ VERSION = '0.2.12'
3
3
  end
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.11
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.11
205
+ summary: zassets-0.2.12
205
206
  test_files: []
206
207
  has_rdoc: