Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump supported minimum version of Ruby to 3.4.1 #30

Merged
merged 1 commit into from
Jan 31, 2025
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/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
ruby:
- '3.3.1'
- '3.4.1'

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ inherit_mode:
# **************************************************************

AllCops:
TargetRubyVersion: 3.0
TargetRubyVersion: 3.4
1 change: 1 addition & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ GEM

PLATFORMS
arm64-darwin-22
arm64-darwin-24
x86_64-darwin-22
x86_64-linux

Expand Down
2 changes: 1 addition & 1 deletion govuk-forms-markdown.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.description = "This gem renders the limited subset of Markdown syntax supported by GOV.UK Forms."
spec.homepage = "https://github.com/alphagov/govuk-forms-markdown"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0.0"
spec.required_ruby_version = ">= 3.4.1"

spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"

Expand Down
4 changes: 2 additions & 2 deletions lib/govuk_forms_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ module GovukFormsMarkdown
class Error < StandardError; end

def self.render(markdown, allow_headings: true)
renderer = GovukFormsMarkdown::Renderer.new({ link_attributes: { class: "govuk-link", rel: "noreferrer noopener", target: "_blank" } }, allow_headings: allow_headings)
renderer = GovukFormsMarkdown::Renderer.new({ link_attributes: { class: "govuk-link", rel: "noreferrer noopener", target: "_blank" } }, allow_headings:)
Redcarpet::Markdown.new(renderer, no_intra_emphasis: true, disable_indented_code_blocks: true).render(markdown).strip
end

def self.validate(markdown, allow_headings: true)
GovukFormsMarkdown::Validator.new(markdown, allow_headings: allow_headings).validate
GovukFormsMarkdown::Validator.new(markdown, allow_headings:).validate
end
end
2 changes: 1 addition & 1 deletion spec/govuk-forms-markdown/renderer/header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# rubocop:disable RSpec/FilePath
RSpec.describe GovukFormsMarkdown::Renderer, "#header" do
subject(:renderer) { described_class.new(allow_headings: allow_headings) }
subject(:renderer) { described_class.new(allow_headings:) }

let(:allow_headings) { true }

Expand Down
2 changes: 1 addition & 1 deletion spec/govuk-forms-markdown/validator/validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# rubocop:disable RSpec/FilePath
RSpec.describe GovukFormsMarkdown::Validator do
let(:validator) { described_class.new(markdown, allow_headings: allow_headings) }
let(:validator) { described_class.new(markdown, allow_headings:) }
let(:allow_headings) { true }

describe "#validate_length" do
Expand Down