guard-nginx 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 5cd66b3a45c56a1a7c86807847234ff5cc6df13e67bf1c05da5a25ea37b28042
4
- data.tar.gz: f12294afc9f745b56d11f469a9d8a434395cd929ba8a653dade1d663826466c7
3
+ metadata.gz: c20e68587dbb10d931c13f2b0c22eddaddac618af1d05b6f8b5d99cb7075bc0a
4
+ data.tar.gz: 56786e5c6307c58ad02aded358a9b2cd934deeacc9c36e16f223d433e8168093
5
5
  SHA512:
6
- metadata.gz: ee8bce58d843ff394c185f44470567b11ca29286b4c116b3fc7330409322b881d799c47c11ff4b37b1789a98a60dad4b36e7ca842fc888609741a56af2dc01f6
7
- data.tar.gz: 95cabb694a32fc16deb8ad17b1a5d0621f12a39e66ba204af26c2a1d673ea50be6fcd189606b98905158c0f97f4957cd045631acc8b748e05362702e52d66215
6
+ metadata.gz: '058dada4cfbf3340bfb6c27e63752960cd7274a8768e6a77d1af9e2d4c6d7d902128f14679b050fe8775fd47cd669b70d95afe0924b770185bf0b667395f2d8c'
7
+ data.tar.gz: 93b803c23ead0e4cef182bde9d4f8c8db45799bc2da7f3db4fdeff76461a7c5c2356579f011cbfef71e9ee29e70cfeea787d2086ca5c99a300ef43aeed7abbda
data/guard-nginx.gemspec CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
34
34
 
35
35
  spec.add_dependency 'guard-compat', '~> 1.2'
36
36
 
37
- spec.add_development_dependency "bundler", "~> 1.16"
37
+ spec.add_development_dependency "bundler", "~> 2.1"
38
38
  spec.add_development_dependency "rake", "~> 10.0"
39
39
  spec.add_development_dependency "rspec", "~> 3.0"
40
40
  end
data/lib/guard/nginx.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'guard/compat/plugin'
2
4
  require 'guard/nginx/version'
3
5
  require 'guard/nginx/config_processor'
@@ -16,7 +18,7 @@ module ::Guard
16
18
  generate_config
17
19
 
18
20
  IO.popen("#{executable} -c #{tmp_path}/config/nginx.conf", 'w+')
19
- UI.info "Nginx started" if $?.success?
21
+ UI.info 'Nginx started' if $CHILD_STATUS.success?
20
22
  end
21
23
 
22
24
  def stop
@@ -24,7 +26,7 @@ module ::Guard
24
26
  if pid
25
27
  UI.info "Sending TERM signal to Nginx (#{pid})"
26
28
  FileUtils.rm "#{tmp_path}/config/nginx.conf"
27
- Process.kill("TERM", pid)
29
+ ::Process.kill('TERM', pid)
28
30
  true
29
31
  end
30
32
  end
@@ -35,7 +37,7 @@ module ::Guard
35
37
  generate_config
36
38
 
37
39
  UI.info "Sending HUP signal to Nginx (reloading #{pid})"
38
- Process.kill("HUP", pid)
40
+ ::Process.kill('HUP', pid)
39
41
  true
40
42
  end
41
43
  end
@@ -44,16 +46,16 @@ module ::Guard
44
46
  reload
45
47
  end
46
48
 
47
- def run_on_change(paths)
49
+ def run_on_change(_paths)
48
50
  true
49
51
  end
50
52
 
51
53
  private
52
54
 
53
55
  def pidfile_path
54
- options.fetch(:pidfile) {
56
+ options.fetch(:pidfile) do
55
57
  File.expand_path('tmp/pids/nginx.pid', Dir.pwd)
56
- }
58
+ end
57
59
  end
58
60
 
59
61
  def tmp_path
@@ -70,15 +72,15 @@ module ::Guard
70
72
  '-'
71
73
  ).result(
72
74
  ConfigProcessor.new({
73
- port: port,
74
- use_ssl: true,
75
- http_port: 3000,
76
- https_port: 3001,
77
- server_name: 'localhost'
78
- }).get_binding
75
+ port: port,
76
+ use_ssl: true,
77
+ http_port: 3000,
78
+ https_port: 3001,
79
+ server_name: 'localhost'
80
+ }).get_binding
79
81
  )
80
82
 
81
- File.open("#{tmp_path}/config/nginx.conf", "w") { |f| f.write(file) }
83
+ File.open("#{tmp_path}/config/nginx.conf", 'w') { |f| f.write(file) }
82
84
  end
83
85
 
84
86
  def pid
@@ -90,7 +92,7 @@ module ::Guard
90
92
  end
91
93
 
92
94
  def port
93
- options.fetch(:port){ 3000 }
95
+ options.fetch(:port) { 3000 }
94
96
  end
95
97
  end
96
98
  end
@@ -7,6 +7,11 @@ events {
7
7
  }
8
8
 
9
9
  http {
10
+ map $http_upgrade $connection_upgrade {
11
+ default upgrade;
12
+ '' close;
13
+ }
14
+
10
15
  types {
11
16
  text/html html htm shtml;
12
17
  text/css css;
@@ -167,6 +172,16 @@ http {
167
172
  location = /404.html {
168
173
  root html;
169
174
  }
175
+ location /cable {
176
+ proxy_pass http://puma_guard_nginx;
177
+ proxy_http_version 1.1;
178
+ proxy_redirect off;
179
+ proxy_set_header Upgrade $http_upgrade;
180
+ proxy_set_header Connection $connection_upgrade;
181
+ proxy_set_header Host $host;
182
+ proxy_set_header X-Forwarded-Proto $scheme;
183
+ proxy_set_header X-Forwarded-Host $host;
184
+ }
170
185
 
171
186
  if ($request_method !~ ^(GET|HEAD|PUT|PATCH|POST|DELETE|OPTIONS)$ ){
172
187
  return 405;
@@ -2,6 +2,6 @@ require 'guard/compat/plugin'
2
2
 
3
3
  module ::Guard
4
4
  class NginxVersion
5
- VERSION = "0.1.2".freeze
5
+ VERSION = "0.1.3".freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-nginx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederik Spang
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-31 00:00:00.000000000 Z
11
+ date: 2021-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard-compat
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.16'
33
+ version: '2.1'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.16'
40
+ version: '2.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - frederik@progras.dk
72
72
  executables: []
@@ -95,7 +95,7 @@ licenses:
95
95
  metadata:
96
96
  allowed_push_host: https://rubygems.org
97
97
  source_code_uri: https://github.com/prograsdk/guard-nginx
98
- post_install_message:
98
+ post_install_message:
99
99
  rdoc_options: []
100
100
  require_paths:
101
101
  - lib
@@ -110,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  requirements: []
113
- rubyforge_project:
114
- rubygems_version: 2.7.7
115
- signing_key:
113
+ rubygems_version: 3.1.2
114
+ signing_key:
116
115
  specification_version: 4
117
116
  summary: A guard-plugin for running a local installation of nginx.
118
117
  test_files: []