Skip to content

Commit a119eba

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 5b5f4f2 commit a119eba

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

lib/tiny_admin/views/default_layout.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Views
55
class DefaultLayout < BasicLayout
66
attr_accessor :flash_component, :head_component, :messages, :navbar_component, :options, :title
77

8-
def view_template(&block)
8+
def view_template
99
extra_styles = TinyAdmin.settings.extra_styles
1010
flash_component&.messages = messages
1111
head_component&.update_attributes(page_title: title, style_links: style_links, extra_styles: extra_styles)
@@ -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

lib/tiny_admin/views/pages/content.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def view_template
88
super do
99
div(class: "content") {
1010
div(class: "content-data") {
11-
unsafe_raw(content)
11+
raw(safe(content))
1212
}
1313

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

tiny_admin.gemspec

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ $:.push File.expand_path("lib", __dir__)
55
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"
8+
spec.platform = Gem::Platform::RUBY
9+
spec.name = "tiny_admin"
10+
spec.version = TinyAdmin::VERSION
11+
spec.summary = "Tiny Admin"
1212
spec.description = "A compact and composable dashboard component for Ruby"
13-
spec.license = "MIT"
13+
spec.license = "MIT"
1414

1515
spec.required_ruby_version = ">= 3.0.0"
1616

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

2121
spec.metadata = {
@@ -25,10 +25,10 @@ Gem::Specification.new do |spec|
2525
"rubygems_mfa_required" => "true"
2626
}
2727

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

31-
spec.add_dependency "phlex", "~> 1", ">= 1.10.0"
31+
spec.add_dependency "phlex", "~> 2"
3232
spec.add_dependency "roda", "~> 3"
3333
spec.add_dependency "tilt", "~> 2"
3434
spec.add_dependency "zeitwerk", "~> 2"

0 commit comments

Comments
 (0)