file_spec 0.1.1 → 0.1.2

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: 815fadd21dc4c1cc4656d17a14ac0f201a6ce087
4
- data.tar.gz: 85ed62a00e0c42737eff7dbf4bde33bc4dbca806
3
+ metadata.gz: ef49123a80e21b7b0f217058af1996c8d5c0ce24
4
+ data.tar.gz: cf886acb7de49edfd2176aef4906e4b05a4b630d
5
5
  SHA512:
6
- metadata.gz: c491b84297e5db0581a5c1c5af22d93195684711d992586f42e181a157acb04e9544f4e05c2afae0b15427002cf300923f23b73a97c59f9271432eec6ebffd09
7
- data.tar.gz: bb1928b2f1481bb4fc69bee4756475f328979a859354e3907f8821e6af52f22198e942ed885cf90f73e40db9b9a40cd15bba3dbad271b7d521f78e18b258c7ff
6
+ metadata.gz: '0639b146a0026ec90919c925a15d6672432d81441b4df093511e28f703fd0a27cd609d1f1bbd35f66d7f1be664aea1c6010fc4c0820c8083b13c9ca6814a7fc8'
7
+ data.tar.gz: 2297098c23a8f954f5ca81a307315bc623ddfc1bec11dbade9651154a84c8e6d4ef13779a0014eccaf025bbb4a4c7b072a16d78896919c7b92db167e929ae82f
@@ -83,14 +83,13 @@ module FileSpec
83
83
  # @param path [String,Pathname] the path to observe
84
84
  # @param opts [Hash] additional options passed to {#diff}
85
85
  def record_changes(path, **opts)
86
- basename = File.basename(path)
87
86
  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
+ before_path = File.join(tmp_path, "before")
88
+ after_path = File.join(tmp_path, "after")
90
89
 
91
- unless File.directory?(path)
92
- mkdir File.dirname(before_path)
93
- mkdir File.dirname(after_path)
90
+ if File.file?(path)
91
+ mkdir before_path
92
+ mkdir after_path
94
93
  end
95
94
 
96
95
  FileUtils.cp_r(path, before_path)
@@ -1,3 +1,3 @@
1
1
  module FileSpec
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: file_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ray Zane