Skip to content

Commit 0338ebf

Browse files
authored
[Ruby] Dependency update (#322)
* Update specs to be slightly more performant * Fix up all outstanding rubocop offenses * Interim rubocop update - all still passing * Update ruby workflows * Update CCK to latest version * Permit latest (and upcoming major), release for messages * Fix assetsloader to create less objects * Tidy up specs * WIP fix up shared context in tests * Tidy up rubocop offenses and make tests flow better * Add changelog * Remove private method now assets loader tests are working
1 parent 8252f13 commit 0338ebf

File tree

13 files changed

+117
-146
lines changed

13 files changed

+117
-146
lines changed

.github/workflows/release-java.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
2423
- uses: ./.github/actions/prepare
25-
2624
- uses: actions/setup-java@v4
2725
with:
2826
distribution: "temurin"

.github/workflows/release-javascript.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,13 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23-
2423
- uses: actions/setup-node@v4
2524
with:
2625
node-version: 18
2726
cache: "npm"
2827
cache-dependency-path: javascript/package-lock.json
29-
3028
- run: npm install-ci-test
3129
working-directory: javascript
32-
3330
- uses: cucumber/[email protected]
3431
with:
3532
npm-token: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-ruby.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: ./.github/actions/prepare
2323
- uses: ruby/setup-ruby@v1
2424
with:
25-
ruby-version: '3.2'
25+
ruby-version: '3.3'
2626
bundler-cache: true
2727
working-directory: ruby
2828
- name: Publish ruby gem

.github/workflows/test-java.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,13 @@ jobs:
2727

2828
steps:
2929
- uses: actions/checkout@v4
30-
3130
- uses: ./.github/actions/prepare
32-
3331
- uses: actions/setup-java@v4
3432
with:
3533
distribution: "temurin"
3634
java-version: ${{ matrix.java }}
3735
cache: "maven"
38-
3936
- run: mvn install
4037
working-directory: java
41-
4238
- run: mvn test
4339
working-directory: java

.github/workflows/test-javascript.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,19 @@ jobs:
2828
steps:
2929
- name: set git core.autocrlf to 'input'
3030
run: git config --global core.autocrlf input
31-
3231
- uses: actions/checkout@v4
33-
3432
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
3533
uses: actions/setup-node@v4
3634
with:
3735
node-version: ${{ matrix.node-version }}
3836
cache: "npm"
3937
cache-dependency-path: javascript/package-lock.json
40-
4138
- run: npm install-ci-test
4239
working-directory: javascript
43-
4440
- run: npm run build
4541
working-directory: javascript
46-
4742
- run: npm run eslint
4843
working-directory: javascript
49-
5044
- name: Acceptance tests
5145
working-directory: javascript
5246
run: npm run validate

.github/workflows/test-ruby.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
matrix:
1919
os:
2020
- ubuntu-latest
21-
ruby: ['2.7', '3.0', '3.1', '3.2']
21+
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
2222
include:
2323
- os: macos-latest
24-
ruby: '3.2'
24+
ruby: '3.3'
2525
steps:
2626
- uses: actions/checkout@v4
2727
- uses: ./.github/actions/prepare

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
9+
### Changed
10+
- [Ruby] Updated dependencies to support latest messages & reduced object creation ([#322](https://github.com/cucumber/html-formatter/pull/322))
911

1012
## [21.6.0] - 2024-08-05
1113
### Added

ruby/.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ AllCops:
88
Exclude:
99
- 'vendor/**/*'
1010

11+
# Stylistic preference for cucumber
12+
Gemspec/DevelopmentDependencies:
13+
Enabled: false
14+
1115
# Disabled on our repo's to enable polyglot-release
1216
Gemspec/RequireMFA:
1317
Enabled: false

ruby/cucumber-html-formatter.gemspec

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ Gem::Specification.new do |s|
2424
'source_code_uri' => 'https://github.com/cucumber/html-formatter'
2525
}
2626

27-
s.add_runtime_dependency 'cucumber-messages', '> 19', '< 25'
27+
s.add_runtime_dependency 'cucumber-messages', '> 19', '< 27'
2828

29-
s.add_development_dependency 'cucumber-compatibility-kit', '~> 14.1'
30-
s.add_development_dependency 'rake', '~> 13.1'
31-
s.add_development_dependency 'rspec', '~> 3.12'
32-
s.add_development_dependency 'rubocop', '~> 1.41.0'
29+
s.add_development_dependency 'cucumber-compatibility-kit', '~> 15.2'
30+
s.add_development_dependency 'rake', '~> 13.2'
31+
s.add_development_dependency 'rspec', '~> 3.13'
32+
s.add_development_dependency 'rubocop', '~> 1.61.0'
3333
s.add_development_dependency 'rubocop-rake', '~> 0.6.0'
34-
s.add_development_dependency 'rubocop-rspec', '~> 2.15.0'
34+
s.add_development_dependency 'rubocop-rspec', '~> 2.25.0'
3535

3636
s.executables = ['cucumber-html-formatter']
3737
s.files = Dir['README.md', 'LICENSE', 'lib/**/*', 'assets/*']

ruby/lib/cucumber/html_formatter/assets_loader.rb

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,34 @@
33
module Cucumber
44
module HTMLFormatter
55
class AssetsLoader
6-
def template
7-
read_asset('index.mustache.html')
8-
end
6+
class << self
7+
def template
8+
read_asset('index.mustache.html')
9+
end
910

10-
def css
11-
read_asset('main.css')
12-
end
11+
def css
12+
read_asset('main.css')
13+
end
1314

14-
def script
15-
read_asset('main.js')
16-
end
15+
def script
16+
read_asset('main.js')
17+
end
1718

18-
private
19+
private
1920

20-
def read_asset(name)
21-
File.read(File.join(assets_path, name))
22-
end
21+
def read_asset(name)
22+
File.read(File.join(assets_path, name))
23+
end
2324

24-
def assets_path
25-
"#{html_formatter_path}/assets"
26-
end
25+
def assets_path
26+
"#{html_formatter_path}/assets"
27+
end
2728

28-
def html_formatter_path
29-
Gem.loaded_specs['cucumber-html-formatter'].full_gem_path
30-
rescue StandardError
31-
'.'
29+
def html_formatter_path
30+
Gem.loaded_specs['cucumber-html-formatter'].full_gem_path
31+
rescue StandardError
32+
'.'
33+
end
3234
end
3335
end
3436
end

0 commit comments

Comments
 (0)