Skip to content

Commit 347b53b

Browse files
committed
feat(phlex): upgrade to Phlex 2
Update gemspec constraint from ~> 1, >= 1.10.0 to ~> 2. Replace deprecated unsafe_raw(content) with raw(safe(content)) in Content page. Replace removed yield_content(&block) with plain yield in DefaultLayout. All existing tests pass with Phlex 2.4.1.
1 parent c4a6a70 commit 347b53b

3 files changed

Lines changed: 34 additions & 34 deletions

File tree

lib/tiny_admin/views/default_layout.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def view_template(&block)
2020
main_content {
2121
render flash_component if flash_component
2222

23-
yield_content(&block)
23+
yield
2424
}
2525

2626
render_scripts
@@ -31,14 +31,14 @@ def view_template(&block)
3131
private
3232

3333
def body_class
34-
"module-#{self.class.to_s.split('::').last.downcase}"
34+
"module-#{self.class.to_s.split("::").last.downcase}"
3535
end
3636

3737
def main_content
38-
div(class: 'container main-content py-4') do
38+
div(class: "container main-content py-4") do
3939
if options&.include?(:compact_layout)
40-
div(class: 'row justify-content-center') {
41-
div(class: 'col-6') {
40+
div(class: "row justify-content-center") {
41+
div(class: "col-6") {
4242
yield
4343
}
4444
}
@@ -52,10 +52,10 @@ def style_links
5252
TinyAdmin.settings.style_links || [
5353
# Bootstrap CDN
5454
{
55-
href: 'https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css',
56-
rel: 'stylesheet',
57-
integrity: 'sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65',
58-
crossorigin: 'anonymous'
55+
href: "https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css",
56+
rel: "stylesheet",
57+
integrity: "sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65",
58+
crossorigin: "anonymous"
5959
}
6060
]
6161
end

lib/tiny_admin/views/pages/content.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ module Pages
66
class Content < DefaultLayout
77
def view_template
88
super do
9-
div(class: 'content') {
10-
div(class: 'content-data') {
11-
unsafe_raw(content)
9+
div(class: "content") {
10+
div(class: "content-data") {
11+
raw(safe(content))
1212
}
1313

1414
render TinyAdmin::Views::Components::Widgets.new(widgets)

tiny_admin.gemspec

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
# frozen_string_literal: true
22

3-
$:.push File.expand_path('lib', __dir__)
3+
$:.push File.expand_path("lib", __dir__)
44

5-
require 'tiny_admin/version'
5+
require "tiny_admin/version"
66

77
Gem::Specification.new do |spec|
8-
spec.platform = Gem::Platform::RUBY
9-
spec.name = 'tiny_admin'
10-
spec.version = TinyAdmin::VERSION
11-
spec.summary = 'Tiny Admin'
12-
spec.description = 'A compact and composable dashboard component for Ruby'
13-
spec.license = 'MIT'
8+
spec.platform = Gem::Platform::RUBY
9+
spec.name = "tiny_admin"
10+
spec.version = TinyAdmin::VERSION
11+
spec.summary = "Tiny Admin"
12+
spec.description = "A compact and composable dashboard component for Ruby"
13+
spec.license = "MIT"
1414

15-
spec.required_ruby_version = '>= 3.0.0'
15+
spec.required_ruby_version = ">= 3.0.0"
1616

17-
spec.author = 'Mattia Roccoberton'
18-
spec.email = 'mat@blocknot.es'
19-
spec.homepage = 'https://github.com/blocknotes/tiny_admin'
17+
spec.author = "Mattia Roccoberton"
18+
spec.email = "mat@blocknot.es"
19+
spec.homepage = "https://github.com/blocknotes/tiny_admin"
2020

2121
spec.metadata = {
22-
'homepage_uri' => spec.homepage,
23-
'source_code_uri' => spec.homepage,
24-
'changelog_uri' => 'https://github.com/blocknotes/tiny_admin/blob/main/CHANGELOG.md',
25-
'rubygems_mfa_required' => 'true'
22+
"homepage_uri" => spec.homepage,
23+
"source_code_uri" => spec.homepage,
24+
"changelog_uri" => "https://github.com/blocknotes/tiny_admin/blob/main/CHANGELOG.md",
25+
"rubygems_mfa_required" => "true"
2626
}
2727

28-
spec.files = Dir['{app,db,lib}/**/*', 'LICENSE.txt', 'README.md']
29-
spec.require_paths = ['lib']
28+
spec.files = Dir["{app,db,lib}/**/*", "LICENSE.txt", "README.md"]
29+
spec.require_paths = ["lib"]
3030

31-
spec.add_dependency 'phlex', '~> 1', '>= 1.10.0'
32-
spec.add_dependency 'roda', '~> 3'
33-
spec.add_dependency 'tilt', '~> 2'
34-
spec.add_dependency 'zeitwerk', '~> 2'
31+
spec.add_dependency "phlex", "~> 2"
32+
spec.add_dependency "roda", "~> 3"
33+
spec.add_dependency "tilt", "~> 2"
34+
spec.add_dependency "zeitwerk", "~> 2"
3535
end

0 commit comments

Comments
 (0)