From d94a3e676b7b525e08b78aa9223d5bba2cf3b986 Mon Sep 17 00:00:00 2001 From: Andy Meneely Date: Tue, 30 May 2017 16:19:42 -0400 Subject: [PATCH] Fix for latest dep changes --- lib/squib/graphics/image.rb | 2 +- spec/args/paragraph_spec.rb | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/squib/graphics/image.rb b/lib/squib/graphics/image.rb index 5f29881..33d0323 100644 --- a/lib/squib/graphics/image.rb +++ b/lib/squib/graphics/image.rb @@ -67,7 +67,7 @@ module Squib Squib.logger.warn 'Both an SVG file and SVG data were specified' unless file.to_s.empty? || svg_args.data.to_s.empty? return if (file.nil? or file.eql? '') and svg_args.data.nil? # nothing specified TODO Move this out to arg validator svg_args.data = File.read(file) if svg_args.data.to_s.empty? - svg = RSVG::Handle.new_from_data(svg_args.data) + svg = Rsvg::Handle.new_from_data(svg_args.data) box.width = svg.width if box.width == :native box.height = svg.height if box.height == :native box.width = svg.width.to_f * box.height.to_f / svg.height.to_f if box.width == :scale diff --git a/spec/args/paragraph_spec.rb b/spec/args/paragraph_spec.rb index d3a8eb7..49d01fd 100644 --- a/spec/args/paragraph_spec.rb +++ b/spec/args/paragraph_spec.rb @@ -33,17 +33,17 @@ describe Squib::Args::Paragraph do context 'align validator' do it 'converts to pango left' do para.load!({ align: :left }) - expect(para.align).to eq [Pango::ALIGN_LEFT] + expect(para.align).to eq [Pango::Alignment::LEFT] end it 'converts to pango right' do para.load!({ align: :RIGHT }) - expect(para.align).to eq [Pango::ALIGN_RIGHT] + expect(para.align).to eq [Pango::Alignment::RIGHT] end it 'converts to pango center' do para.load!({ align: 'center' }) - expect(para.align).to eq [Pango::ALIGN_CENTER] + expect(para.align).to eq [Pango::Alignment::CENTER] end it 'raises an exception on anything else' do @@ -54,22 +54,22 @@ describe Squib::Args::Paragraph do context 'wrap validator' do it 'converts to pango wrap word' do para.load!({ wrap: 'word' }) - expect(para.wrap).to eq [Pango::WRAP_WORD] + expect(para.wrap).to eq [Pango::WrapMode::WORD] end it 'converts to pango wrap char' do para.load!({ wrap: 'WORD_ChAr' }) - expect(para.wrap).to eq [Pango::WRAP_WORD_CHAR] + expect(para.wrap).to eq [Pango::WrapMode::WORD_CHAR] end it 'converts to pango wrap char on true' do para.load!({ wrap: true }) - expect(para.wrap).to eq [Pango::WRAP_WORD_CHAR] + expect(para.wrap).to eq [Pango::WrapMode::WORD_CHAR] end it 'converts to pango wrap char with false' do para.load!({ wrap: false }) - expect(para.wrap).to eq [Pango::WRAP_CHAR] + expect(para.wrap).to eq [Pango::WrapMode::CHAR] end it 'raises an exception on anything else' do @@ -80,22 +80,22 @@ describe Squib::Args::Paragraph do context 'ellipsize validator' do it 'converts to pango on none and false' do para.load!({ ellipsize: 'none' }) - expect(para.ellipsize).to eq [Pango::Layout::ELLIPSIZE_NONE] + expect(para.ellipsize).to eq [Pango::EllipsizeMode::NONE] end it 'converts to pango with start' do para.load!({ ellipsize: :StArt }) - expect(para.ellipsize).to eq [Pango::Layout::ELLIPSIZE_START] + expect(para.ellipsize).to eq [Pango::EllipsizeMode::START] end it 'converts to pango middle' do para.load!({ ellipsize: 'middle' }) - expect(para.ellipsize).to eq [Pango::Layout::ELLIPSIZE_MIDDLE] + expect(para.ellipsize).to eq [Pango::EllipsizeMode::MIDDLE] end it 'converts to pango end' do para.load!({ ellipsize: 'END' }) - expect(para.ellipsize).to eq [Pango::Layout::ELLIPSIZE_END] + expect(para.ellipsize).to eq [Pango::EllipsizeMode::END] end it 'raises an exception on anything else' do