file_spec 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: ca21025c22dcba12e7baf4d9143e621eeec2f53e
4
- data.tar.gz: c176bae86df4299a01bf9578f8b576e6330118a5
3
+ metadata.gz: 815fadd21dc4c1cc4656d17a14ac0f201a6ce087
4
+ data.tar.gz: 85ed62a00e0c42737eff7dbf4bde33bc4dbca806
5
5
  SHA512:
6
- metadata.gz: 584e278157a2ea0ae5cd628f88211ad416a5e545d79ff6d993d7e83edc97f22068536b464725befc7c080f356ea33d009bb785eca7e21aab687b3a313f4ac004
7
- data.tar.gz: edaf395bf18e3baa12e11a33cf77a841bde035056bcd2f94b1183dbb4d05e838c562d1a03382b7ea780ed7d407a8a9e5e984f7fe012d12406224d5a78f9e68ae
6
+ metadata.gz: c491b84297e5db0581a5c1c5af22d93195684711d992586f42e181a157acb04e9544f4e05c2afae0b15427002cf300923f23b73a97c59f9271432eec6ebffd09
7
+ data.tar.gz: bb1928b2f1481bb4fc69bee4756475f328979a859354e3907f8821e6af52f22198e942ed885cf90f73e40db9b9a40cd15bba3dbad271b7d521f78e18b258c7ff
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ Gemfile.lock
@@ -84,22 +84,22 @@ module FileSpec
84
84
  # @param opts [Hash] additional options passed to {#diff}
85
85
  def record_changes(path, **opts)
86
86
  basename = File.basename(path)
87
+ tmp_path = Dir.mktmpdir("file_spec")
88
+ before_path = File.join(tmp_path, "before", basename)
89
+ after_path = File.join(tmp_path, "after", basename)
87
90
 
88
- Dir.mktmpdir do |tmp|
89
- before = File.join(tmp, "before", basename)
90
- after = File.join(tmp, "after", basename)
91
-
92
- unless File.directory?(path)
93
- mkdir File.dirname(before)
94
- mkdir File.dirname(after)
95
- end
91
+ unless File.directory?(path)
92
+ mkdir File.dirname(before_path)
93
+ mkdir File.dirname(after_path)
94
+ end
96
95
 
97
- FileUtils.cp_r(path, before)
98
- yield
99
- FileUtils.cp_r(path, after)
96
+ FileUtils.cp_r(path, before_path)
97
+ yield
98
+ FileUtils.cp_r(path, after_path)
100
99
 
101
- diff("before", "after", chdir: tmp, **opts)
102
- end
100
+ diff("before", "after", chdir: tmp_path, **opts)
101
+ ensure
102
+ FileUtils.rm_rf(tmp_path)
103
103
  end
104
104
  end
105
105
 
@@ -1,3 +1,3 @@
1
1
  module FileSpec
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Zane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-26 00:00:00.000000000 Z
11
+ date: 2019-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -65,7 +65,6 @@ files:
65
65
  - ".yardopts"
66
66
  - CODE_OF_CONDUCT.md
67
67
  - Gemfile
68
- - Gemfile.lock
69
68
  - LICENSE.txt
70
69
  - README.md
71
70
  - Rakefile
@@ -1,35 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- file_spec (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- diff-lcs (1.3)
10
- rake (10.5.0)
11
- rspec (3.9.0)
12
- rspec-core (~> 3.9.0)
13
- rspec-expectations (~> 3.9.0)
14
- rspec-mocks (~> 3.9.0)
15
- rspec-core (3.9.0)
16
- rspec-support (~> 3.9.0)
17
- rspec-expectations (3.9.0)
18
- diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.9.0)
20
- rspec-mocks (3.9.0)
21
- diff-lcs (>= 1.2.0, < 2.0)
22
- rspec-support (~> 3.9.0)
23
- rspec-support (3.9.0)
24
-
25
- PLATFORMS
26
- ruby
27
-
28
- DEPENDENCIES
29
- bundler (~> 2.0)
30
- file_spec!
31
- rake (~> 10.0)
32
- rspec (~> 3.0)
33
-
34
- BUNDLED WITH
35
- 2.0.2