atomos 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/VERSION +1 -1
  4. data/lib/atomos.rb +4 -0
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b6b642bdf041beee0148d33c2ca0af28c9e3a98886a45d9772da527551354fb
4
- data.tar.gz: 19bd5261c787806e8cf3b833653bc18008ec40b8ce261bcb5798c98df3277e1a
3
+ metadata.gz: cfbb3fc3db361c21f5e625049181be7ca4970fcf11e7b9cd4aaabf0da2e66d7d
4
+ data.tar.gz: 9cd5e507898abc17b46812778c40b12d8c230f72d38d32667cef127a2561ff81
5
5
  SHA512:
6
- metadata.gz: 57dae199e4896dbc9ad5f26fee36f96310bf5f6647db913ea343fdb03a69e0606631ecf40161a473c764eb603475ac7317631503ee876fa59dcbef0965100808
7
- data.tar.gz: 1c59ba0f89730e73af035a9720e9d72aa21b94a1ef9a20e85744fcff04d7474e2ad9948b2b7daa7f8155eaf0dd961337d7802b8b2d79b647f34c111a3ac5ab43
6
+ metadata.gz: 97dff47b26198b24b0e3643dd7b88a62f117e6d4019904efd647fed024f0d867edfde3c4e0343c2f39bf87257fdabec10e44cec7288630103e5127ad8d322d3b
7
+ data.tar.gz: eccdcebc770810c367ee1788c8e99737bf43f94490d106cce3ca33a5259bca4ca23a008d31f368a4d2c242769e1647abe32783645ecbea8da840ba7f244b779b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atomos (0.1.2)
4
+ atomos (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -48,4 +48,4 @@ DEPENDENCIES
48
48
  rubocop
49
49
 
50
50
  BUNDLED WITH
51
- 1.16.1
51
+ 1.16.3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -5,6 +5,7 @@ require 'atomos/version'
5
5
  module Atomos
6
6
  module_function
7
7
 
8
+ # rubocop:disable Metrics/MethodLength
8
9
  def atomic_write(dest, contents = nil, tmpdir: nil, &block)
9
10
  unless contents.nil? ^ block.nil?
10
11
  raise ArgumentError, 'must provide either contents or a block'
@@ -20,11 +21,14 @@ module Atomos
20
21
  retval = yield tmpfile
21
22
  end
22
23
 
24
+ tmpfile.close
25
+
23
26
  File.rename(tmpfile.path, dest)
24
27
 
25
28
  retval
26
29
  end
27
30
  end
31
+ # rubocop:enable Metrics/MethodLength
28
32
 
29
33
  def self.default_tmpdir_for_file(dest, tmpdir)
30
34
  tmpdir ||= begin
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atomos
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
  - Samuel Giddins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-02 00:00:00.000000000 Z
11
+ date: 2018-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.7.4
116
+ rubygems_version: 2.7.7
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: A simple gem to atomically write files