Skip to content

Commit

Permalink
chore: Add rubocop and autocorrect lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkl committed Feb 26, 2024
1 parent 1ba12c3 commit 04b8402
Show file tree
Hide file tree
Showing 27 changed files with 568 additions and 527 deletions.
16 changes: 16 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# The behavior of RuboCop can be controlled via the .rubocop.yml
# configuration file. It makes it possible to enable/disable
# certain cops (checks) and to alter their behavior if they accept
# any parameters. The file can be placed either in your home
# directory or in some project directory.
#
# RuboCop will start looking for the configuration file in the directory
# where the inspected file is and continue its way up to the root directory.
#
# See https://docs.rubocop.org/rubocop/configuration
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
# If `true`, strings which span multiple lines using `\` for continuation must
# use the same type of quotes on each line.
ConsistentQuotesInMultiline: false
45 changes: 37 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,47 @@ PATH
GEM
remote: https://rubygems.org/
specs:
base64 (0.1.1)
ast (2.4.2)
base64 (0.2.0)
byebug (11.1.3)
concurrent-ruby (1.2.2)
faraday (2.7.11)
concurrent-ruby (1.2.3)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
faraday-net_http (3.1.0)
net-http
json (2.7.1)
jwt (2.8.0)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-net_http (3.0.2)
jwt (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.20.0)
net-http (0.4.1)
uri
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
racc (1.7.3)
rainbow (3.1.1)
rake (13.1.0)
ruby2_keywords (0.0.5)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.60.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
timecop (0.9.8)
unicode-display_width (2.5.0)
uri (0.13.0)

PLATFORMS
arm64-darwin-22
Expand All @@ -33,6 +61,7 @@ DEPENDENCIES
clerk-sdk-ruby!
minitest (~> 5.0)
rake (~> 13.0)
rubocop (~> 1.60)
timecop (~> 0.9.4)

BUNDLED WITH
Expand Down
1 change: 1 addition & 0 deletions clerk-sdk-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ Gem::Specification.new do |spec|

spec.add_development_dependency "byebug", "~> 11.1"
spec.add_development_dependency "timecop", "~> 0.9.4"
spec.add_development_dependency "rubocop", "~> 1.60"
end
10 changes: 3 additions & 7 deletions lib/clerk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def configuration
end

class Config
PRODUCTION_BASE_URL = "https://api.clerk.dev/v1/".freeze
PRODUCTION_BASE_URL = "https://api.clerk.dev/v1/"
attr_accessor :api_key, :base_url, :publishable_key, :logger, :middleware_cache_store

# An array of route paths on which the middleware will not execute.
Expand Down Expand Up @@ -47,9 +47,7 @@ def initialize
@api_key = ENV["CLERK_API_KEY"]

secret_key = ENV["CLERK_SECRET_KEY"]
if secret_key && !secret_key.empty?
@api_key = secret_key
end
@api_key = secret_key if secret_key && !secret_key.empty?

@publishable_key = ENV.fetch("CLERK_PUBLISHABLE_KEY")

Expand All @@ -58,6 +56,4 @@ def initialize
end
end

if defined?(::Rails)
require_relative "clerk/railtie"
end
require_relative "clerk/railtie" if defined?(::Rails)
10 changes: 5 additions & 5 deletions lib/clerk/authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def clerk_user_profile_url

included do
helper_method :clerk_session, :clerk_reverify_session!,
:clerk_verified_session_claims, :clerk_verified_session_token,
:clerk_user, :clerk_user_id, :clerk_user_signed_in?, :clerk_sign_in_url,
:clerk_sign_up_url, :clerk_user_profile_url,
:clerk_organization, :clerk_organization_id, :clerk_organization_role,
:clerk_organization_permissions
:clerk_verified_session_claims, :clerk_verified_session_token,
:clerk_user, :clerk_user_id, :clerk_user_signed_in?, :clerk_sign_in_url,
:clerk_sign_up_url, :clerk_user_profile_url,
:clerk_organization, :clerk_organization_id, :clerk_organization_role,
:clerk_organization_permissions
end
end
end
Loading

0 comments on commit 04b8402

Please sign in to comment.