relinker 1.0.2 → 1.1.0

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: 10425b606f58c7f4f0f93c0b115a410fa04484fed8c783827c0c511a5df3a024
4
- data.tar.gz: d7f969d45fdc209f02ea9494ebae67bfd3c492bbaea75a26c07ec5e74043cf1c
3
+ metadata.gz: 06c4f0a93483f02dc239eb09f872ba17ae7ce52f64b1e31fd68b490985863b4a
4
+ data.tar.gz: 25adabb0e84fd4ed9e0e1e7ce1112bf5266d250de61e5c36e7a50a06803c42bc
5
5
  SHA512:
6
- metadata.gz: 0b41e49c9747cba364bd0866c7fd9e6ddd3fd78a6c18a46a7deb7761e7c697ba021b0f83f18b516969ba8391e8186b63f3f88927d6ab41cc3ce8565a50c76de7
7
- data.tar.gz: 22887583487a83c9e9579f0521392a0da841a919761773cc274e156adbae74cec2189f865193dae31c368b51d63326b23aeda1ddfc1be60a7b9c94421fc1f878
6
+ metadata.gz: 2bfa0cd151016ecb2214c2055f68b192058e29df8c7a36c2e3cb42de1f96765cf23e6fefdb00f9436b569fc49cff988e9017f70c1ac5aa1fec96cb0a1b8c0917
7
+ data.tar.gz: 35f4f0e5d4b557a68f83a970e90233b2c07e06901c8a183e2bc706a8361551f5c1da667868346db6269fe999875650df02f92bc7a270f8e0748977d1d1c79257
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relinker (1.0.0)
4
+ relinker (1.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -29,9 +29,9 @@ module Relinker
29
29
  children.each do |child|
30
30
  next if child.symlink?
31
31
  if child.directory?
32
- discover(child) { |file| yield(file, checksum(file)) }
32
+ discover(child) { |file| yield(file, checksum(file)) if regular_file?(file) }
33
33
  else
34
- yield(child, checksum(child))
34
+ yield(child, checksum(child)) if regular_file?(child)
35
35
  end
36
36
  end
37
37
  end
@@ -46,6 +46,12 @@ module Relinker
46
46
 
47
47
  private
48
48
 
49
+ def regular_file?(path)
50
+ special_types = %i[symlink chardev blockdev socket pipe]
51
+ special_type = special_types.find { |test| path.send("#{test}?") }
52
+ path.file? && !special_type && !path.to_s.match(/:|pid$|swap$|lock$/)
53
+ end
54
+
49
55
  def merge_options(options = {})
50
56
  options = options.map { |key, val| [key.to_sym, val] }.to_h
51
57
  default_options.merge(options)
@@ -1,3 +1,3 @@
1
1
  module Relinker
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relinker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Zinovyev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-07 00:00:00.000000000 Z
11
+ date: 2018-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler