From 912316c1fa47b2cfcae8b69799d1b435f96e1e0c Mon Sep 17 00:00:00 2001 From: Panos Dalitsouris Date: Tue, 19 Dec 2023 07:14:48 +0200 Subject: [PATCH] Fix Rubocop offenses --- lib/apipie/errors.rb | 2 +- lib/apipie/generator/swagger/config.rb | 2 +- lib/tasks/apipie.rake | 4 ++-- spec/lib/swagger/rake_swagger_spec.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/apipie/errors.rb b/lib/apipie/errors.rb index df585ed71..ac287c203 100644 --- a/lib/apipie/errors.rb +++ b/lib/apipie/errors.rb @@ -62,7 +62,7 @@ class ParamInvalid < DefinedParamError attr_accessor :value, :error def initialize(param, value, error) - super param + super(param) @value = value @error = error end diff --git a/lib/apipie/generator/swagger/config.rb b/lib/apipie/generator/swagger/config.rb index 73062f061..d77df5be3 100644 --- a/lib/apipie/generator/swagger/config.rb +++ b/lib/apipie/generator/swagger/config.rb @@ -24,7 +24,7 @@ class Config HEREDOC ) - send("#{attribute}=", value) + send(:"#{attribute}=", value) end old_setter_method = "swagger_#{attribute}" diff --git a/lib/tasks/apipie.rake b/lib/tasks/apipie.rake index 5003f2146..e7c754512 100644 --- a/lib/tasks/apipie.rake +++ b/lib/tasks/apipie.rake @@ -186,11 +186,11 @@ namespace :apipie do av = renderer File.open(file_name, "w") do |f| variables.each do |var, val| - av.instance_variable_set("@#{var}", val) + av.instance_variable_set(:"@#{var}", val) end f.write av.render( :template => "#{template}", - :layout => (layout && "apipie/#{layout}")) + :layout => layout && "apipie/#{layout}") end end diff --git a/spec/lib/swagger/rake_swagger_spec.rb b/spec/lib/swagger/rake_swagger_spec.rb index 426065442..6817956cf 100644 --- a/spec/lib/swagger/rake_swagger_spec.rb +++ b/spec/lib/swagger/rake_swagger_spec.rb @@ -151,7 +151,7 @@ def expect_response_params_def(http_method, path, response_code, param_name, fie describe 'apipie:did_swagger_change[development,form_data,_tmp]' do it "keeps a reference file" do - expect(Pathname(ref_output).children.count).to eq(2) # one file for each language + expect(Pathname(ref_output).children.count).to eq(2) # one file for each language end end end