right_data 0.7.7 → 0.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,7 +164,7 @@ module RightData
164
164
  # puts "#{pre}'#{n.path.gsub(/'/,"\\\\'")}' # Empty... "
165
165
  false
166
166
  else
167
- puts "# #{n.path} # Not #{n.duplicate_children} dup/ #{n.ignore_children} ign / #{n.other_children} other "
167
+ puts "# #{n.path} # Note: #{n.duplicate_children} dup/ #{n.ignore_children} ign / #{n.other_children} other "
168
168
  true
169
169
  end
170
170
  end
@@ -160,7 +160,7 @@ module RightData
160
160
  # puts "#{pre}'#{n.path.gsub(/'/,"\\\\'")}' # Empty... "
161
161
  false
162
162
  else
163
- puts "# #{n.path} # Not #{n.duplicate_children} dup/ #{n.ignore_children} ign / #{n.other_children} other "
163
+ puts "# #{n.path} # Note #{n.duplicate_children} dup/ #{n.ignore_children} ign / #{n.other_children} other "
164
164
  true
165
165
  end
166
166
  end
data/lib/main.rb CHANGED
@@ -159,9 +159,8 @@ module RightData
159
159
  size = File.size(file_to_check)
160
160
  return [] if size == 0 # Ignore empty files
161
161
  possible_master_dups = master_index[File.basename(file_to_check).downcase] || []
162
- possible_master_dups.select { |master_file|
163
- self.identical_images?(master_file,file_to_check)
164
- }
162
+ r = possible_master_dups.find { |master_file| self.identical_images?(master_file,file_to_check) }
163
+ r == nil ? [] : [r] # Original check API wanted an array
165
164
  end
166
165
 
167
166
  def self.check_file_in_index(master_index, file_to_check)
@@ -170,14 +169,14 @@ module RightData
170
169
  possible_master_dups = master_index[size] || []
171
170
  offset = 0
172
171
  while !possible_master_dups.empty? && offset <= size
173
- file_to_check_block = get_block(file_to_check, offset)
172
+ file_to_check_block = get_block(file_to_check, offset)
174
173
  new_possible_master_dups = []
175
- possible_master_dups.each do |master|
176
- block = get_block(master,offset)
177
- if(block == file_to_check_block)
178
- new_possible_master_dups << master
179
- end
180
- end
174
+ possible_master_dups.each do |master|
175
+ block = get_block(master,offset)
176
+ if(block == file_to_check_block)
177
+ new_possible_master_dups << master
178
+ end
179
+ end
181
180
  possible_master_dups = new_possible_master_dups
182
181
  offset += BLOCK_SIZE
183
182
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_data
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 7
10
- version: 0.7.7
9
+ - 8
10
+ version: 0.7.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jonathan Siegel