From a1c2b192b339aca9d8ea1e891ec340327b6fa5da Mon Sep 17 00:00:00 2001 From: Lars Kanis Date: Thu, 27 Jun 2024 12:03:44 +0200 Subject: [PATCH] Satisfy latest standardrb --- lib/zint/barcode.rb | 4 ++-- ruby-zint.gemspec | 8 ++++---- spec/zint/barcode_spec.rb | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/zint/barcode.rb b/lib/zint/barcode.rb index 7841c6b..646850e 100644 --- a/lib/zint/barcode.rb +++ b/lib/zint/barcode.rb @@ -25,7 +25,7 @@ def initialize(value: nil, input_file: nil, symbology: Zint::BARCODE_CODE128, ** @zint_symbol = Native.ZBarcode_Create self.symbology = symbology kwargs.each do |k, v| - send("#{k}=", v) + send(:"#{k}=", v) end @value = value @@ -39,7 +39,7 @@ def initialize(value: nil, input_file: nil, symbology: Zint::BARCODE_CODE128, ** # Must end in .png, .gif, .bmp, .emf, .eps, .pcx, .svg, .tif or .txt # @param rotate_angle [Integer] Rotate angle in degrees (0, 90, 180, 270) def to_file(path:, rotate_angle: 0) - unless outfile == 'out.png' + unless outfile == "out.png" raise AlreadyGenerated, "to_file was already executed" end @zint_symbol[:outfile] = path diff --git a/ruby-zint.gemspec b/ruby-zint.gemspec index cd6b370..c34ac23 100644 --- a/ruby-zint.gemspec +++ b/ruby-zint.gemspec @@ -32,9 +32,9 @@ Gem::Specification.new do |spec| spec.add_dependency "mini_portile2", Zint::MINI_PORTILE_VERSION yardopts = File.read(".yardopts") - spec.rdoc_options = ["--main", "README.md", - "--title", "Ruby FFI binding for libzint", - "--exclude", "/ext.ruby-zint/"] - docfiles = yardopts.lines.map(&:strip).select{|r| r=~/^[^-]/ } + spec.rdoc_options = ["--main", "README.md", + "--title", "Ruby FFI binding for libzint", + "--exclude", "/ext.ruby-zint/"] + docfiles = yardopts.lines.map(&:strip).select { |r| r =~ /^[^-]/ } spec.extra_rdoc_files = `git ls-files -z #{docfiles.join(" ")}`.split("\x0") end diff --git a/spec/zint/barcode_spec.rb b/spec/zint/barcode_spec.rb index 0c5745d..33763ad 100644 --- a/spec/zint/barcode_spec.rb +++ b/spec/zint/barcode_spec.rb @@ -59,7 +59,7 @@ module Zint it "exports barcode to bitmap only once" do barcode.to_bitmap - expect{ barcode.to_bitmap }.to raise_error(Zint::Barcode::AlreadyGenerated) + expect { barcode.to_bitmap }.to raise_error(Zint::Barcode::AlreadyGenerated) end it "exports barcode to bitmap object from input file" do @@ -136,7 +136,7 @@ module Zint it "exports barcode to buffer only once" do barcode.to_buffer - expect{ barcode.to_buffer }.to raise_error(Zint::Barcode::AlreadyGenerated) + expect { barcode.to_buffer }.to raise_error(Zint::Barcode::AlreadyGenerated) end it "exports barcode as vector from given value" do @@ -147,7 +147,7 @@ module Zint it "exports barcode to vector only once" do barcode.to_vector - expect{ barcode.to_vector }.to raise_error(Zint::Barcode::AlreadyGenerated) + expect { barcode.to_vector }.to raise_error(Zint::Barcode::AlreadyGenerated) end it "exports barcode as vector from input file" do