diff --git a/lib/preflight/measurements.rb b/lib/preflight/measurements.rb index 62acc3b..c7237aa 100644 --- a/lib/preflight/measurements.rb +++ b/lib/preflight/measurements.rb @@ -11,13 +11,13 @@ module Measurements # convert inches to standard PDF points # def in2pt(inch) - return inch * BigDecimal.new("72") + return inch * BigDecimal('72') end # convert mm to standard PDF points # def mm2pt(mm) - return mm * (BigDecimal.new("72") / BigDecimal.new("25.4")) + return mm * (BigDecimal('72') / BigDecimal('25.4')) end # convert mm to standard PDF points diff --git a/lib/preflight/rules/consistent_boxes.rb b/lib/preflight/rules/consistent_boxes.rb index 403457f..c7fd2c4 100644 --- a/lib/preflight/rules/consistent_boxes.rb +++ b/lib/preflight/rules/consistent_boxes.rb @@ -19,7 +19,7 @@ class ConsistentBoxes # Default tolerance is that each page box MUST be within .03 PDF points # of the same box on all other pages - DEFAULT_TOLERANCE = (BigDecimal.new("-0.03")..BigDecimal.new("0.03")) + DEFAULT_TOLERANCE = (BigDecimal('-0.03')..BigDecimal('0.03')) attr_reader :issues diff --git a/lib/preflight/rules/cropbox_matches_mediabox.rb b/lib/preflight/rules/cropbox_matches_mediabox.rb index 7027469..6fbd18e 100644 --- a/lib/preflight/rules/cropbox_matches_mediabox.rb +++ b/lib/preflight/rules/cropbox_matches_mediabox.rb @@ -31,7 +31,7 @@ def page=(page) private def round_off(*arr) - arr.flatten.compact.map { |n| BigDecimal.new(n.to_s).round(2) } + arr.flatten.compact.map { |n| BigDecimal(n.to_s).round(2) } end end end diff --git a/lib/preflight/rules/mediabox_at_origin.rb b/lib/preflight/rules/mediabox_at_origin.rb index e241b53..0bf481c 100644 --- a/lib/preflight/rules/mediabox_at_origin.rb +++ b/lib/preflight/rules/mediabox_at_origin.rb @@ -35,7 +35,7 @@ def page=(page) private def round_off(*arr) - arr.flatten.compact.map { |n| BigDecimal.new(n.to_s).round(2) } + arr.flatten.compact.map { |n| BigDecimal(n.to_s).round(2) } end end end diff --git a/lib/preflight/rules/min_ppi.rb b/lib/preflight/rules/min_ppi.rb index d9252f7..963301f 100644 --- a/lib/preflight/rules/min_ppi.rb +++ b/lib/preflight/rules/min_ppi.rb @@ -65,8 +65,8 @@ def invoke_image_xobject(xobject) device_w = pt2in(image_width) device_h = pt2in(image_height) - horizontal_ppi = BigDecimal.new((sample_w / device_w).to_s).round(3) - vertical_ppi = BigDecimal.new((sample_h / device_h).to_s).round(3) + horizontal_ppi = BigDecimal((sample_w / device_w).to_s).round(3) + vertical_ppi = BigDecimal((sample_h / device_h).to_s).round(3) if horizontal_ppi < @min_ppi || vertical_ppi < @min_ppi @issues << Issue.new("Image with low PPI/DPI", self, :page => @page.number, diff --git a/spec/rules/consistent_boxes_spec.rb b/spec/rules/consistent_boxes_spec.rb index 8de9056..557b3b7 100644 --- a/spec/rules/consistent_boxes_spec.rb +++ b/spec/rules/consistent_boxes_spec.rb @@ -28,7 +28,7 @@ it "pass files with mismatched MediaBox on each page within the defined tolerance" do filename = pdf_spec_file("two_mismatched_pages") - tolerance = (BigDecimal.new("-300")..BigDecimal.new("300")) + tolerance = (BigDecimal("-300")..BigDecimal("300")) rule = Preflight::Rules::ConsistentBoxes.new(tolerance) PDF::Reader.open(filename) do |reader|