Rubocop: Using single-quotes properly

This commit is contained in:
Andy Meneely
2014-10-29 12:04:33 -04:00
parent 37fd4e7733
commit e115135d51
23 changed files with 2466 additions and 110 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1) do
text color: '#ffff000000009999', str: '12-hex (alpha)', x: 50, y: y+=50
text color: :burnt_orange, str: 'Symbols of constants too', x: 50, y: y+=50
save_png prefix: "colors_"
save_png prefix: 'colors_'
end
+2 -2
View File
@@ -6,7 +6,7 @@ Squib::Deck.new(config: 'custom-config.yml') do
background color: :foo
# Hints are turned on in the config file
text str: "The Title", x: 0, y: 78, width: 825,
text str: 'The Title', x: 0, y: 78, width: 825,
font: 'Arial 72', align: :center
# Progress bars are shown for these commands
@@ -14,6 +14,6 @@ Squib::Deck.new(config: 'custom-config.yml') do
png file: 'shiny-purse2.png', x: 620, y: 75
svg file: 'spanner2.svg', x: 620, y: 218
save_png prefix: 'custom-config_'
save_pdf file: "custom-config-out.pdf"
save_pdf file: 'custom-config-out.pdf'
end
+4 -4
View File
@@ -8,16 +8,16 @@ require 'squib'
Squib::Deck.new(width: 825, height: 1125) do
background color: '#aaa'
text str: "This is portrait"
text str: 'This is portrait'
save_png prefix: "portrait_"
save_png prefix: 'portrait_'
end
# Money cards are landscape
Squib::Deck.new(width: 1125, height: 825) do
background color: '#aaa'
text str: "This is landscape"
text str: 'This is landscape'
save_png prefix: "landscape_", rotate: true
save_png prefix: 'landscape_', rotate: true
end
+7 -7
View File
@@ -17,17 +17,17 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
width: 100, align: :center
# Ranges are inclusive, zero-based
text range: 0..1, str: "Thief and Grifter only!!", x: 25, y:200
text range: 0..1, str: 'Thief and Grifter only!!', x: 25, y:200
# Integers are also allowed
text range: 0, str: "Thief only!", x: 25, y: 250
text range: 0, str: 'Thief only!', x: 25, y: 250
# Negatives go from the back of the deck
text range: -1, str: "Mastermind only!", x: 25, y: 250
text range: -2..-1, str: "Grifter and Mastermind only!", x: 25, y: 650
text range: -1, str: 'Mastermind only!', x: 25, y: 250
text range: -2..-1, str: 'Grifter and Mastermind only!', x: 25, y: 650
# We can use Arrays too!
text range: [0,2], str: "Thief and Mastermind only!!", x: 25, y:300
text range: [0,2], str: 'Thief and Mastermind only!!', x: 25, y:300
# Just about everything in Squib can be given an array that
# corresponds to the deck's cards. This allows for each card to be styled differently
@@ -41,13 +41,13 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
# then use a range. No need to memorize IDs, and you can add cards easily
id = {} ; data['name'].each_with_index{ |name,i| id[name] = i}
text range: id['Thief']..id['Grifter'],
str: "Thief through Grifter with id lookup!!",
str: 'Thief through Grifter with id lookup!!',
x:25, y: 400
# Useful idiom: generate arrays from a column called 'type'
type = {}; data['type'].each_with_index{ |t,i| (type[t] ||= []) << i}
text range: type['Thinker'],
str: "Only for Thinkers!",
str: 'Only for Thinkers!',
x:25, y: 500
save prefix: 'ranges_', format: :png
+2 -2
View File
@@ -7,8 +7,8 @@ Squib::Deck.new(width: 825, height: 1125, cards: 16) do
text str: (1..16).to_a, x: 220, y: 78, font: 'Arial 54'
save_pdf file: "sample-save-pdf.pdf", margin: 75, gap: 5, trim: 37
save_pdf file: 'sample-save-pdf.pdf', margin: 75, gap: 5, trim: 37
#Note that our PNGs still are not trimmed even though the pdf ones are
save_png range: 1, prefix: "save_pdf_"
save_png range: 1, prefix: 'save_pdf_'
end
+9 -9
View File
@@ -16,38 +16,38 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
text str: "UTF-8 \u2663", x: 565, y: 150, font: 'Arial weight=900 36'
text str: "Font strings are expressive!", x:65, y: 200,
text str: 'Font strings are expressive!', x:65, y: 200,
font: 'Impact bold italic 36'
text str: "Font strings are expressive!", x:65, y: 300,
text str: 'Font strings are expressive!', x:65, y: 300,
font: 'Arial,Verdana weight=900 style=oblique 36'
text str: "Font string sizes can be overridden per card.", x: 65, y: 350,
text str: 'Font string sizes can be overridden per card.', x: 65, y: 350,
font: 'Impact 36', font_size: [16, 20, 24]
text str: "This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint",
text str: 'This text has fixed width, fixed height, center-aligned, middle-valigned, and has a red hint',
hint: :red,
x: 65, y: 400,
width: 300, height: 200,
align: :center, valign: :middle,
font: 'Arial 18'
text str: "Ellipsization!\nThe ultimate question of life, the universe, and everything to life and everything is 42",
text str: 'Ellipsization!\nThe ultimate question of life, the universe, and everything to life and everything is 42',
hint: :green, font: 'Arial 22',
x: 450, y: 400,
width: 280, height: 180,
ellipsize: true
hint text: :cyan
text str: "Text hints are also globally togglable!",
text str: 'Text hints are also globally togglable!',
x: 65, y: 625,
font: 'Arial 22'
hint text: :off
text str: "See? No hint here.",
text str: 'See? No hint here.',
x: 565, y: 625,
font: 'Arial 22'
text str: "Rotated",
text str: 'Rotated',
x: 565, y: 675, angle: 0.1,
font: 'Arial 18'
@@ -56,7 +56,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 3) do
width: inches(2.25), height: inches(1),
justify: true
text str: "<b>Markup</b> is also <i>quite</i> <s>easy</s> awesome",
text str: '<b>Markup</b> is also <i>quite</i> <s>easy</s> awesome',
markup: true,
x: 50, y: 1000,
width: 750, height: 100,