Skip to content

Commit

Permalink
Merge pull request #1758 from alphagov/dependabot/bundler/rubocop-gov…
Browse files Browse the repository at this point in the history
…uk-3.9.0

Bump rubocop-govuk from 3.8.0 to 3.9.0
  • Loading branch information
benthorner authored May 13, 2020
2 parents 4b2b905 + 26ba052 commit 3a65e6c
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ GEM
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-govuk (3.8.0)
rubocop-govuk (3.9.0)
rubocop (= 0.82.0)
rubocop-rails (~> 2)
rubocop-rake (~> 0.5.1)
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/content_item/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def publisher_metadata
{
published: published,
last_updated: updated,
link_to_history: !!updated,
link_to_history: updated.present?,
other: {
from: from,
},
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/content_item/no_deal_notice.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ContentItem
module NoDealNotice
def has_no_deal_notice?
content_item.dig("details").has_key?("brexit_no_deal_notice")
content_item.dig("details").key?("brexit_no_deal_notice")
end

def no_deal_notice_component
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/content_item/parts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def requesting_a_part?
end

def has_valid_part?
!!current_part && current_part != parts.first
current_part && current_part != parts.first
end

def current_part_title
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/content_item/updatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def change_history
end
end

# The direction of change history isnt guaranteed
# The direction of change history isn't guaranteed
# https://github.com/alphagov/govuk-content-schemas/issues/545
def reverse_chronological_change_history
change_history.sort_by { |item| Time.zone.parse(item[:timestamp]) }.reverse
Expand Down
8 changes: 4 additions & 4 deletions app/presenters/document_collection_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def contents_items
end

def groups
groups = content_item["details"]["collection_groups"].reject { |group|
groups = content_item["details"]["collection_groups"].reject do |group|
group_documents(group).empty?
}
end

groups.map { |group|
groups.map do |group|
group["documents"] = reject_withdrawn_documents(group)
group
}
end
end

def group_document_links(group, group_index)
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/specialist_document_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def any_updates?
# Example:
# https://www.gov.uk/aaib-reports/lockheed-l1011-385-1-15-g-bhbr-19-december-1989
def bulk_published?
!!facet_values["bulk_published"]
facet_values["bulk_published"].present?
end

def statutory_instrument?
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/travel_advice_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def change_description
# This led to users appending (in a variety of formats)
# "Latest update:" to the start of the change description. The frontend now
# has a latest update label, so we can strip this out.
# Avoids: "Latest update: Latest update - "
# Avoids: "Latest update: Latest update - ..."
def latest_update
change_description.sub(/^Latest update:?\s-?\s?/i, "").tap do |latest|
latest[0] = latest[0].capitalize if latest.present?
Expand Down
24 changes: 12 additions & 12 deletions config/locales/plurals.rb
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
# Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3.
dr: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Armenian
hy: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Pushto
ps: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
ps: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Portugese
pt: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
pt: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Sinhalese
si: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Somali
so: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
so: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Albanian
sq: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
sq: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Tamil
ta: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
ta: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Turkmen
tk: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
tk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Uzbek
uz: { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Chinese Hong Kong
"zh-hk" => { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
"zh-hk" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
# Chinese Taiwan
"zh-tw" => { i18n: { plural: { keys: %i[one other], rule: lambda { |n| n == 1 ? :one : :other } } } },
"zh-tw" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
}
4 changes: 2 additions & 2 deletions lib/helpers/document_types_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def initialize(sample_size = 10)
end

def all_type_paths
response = RestClient.get(ALL_SEARCH_ENDPOINT % { sample_size: @sample_size })
response = RestClient.get(format(ALL_SEARCH_ENDPOINT, sample_size: @sample_size))
results = extract_results(JSON.parse(response.body))
results.map { |result| extract_type(result) }.reduce({}, :merge)
end

def type_paths(type)
response = RestClient.get(SINGLE_SEARCH_ENDPOINT % { document_type: type, sample_size: @sample_size })
response = RestClient.get(format(SINGLE_SEARCH_ENDPOINT, document_type: type, sample_size: @sample_size))
JSON.parse(response.body)["results"].map { |result| result["link"] }
end

Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/wraith_config_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def path_index(prefix, index)
end

def write_config(config)
file_name = OUTPUT_PATH % { suffix: @name }
file_name = format(OUTPUT_PATH, suffix: @name)
File.open(file_name, "w") { |f| f.write config.to_yaml }
file_name
end
Expand Down
2 changes: 1 addition & 1 deletion test/integration/consultation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ConsultationTest < ActionDispatch::IntegrationTest

assert page.has_text?("Consultation")

# Theres no daylight savings after 2037
# There's no daylight savings after 2037
# http://timezonesjl.readthedocs.io/en/stable/faq/#far-future-zoneddatetime-with-variabletimezone
assert page.has_css?(".gem-c-notice", text: "This consultation opens at 1pm on 5 October 2200")
assert page.has_text?(:all, "It closes at 4pm on 31 October 2210")
Expand Down

0 comments on commit 3a65e6c

Please sign in to comment.