parent
19812777d3
commit
2329a069d1
|
|
@ -9,6 +9,9 @@ Features:
|
||||||
* The `csv` method now supports all of the Ruby CSV options (e.g. `col_sep`, `quote_char`). These options simply get passed through to Ruby, so as they change in Ruby, so the support changes in Squib. (#149) Special thanks to Qgel's initial pull request (#146).
|
* The `csv` method now supports all of the Ruby CSV options (e.g. `col_sep`, `quote_char`). These options simply get passed through to Ruby, so as they change in Ruby, so the support changes in Squib. (#149) Special thanks to Qgel's initial pull request (#146).
|
||||||
* New `use_layout` method will allow you to load a layout file as a DSL method instead of in the constructor. Useful in conjunction with build groups! (#141)
|
* New `use_layout` method will allow you to load a layout file as a DSL method instead of in the constructor. Useful in conjunction with build groups! (#141)
|
||||||
|
|
||||||
|
Bugs:
|
||||||
|
* The `save_pdf` method will flush to file upon exit so that the PDF is available immediately. (#150, thanks for the bug report Qgel!)
|
||||||
|
|
||||||
Chores:
|
Chores:
|
||||||
* Switched to `require_relative` internally throughout the codebase to be more pry-friendly (#130)
|
* Switched to `require_relative` internally throughout the codebase to be more pry-friendly (#130)
|
||||||
* Rewrote the entire API doc and placed it on [squib.readthedocs.org](http://squib.readthedocs.org). :tada:
|
* Rewrote the entire API doc and placed it on [squib.readthedocs.org](http://squib.readthedocs.org). :tada:
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ module Squib
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
cc.target.finish
|
||||||
end
|
end
|
||||||
|
|
||||||
# :nodoc:
|
# :nodoc:
|
||||||
|
|
|
||||||
|
|
@ -55,3 +55,4 @@ cairo: set_source([MockDouble, 0, 0])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
cairo: reset_clip([])
|
cairo: reset_clip([])
|
||||||
cairo: translate([-75, -75])
|
cairo: translate([-75, -75])
|
||||||
|
surface: finish([])
|
||||||
|
|
|
||||||
|
|
@ -634,6 +634,7 @@ cairo: paint([])
|
||||||
cairo: reset_clip([])
|
cairo: reset_clip([])
|
||||||
cairo: translate([-2343, -1131])
|
cairo: translate([-2343, -1131])
|
||||||
cairo: show_page([])
|
cairo: show_page([])
|
||||||
|
surface: finish([])
|
||||||
cairo: scale([0.24, 0.24])
|
cairo: scale([0.24, 0.24])
|
||||||
cairo: translate([75, 75])
|
cairo: translate([75, 75])
|
||||||
cairo: rectangle([0, 0, 825, 1125])
|
cairo: rectangle([0, 0, 825, 1125])
|
||||||
|
|
@ -650,6 +651,7 @@ cairo: paint([])
|
||||||
cairo: reset_clip([])
|
cairo: reset_clip([])
|
||||||
cairo: translate([-900, -75])
|
cairo: translate([-900, -75])
|
||||||
cairo: show_page([])
|
cairo: show_page([])
|
||||||
|
surface: finish([])
|
||||||
surface: write_to_png(["_output/saves_notrim_01.png"])
|
surface: write_to_png(["_output/saves_notrim_01.png"])
|
||||||
cairo: set_source([MockDouble, -37, -37])
|
cairo: set_source([MockDouble, -37, -37])
|
||||||
cairo: paint([])
|
cairo: paint([])
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ require 'squib'
|
||||||
describe Squib::Deck, '#save_pdf' do
|
describe Squib::Deck, '#save_pdf' do
|
||||||
|
|
||||||
context 'typical inputs' do
|
context 'typical inputs' do
|
||||||
let(:cxt) { double(Cairo::Context) }
|
let(:cxt) { double(Cairo::Context) }
|
||||||
|
let(:target) { double(Cairo::PDFSurface) }
|
||||||
|
|
||||||
def expect_card_place(x, y)
|
def expect_card_place(x, y)
|
||||||
expect(cxt).to receive(:translate).with(x, y).once
|
expect(cxt).to receive(:translate).with(x, y).once
|
||||||
|
|
@ -41,6 +42,8 @@ describe Squib::Deck, '#save_pdf' do
|
||||||
expect_card_place(2343, 1131)
|
expect_card_place(2343, 1131)
|
||||||
expect(cxt).to receive(:show_page).once
|
expect(cxt).to receive(:show_page).once
|
||||||
expect_card_place(75, 75)
|
expect_card_place(75, 75)
|
||||||
|
expect(cxt).to receive(:target).and_return(target)
|
||||||
|
expect(target).to receive(:finish).once
|
||||||
|
|
||||||
args = { file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 }
|
args = { file: 'foo.pdf', dir: '_out', margin: 75, gap: 5, trim: 37 }
|
||||||
deck.save_pdf(args)
|
deck.save_pdf(args)
|
||||||
|
|
@ -59,6 +62,9 @@ describe Squib::Deck, '#save_pdf' do
|
||||||
expect_card_place(831, 75)
|
expect_card_place(831, 75)
|
||||||
expect_card_place(1587, 75)
|
expect_card_place(1587, 75)
|
||||||
|
|
||||||
|
expect(cxt).to receive(:target).and_return(target)
|
||||||
|
expect(target).to receive(:finish).once
|
||||||
|
|
||||||
deck.save_pdf(args)
|
deck.save_pdf(args)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ def mock_cairo(strio)
|
||||||
allow(font).to receive(m) { |*args| strio << scrub_hex("pango font: #{m}(#{args})\n") }
|
allow(font).to receive(m) { |*args| strio << scrub_hex("pango font: #{m}(#{args})\n") }
|
||||||
end
|
end
|
||||||
|
|
||||||
%w(write_to_png).each do |m|
|
%w(write_to_png finish).each do |m|
|
||||||
allow(surface).to receive(m) { |*args| strio << scrub_hex("surface: #{m}(#{args})\n") }
|
allow(surface).to receive(m) { |*args| strio << scrub_hex("surface: #{m}(#{args})\n") }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue