From 240ab1ee011ca10055905042516400b19dab880e Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Tue, 9 Jan 2024 20:03:52 +0100 Subject: [PATCH] Use SCREAMING_SNAKE_CASE for constant name Potential breaking change --- .rubocop_todo.yml | 4 ---- lib/omniauth/strategies/cas.rb | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9840707..3e8096d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -43,10 +43,6 @@ Naming/AccessorMethodName: Exclude: - 'lib/omniauth/strategies/cas/service_ticket_validator.rb' -Naming/ConstantName: - Exclude: - - 'lib/omniauth/strategies/cas.rb' - # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. # CheckDefinitionPathHierarchyRoots: lib, spec, test, src # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS diff --git a/lib/omniauth/strategies/cas.rb b/lib/omniauth/strategies/cas.rb index 9a3054d..77868ac 100644 --- a/lib/omniauth/strategies/cas.rb +++ b/lib/omniauth/strategies/cas.rb @@ -50,7 +50,7 @@ class InvalidCASTicket < StandardError; end option :phone_key, 'phone' # As required by https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema - AuthHashSchemaKeys = %w[name email nickname first_name last_name location image phone].freeze + AUTH_HASH_SCHEMA_KEYS = %w[name email nickname first_name last_name location image phone].freeze info do prune!({ name: raw_info[options[:name_key].to_s], @@ -66,7 +66,7 @@ class InvalidCASTicket < StandardError; end extra do prune!( - raw_info.delete_if { |k, _v| AuthHashSchemaKeys.include?(k) } + raw_info.delete_if { |k, _v| AUTH_HASH_SCHEMA_KEYS.include?(k) } ) end