Skip to content

Commit

Permalink
Merge pull request #30 from alphagov/ruby-3-4-1
Browse files Browse the repository at this point in the history
Bump supported minimum version of Ruby to 3.4.1
  • Loading branch information
chao-xian authored Jan 31, 2025
2 parents 1215a30 + 7d5fa20 commit d8a4185
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
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

0 comments on commit d8a4185

Please sign in to comment.