fingerprint 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,6 +103,7 @@ case (OPTIONS[:mode])
103
103
  end
104
104
 
105
105
  options = {}
106
+ options[:excludes] = [OPTIONS[:name]]
106
107
  options[:verbose] = true if OPTIONS[:verbose]
107
108
 
108
109
  File.open(output_file, "w") do |io|
@@ -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] || DEFAULT_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 exclusion.match(path)
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
@@ -23,7 +23,7 @@ module Fingerprint
23
23
  module VERSION
24
24
  MAJOR = 1
25
25
  MINOR = 2
26
- TINY = 3
26
+ TINY = 4
27
27
 
28
28
  STRING = [MAJOR, MINOR, TINY].join('.')
29
29
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fingerprint
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 23
5
+ prerelease:
5
6
  segments:
6
7
  - 1
7
8
  - 2
8
- - 3
9
- version: 1.2.3
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-07-23 00:00:00 +12:00
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.3.6
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.