file_spec 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/file_spec.rb +13 -13
- data/lib/file_spec/version.rb +1 -1
- metadata +2 -3
- data/Gemfile.lock +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 815fadd21dc4c1cc4656d17a14ac0f201a6ce087
|
4
|
+
data.tar.gz: 85ed62a00e0c42737eff7dbf4bde33bc4dbca806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c491b84297e5db0581a5c1c5af22d93195684711d992586f42e181a157acb04e9544f4e05c2afae0b15427002cf300923f23b73a97c59f9271432eec6ebffd09
|
7
|
+
data.tar.gz: bb1928b2f1481bb4fc69bee4756475f328979a859354e3907f8821e6af52f22198e942ed885cf90f73e40db9b9a40cd15bba3dbad271b7d521f78e18b258c7ff
|
data/.gitignore
CHANGED
data/lib/file_spec.rb
CHANGED
@@ -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
|
-
|
89
|
-
|
90
|
-
|
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
|
-
|
98
|
-
|
99
|
-
|
96
|
+
FileUtils.cp_r(path, before_path)
|
97
|
+
yield
|
98
|
+
FileUtils.cp_r(path, after_path)
|
100
99
|
|
101
|
-
|
102
|
-
|
100
|
+
diff("before", "after", chdir: tmp_path, **opts)
|
101
|
+
ensure
|
102
|
+
FileUtils.rm_rf(tmp_path)
|
103
103
|
end
|
104
104
|
end
|
105
105
|
|
data/lib/file_spec/version.rb
CHANGED
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.
|
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-
|
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
|
data/Gemfile.lock
DELETED
@@ -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
|