localhost 1.1.7 → 1.1.8

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
  SHA256:
3
- metadata.gz: 43b262a968bffc41686157f8aeb624e0521827a90e33e73c6611296bd6e73e87
4
- data.tar.gz: edef20da4668a9b95afe5c20da1a6d967ab6af0cfb920b8f5359d9c206ca6bee
3
+ metadata.gz: 7a8bb85b8e82b1ceaec73363ba246313ee46da6d47c948ed2b57bfa1f931b51a
4
+ data.tar.gz: 8953521fbcd8eb215ddfaaa59a65b96715c8e69dfb925b0794d1e5e41c204613
5
5
  SHA512:
6
- metadata.gz: bd194a986200716fcc1989e6048269f399f7b91c4ec7e03c5214dd7e815da067ec854e079abedb1ca55fd0e260a0b787c0436a85e4f849baecb77ae583f9ed06
7
- data.tar.gz: 98288d9c362a8d9f7b1fdd23bf5b24c110652cd480eb17a38218e16384155385ecbc87a5e210ea1fa02dd4c210297898dd2dac0fc81d6503ae086a08b1972501
6
+ metadata.gz: 16e6781fb5b9caf6180ae68579066d2ab0006fbbb5107d81a6ed475dabeb37a0362ecb67a4e19a7f4d527794e56848c9c367286a1a6424494e0f3bc81cfc9704
7
+ data.tar.gz: 93a1b52e82b6abf55413b9af17f3769bc659cfcc857da9e6a0c9860120137247490abd11d9261d17539f1ef9ef234db29827c3ce07745ac89a0dd1ebad28b2fb
@@ -169,15 +169,21 @@ module Localhost
169
169
  end
170
170
 
171
171
  def save(path)
172
- File.write(
173
- File.join(path, "#{@hostname}.crt"),
174
- self.certificate.to_pem
175
- )
172
+ lockfile_path = File.join(path, "#{@hostname}.lock")
176
173
 
177
- File.write(
178
- File.join(path, "#{@hostname}.key"),
179
- self.key.to_pem
180
- )
174
+ File.open(lockfile_path, File::RDWR|File::CREAT, 0644) do |lockfile|
175
+ lockfile.flock(File::LOCK_EX)
176
+
177
+ File.write(
178
+ File.join(path, "#{@hostname}.crt"),
179
+ self.certificate.to_pem
180
+ )
181
+
182
+ File.write(
183
+ File.join(path, "#{@hostname}.key"),
184
+ self.key.to_pem
185
+ )
186
+ end
181
187
  end
182
188
  end
183
189
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Localhost
22
- VERSION = "1.1.7"
22
+ VERSION = "1.1.8"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: localhost
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-14 00:00:00.000000000 Z
11
+ date: 2021-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.1.2
97
+ rubygems_version: 3.2.3
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Manage a local certificate authority for self-signed localhost development