6 changed files with 74 additions and 1 deletions
@ -0,0 +1,17 @@ |
|||||||
|
require 'squib' |
||||||
|
|
||||||
|
Squib::Deck.new(cards: 2) do |
||||||
|
background color: :white |
||||||
|
|
||||||
|
# Outputs a hash of arrays with the header names as keys |
||||||
|
data = csv file: 'sample.csv' |
||||||
|
|
||||||
|
text str: data['Name'], x: 250, y: 55, font: 'Arial 54' |
||||||
|
text str: data['Level'], x: 65, y: 65, font: 'Arial 72' |
||||||
|
text str: data['Description'], x: 65, y: 600, font: 'Arial 36' |
||||||
|
|
||||||
|
# You can also specify the sheet, starting at 0 |
||||||
|
data = xlsx file: 'sample.xlsx', sheet: 2 |
||||||
|
|
||||||
|
save format: :png, prefix: 'sample_excel_' |
||||||
|
end |
||||||
@ -0,0 +1,12 @@ |
|||||||
|
require 'spec_helper' |
||||||
|
|
||||||
|
describe Squib::Deck do |
||||||
|
context '#csv' do |
||||||
|
# it 'loads basic csv data' do |
||||||
|
# expect(Squib.csv(file: csv_file('basic.csv'))).to eq({ |
||||||
|
# 'h1' => [1, 3], |
||||||
|
# 'h2' => [2, 4] |
||||||
|
# }) |
||||||
|
# end |
||||||
|
end |
||||||
|
end |
||||||
Loading…
Reference in new issue