Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/release-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: ./.github/actions/prepare
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
ruby-version: '3.4'
bundler-cache: true
working-directory: ruby
- name: Publish ruby gem
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
matrix:
os:
- ubuntu-latest
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
ruby: ['3.1', '3.2', '3.3', '3.4', '3.5']
include:
- os: macos-latest
ruby: '3.3'
ruby: '3.4'
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/prepare
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Changed
- [Ruby] Minimum ruby version is now 3.1+ (Bumped CI workflows also) ([#441](https://github.com/cucumber/html-formatter/pull/441))
- Upgrade `cucumber-messages` to [30.0.0](https://github.com/cucumber/messages/releases/tag/v30.0.0)

## [21.15.1] - 2025-09-11
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>messages</artifactId>
<version>[18.0.0,30.0.0)</version>
<version>[18.0.0,31.0.0)</version>
</dependency>

<dependency>
Expand Down
12 changes: 6 additions & 6 deletions ruby/cucumber-html-formatter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Gem::Specification.new do |s|
s.homepage = 'https://github.com/cucumber/html-formatter'
s.platform = Gem::Platform::RUBY
s.license = 'MIT'
s.required_ruby_version = '>= 2.6'
s.required_rubygems_version = '>= 3.0.3'
s.required_ruby_version = '>= 3.1'
s.required_rubygems_version = '>= 3.2.8'

s.metadata = {
'bug_tracker_uri' => 'https://github.com/cucumber/html-formatter/issues',
Expand All @@ -24,13 +24,13 @@ Gem::Specification.new do |s|
'source_code_uri' => 'https://github.com/cucumber/html-formatter'
}

s.add_runtime_dependency 'cucumber-messages', '> 19', '< 28'
s.add_runtime_dependency 'cucumber-messages', '> 19', '< 31'

s.add_development_dependency 'rake', '~> 13.2'
s.add_development_dependency 'rake', '~> 13.3'
s.add_development_dependency 'rspec', '~> 3.13'
s.add_development_dependency 'rubocop', '~> 1.71.0'
s.add_development_dependency 'rubocop', '~> 1.81.0'
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
s.add_development_dependency 'rubocop-rspec', '~> 2.31.0'
s.add_development_dependency 'rubocop-rspec', '~> 3.7.0'

s.executables = ['cucumber-html-formatter']
s.files = Dir['README.md', 'LICENSE', 'lib/**/*', 'assets/*']
Expand Down
6 changes: 3 additions & 3 deletions ruby/lib/cucumber/html_formatter/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def write_message(message)
out.puts(',') unless @first_message
# Replace < with \x3C
# https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
out.print(message.to_json.gsub('<', "\\x3C"))
out.print(message.to_json.gsub('<', '\\x3C'))

@first_message = false
end
Expand Down Expand Up @@ -53,7 +53,7 @@ def pre_message
AssetsLoader.css,
template_writer.write_between('{{css}}', '{{custom_css}}'),
template_writer.write_between('{{custom_css}}', '{{messages}}')
].join("")
].join('')
end

def post_message
Expand All @@ -62,7 +62,7 @@ def post_message
AssetsLoader.script,
template_writer.write_between('{{script}}', '{{custom_script}}'),
template_writer.write_between('{{custom_script}}', nil)
].join("")
].join('')
end

def template_writer
Expand Down
4 changes: 2 additions & 2 deletions ruby/spec/cucumber/html_formatter/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
expect(out.string).to match(/\A<!DOCTYPE html>\s?<html/)
expect(out.string).to include("window.CUCUMBER_MESSAGES = [\n];")
expect(out.string).to match(/<\/html>\Z/)

end

it 'writes an empty report' do
Expand All @@ -115,6 +115,6 @@
expect(out.string).to match(/\A<!DOCTYPE html>\s?<html/)
expect(out.string).to include("window.CUCUMBER_MESSAGES = [\n{\"testRunStarted\":{\"timestamp\":{\"seconds\":10,\"nanos\":0}}},\n{\"testRunFinished\":{\"success\":false,\"timestamp\":{\"seconds\":15,\"nanos\":0}}}];")
expect(out.string).to match(/<\/html>\Z/)

end
end