lib/combine_pdf/parser.rb in combine_pdf-0.2.31 vs lib/combine_pdf/parser.rb in combine_pdf-0.2.32
- old
+ new
@@ -75,16 +75,17 @@
@parsed = _parse_
# puts @parsed
raise 'Unknown PDF parsing error - maleformed PDF file?' unless (@parsed.select { |i| !i.is_a?(Hash) }).empty?
- if @root_object == {}
+ if @root_object == {}.freeze
xref_streams = @parsed.select { |obj| obj.is_a?(Hash) && obj[:Type] == :XRef }
xref_streams.each do |xref_dictionary|
@root_object.merge! xref_dictionary
end
end
- raise 'root is unknown - cannot determine if file is Encrypted' if @root_object == {}
+
+ raise 'root is unknown - cannot determine if file is Encrypted' if @root_object == {}.freeze
if @root_object[:Encrypt]
# change_references_to_actual_values @root_object
warn 'PDF is Encrypted! Attempting to decrypt - not yet fully supported.'
decryptor = PDFDecrypt.new @parsed, @root_object