Skip to content

Commit

Permalink
Merge pull request #156 from coord-e/html-pipeline-3.0
Browse files Browse the repository at this point in the history
Upgrade html-pipeline to v3 and drop support for Ruby <= 3.0
  • Loading branch information
coord-e authored Feb 14, 2024
2 parents 6b20799 + 8abe619 commit d634cc5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 8 deletions.
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

0 comments on commit d634cc5

Please sign in to comment.