fingerprint 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/fingerprint +1 -0
- data/lib/fingerprint/scanner.rb +6 -9
- data/lib/fingerprint/version.rb +1 -1
- metadata +10 -7
data/bin/fingerprint
CHANGED
data/lib/fingerprint/scanner.rb
CHANGED
@@ -23,10 +23,7 @@ require 'find'
|
|
23
23
|
require 'digest'
|
24
24
|
|
25
25
|
module Fingerprint
|
26
|
-
|
27
|
-
# The default pattern for excluding files.
|
28
|
-
DEFAULT_EXCLUDES = [/\/\.[^\/]+$/, /\~$/]
|
29
|
-
|
26
|
+
|
30
27
|
# The scanner class can scan a set of directories and produce an index.
|
31
28
|
class Scanner
|
32
29
|
# Initialize the scanner to scan a given set of directories in order.
|
@@ -35,7 +32,7 @@ module Fingerprint
|
|
35
32
|
def initialize(roots, options = {})
|
36
33
|
@roots = roots
|
37
34
|
|
38
|
-
@excludes = options[:excludes] ||
|
35
|
+
@excludes = options[:excludes] || []
|
39
36
|
@output = options[:output] || StringIO.new
|
40
37
|
|
41
38
|
@options = options
|
@@ -69,7 +66,7 @@ module Fingerprint
|
|
69
66
|
|
70
67
|
@output.puts "#{d.hexdigest}: #{path}"
|
71
68
|
end
|
72
|
-
|
69
|
+
|
73
70
|
# Add information about excluded paths.
|
74
71
|
def output_excluded(path)
|
75
72
|
if @options[:verbose]
|
@@ -82,14 +79,14 @@ module Fingerprint
|
|
82
79
|
# Returns true if the given path should be excluded.
|
83
80
|
def excluded?(path)
|
84
81
|
@excludes.each do |exclusion|
|
85
|
-
if
|
82
|
+
if path.match(exclusion)
|
86
83
|
return true
|
87
84
|
end
|
88
85
|
end
|
89
86
|
|
90
87
|
return false
|
91
88
|
end
|
92
|
-
|
89
|
+
|
93
90
|
# Run the scanning process.
|
94
91
|
def scan
|
95
92
|
excluded_count = 0
|
@@ -111,7 +108,7 @@ module Fingerprint
|
|
111
108
|
end
|
112
109
|
else
|
113
110
|
# Skip anything that isn't a valid file (e.g. pipes, sockets, symlinks).
|
114
|
-
if excluded?(path) || File.symlink?(path) || !File.file?(path)
|
111
|
+
if excluded?(path) || File.symlink?(path) || !File.file?(path) || !File.readable?(path)
|
115
112
|
excluded_count += 1
|
116
113
|
output_excluded(path)
|
117
114
|
else
|
data/lib/fingerprint/version.rb
CHANGED
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
5
6
|
segments:
|
6
7
|
- 1
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
9
|
+
- 4
|
10
|
+
version: 1.2.4
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Samuel Williams
|
@@ -14,8 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2011-
|
18
|
-
default_executable: fingerprint
|
18
|
+
date: 2011-08-09 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description:
|
@@ -33,7 +33,6 @@ files:
|
|
33
33
|
- lib/fingerprint/version.rb
|
34
34
|
- lib/fingerprint.rb
|
35
35
|
- README.md
|
36
|
-
has_rdoc: yard
|
37
36
|
homepage: http://www.oriontransfer.co.nz/projects/admin-toolbox/fingerprint
|
38
37
|
licenses: []
|
39
38
|
|
@@ -43,23 +42,27 @@ rdoc_options: []
|
|
43
42
|
require_paths:
|
44
43
|
- lib
|
45
44
|
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
+
hash: 3
|
49
50
|
segments:
|
50
51
|
- 0
|
51
52
|
version: "0"
|
52
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
53
55
|
requirements:
|
54
56
|
- - ">="
|
55
57
|
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
56
59
|
segments:
|
57
60
|
- 0
|
58
61
|
version: "0"
|
59
62
|
requirements: []
|
60
63
|
|
61
64
|
rubyforge_project:
|
62
|
-
rubygems_version: 1.
|
65
|
+
rubygems_version: 1.8.7
|
63
66
|
signing_key:
|
64
67
|
specification_version: 3
|
65
68
|
summary: Fingerprint is a tool for creating checksums of entire directory structures, and comparing them for inconsistencies.
|