jmeter-ruby 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6e3df6308fba625f6639be81d7f74a2703b6f31d8a38907620f43c8361e308a
4
- data.tar.gz: 3f878f2afa7e83c5a2975c6682719d133136d322511c924863502ebdb18afadd
3
+ metadata.gz: c6295d5ca488972f89f960b0a06172e968d27567dd96339a289a4def7dbd1611
4
+ data.tar.gz: 5e54caa52be883697fca1c1c04859ba4508e69f55cd2f158103752497ecc6a7a
5
5
  SHA512:
6
- metadata.gz: c23624b52ea012efbd7ca96352992ac4a6efc77f4291e673f5bfb94b07f0cc29383dcefb52dc3fee3655c9c06c8a35732e7ddc306f4ef9bd0788b79725c64ab2
7
- data.tar.gz: ca7bf82218e82adf99bde069851a900ec830e1c37c0f65bf8391f23016d2cb92cff075f503eb4fa91bb2e1fefb5b90bfa2108a72e6999241ac9378d7d6bead31
6
+ metadata.gz: 95769e39adaa0c70cb055412268dc34d22e55ce1c315a85fa4f7e9ef8f07ccf579b74e85a3a1216d0806578f67dff97795ec78d8d73cd3c823b84aca41039f47
7
+ data.tar.gz: 74e16cb6c8a8dfb312bb4e1832ee83986360d232b5f4315c514c1b3d6aec1746fb91518ebda0bb0e559cf9f82a32dc8bce1b454cf98ad6c1994f706a3ac6d5c2
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ - package-ecosystem: github-actions
8
+ directory: /
9
+ schedule:
10
+ interval: weekly
@@ -14,13 +14,13 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  include:
17
- - ruby_version: "3.2"
18
17
  - ruby_version: "3.3"
19
18
  - ruby_version: "3.4"
19
+ - ruby_version: "4.0.5"
20
20
  steps:
21
- - uses: actions/checkout@v4.1.1
21
+ - uses: actions/checkout@v6.0.3
22
22
  - name: Setup Ruby
23
- uses: ruby/setup-ruby@v1
23
+ uses: ruby/setup-ruby@v1.313.0
24
24
  with:
25
25
  ruby-version: ${{ matrix.ruby_version }}
26
26
  bundler-cache: true
@@ -31,7 +31,7 @@ jobs:
31
31
  RAISE_ON_WARNING: 1
32
32
  RUBY_VERSION: ${{ matrix.ruby_version }}
33
33
  - name: Upload coverage results
34
- uses: actions/upload-artifact@v4.4.0
34
+ uses: actions/upload-artifact@v7.0.1
35
35
  if: always()
36
36
  with:
37
37
  name: simplecov-resultset-ruby${{matrix.ruby_version}}
@@ -41,14 +41,14 @@ jobs:
41
41
  needs: test
42
42
  runs-on: ubuntu-latest
43
43
  steps:
44
- - uses: actions/checkout@v4.1.1
44
+ - uses: actions/checkout@v6.0.3
45
45
  - name: Setup Ruby
46
- uses: ruby/setup-ruby@v1
46
+ uses: ruby/setup-ruby@v1.313.0
47
47
  with:
48
- ruby-version: 3.4
48
+ ruby-version: "4.0.5"
49
49
  bundler-cache: true
50
50
  - name: Download coverage results
51
- uses: actions/download-artifact@v4.2.1
51
+ uses: actions/download-artifact@v8.0.1
52
52
  - name: Collate simplecov
53
53
  run: |
54
54
  bundle exec rake coverage:report
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.7
1
+ 4.0.5
data/CHANGES.md CHANGED
@@ -1,4 +1,15 @@
1
1
  # Changes
2
+ ## v3.0.1
3
+ - Update local Ruby tooling to Ruby 4.0.5.
4
+ - Raise the supported Ruby floor to 3.3.0 and test supported Ruby branches in CI.
5
+ - Refresh GitHub Actions versions and add Dependabot automation for Bundler and GitHub Actions.
6
+ - Clean up gemspec metadata for release builds.
7
+ - Replace the stale release script with the current Bundler/RubyGems release flow and document it.
8
+ - Create the GitHub release from `script/release` using the matching `CHANGES.md` notes.
9
+ - Make `script/release` fail earlier on missing RubyGems credentials and resume GitHub release creation when the release tag already exists.
10
+ - Make `script/release` fail early when macOS system Ruby is active and document running releases through mise.
11
+ - Make `script/release` automatically re-run through mise when the active shell is using the wrong Ruby.
12
+
2
13
  ## v3.0.0
3
14
  - Add Github Actions CI
4
15
  - Add support foir modern Rubies
data/Gemfile CHANGED
@@ -1,5 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '>= 3.3.0'
4
+
3
5
  # Specify your gem's dependencies in jmeter-ruby.gemspec
4
6
  gemspec
5
7
 
data/README.md CHANGED
@@ -414,6 +414,28 @@ If contributing please add an appropriate test. See `spec/*_spec.rb` for example
414
414
 
415
415
  $ bundle exec rspec
416
416
 
417
+ ### Release
418
+
419
+ Releases use Bundler's gem release task. Prepare the version bump and `CHANGES.md` entry in a pull request first. After that PR is merged, release from an up-to-date `main` branch:
420
+
421
+ ```sh
422
+ git switch main
423
+ git pull origin main
424
+ gem signin
425
+ gh auth login
426
+ script/release
427
+ ```
428
+
429
+ The release script verifies that `main` is clean and synced, runs `bundle install`, runs the specs, builds the gem, and then delegates publishing to `bundle exec rake release`. If the active shell is using the wrong Ruby and `mise` is installed, the script automatically re-runs itself through the Ruby configured in `mise.toml`. The Bundler release task creates and pushes the `vX.Y.Z` git tag and pushes the gem to RubyGems.org. After that, the script creates the GitHub release for the same tag using the matching `CHANGES.md` section.
430
+
431
+ If the gem/tag publish succeeds but GitHub release creation fails, rerun `script/release`. The script will reuse the existing tag and finish creating the GitHub release.
432
+
433
+ To check the release flow without publishing:
434
+
435
+ ```sh
436
+ DRY_RUN=1 script/release
437
+ ```
438
+
417
439
  ### Examples
418
440
 
419
441
  It is often useful to add an appropriate example for other users and for testing your changes locally with the JMeter UI. See `examples` for different types of examples. To let your examples work locally from your own changes / commits simply prefix the examples with:
data/jmeter-ruby.gemspec CHANGED
@@ -8,10 +8,10 @@ Gem::Specification.new do |gem|
8
8
  gem.version = JmeterRuby::VERSION::STRING
9
9
  gem.authors = ['Reegan Viljoen']
10
10
  gem.email = ['reeganviljoen@outlook.com']
11
- gem.description = %q{Ruby based DSL for writing JMeter test plans}
12
- gem.summary = %q{Ruby based DSL for writing JMeter test plans}
13
- gem.homepage = 'https://github.com/reeganviljoen/jmeter-ruby/issues'
14
- gem.required_ruby_version = ">= 3.1.0"
11
+ gem.summary = 'Ruby DSL for writing JMeter test plans'
12
+ gem.description = 'JMeter-Ruby provides a Ruby DSL for generating Apache JMeter test plans.'
13
+ gem.homepage = 'https://github.com/reeganviljoen/jmeter-ruby'
14
+ gem.required_ruby_version = ">= 3.3.0"
15
15
 
16
16
  gem.add_dependency 'rest-client'
17
17
  gem.add_dependency 'nokogiri'
@@ -2,7 +2,7 @@ module JmeterRuby
2
2
  module VERSION
3
3
  MAJOR = 3
4
4
  MINOR = 0
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join(".")
data/mise.toml CHANGED
@@ -1,2 +1,2 @@
1
1
  [tools]
2
- ruby = "3.4.2"
2
+ ruby = "4.0.5"
data/script/release CHANGED
@@ -1,162 +1,232 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- fetch() {
4
- git fetch --all
5
- }
3
+ set -euo pipefail
6
4
 
7
5
  branch_name() {
8
6
  git symbolic-ref --short HEAD
9
7
  }
10
8
 
11
- local_history_is_clean() {
12
- history=$(git rev-list --count --right-only @{u}...HEAD)
13
- [ "$history" == "0" ]
9
+ current_version() {
10
+ ruby ./lib/jmeter-ruby/version.rb
14
11
  }
15
12
 
16
- remote_history_is_clean() {
17
- history=$(git rev-list --count --left-only @{u}...HEAD)
18
- [ "$history" == "0" ]
13
+ run_with_mise_if_available() {
14
+ if [ "${JMETER_RUBY_RELEASE_MISE:-}" = "1" ]; then
15
+ return 1
16
+ fi
17
+
18
+ if ! command -v mise > /dev/null; then
19
+ return 1
20
+ fi
21
+
22
+ echo "Active Ruby is not supported. Re-running release with mise."
23
+ mise trust
24
+ mise install
25
+ JMETER_RUBY_RELEASE_MISE=1 exec mise exec -- "$0" "$@"
26
+ }
27
+
28
+ required_ruby_version() {
29
+ ruby -e 'spec = Gem::Specification.load("jmeter-ruby.gemspec"); puts spec.required_ruby_version.requirements.first.last'
19
30
  }
20
31
 
21
- tag_exists_on_remote() {
22
- git rev-parse --quiet --verify refs/tags/$1.$2.$3 > /dev/null
32
+ current_ruby_version() {
33
+ ruby -e 'puts RUBY_VERSION'
34
+ }
35
+
36
+ require_supported_ruby() {
37
+ local required_version
38
+ local active_version
39
+
40
+ required_version="$(required_ruby_version)"
41
+ active_version="$(current_ruby_version)"
42
+
43
+ if ruby -e "exit(Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('$required_version'))"; then
44
+ return
45
+ fi
46
+
47
+ run_with_mise_if_available "$@"
48
+
49
+ echo "Error: Ruby ${required_version} or newer is required, but active ruby is ${active_version}."
50
+ echo "Active ruby: $(command -v ruby)"
51
+ echo "Install/activate the project Ruby first, for example:"
52
+ echo " mise trust && mise install"
53
+ echo "Then rerun:"
54
+ echo " script/release"
55
+ exit 1
56
+ }
57
+
58
+ require_bundler() {
59
+ if command -v bundle > /dev/null && bundle -v > /dev/null 2>&1; then
60
+ return
61
+ fi
62
+
63
+ echo "Error: Bundler is not available for the active Ruby."
64
+ echo "Active ruby: $(command -v ruby)"
65
+ if [ -f Gemfile.lock ]; then
66
+ local bundled_version
67
+ bundled_version="$(awk '/^BUNDLED WITH$/ { getline; gsub(/^[[:space:]]+/, ""); print; exit }' Gemfile.lock)"
68
+
69
+ if [ -n "$bundled_version" ]; then
70
+ echo "Install the locked Bundler for this Ruby with:"
71
+ echo " gem install bundler:${bundled_version}"
72
+ exit 1
73
+ fi
74
+ fi
75
+
76
+ echo "Install Bundler for this Ruby with:"
77
+ echo " gem install bundler"
78
+ exit 1
23
79
  }
24
80
 
25
81
  working_tree_is_clean() {
26
- status=$(git status --porcelain)
27
- [ "$status" == "" ]
82
+ [ -z "$(git status --porcelain)" ]
28
83
  }
29
84
 
30
- create_release_branch() {
31
- git switch -c release-$1-$2-$3
85
+ local_history_is_clean() {
86
+ [ "$(git rev-list --count --right-only @{u}...HEAD)" = "0" ]
87
+ }
88
+
89
+ remote_history_is_clean() {
90
+ [ "$(git rev-list --count --left-only @{u}...HEAD)" = "0" ]
32
91
  }
33
92
 
34
- update_readme() {
35
- sed -i '' "/## main/ {a\
36
- \\
37
- \\
38
- ## $1.$2.$3
39
- }" docs/CHANGELOG.md
93
+ tag_exists() {
94
+ local version="$1"
95
+
96
+ git rev-parse --quiet --verify "refs/tags/v${version}" > /dev/null ||
97
+ git ls-remote --exit-code --tags origin "refs/tags/v${version}" > /dev/null
98
+ }
99
+
100
+ github_release_exists() {
101
+ local version="$1"
102
+
103
+ gh release view "v${version}" > /dev/null 2>&1
40
104
  }
41
105
 
42
- update_ruby_version() {
43
- # Update version file
44
- sed -E -i '' \
45
- -e "s/MAJOR = [0-9]+/MAJOR = $1/g" \
46
- -e "s/MINOR = [0-9]+/MINOR = $2/g" \
47
- -e "s/PATCH = [0-9]+/PATCH = $3/g" \
48
- lib/jmeter-ruby/version.rb
106
+ require_github_cli() {
107
+ if ! command -v gh > /dev/null; then
108
+ echo "Error: GitHub CLI is required to create the GitHub release."
109
+ echo "Install it from https://cli.github.com/ and run gh auth login."
110
+ exit 1
111
+ fi
49
112
 
50
- # Update deprecation horizon version
51
- major=$1
52
- sed -E -i '' \
53
- -e "s/DEPRECATION_HORIZON = [0-9]+/DEPRECATION_HORIZON = $((major + 1))/g" \
54
- lib/jmeter-ruby/deprecation.rb
113
+ if ! gh auth status -h github.com > /dev/null 2>&1; then
114
+ echo "Error: GitHub CLI is not authenticated."
115
+ echo "Run gh auth login before releasing."
116
+ exit 1
117
+ fi
55
118
  }
56
119
 
57
- update_gemfiles() {
58
- # Update Gemfile.lock
59
- bundle
120
+ require_rubygems_credentials() {
121
+ if gem owner jmeter-ruby > /dev/null 2>&1; then
122
+ return
123
+ fi
124
+
125
+ if [ -t 0 ]; then
126
+ echo "RubyGems credentials are missing or invalid. Starting gem signin."
127
+ gem signin
128
+ fi
129
+
130
+ if ! gem owner jmeter-ruby > /dev/null 2>&1; then
131
+ echo "Error: RubyGems credentials are missing, invalid, or cannot access jmeter-ruby."
132
+ echo "Run gem signin, make sure you are an owner of jmeter-ruby, then rerun script/release."
133
+ exit 1
134
+ fi
60
135
  }
61
136
 
62
- add_changed_files() {
63
- git add \
64
- Gemfile.lock \
65
- lib/jmeter-ruby/version.rb
137
+ write_release_notes() {
138
+ local version="$1"
139
+ local notes_file="$2"
140
+
141
+ awk -v heading="## v${version}" '
142
+ $0 == heading { in_section = 1; next }
143
+ in_section && /^## / { exit }
144
+ in_section { print }
145
+ ' CHANGES.md > "$notes_file"
146
+
147
+ if [ ! -s "$notes_file" ]; then
148
+ echo "Error: no release notes found for v${version} in CHANGES.md."
149
+ exit 1
150
+ fi
66
151
  }
67
152
 
68
- commit() {
69
- git commit -m "release $1.$2.$3"
153
+ create_github_release() {
154
+ local version="$1"
155
+ local notes_file
156
+
157
+ notes_file="$(mktemp)"
158
+ trap 'rm -f "$notes_file"' EXIT
159
+
160
+ write_release_notes "$version" "$notes_file"
161
+ gh release create "v${version}" \
162
+ --title "v${version}" \
163
+ --notes-file "$notes_file"
70
164
  }
71
165
 
72
- push() {
73
- git push origin release-$1-$2-$3
166
+ release_tag_and_gem() {
167
+ local version="$1"
74
168
 
75
- echo "####################################################"
76
- echo "Now, open a PR with this branch and merge it to main"
77
- echo "Then, run script/publish on main to release the gem"
78
- echo "Finally, create a GitHub release https://github.com/reeganviljoen/jmeter-ruby/releases/new with the changes from docs/CHANGELOG"
79
- echo "####################################################"
169
+ if tag_exists "$version"; then
170
+ echo "Tag v${version} already exists. Skipping gem publish and tag creation."
171
+ return
172
+ fi
173
+
174
+ bundle exec rake release
80
175
  }
81
176
 
82
177
  main() {
83
- version=$(ruby ./lib/jmeter-ruby/version.rb)
84
- version=(${version//./ })
85
- major=${version[0]}
86
- minor=${version[1]}
87
- patch=${version[2]}
178
+ local version
88
179
 
89
- echo "==================="
90
- echo "Prerequisite Checks"
91
- echo "==================="
180
+ require_supported_ruby "$@"
181
+ require_bundler
92
182
 
93
- if ! working_tree_is_clean; then
94
- echo "Error: unclean working tree"
183
+ version="$(current_version)"
184
+
185
+ echo "Preparing to release jmeter-ruby ${version}"
186
+
187
+ if [ "$(branch_name)" != "main" ]; then
188
+ echo "Error: releases must be run from main after the release PR is merged."
95
189
  exit 1
96
190
  fi
97
191
 
98
- if [ "$(branch_name)" != "main" ]; then
99
- echo "Error: can only make a release on the main branch"
192
+ if ! working_tree_is_clean; then
193
+ echo "Error: working tree is not clean."
100
194
  exit 1
101
195
  fi
102
196
 
103
- fetch
197
+ git fetch --all --tags
104
198
 
105
199
  if ! remote_history_is_clean; then
106
- echo "Error: changes exist on origin not pulled into this branch. Please pull"
200
+ echo "Error: origin/main has changes that are not pulled locally."
107
201
  exit 1
108
202
  fi
109
203
 
110
204
  if ! local_history_is_clean; then
111
- echo "Error: changes exist that haven't been pushed to origin. Please pull"
205
+ echo "Error: local main has commits that are not pushed to origin."
112
206
  exit 1
113
207
  fi
114
208
 
115
- echo "Type the number of an option to bump, or pick Manual to enter a version number"
116
- select bump in Major Minor Patch Manual
117
- do
118
- if [ "$bump" == "Major" ]; then
119
- major=$((major + 1))
120
- minor=0
121
- patch=0
122
- elif [ "$bump" == "Minor" ]; then
123
- minor=$((minor + 1))
124
- patch=0
125
- elif [ "$bump" == "Patch" ]; then
126
- patch=$((patch + 1))
127
- else
128
- read -p "What version? (Currently $major.$minor.$patch): " new_version
129
- if [ "$new_version" == "$major.$minor.$patch" ]; then
130
- echo "Error: Can't be the same version"
131
- exit 1
132
- fi
133
-
134
- new_version=(${new_version//./ })
135
-
136
- major=${new_version[0]}
137
- minor=${new_version[1]}
138
- patch=${new_version[2]}
139
- fi
209
+ require_github_cli
210
+ require_rubygems_credentials
140
211
 
141
- if tag_exists_on_remote $major $minor $patch; then
142
- echo "Error: tag exists on remote"
143
- exit 1
144
- fi
212
+ if github_release_exists "$version"; then
213
+ echo "Error: GitHub release v${version} already exists."
214
+ exit 1
215
+ fi
145
216
 
146
- echo "==============================="
147
- echo "Creating release for $major.$minor.$patch"
148
- echo "==============================="
149
-
150
- create_release_branch $major $minor $patch
151
- update_readme $major $minor $patch
152
- update_ruby_version $major $minor $patch
153
- update_gemfiles $major $minor $patch
154
- echo "version: $major.$minor.$patch" > docs/_data/library.yml
155
- add_changed_files $major $minor $patch
156
- commit $major $minor $patch
157
- push $major $minor $patch
217
+ bundle install
218
+ bundle exec rake spec
219
+ bundle exec rake build
220
+
221
+ if [ "${DRY_RUN:-}" = "1" ]; then
222
+ echo "Dry run complete. Skipping: bundle exec rake release and gh release create"
158
223
  exit 0
159
- done
224
+ fi
225
+
226
+ release_tag_and_gem "$version"
227
+ create_github_release "$version"
228
+
229
+ echo "Released jmeter-ruby ${version}."
160
230
  }
161
231
 
162
232
  main
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmeter-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reegan Viljoen
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-15 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rest-client
@@ -65,7 +65,7 @@ dependencies:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
67
  version: 0.9.1
68
- description: Ruby based DSL for writing JMeter test plans
68
+ description: JMeter-Ruby provides a Ruby DSL for generating Apache JMeter test plans.
69
69
  email:
70
70
  - reeganviljoen@outlook.com
71
71
  executables: []
@@ -73,6 +73,7 @@ extensions: []
73
73
  extra_rdoc_files: []
74
74
  files:
75
75
  - ".gitattributes"
76
+ - ".github/dependabot.yml"
76
77
  - ".github/workflows/ci.yml"
77
78
  - ".gitignore"
78
79
  - ".rspec"
@@ -336,7 +337,7 @@ files:
336
337
  - spec/user_parameters_spec.rb
337
338
  - spec/with_helpers_spec.rb
338
339
  - spec/xpath_extractor_spec.rb
339
- homepage: https://github.com/reeganviljoen/jmeter-ruby/issues
340
+ homepage: https://github.com/reeganviljoen/jmeter-ruby
340
341
  licenses:
341
342
  - MIT
342
343
  metadata: {}
@@ -347,14 +348,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
347
348
  requirements:
348
349
  - - ">="
349
350
  - !ruby/object:Gem::Version
350
- version: 3.1.0
351
+ version: 3.3.0
351
352
  required_rubygems_version: !ruby/object:Gem::Requirement
352
353
  requirements:
353
354
  - - ">="
354
355
  - !ruby/object:Gem::Version
355
356
  version: '0'
356
357
  requirements: []
357
- rubygems_version: 3.6.6
358
+ rubygems_version: 4.0.10
358
359
  specification_version: 4
359
- summary: Ruby based DSL for writing JMeter test plans
360
+ summary: Ruby DSL for writing JMeter test plans
360
361
  test_files: []