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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6fadfe59eea88acb49e79650348219fccdb3b51f0c9fad2c6c7c5976fb464d4
4
- data.tar.gz: da9b088cbfcb54ea7dc5a8fcbf53dfde050f21afa128ea261c485034d73626d9
3
+ metadata.gz: afebcc41ccb4bacdc8abd87bb29bdd041e2d16d022317ceec7b47df81b0e6cf2
4
+ data.tar.gz: 8e6bbb9c21519bd054a9bd713e67a6fb64d5a5edd29cae37e2ea31abc36b3de9
5
5
  SHA512:
6
- metadata.gz: 12b886de9637042d5bd763a6bf7a7e9137bc7a89cc3850da53ff7e547049996b2c66d7dc4fff2259dffe8cf26a68db35458552e0fa57371fc7c8114de7c4c8b9
7
- data.tar.gz: '08b3cc949beb54c750f5b5d3313ae10ea2bdee5e056fc9223514126b47e0a81b3c05d9cb99cd639b2fdf882c210a7a9d27e5c66187ae424984e37c91238819d1'
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..-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 |_, file|
83
- parent_dir, dir_exists, level_depth = file[1..-1]
84
- level_depth-=1 unless level_depth.zero?
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
@@ -1,3 +1,3 @@
1
1
  module RspecFileChef
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.2'
3
3
  end
@@ -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 previous state of tracking files and temporary test files cleaner.}
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.0
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 previous state of tracking
70
- files and temporary test files cleaner.
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: []