Skip to content

Commit

Permalink
Apply fixes from rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcp committed Mar 29, 2022
1 parent b8ece28 commit b15224f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MissingParameterError < RuntimeError; end
@message = exception.message
layout = request.xhr? ? false : 'application'
logger.error exception.backtrace.join("\n") unless EXCEPTIONS_TO_IGNORE.include? exception
render template: 'error', formats: [:html], layout: layout, status: 400
render template: 'error', formats: [:html], layout:, status: 400
end

def validate_configuration
Expand All @@ -37,7 +37,7 @@ def validate_configuration

if config.api_username.blank? && config.opensuse_cookie.blank?
@message = _('The authentication to the OBS API has not been configured correctly.')
render template: 'error', formats: [:html], layout: layout, status: 503
render template: 'error', formats: [:html], layout:, status: 503
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/package_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def show
@official_projects = @distributions.map { |d| d[:project] }
# get extra distributions that are not in the default distribution list
@extra_packages = @packages.reject { |p| @distributions.map { |d| d[:project] }.include? p.baseproject }
@extra_dists = @extra_packages.map(&:baseproject).compact.uniq.map { |d| { project: d } }
@extra_dists = @extra_packages.filter_map(&:baseproject).uniq.map { |d| { project: d } }
rescue OBSError
@hide_search_box = true
flash.now[:error] = _('Connection to OBS is unavailable. Functionality of this site is limited.')
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ def search_for_description(pkgname, packages = [])
end

def icon(name, size = nil)
render(partial: "icons/#{name}", formats: :svg, locals: { size: size })
render(partial: "icons/#{name}", formats: :svg, locals: { size: })
end
end
2 changes: 1 addition & 1 deletion app/helpers/package_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create_links(txt)

# Returns the screenshot thumbnail url for a given package object/hash
def screenshot_thumb_url(package)
url_for controller: :package, action: :thumbnail, package: package, protocol: 'https'
url_for controller: :package, action: :thumbnail, package:, protocol: 'https'
end

def project_url(project)
Expand Down

0 comments on commit b15224f

Please sign in to comment.