Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
elektronaut committed Dec 30, 2023
1 parent 5a794e7 commit 5fed11a
Show file tree
Hide file tree
Showing 51 changed files with 119 additions and 118 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
env:
RUBY_VERSION: 3.0
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pages_test
Expand All @@ -22,6 +21,7 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: 3.3
- name: Check code
run: bundle exec rubocop

Expand All @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Node modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -49,7 +49,7 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
ruby: ['3.0', '3.1', '3.2']
ruby: ['3.1', '3.2', '3.3']
services:
postgres:
image: postgres:latest
Expand All @@ -73,7 +73,7 @@ jobs:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Node modules cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -97,7 +97,7 @@ jobs:
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }}
run: bundle exec rspec
- name: Send results to Code Climate
uses: paambaati/codeclimate-action@v2.6.0
uses: paambaati/codeclimate-action@v5.0.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inherit_mode:

AllCops:
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
Exclude:
- "spec/internal/db/schema.rb"
- "node_modules/**/*"
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

10 changes: 6 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ GEM
ffi (>= 1.15.0)
excon (0.108.0)
execjs (2.9.1)
factory_bot (6.4.3)
factory_bot (6.4.5)
activesupport (>= 5.0.0)
ffi (1.16.3)
fog-core (2.1.2)
Expand Down Expand Up @@ -217,7 +217,6 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2023.1205)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.20.0)
mutex_m (0.2.0)
net-imap (0.4.9)
Expand All @@ -230,8 +229,11 @@ GEM
net-smtp (0.4.0)
net-protocol
nio4r (2.7.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
nokogiri (1.16.0-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
options (2.3.2)
parallel (1.24.0)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def update

def move
parent = params[:parent_id] ? Page.find(params[:parent_id]) : nil
@page.update(parent: parent, position: params[:position])
@page.update(parent:, position: params[:position])
respond_with_page(@page) { redirect_to admin_pages_url(content_locale) }
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/pages_core/attachments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def send_attachment(disposition: "inline")
send_ranged_data(@attachment.data,
filename: @attachment.filename,
type: @attachment.content_type,
disposition: disposition)
disposition:)
end

def verify_signed_params
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/pages_core/frontend/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def redirect_to_parent_or_root(page)
def redirect_page(page)
return false unless page.redirects?

redirect_to(page.redirect_path(locale: locale), allow_other_host: true)
redirect_to(page.redirect_path(locale:), allow_other_host: true)
end

def require_page
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ def destroy
protected

def find_user(email, password)
User.authenticate(email, password: password) if email && password
User.authenticate(email, password:) if email && password
end
end
6 changes: 3 additions & 3 deletions app/formatters/pages_core/image_embedder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def image_expression
def embed_image(id, size:, class_name:, link:)
image_figure(
Image.find(id).localize(I18n.locale),
size: size, class_name: class_name, link: link
size:, class_name:, link:
)
rescue ActiveRecord::RecordNotFound
nil
Expand All @@ -44,8 +44,8 @@ def parse_image(str)
link = (Regexp.last_match(1) if options =~ /link="([^"]+)"/)
embed_image(id,
size: embed_image_size(options),
class_name: class_name,
link: link)
class_name:,
link:)
end

def parse_images(string)
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/admin/pages_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def page_authors(page)
([page.author] + User.activated).uniq
end

def page_list_row(page, &block)
def page_list_row(page, &)
classes = [page.status_label.downcase]
classes << "autopublish" if page.autopublish?
classes << "pinned" if page.pinned?

tag.tr(capture(&block), class: classes.join(" "))
tag.tr(capture(&), class: classes.join(" "))
end

def page_name(page, options = {})
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/pages_core/admin/admin_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module AdminHelper
def rich_text_area_tag(name, content = nil, options = {})
react_component("RichTextArea",
options.merge(id: sanitize_to_id(name),
name: name,
name:,
value: content))
end

Expand Down
6 changes: 3 additions & 3 deletions app/helpers/pages_core/admin/content_tabs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def content_tabs?
content_tabs.any?
end

def content_tab(name, options = {}, &block)
def content_tab(name, options = {}, &)
return unless block_given?

tab = {
name: name.to_s.humanize,
key: options[:key] || name.to_s.underscore.gsub(/\s+/, "_"),
options: options,
content: capture(&block)
options:,
content: capture(&)
}
content_tabs.push(tab)
content_tab_tag(tab[:key], tab[:content])
Expand Down
12 changes: 6 additions & 6 deletions app/helpers/pages_core/admin/image_uploads_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ def editable_dynamic_image_tag(image, width: 250,
react_component("EditableImage",
editable_image_options(
image,
width: width,
caption: caption,
locale: locale
).merge(width: width))
width:,
caption:,
locale:
).merge(width:))
end

def image_uploader_tag(name, image, options = {})
Expand All @@ -36,8 +36,8 @@ def editable_image_src_options(image, width)

def editable_image_options(image, width: 250, caption: false, locale: nil)
editable_image_src_options(image, width).merge(
width: width,
caption: caption,
width:,
caption:,
locale: locale || I18n.default_locale,
locales: locales_with_dir
)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/pages_core/admin/locales_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module LocalesHelper
def locales_with_dir
locales = PagesCore.config.locales || {}
locales.each_with_object({}) do |(key, name), hash|
hash[key] = { name: name, dir: locale_direction(key) }
hash[key] = { name:, dir: locale_direction(key) }
end
end

Expand Down
6 changes: 3 additions & 3 deletions app/helpers/pages_core/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def page_link(page, options = {})
end
end

def unique_page(page_name, &block)
def unique_page(page_name, &)
page = Page.where(unique_name: page_name).first
if page && block_given?
output = capture(page.localize(content_locale), &block)
output = capture(page.localize(content_locale), &)
concat(output)
end
page&.localize(content_locale)
Expand All @@ -44,7 +44,7 @@ def conditional_options?(options = {})

def page_link_path(locale, page)
if page.redirects?
page.redirect_path(locale: locale)
page.redirect_path(locale:)
else
page_path(locale, page)
end
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/pages_core/head_tags_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def feed_tags(options = {})
# <%= feed_tags %>
# <% end %>
#
def head_tag(&block)
def head_tag(&)
# The block output must be captured first
block_output = block_given? ? capture(&block) : nil
block_output = block_given? ? capture(&) : nil

tag.head { safe_join(head_tag_contents(block_output), "\n") }
end
Expand All @@ -64,8 +64,8 @@ def head_tag(&block)
def rss_link_tag(title, href)
tag.link(rel: "alternate",
type: "application/rss+xml",
title: title,
href: href)
title:,
href:)
end

private
Expand Down
14 changes: 7 additions & 7 deletions app/helpers/pages_core/images_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def picture(image, opts = {})
def picture_tag(image, ratio: nil, sizes: "100vw")
tag.picture do
safe_join(
[webp_source(image, ratio: ratio, sizes: sizes || "100vw"),
[webp_source(image, ratio:, sizes: sizes || "100vw"),
dynamic_image_tag(image,
size: image_size(1050, ratio),
crop: (ratio ? true : false),
sizes: sizes,
srcset: srcset(image, ratio: ratio))]
sizes:,
srcset: srcset(image, ratio:))]
)
end
end
Expand Down Expand Up @@ -106,11 +106,11 @@ def image_figure_image_tag(image, size: nil, ratio: nil)
size ||= default_image_size
size = fit_ratio(size, ratio) if ratio

dynamic_image_tag(image, size: size, crop: ratio && true, upscale: false)
dynamic_image_tag(image, size:, crop: ratio && true, upscale: false)
end

def image_link_to(content, href)
tag.a(content, href: href)
tag.a(content, href:)
end

def image_size(width, ratio)
Expand Down Expand Up @@ -139,8 +139,8 @@ def webp_source(image, ratio: nil, sizes: "100vw")
return unless webp_compatible?(image)

tag.source(type: "image/webp",
srcset: srcset(image, ratio: ratio, format: :webp),
sizes: sizes)
srcset: srcset(image, ratio:, format: :webp),
sizes:)
end

def webp_compatible?(image)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/pages_core/open_graph_tags_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def open_graph_tags
properties
.compact
.map do |name, content|
tag.meta(property: "og:#{name}", content: content)
tag.meta(property: "og:#{name}", content:)
end,
"\n"
)
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/pages_core/page_path_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def page_url(page_or_locale, page = nil, opts = {})
private

def page_redirect_url(locale, page)
redirect = page.redirect_path(locale: locale)
redirect = page.redirect_path(locale:)
return redirect if redirect =~ %r{^https?://}

base_page_url + redirect
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/pages_core/has_roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ def role_names
def role_names=(names)
self.roles = names.map do |name|
if role?(name)
roles.find_by(name: name)
roles.find_by(name:)
else
roles.new(name: name)
roles.new(name:)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pages_core/page_model/dated_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def set_all_day_dates
def siblings_by_date
siblings.reorder("starts_at ASC, pages.id DESC")
.where
.not(id: id)
.not(id:)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pages_core/page_model/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Searchable
def search_document_attributes
super.merge(
published: published?,
name: name,
name:,
description: try(&:meta_description?) ? meta_description : excerpt,
# content: "",
tags: tag_names.join(" ")
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/pages_core/page_model/templateable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def default_subtemplate
end

def unconfigured_blocks
blocks = (localizations.where(locale: locale).pluck(:name)
blocks = (localizations.where(locale:).pluck(:name)
.map(&:to_sym) -
configured_blocks) &
PagesCore::Templates::TemplateConfiguration.all_blocks
Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/pages_core/searchable_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ def localized_record(locale)
end

def update_index(locale, attrs)
record.search_documents.create_or_find_by!(locale: locale).update(attrs)
record.search_documents.create_or_find_by!(locale:).update(attrs)
end
end

def search_document_attributes
return {} unless respond_to?(:localized_attributes)

content = localized_attributes.keys.map { |a| localizer.get(a) }.join(" ")
{ content: content }
{ content: }
end

def update_search_documents!
Expand Down
2 changes: 1 addition & 1 deletion app/models/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def headline_or_name

def move(parent:, position:)
Page.transaction do
update(parent: parent) unless self.parent == parent
update(parent:) unless self.parent == parent
insert_at(position)
end
end
Expand Down
Loading

0 comments on commit 5fed11a

Please sign in to comment.