diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95a4f14..06b7154 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: ruby: - - '3.3.1' + - '3.4.1' steps: - uses: actions/checkout@v4 diff --git a/.rubocop.yml b/.rubocop.yml index fe73b34..28a0759 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -19,4 +19,4 @@ inherit_mode: # ************************************************************** AllCops: - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.4 diff --git a/Gemfile.lock b/Gemfile.lock index f85acfd..e3cda10 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,7 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-24 x86_64-darwin-22 x86_64-linux diff --git a/govuk-forms-markdown.gemspec b/govuk-forms-markdown.gemspec index b8f8bdd..a31124f 100644 --- a/govuk-forms-markdown.gemspec +++ b/govuk-forms-markdown.gemspec @@ -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'" diff --git a/lib/govuk_forms_markdown.rb b/lib/govuk_forms_markdown.rb index 610a483..ef23f18 100644 --- a/lib/govuk_forms_markdown.rb +++ b/lib/govuk_forms_markdown.rb @@ -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 diff --git a/spec/govuk-forms-markdown/renderer/header_spec.rb b/spec/govuk-forms-markdown/renderer/header_spec.rb index 4b9bb12..90a98bc 100644 --- a/spec/govuk-forms-markdown/renderer/header_spec.rb +++ b/spec/govuk-forms-markdown/renderer/header_spec.rb @@ -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 } diff --git a/spec/govuk-forms-markdown/validator/validator_spec.rb b/spec/govuk-forms-markdown/validator/validator_spec.rb index ff9ccbe..6b69e11 100644 --- a/spec/govuk-forms-markdown/validator/validator_spec.rb +++ b/spec/govuk-forms-markdown/validator/validator_spec.rb @@ -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