Skip to content

Commit

Permalink
DEV: Bump rubocop-discourse to 3.8.0
Browse files Browse the repository at this point in the history
This commit resolves all `Lint/OrAssignmentToConstant` cop violations.
  • Loading branch information
tgxworld committed Nov 14, 2024
1 parent b2fb2e4 commit b66f42f
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 108 deletions.
73 changes: 38 additions & 35 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,80 +1,83 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (7.1.3.3)
activesupport (8.0.0)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
drb (2.2.1)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.2)
json (2.8.2)
language_server-protocol (3.17.0.3)
minitest (5.23.1)
mutex_m (0.2.0)
parallel (1.24.0)
parser (3.3.1.0)
logger (1.6.1)
minitest (5.25.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.8.0)
rack (3.0.11)
racc (1.8.1)
rack (3.1.8)
rainbow (3.1.1)
regexp_parser (2.9.2)
rexml (3.3.9)
rubocop (1.64.0)
rubocop (1.68.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.31.1, < 2.0)
regexp_parser (>= 2.4, < 3.0)
rubocop-ast (>= 1.32.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.36.1)
parser (>= 3.3.1.0)
rubocop-capybara (2.20.0)
rubocop-capybara (2.21.0)
rubocop (~> 1.41)
rubocop-discourse (3.8.0)
rubocop-discourse (3.8.6)
activesupport (>= 6.1)
rubocop (>= 1.59.0)
rubocop-capybara (>= 2.0.0)
rubocop-factory_bot (>= 2.0.0)
rubocop-rails (>= 2.25.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rails (2.25.0)
rubocop-rspec (>= 3.0.1)
rubocop-rspec_rails (>= 2.30.0)
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-rails (2.27.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rspec (2.29.2)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
rubocop-rspec_rails (~> 2.28)
rubocop-rspec_rails (2.28.3)
rubocop (~> 1.40)
rubocop-rspec (3.2.0)
rubocop (~> 1.61)
rubocop-rspec_rails (2.30.0)
rubocop (~> 1.61)
rubocop-rspec (~> 3, >= 3.0.1)
ruby-progressbar (1.13.0)
securerandom (0.3.2)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
unicode-display_width (2.6.0)
uri (1.0.2)

PLATFORMS
ruby
Expand All @@ -84,4 +87,4 @@ DEPENDENCIES
syntax_tree

BUNDLED WITH
2.5.10
2.5.18
2 changes: 1 addition & 1 deletion lib/calendar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module DiscourseCalendar
class Calendar
DATA_PREFIX ||= "data-calendar-"
DATA_PREFIX = "data-calendar-"

def self.extract(post)
cooked = PrettyText.cook(post.raw, topic_id: post.topic_id, user_id: post.user_id)
Expand Down
39 changes: 21 additions & 18 deletions lib/tasks/javascript.rake
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,34 @@

require "open-uri"

TIMEZONES_DEFINITIONS ||=
"https://raw.githubusercontent.com/moment/moment-timezone/develop/data/meta/latest.json"
UNUSED_REGIONS ||= %w[
ecbtarget
federalreserve
federalreservebanks
fedex
nerc
unitednations
ups
nyse
]
HOLIDAYS_COUNTRY_OVERRIDES ||= { "gr" => "el" }

task "javascript:update_constants" => :environment do
timezone_definitions =
"https://raw.githubusercontent.com/moment/moment-timezone/develop/data/meta/latest.json"

unused_regions = %w[
ecbtarget
federalreserve
federalreservebanks
fedex
nerc
unitednations
ups
nyse
]

holidays_country_overrides = { "gr" => "el" }

require "holidays" if !defined?(Holidays)

holiday_regions = Holidays.available_regions.map(&:to_s) - UNUSED_REGIONS
holiday_regions = Holidays.available_regions.map(&:to_s) - unused_regions

time_zone_to_region = {}
data = JSON.parse(URI.parse(TIMEZONES_DEFINITIONS).open.read)
data = JSON.parse(URI.parse(timezone_definitions).open.read)
data["zones"].sort.each do |timezone, timezone_data|
country_code = timezone_data["countries"].first.downcase
if HOLIDAYS_COUNTRY_OVERRIDES.include?(country_code)
country_code = HOLIDAYS_COUNTRY_OVERRIDES[country_code]

if holidays_country_overrides.include?(country_code)
country_code = holidays_country_overrides[country_code]
end

next if !holiday_regions.include?(country_code)
Expand Down
4 changes: 1 addition & 3 deletions spec/integration/topic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
require "rails_helper"

describe Topic do
Event ||= DiscoursePostEvent::Event

before do
freeze_time
Jobs.run_immediately!
Expand All @@ -24,7 +22,7 @@
raw: "The boat market is quite active lately.",
)

expect(Event).to_not exist(id: post_with_date.id)
expect(DiscoursePostEvent::Event).to_not exist(id: post_with_date.id)
end
end
end
Expand Down
Loading

0 comments on commit b66f42f

Please sign in to comment.