pdf-reader 0.7.4 → 0.7.5

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.
Files changed (4) hide show
  1. data/CHANGELOG +5 -0
  2. data/Rakefile +1 -1
  3. data/lib/pdf/reader/parser.rb +10 -4
  4. metadata +2 -2
data/CHANGELOG CHANGED
@@ -1,7 +1,12 @@
1
+ v0.7.5 (27th August 2008)
2
+ - Fix a 1.8.7ism
3
+
1
4
  v0.7.4 (7th August 2008)
2
5
  - Raise a MalformedPDFError if a content stream contains an unterminated string
3
6
  - Fix an bug that was causing an endless loop on some OSX systems
4
7
  - valid strings were incorrectly thought to be unterminated
8
+ - thanks to Jeff Webb for playing email ping pong with me as I tracked this
9
+ issue down
5
10
 
6
11
  v0.7.3 (11th June 2008)
7
12
  - Add a high level way to get direct access to a PDF object, including a new executable: pdf_object
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/testtask'
6
6
  require "rake/gempackagetask"
7
7
  require 'spec/rake/spectask'
8
8
 
9
- PKG_VERSION = "0.7.4"
9
+ PKG_VERSION = "0.7.5"
10
10
  PKG_NAME = "pdf-reader"
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
@@ -121,10 +121,16 @@ class PDF::Reader
121
121
 
122
122
  # find the first occurance of ( ) [ \ or ]
123
123
  #
124
- # we used to use the following line, but it fails sometimes
125
- # under OSX.
126
- # i = @buffer.raw.index(/[\\\(\)]/)
127
- i = @buffer.raw.unpack("C*").index { |n| [40, 41, 91, 92, 93].include?(n) }
124
+ # I originally just used the regexp form of index(), but it seems to be
125
+ # buggy on some OSX systems (returns nil when there is a match). The
126
+ # block form of index() is more reliable, but only works on 1.8.7 or
127
+ # greater.
128
+ #
129
+ if RUBY_VERSION >= "1.8.7"
130
+ i = @buffer.raw.unpack("C*").index { |n| [40, 41, 91, 92, 93].include?(n) }
131
+ else
132
+ i = @buffer.raw.index(/[\\\(\)]/)
133
+ end
128
134
 
129
135
  if i.nil?
130
136
  str << @buffer.raw + "\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pdf-reader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Jones
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-07 00:00:00 +10:00
12
+ date: 2008-08-27 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies: []
15
15