diff --git a/Gemfile b/Gemfile index 6ac5785..4ba4089 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' group :development do diff --git a/bin/pull_translations.rb b/bin/pull_translations.rb index f2119f3..e8f21bc 100755 --- a/bin/pull_translations.rb +++ b/bin/pull_translations.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true # Usage: # bundle install diff --git a/plugin.rb b/plugin.rb index d8866fd..43b4680 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # name: discourse-oauth2-basic # about: Generic OAuth2 Plugin # version: 0.3 @@ -64,7 +66,7 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator end def json_walk(result, user_json, prop) - path = SiteSetting.send("oauth2_json_#{prop}_path") + path = SiteSetting.get("oauth2_json_#{prop}_path") if path.present? segments = path.split('.') val = walk_path(user_json, segments) diff --git a/spec/plugin_spec.rb b/spec/plugin_spec.rb index 59bf72e..a80f46f 100644 --- a/spec/plugin_spec.rb +++ b/spec/plugin_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rails_helper' require 'json'