From 378b4b5af87ed6bc275a9d82eb9278869eb91299 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Sun, 9 Mar 2025 16:08:50 -0500 Subject: [PATCH] fix lint errors --- lib/config.rb | 5 ++--- spec/sensitive_spec.rb | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/config.rb b/lib/config.rb index 1b913bc..66662ea 100644 --- a/lib/config.rb +++ b/lib/config.rb @@ -31,9 +31,8 @@ class Config end def to_json(options = nil) - if options && - options.key?(:pretty) && - options[:pretty] == true + if options&.key?(:pretty) && + options[:pretty] == true JSON.pretty_generate as_json(options) else JSON.generate as_json(options) diff --git a/spec/sensitive_spec.rb b/spec/sensitive_spec.rb index a5b91c2..00b28bd 100644 --- a/spec/sensitive_spec.rb +++ b/spec/sensitive_spec.rb @@ -4,7 +4,7 @@ $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib" require "sensitive" -ALPHABET = ('a' .. 'z').reduce(:concat) +ALPHABET = ("a".."z").reduce(:concat) describe "Sensitive" do before do @@ -20,7 +20,7 @@ describe "Sensitive" do end it "test using different mask character" do - s = Sensitive.new ALPHABET, ch: "x" + s = Sensitive.new ALPHABET, ch: "x" _(s.to_s).must_equal "x" end end