potluck-nginx 0.0.6 → 0.0.7

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: 27f10a23324844c7c0e3733f2ce1d7d48c0fd4fd61d0444e45f7db62a3a4d58a
4
- data.tar.gz: '094a492be3e1efa5c5919f14111d03b86de1ab809e8482635b313671d658bb12'
3
+ metadata.gz: 4fc8a1ec53a80c8a2914316ea35e955a79851fde0c32b59c2d26b22c573e4d3f
4
+ data.tar.gz: 1f5beb340d4e719f11f98806a7d96844e9c71b11aef0de8441de516d170c0a24
5
5
  SHA512:
6
- metadata.gz: 9216e7234a2ccfcb0ae3589b517b76b2bc4ba7800cd73cd9fc5330b516511ab0ad41ae80b0daf3266dada155dd1e8005866cccbab1a28afabdd6a2473d41a62f
7
- data.tar.gz: 5bce05141ee5156f2cf1b9d83d062bb9c4fbea5226a8b666ecce8dbb54e5d0bd273e027c014e847a9f24cf11c22ad77a4bc68c733b8e9f9f56908e279382a0fc
6
+ metadata.gz: 2852025b7fa30b945c8450b23d9efbd725b5abf3dcc41875dff7a860e85a182074c7e47ea3bf8cf7442e7ebab0a715d56296cea541b5a1c9ad9906369aeaa3fc
7
+ data.tar.gz: 99cef178c6195136c566f55948b5b64068a56ffaa918f4bdea05c7f193d9161ad05796a7a33a3c4dfc0637d1ecb491a818dac35c36516c6a241b581a119f999e
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.7
@@ -73,10 +73,10 @@ module Potluck
73
73
  #
74
74
  def ensure_files
75
75
  return if !@auto_generated || (
76
- File.exists?(@csr_file) &&
77
- File.exists?(@key_file) &&
78
- File.exists?(@crt_file) &&
79
- File.exists?(@dhparam_file) &&
76
+ File.exist?(@csr_file) &&
77
+ File.exist?(@key_file) &&
78
+ File.exist?(@crt_file) &&
79
+ File.exist?(@dhparam_file) &&
80
80
  (Time.parse(
81
81
  @nginx.run("openssl x509 -enddate -noout -in #{@crt_file}").sub('notAfter=', '')
82
82
  ) - Time.now) >= CERT_RENEW_DAYS * 24 * 60 * 60
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Potluck
4
+ class Nginx < Service
5
+ VERSION = '0.0.7'
6
+ end
7
+ end
data/lib/potluck/nginx.rb CHANGED
@@ -4,6 +4,7 @@ require('fileutils')
4
4
  require('potluck')
5
5
  require_relative('nginx/ssl')
6
6
  require_relative('nginx/util')
7
+ require_relative('nginx/version')
7
8
 
8
9
  module Potluck
9
10
  ##
@@ -146,14 +147,14 @@ module Potluck
146
147
  <<~EOS
147
148
  <key>ProgramArguments</key>
148
149
  <array>
149
- <string>/usr/local/opt/nginx/bin/nginx</string>
150
+ <string>#{HOMEBREW_PREFIX}/opt/nginx/bin/nginx</string>
150
151
  <string>-g</string>
151
152
  <string>daemon off;</string>
152
153
  </array>
153
154
  <key>StandardOutPath</key>
154
- <string>/usr/local/var/log/nginx/access.log</string>
155
+ <string>#{HOMEBREW_PREFIX}/var/log/nginx/access.log</string>
155
156
  <key>StandardErrorPath</key>
156
- <string>/usr/local/var/log/nginx/error.log</string>
157
+ <string>#{HOMEBREW_PREFIX}/var/log/nginx/error.log</string>
157
158
  EOS
158
159
  )
159
160
  end
@@ -351,9 +352,7 @@ module Potluck
351
352
  # Writes the Nginx configuration to the (inactive) configuration file.
352
353
  #
353
354
  def write_config
354
- File.open(@config_file_inactive, 'w') do |file|
355
- file.write(config_file_content)
356
- end
355
+ File.write(@config_file_inactive, config_file_content)
357
356
  end
358
357
 
359
358
  ##
@@ -367,7 +366,7 @@ module Potluck
367
366
  # Renames the active Nginx configuration file to its inactive name.
368
367
  #
369
368
  def deactivate_config
370
- FileUtils.mv(@config_file_active, @config_file_inactive) if File.exists?(@config_file_active)
369
+ FileUtils.mv(@config_file_active, @config_file_inactive) if File.exist?(@config_file_active)
371
370
  end
372
371
 
373
372
  ##
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potluck-nginx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nate Pickens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-21 00:00:00.000000000 Z
11
+ date: 2023-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: potluck
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.6
19
+ version: 0.0.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.6
26
+ version: 0.0.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -67,9 +67,11 @@ extra_rdoc_files: []
67
67
  files:
68
68
  - LICENSE
69
69
  - README.md
70
+ - VERSION
70
71
  - lib/potluck/nginx.rb
71
72
  - lib/potluck/nginx/ssl.rb
72
73
  - lib/potluck/nginx/util.rb
74
+ - lib/potluck/nginx/version.rb
73
75
  homepage: https://github.com/npickens/potluck/tree/master/potluck-nginx
74
76
  licenses:
75
77
  - MIT
@@ -92,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
94
  - !ruby/object:Gem::Version
93
95
  version: '0'
94
96
  requirements: []
95
- rubygems_version: 3.2.32
97
+ rubygems_version: 3.3.7
96
98
  signing_key:
97
99
  specification_version: 4
98
100
  summary: A Ruby manager for Nginx.