From ee58ca439970a62b863b8a479bc455b9744af2fb Mon Sep 17 00:00:00 2001 From: Brandon Keepers Date: Wed, 27 Jul 2022 10:06:16 -0400 Subject: [PATCH] Disable Style/SlicingWithRange standard rule --- lib/dotenv/parser.rb | 2 +- lib/dotenv/substitutions/command.rb | 2 +- lib/dotenv/substitutions/variable.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/dotenv/parser.rb b/lib/dotenv/parser.rb index d2c8028f..00422a4f 100644 --- a/lib/dotenv/parser.rb +++ b/lib/dotenv/parser.rb @@ -84,7 +84,7 @@ def expand_newlines(value) end def variable_not_set?(line) - !line.split[1..-1].all? { |var| @hash.member?(var) } + !line.split[1..-1].all? { |var| @hash.member?(var) } # standard:disable Style/SlicingWithRange end def unescape_value(value, maybe_quote) diff --git a/lib/dotenv/substitutions/command.rb b/lib/dotenv/substitutions/command.rb index 724f87d2..4adea00e 100644 --- a/lib/dotenv/substitutions/command.rb +++ b/lib/dotenv/substitutions/command.rb @@ -28,7 +28,7 @@ def call(value, _env, _is_load) if $LAST_MATCH_INFO[:backslash] # Command is escaped, don't replace it. - $LAST_MATCH_INFO[0][1..-1] + $LAST_MATCH_INFO[0][1..-1] # standard:disable Style/SlicingWithRange else # Execute the command and return the value `#{command}`.chomp diff --git a/lib/dotenv/substitutions/variable.rb b/lib/dotenv/substitutions/variable.rb index 4dba441e..68d2e587 100644 --- a/lib/dotenv/substitutions/variable.rb +++ b/lib/dotenv/substitutions/variable.rb @@ -30,7 +30,7 @@ def call(value, env, is_load) def substitute(match, variable, env) if match[1] == "\\" - variable[1..-1] + variable[1..-1] # standard:disable Style/SlicingWithRange elsif match[3] env.fetch(match[3], "") else