preflight 0.0.3 → 0.0.4

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.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ v0.0.4 (24th April 2011)
2
+ - bug: fix occasional crash due to not dereferencing an object
3
+ - bug: improve accuracy of rules that check box-related page attributes
4
+ - MediaBox, TrimBox, etc
5
+
1
6
  v0.0.3 (7th April 2011)
2
7
  - added some additional rules to the pdfx1a profile
3
8
 
@@ -12,10 +12,16 @@ module Preflight
12
12
  def initialize
13
13
  @messages = []
14
14
  @page_num = 0
15
+ @parent = {}
16
+ end
17
+
18
+ def begin_page_container(hash = {})
19
+ @parent.merge!(hash)
15
20
  end
16
21
 
17
22
  def begin_page(hash = {})
18
23
  @page_num += 1
24
+ hash = @parent.merge(hash)
19
25
 
20
26
  media = hash[:MediaBox]
21
27
  bleed = hash[:BleedBox]
@@ -7,7 +7,7 @@ module Preflight
7
7
 
8
8
  def messages(ohash)
9
9
  intents = output_intents(ohash).select { |dict|
10
- dict[:S] == :GTS_PDFX
10
+ ohash.object(dict)[:S] == :GTS_PDFX
11
11
  }
12
12
 
13
13
  if intents.size != 1
@@ -12,10 +12,16 @@ module Preflight
12
12
  def initialize
13
13
  @messages = []
14
14
  @page_num = 0
15
+ @parent = {}
16
+ end
17
+
18
+ def begin_page_container(hash = {})
19
+ @parent.merge!(hash)
15
20
  end
16
21
 
17
22
  def begin_page(hash = {})
18
23
  @page_num += 1
24
+ hash = @parent.merge(hash)
19
25
 
20
26
  if hash[:MediaBox].nil?
21
27
  @messages << "every page must have a MediaBox (page #{@page_num})"
data/lib/preflight.rb CHANGED
@@ -7,5 +7,5 @@ require 'preflight/rules'
7
7
  require 'preflight/profiles'
8
8
 
9
9
  module Preflight
10
- VERSION = "0.0.3"
10
+ VERSION = "0.0.4"
11
11
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - James Healy
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-04-07 00:00:00 +10:00
17
+ date: 2011-04-24 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency