rspec_file_chef 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec_file_chef/state_keeper.rb +10 -6
- data/lib/rspec_file_chef/version.rb +1 -1
- data/rspec_file_env.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afebcc41ccb4bacdc8abd87bb29bdd041e2d16d022317ceec7b47df81b0e6cf2
|
4
|
+
data.tar.gz: 8e6bbb9c21519bd054a9bd713e67a6fb64d5a5edd29cae37e2ea31abc36b3de9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7acae8ac1ebec9e0c3fdb83302409fad941045871fd83c758ef318de90e1cc48fa4eb6724b4ef56734f6abc0b04ddeb4afcc1517fa1c6bb19b4bd33e5f20271
|
7
|
+
data.tar.gz: 03b9d7c5a40f8ce2d1a586719ce511b535fcae055c0b08a2337156f9e6b85c63c2f1a81e4b031f5dd212b2a6d1b2e4d9459a4db283d6c9b62c4fec23048a07d7
|
@@ -49,7 +49,7 @@ module RspecFileChef
|
|
49
49
|
|
50
50
|
def create_nonexistent_dirs
|
51
51
|
path_table.each do |_, file|
|
52
|
-
file_dir, dir_exists = file[1
|
52
|
+
file_dir, dir_exists = file[1..2]
|
53
53
|
FileUtils.mkdir_p(file_dir) unless dir_exists
|
54
54
|
end
|
55
55
|
end
|
@@ -78,12 +78,16 @@ module RspecFileChef
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
+
def candidate_to_erase(file_data)
|
82
|
+
parent_dir, level_depth = file_data[1], file_data[-1]
|
83
|
+
level_depth-=1 unless level_depth.zero?
|
84
|
+
discover_path_depth(parent_dir)[level_depth]
|
85
|
+
end
|
86
|
+
|
81
87
|
def delete_nonexistent_dirs
|
82
|
-
path_table.each do |_,
|
83
|
-
|
84
|
-
|
85
|
-
candidate_to_erase = discover_path_depth(parent_dir)[level_depth]
|
86
|
-
FileUtils.rm_r(candidate_to_erase) unless dir_exists
|
88
|
+
path_table.each do |_, file_data|
|
89
|
+
dir_exists = file_data[2]
|
90
|
+
FileUtils.rm_r(candidate_to_erase(file_data)) unless dir_exists
|
87
91
|
end
|
88
92
|
end
|
89
93
|
end
|
data/rspec_file_env.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.email = ['admin@bestweb.com.ua']
|
10
10
|
|
11
11
|
spec.summary = %q{RspecFileChef}
|
12
|
-
spec.description = %q{RSpec File Environment control. Keeper of
|
12
|
+
spec.description = %q{RSpec File Environment control. Keeper of current state of tracked files and temporary files cleaner.}
|
13
13
|
spec.homepage = 'https://github.com/bestwebua/rspec_file_chef'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_file_chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladislav Trotsenko
|
@@ -66,8 +66,8 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
-
description: RSpec File Environment control. Keeper of
|
70
|
-
|
69
|
+
description: RSpec File Environment control. Keeper of current state of tracked files
|
70
|
+
and temporary files cleaner.
|
71
71
|
email:
|
72
72
|
- admin@bestweb.com.ua
|
73
73
|
executables: []
|