Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

Commit da37da5

Browse files
authored
Update project to Ruby 3 (#57)
## Description This PR updates the project's minimum supported Ruby version to 3.0. ## Commits - Set development Ruby version to v3.3.1 - Set minimum Ruby version in gemspec - Remove Ruby 2.7 from test matrix - Set target Ruby version to 3.0 - Set IRB pager config - RuboCop: Style/RedundantFreeze - Explicitly require uri library - Update documentation
2 parents 0c81d01 + 8ec920f commit da37da5

File tree

10 files changed

+16
-9
lines changed

10 files changed

+16
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: [macos-latest, ubuntu-latest]
30-
ruby: ["2.7", "3.0", "3.1", "3.2", "3.3"]
30+
ruby: ["3.0", "3.1", "3.2", "3.3"]
3131
steps:
3232
- uses: actions/checkout@v4
3333
- uses: ruby/setup-ruby@v1

.irbrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ IRB.conf[:AUTO_INDENT] = true
66
IRB.conf[:HISTORY_FILE] = ".irb_history"
77
IRB.conf[:SAVE_HISTORY] = 1000
88
IRB.conf[:USE_AUTOCOMPLETE] = false
9+
IRB.conf[:USE_PAGER] = false
910

1011
def clear
1112
system("clear")

.rubocop.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ inherit_from:
55
require:
66
- rubocop-packaging
77

8-
# Makes sure that Ruby source files have snake_case names.
8+
AllCops:
9+
TargetRubyVersion: "3.0"
10+
911
Naming/FileName:
1012
Exclude:
1113
- lib/link-header-parser.rb

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.8
1+
3.3.1

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
> [!NOTE]
4+
> From v6.0.0, changes are documented using [GitHub Releases](https://github.com/jgarber623/link-header-parser-ruby/releases). For a given release, metadata on RubyGems.org will link to that version's Release page.
5+
36
## 5.1.1 / 2024-01-01
47

58
- RuboCop: Style/WordArray (7b5964f)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
## Getting Started
1010

11-
Before installing and using link-header-parser-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 2.7 (or newer) installed. Using a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm) is recommended.
11+
Before installing and using link-header-parser-ruby, you'll want to have [Ruby](https://www.ruby-lang.org) 3.0 (or newer) installed. Using a Ruby version managment tool like [rbenv](https://github.com/rbenv/rbenv), [chruby](https://github.com/postmodern/chruby), or [rvm](https://github.com/rvm/rvm) is recommended.
1212

13-
link-header-parser-ruby is developed using Ruby 2.7.8 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/jgarber623/link-header-parser-ruby/actions).
13+
link-header-parser-ruby is developed using Ruby 3.3.1 and is tested against additional Ruby versions using [GitHub Actions](https://github.com/jgarber623/link-header-parser-ruby/actions).
1414

1515
## Installation
1616

lib/link-header-parser.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# frozen_string_literal: true
22

33
require "forwardable"
4+
require "uri"
45

56
require_relative "link_header_parser/version"
67

lib/link_header_parser/link_header.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
module LinkHeaderParser
44
class LinkHeader
5-
FIELD_VALUE_REGEXP_PATTERN = /^\s*<\s*(?<target_string>[^>]+)\s*>\s*(?<parameters>;\s*.*)$/.freeze
5+
FIELD_VALUE_REGEXP_PATTERN = /^\s*<\s*(?<target_string>[^>]+)\s*>\s*(?<parameters>;\s*.*)$/
66
private_constant :FIELD_VALUE_REGEXP_PATTERN
77

8-
PARAMETERS_REGEXP_PATTERN = /(?<!;)\s*[^;]+/.freeze
8+
PARAMETERS_REGEXP_PATTERN = /(?<!;)\s*[^;]+/
99
private_constant :PARAMETERS_REGEXP_PATTERN
1010

1111
# The +String+ value used to create this {LinkHeader}.

lib/link_header_parser/link_header_parameter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module LinkHeaderParser
44
class LinkHeaderParameter
5-
PARAMETER_REGEXP_PATTERN = /^(?<name>.+?)(?:="?(?<value>.*?)"?)?$/.freeze
5+
PARAMETER_REGEXP_PATTERN = /^(?<name>.+?)(?:="?(?<value>.*?)"?)?$/
66
private_constant :PARAMETER_REGEXP_PATTERN
77

88
# The +String+ value used to create this {LinkHeaderParameter}.

link-header-parser.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_relative "lib/link_header_parser/version"
44

55
Gem::Specification.new do |spec|
6-
spec.required_ruby_version = ">= 2.7"
6+
spec.required_ruby_version = ">= 3.0"
77

88
spec.name = "link-header-parser"
99
spec.version = LinkHeaderParser::VERSION

0 commit comments

Comments
 (0)