diff --git a/Rakefile b/Rakefile index b7c565b..eec0451 100644 --- a/Rakefile +++ b/Rakefile @@ -13,7 +13,7 @@ desc 'Run a specific sample' task :run, [:file] => :install do |t, args| args.with_defaults(file: 'basic.rb') Dir.chdir('samples') do - args[:file] << ".rb" unless args[:file].end_with? '.rb' + args[:file] << ".rb" unless args[:file].end_with? '.rb' puts "Running samples/#{args[:file]}" load args[:file] end diff --git a/benchmarks/antialias_best.rb b/benchmarks/antialias_best.rb index cbd883b..ef8448f 100644 --- a/benchmarks/antialias_best.rb +++ b/benchmarks/antialias_best.rb @@ -9,5 +9,5 @@ Squib::Deck.new(cards: 200, config: 'antialias_best.yml') do x: (i % 17) * 50, y: (i / 17) * 50 end - save_png prefix: 'antialias_best_' + save_png prefix: 'antialias_best_' end \ No newline at end of file diff --git a/benchmarks/antialias_fast.rb b/benchmarks/antialias_fast.rb index 57e5157..c104af9 100644 --- a/benchmarks/antialias_fast.rb +++ b/benchmarks/antialias_fast.rb @@ -9,5 +9,5 @@ Squib::Deck.new(cards: 200, config: 'antialias_fast.yml') do x: (i % 17) * 50, y: (i / 17) * 50 end - save_png prefix: 'antialias_fast_' + save_png prefix: 'antialias_fast_' end \ No newline at end of file diff --git a/lib/squib/api/text_embed.rb b/lib/squib/api/text_embed.rb index 2cc14b2..967f366 100644 --- a/lib/squib/api/text_embed.rb +++ b/lib/squib/api/text_embed.rb @@ -47,7 +47,7 @@ module Squib trans = Args::Transform.new.load!(opts, expand_by: @deck_size, layout: @layout, dpi: @dpi) ifile = Args::InputFile.new.load!(opts, expand_by: @deck_size, layout: @layout, dpi: @dpi) svg_args = Args::SvgSpecial.new.load!(opts, expand_by: @deck_size, layout: @layout, dpi: @dpi) - rule = { type: :png, file: ifile, box: box, paint: paint, trans: trans, adjust: adjust } + rule = { type: :png, file: ifile, box: box, paint: paint, trans: trans, adjust: adjust } rule[:draw] = Proc.new do |card, x, y| i = card.index b = box[i] diff --git a/lib/squib/args/arg_loader.rb b/lib/squib/args/arg_loader.rb index 577e0cb..0a94c21 100644 --- a/lib/squib/args/arg_loader.rb +++ b/lib/squib/args/arg_loader.rb @@ -84,7 +84,7 @@ module Squib attribute = "@#{param}" val = instance_variable_get(attribute) if val.respond_to? :each - new_val = val.map.with_index{ |v, i| send(method, v, i) } + new_val = val.map.with_index{ |v, i| send(method, v, i) } instance_variable_set(attribute, new_val) else instance_variable_set(attribute, send(method, val)) diff --git a/lib/squib/deck.rb b/lib/squib/deck.rb index af6b0a0..8b93f1b 100644 --- a/lib/squib/deck.rb +++ b/lib/squib/deck.rb @@ -68,7 +68,7 @@ module Squib @width = Args::UnitConversion.parse width, dpi @height = Args::UnitConversion.parse height, dpi cards.times{ |i| @cards << Squib::Card.new(self, @width, @height, i) } - @layout = LayoutParser.load_layout(layout) + @layout = LayoutParser.load_layout(layout) enable_groups_from_env! if block_given? instance_eval(&block) # here we go. wheeeee! diff --git a/lib/squib/graphics/cairo_context_wrapper.rb b/lib/squib/graphics/cairo_context_wrapper.rb index 47c91c1..c51956a 100644 --- a/lib/squib/graphics/cairo_context_wrapper.rb +++ b/lib/squib/graphics/cairo_context_wrapper.rb @@ -40,7 +40,7 @@ module Squib linear.matrix = matrix # match the coordinate systems - see bug 127 @cairo_cxt.set_source(linear) elsif match = arg.match(RADIAL_GRADIENT) - x1, y1, r1, x2, y2, r2 = match.captures + x1, y1, r1, x2, y2, r2 = match.captures radial = Cairo::RadialPattern.new(x1.to_f, y1.to_f, r1.to_f, x2.to_f, y2.to_f, r2.to_f) radial.matrix = matrix # match the coordinate systems - see bug 127 diff --git a/lib/squib/graphics/shapes.rb b/lib/squib/graphics/shapes.rb index 4a7590a..067a3eb 100644 --- a/lib/squib/graphics/shapes.rb +++ b/lib/squib/graphics/shapes.rb @@ -33,7 +33,7 @@ module Squib cc.move_to(x, y + 0.5*h) # start west cc.curve_to(x, y + 0.25*h, # west to north x + 0.25*w, y, - x + 0.5*w, y) + x + 0.5*w, y) cc.curve_to(x + 0.75*w, y, # north to east x + w, y + 0.25*h, x + w, y + 0.5*h) diff --git a/lib/squib/graphics/text.rb b/lib/squib/graphics/text.rb index 41386ea..17f3028 100644 --- a/lib/squib/graphics/text.rb +++ b/lib/squib/graphics/text.rb @@ -140,7 +140,7 @@ module Squib font_desc.size = para.font_size * Pango::SCALE unless para.font_size.nil? layout = cc.create_pango_layout layout.font_description = font_desc - layout.text = para.str + layout.text = para.str if para.markup para.str = @deck.typographer.process(layout.text) layout.markup = para.str diff --git a/samples/csv_import.rb b/samples/csv_import.rb index df3ce63..ea4f4ae 100644 --- a/samples/csv_import.rb +++ b/samples/csv_import.rb @@ -22,7 +22,7 @@ Squib::Deck.new(cards: num_cards) do background color: :white rect # card border text str: data['Name'], font: 'Arial 54' - save_sheet prefix: 'sample_csv_qty_', columns: 4 + save_sheet prefix: 'sample_csv_qty_', columns: 4 end # Additionally, CSV supports inline data specifically diff --git a/samples/excel.rb b/samples/excel.rb index 9bf3406..2f67588 100644 --- a/samples/excel.rb +++ b/samples/excel.rb @@ -22,7 +22,7 @@ Squib::Deck.new(cards: num_cards) do background color: :white rect # card border text str: data['Name'], font: 'Arial 54' - save_sheet prefix: 'sample_xlsx_qty_', columns: 4 + save_sheet prefix: 'sample_xlsx_qty_', columns: 4 end diff --git a/samples/layouts.rb b/samples/layouts.rb index c743e58..1f5298c 100644 --- a/samples/layouts.rb +++ b/samples/layouts.rb @@ -66,7 +66,7 @@ end Squib::Deck.new do use_layout file: 'custom-layout.yml' use_layout file: 'custom-layout2.yml' - text str: 'The Title', layout: :title # from custom-layout.yml - text str: 'The Subtitle', layout: :subtitle # redefined in custom-layout2.yml + text str: 'The Title', layout: :title # from custom-layout.yml + text str: 'The Subtitle', layout: :subtitle # redefined in custom-layout2.yml save_png prefix: 'layout3_' end diff --git a/samples/load_images.rb b/samples/load_images.rb index f5b369f..eb1a862 100644 --- a/samples/load_images.rb +++ b/samples/load_images.rb @@ -60,7 +60,7 @@ Squib::Deck.new(width: 825, height: 1125, cards: 1, config: 'load_images_config. # WARNING! If you choose to use the SVG ID, the x-y coordinates are still # relative to the SVG page. See this example in an SVG editor - svg file: 'offset.svg', id: 'thing', x: 0, y: 0, width: 600, height: 600 + svg file: 'offset.svg', id: 'thing', x: 0, y: 0, width: 600, height: 600 # Over 15 different blending operators are supported. # See http://cairographics.org/operators diff --git a/samples/unicode.rb b/samples/unicode.rb index 857c39c..87f9a1c 100644 --- a/samples/unicode.rb +++ b/samples/unicode.rb @@ -14,7 +14,7 @@ Squib::Deck.new(height: (game_chars.size / cols + 1) * cell_height, text str: 'Game-related UTF8 icons. Generated by Squib, https://github.com/andymeneely/squib' game_chars.each_with_index do |c, i| rect fill_color: %w(#eeee #ffff)[i % 2], - width: cell_width, height: cell_height, x: x, y: y + width: cell_width, height: cell_height, x: x, y: y text str: c.inspect, font: 'Sans 42', x: x, y: y text str: c, font: 'Sans,Segoe UI Symbol 42', x: x + 300, y: y x += cell_width diff --git a/spec/args/draw_spec.rb b/spec/args/draw_spec.rb index 9049403..f707b46 100644 --- a/spec/args/draw_spec.rb +++ b/spec/args/draw_spec.rb @@ -16,7 +16,7 @@ describe Squib::Args::Draw do end context 'dsl overrides' do - subject(:draw) {Squib::Args::Draw.new(custom_colors, {stroke_width: 0.0})} + subject(:draw) {Squib::Args::Draw.new(custom_colors, {stroke_width: 0.0})} it 'works when specified' do draw.load!({}) # go right to defaults diff --git a/spec/args/paint_spec.rb b/spec/args/paint_spec.rb index 15e98dc..a2e30f5 100644 --- a/spec/args/paint_spec.rb +++ b/spec/args/paint_spec.rb @@ -3,7 +3,7 @@ require 'squib/args/paint' describe Squib::Args::Draw do let(:custom_colors) { {'foo' => 'abc'} } - subject(:paint) {Squib::Args::Paint.new(custom_colors)} + subject(:paint) {Squib::Args::Paint.new(custom_colors)} context 'alpha' do diff --git a/spec/args/unit_conversion_spec.rb b/spec/args/unit_conversion_spec.rb index 37e1d38..03cea16 100644 --- a/spec/args/unit_conversion_spec.rb +++ b/spec/args/unit_conversion_spec.rb @@ -7,7 +7,7 @@ describe Squib::Args::UnitConversion do expect(subject.parse(20)).to eq(20) end - it 'strips trailing whitespace' do + it 'strips trailing whitespace' do expect(subject.parse('1in ')).to eq(300) end diff --git a/spec/commands/new_spec.rb b/spec/commands/new_spec.rb index 036c1e9..98c3125 100644 --- a/spec/commands/new_spec.rb +++ b/spec/commands/new_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' require 'squib' -describe Squib::Commands::New do +describe Squib::Commands::New do describe '#process' do before(:all) do