Skip to content

Commit 69c14cc

Browse files
committed
Add support for Phlex 2, drop support for Phlex 1
1 parent 121a264 commit 69c14cc

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ jobs:
99
strategy:
1010
matrix:
1111
ruby:
12-
- '2.7'
13-
- '3.0'
14-
- '3.1'
1512
- '3.2'
1613
- '3.3'
1714
- '3.4'
@@ -31,5 +28,5 @@ jobs:
3128
- uses: ruby/setup-ruby@v1
3229
with:
3330
bundler-cache: true
34-
ruby-version: '3.2'
31+
ruby-version: '3.4'
3532
- run: bundle exec rubocop

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
AllCops:
22
NewCops: enable
33
SuggestExtensions: false
4-
TargetRubyVersion: 2.7
4+
TargetRubyVersion: 3.2
55

66
Layout:
77
Enabled: false

lib/phlex-sinatra.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ def initialize(obj)
2121

2222
module SGMLOverrides
2323
def helpers
24-
@_view_context
24+
context
2525
end
2626

2727
def url(...)
28-
helpers.url(...)
28+
context.url(...)
2929
end
3030
end
3131

@@ -51,10 +51,10 @@ def phlex(
5151

5252
if stream
5353
self.stream do |out|
54-
obj.call(out, view_context: self)
54+
obj.call(out, context: self)
5555
end
5656
else
57-
output = obj.call(view_context: self)
57+
output = obj.call(context: self)
5858

5959
if layout
6060
render(layout_engine, layout, { layout: false }) { output }

phlex-sinatra.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
1212
spec.description = 'A Phlex adapter for Sinatra'
1313
spec.homepage = 'https://github.com/benpickles/phlex-sinatra'
1414
spec.license = 'MIT'
15-
spec.required_ruby_version = '>= 2.7' # Match Phlex.
15+
spec.required_ruby_version = '>= 3.2' # Match Phlex.
1616

1717
spec.metadata['changelog_uri'] = 'https://github.com/benpickles/phlex-sinatra/blob/main/CHANGELOG.md'
1818
spec.metadata['homepage_uri'] = spec.homepage
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
3030
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
3131
spec.require_paths = ['lib']
3232

33-
spec.add_dependency 'phlex', '>= 1.7.0'
33+
spec.add_dependency 'phlex', '>= 2'
3434
spec.add_dependency 'sinatra'
3535
end

0 commit comments

Comments
 (0)