Skip to content

Commit

Permalink
Fix Rubocop errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mheap committed Aug 30, 2022
1 parent f32cb3e commit 60d668e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions app/_plugins/filters/breadcrumb_title_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
require 'yaml'
module Jekyll
module BreadcrumbTitleFilter
def initialize(_)
super(_)
def initialize(ctx)
super(ctx)
@mapping = YAML.load_file("#{__dir__}/../../breadcrumb_titles.yml")
end

def breadcrumb_title(input)
parts = input.split("/")
parts = input.split('/')
parts[2] = 'VERSION'
input = "#{parts.join("/")}/"
input = "#{parts.join('/')}/"
@mapping[input]
end
end
Expand Down
7 changes: 3 additions & 4 deletions app/_plugins/generators/single_source_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create_pages(data, site, product, release, version, assume_generated, nav) #
end

class SingleSourcePage < Jekyll::Page
def initialize(site, src, dest, product, release, version, nav) # rubocop:disable Lint/MissingSuper, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
def initialize(site, src, dest, product, release, version, nav) # rubocop:disable Lint/MissingSuper, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
# Configure variables that Jekyll depends on
@site = site

Expand Down Expand Up @@ -98,9 +98,8 @@ def initialize(site, src, dest, product, release, version, nav) # rubocop:disabl
is_dir_index = false
else
file = "src/#{src}/index.md"
unless File.exist?(file)
raise "Could not find a source file at 'src/#{src}.md' or #{file}"
end
raise "Could not find a source file at 'src/#{src}.md' or #{file}" unless File.exist?(file)

is_dir_index = true
end

Expand Down

0 comments on commit 60d668e

Please sign in to comment.