Skip to content

Commit

Permalink
DEV: Fix new Rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
Flink committed Mar 6, 2024
1 parent ba0bed8 commit 2b95a18
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 24 deletions.
39 changes: 32 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,45 +1,70 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.6)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
drb (2.2.1)
i18n (1.14.3)
concurrent-ruby (~> 1.0)
racc (~> 1.7)
json (2.7.1)
language_server-protocol (3.17.0.3)
minitest (5.22.2)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.0.4)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.7.3)
rainbow (3.1.1)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.60.0)
rubocop (1.62.0)
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)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-ast (1.31.1)
parser (>= 3.3.0.4)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.6.0)
rubocop-discourse (3.7.1)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
rubocop-factory_bot (>= 2.0.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rspec (2.26.1)
rubocop-rspec (2.27.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)

PLATFORMS
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/patreon_webhook_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "json"

class ::Patreon::PatreonWebhookController < ApplicationController
requires_plugin ::Patreon::PLUGIN_NAME

skip_before_action :redirect_to_login_if_required,
:preload_json,
:check_xhr,
Expand Down
28 changes: 12 additions & 16 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

enabled_site_setting :patreon_enabled

PLUGIN_NAME = "discourse-patreon"

register_asset "stylesheets/patreon.scss"

register_svg_icon "fab-patreon"
Expand Down Expand Up @@ -66,19 +64,17 @@ def self.all
end
end

%w[
../app/controllers/patreon_admin_controller.rb
../app/controllers/patreon_webhook_controller.rb
../app/jobs/regular/sync_patron_groups.rb
../app/jobs/scheduled/patreon_sync_patrons_to_groups.rb
../app/jobs/scheduled/patreon_update_tokens.rb
../lib/api.rb
../lib/seed.rb
../lib/campaign.rb
../lib/pledge.rb
../lib/patron.rb
../lib/tokens.rb
].each { |path| load File.expand_path(path, __FILE__) }
require_relative "app/controllers/patreon_admin_controller"
require_relative "app/controllers/patreon_webhook_controller"
require_relative "app/jobs/regular/sync_patron_groups"
require_relative "app/jobs/scheduled/patreon_sync_patrons_to_groups"
require_relative "app/jobs/scheduled/patreon_update_tokens"
require_relative "lib/api"
require_relative "lib/seed"
require_relative "lib/campaign"
require_relative "lib/pledge"
require_relative "lib/patron"
require_relative "lib/tokens"

AdminDashboardData.problem_messages << ::Patreon::Api::ACCESS_TOKEN_INVALID

Expand Down Expand Up @@ -107,7 +103,7 @@ def self.all
end

on(:user_created) do |user|
filters = PluginStore.get(PLUGIN_NAME, "filters")
filters = PluginStore.get(::Patreon::PLUGIN_NAME, "filters")
patreon_id = Patreon::Patron.all.key(user.email)

if filters.present? && patreon_id.present?
Expand Down
5 changes: 4 additions & 1 deletion spec/requests/patreon_webhook_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
require_relative "../spec_helper"

RSpec.describe ::Patreon::PatreonWebhookController do
before { Jobs.run_immediately! }
before do
SiteSetting.patreon_enabled = true
Jobs.run_immediately!
end

describe "index" do
describe "header checking" do
Expand Down

0 comments on commit 2b95a18

Please sign in to comment.