Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade html-pipeline to v3 and drop support for Ruby <= 3.0 #156

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
fail-fast: false
matrix:
ruby:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
name: Run test with Ruby ${{ matrix.ruby }}
Expand Down Expand Up @@ -49,8 +47,6 @@ jobs:
fail-fast: false
matrix:
ruby:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
name: Run assets:precompile with Ruby ${{ matrix.ruby }}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## lastest(master branch)
- Dependencies
- Upgrade html-pipeline to v3
- Drop support for Ruby <= 3.0

## v0.8.0
- Upgrade Rails to v7.0
- Support Ruby 3.2
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/kuroko2/job_definitions_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def first_line(text)
end

def markdown_format(text)
pipeline = HTML::Pipeline.new([HTML::Pipeline::MarkdownFilter])
pipeline = HTMLPipeline.new(convert_filter: HTMLPipeline::ConvertFilter::MarkdownFilter.new)
raw(pipeline.call(text)[:output].to_s)
end

Expand Down
2 changes: 1 addition & 1 deletion kuroko2.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Gem::Specification.new do |s|
s.add_dependency 'omniauth-google-oauth2', '>= 1.0.0'
s.add_dependency 'omniauth-rails_csrf_protection'

s.add_dependency 'html-pipeline'
s.add_dependency 'html-pipeline', '>= 3'
s.add_dependency 'commonmarker', '>= 0.17.8'
s.add_dependency 'font-awesome-rails'
s.add_dependency 'rinku'
Expand Down
3 changes: 2 additions & 1 deletion lib/kuroko2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
require 'aws-sdk-cloudwatchlogs'
require 'retryable'
require 'faraday'
require 'html/pipeline'
require 'html_pipeline'
require 'html_pipeline/convert_filter/markdown_filter'
require 'hipchat'
require 'omniauth-google-oauth2'
require 'omniauth/rails_csrf_protection'
Expand Down
3 changes: 2 additions & 1 deletion spec/helpers/job_definition_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
EOF
end

it { is_expected.to match %r(<h1>Title</h1>) }
# commonmarker >= 1 includes an anchor in headings
it { is_expected.to match %r(<h1>(<a href="#title" aria-hidden="true" id="title"></a>)?Title</h1>) }
it { is_expected.to match %r(LGTM) }
end

Expand Down
Loading