Skip to content

Commit

Permalink
Merge pull request #800 from openSUSE/depfu/update/rubocop-0.83.0
Browse files Browse the repository at this point in the history
Update rubocop: 0.80.1 → 0.83.0 (major)
  • Loading branch information
lkocman committed Jun 19, 2020
2 parents 470f55f + 6b04d08 commit a30256c
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 63 deletions.
99 changes: 49 additions & 50 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.4.2)
actionpack (= 5.2.4.2)
actioncable (5.2.4.3)
actionpack (= 5.2.4.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
actionmailer (5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.4.2)
actionview (= 5.2.4.2)
activesupport (= 5.2.4.2)
actionpack (5.2.4.3)
actionview (= 5.2.4.3)
activesupport (= 5.2.4.3)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.4.2)
activesupport (= 5.2.4.2)
actionview (5.2.4.3)
activesupport (= 5.2.4.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.4.2)
activesupport (= 5.2.4.2)
activejob (5.2.4.3)
activesupport (= 5.2.4.3)
globalid (>= 0.3.6)
activemodel (5.2.4.2)
activesupport (= 5.2.4.2)
activerecord (5.2.4.2)
activemodel (= 5.2.4.2)
activesupport (= 5.2.4.2)
activemodel (5.2.4.3)
activesupport (= 5.2.4.3)
activerecord (5.2.4.3)
activemodel (= 5.2.4.3)
activesupport (= 5.2.4.3)
arel (>= 9.0)
activestorage (5.2.4.2)
actionpack (= 5.2.4.2)
activerecord (= 5.2.4.2)
activestorage (5.2.4.3)
actionpack (= 5.2.4.3)
activerecord (= 5.2.4.3)
marcel (~> 0.3.1)
activesupport (5.2.4.2)
activesupport (5.2.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand Down Expand Up @@ -96,7 +96,7 @@ GEM
io-like (0.3.0)
jaro_winkler (1.5.4)
locale (2.1.2)
loofah (2.4.0)
loofah (2.5.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -105,19 +105,19 @@ GEM
mimemagic (~> 0.3.2)
maruku (0.7.3)
method_source (1.0.0)
mimemagic (0.3.4)
mimemagic (0.3.5)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.0)
minitest (5.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
open_uri_redirections (0.2.1)
parallel (1.19.1)
parser (2.7.1.0)
parser (2.7.1.2)
ast (~> 2.4.0)
pkg-config (1.3.2)
prometheus_exporter (0.5.1)
Expand All @@ -130,18 +130,18 @@ GEM
rack (2.2.2)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.4.2)
actioncable (= 5.2.4.2)
actionmailer (= 5.2.4.2)
actionpack (= 5.2.4.2)
actionview (= 5.2.4.2)
activejob (= 5.2.4.2)
activemodel (= 5.2.4.2)
activerecord (= 5.2.4.2)
activestorage (= 5.2.4.2)
activesupport (= 5.2.4.2)
rails (5.2.4.3)
actioncable (= 5.2.4.3)
actionmailer (= 5.2.4.3)
actionpack (= 5.2.4.3)
actionview (= 5.2.4.3)
activejob (= 5.2.4.3)
activemodel (= 5.2.4.3)
activerecord (= 5.2.4.3)
activestorage (= 5.2.4.3)
activesupport (= 5.2.4.3)
bundler (>= 1.3.0)
railties (= 5.2.4.2)
railties (= 5.2.4.3)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
Expand All @@ -151,9 +151,9 @@ GEM
rails-i18n (5.1.3)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (5.2.4.2)
actionpack (= 5.2.4.2)
activesupport (= 5.2.4.2)
railties (5.2.4.3)
actionpack (= 5.2.4.3)
activesupport (= 5.2.4.3)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
Expand All @@ -164,14 +164,13 @@ GEM
reverse_markdown (1.4.0)
nokogiri
rexml (3.2.4)
rubocop (0.80.1)
jaro_winkler (~> 1.5.1)
rubocop (0.83.0)
parallel (~> 1.10)
parser (>= 2.7.0.1)
rainbow (>= 2.2.2, < 4.0)
rexml
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-performance (1.5.2)
rubocop (>= 0.71.0)
ruby-progressbar (1.10.1)
Expand All @@ -188,7 +187,7 @@ GEM
selenium-webdriver (3.142.7)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
solargraph (0.38.5)
solargraph (0.39.7)
backport (~> 1.1)
benchmark
bundler (>= 1.17.2)
Expand All @@ -201,23 +200,23 @@ GEM
rubocop (~> 0.52)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9)
sprockets (3.7.2)
yard (~> 0.9, >= 0.9.24)
sprockets (4.0.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
text (1.3.1)
thor (0.20.3)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
tzinfo (1.2.7)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (1.6.1)
unicode-display_width (1.7.0)
vcr (5.1.0)
web-console (3.7.0)
actionview (>= 5.0)
Expand All @@ -228,14 +227,14 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
websocket-driver (0.7.1)
websocket-driver (0.7.2)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
xmlhash (1.3.7)
pkg-config
xpath (3.2.0)
nokogiri (~> 1.8)
yard (0.9.24)
yard (0.9.25)

PLATFORMS
ruby
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def index
end
@packagenames = @packagenames.uniq

# rubocop:disable Style/GuardClause
if @packagenames.size == 1
redirect_to(controller: :package, action: :show, package: @packagenames.first, search_term: @search_term) && return
elsif request.xhr?
Expand All @@ -56,6 +57,7 @@ def index
render('find') && return
end
end
# rubocop:enable Style/GuardClause

def find; end
end
2 changes: 1 addition & 1 deletion lib/api_connect.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Error < RuntimeError; end
def self.get(path, limit = 10)
config = Rails.configuration.x
uri_str = "#{config.api_host}/#{path}".gsub(' ', '%20')
uri_str = path if path =~ /^http/
uri_str = path if /^http/.match?(path)
uri = URI.parse(uri_str)
logger.debug "Loading from api: #{uri_str}"
begin
Expand Down
24 changes: 12 additions & 12 deletions lib/obs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,18 @@ def self.search_published_binary(query, opts = {})
def self.add_binary_relevance(binary, query)
quoted_query = Regexp.quote(query)
binary.relevance = 0
binary.relevance += 15 if binary.name =~ /^#{quoted_query}$/i
binary.relevance += 5 if binary.name =~ /^#{quoted_query}/i
binary.relevance += 15 if binary.project =~ /^openSUSE:/i
binary.relevance += 5 if binary.project =~ /^#{quoted_query}$/i
binary.relevance += 2 if binary.project =~ /^#{quoted_query}/i
binary.relevance -= 5 if binary.project =~ /unstable/i
binary.relevance -= 10 if binary.project =~ /^home:/
binary.relevance -= 20 if binary.project =~ /^openSUSE:Maintenance/i
binary.relevance -= 10 if binary.name =~ /-debugsource$/
binary.relevance -= 10 if binary.name =~ /-debuginfo$/
binary.relevance -= 3 if binary.name =~ /-devel$/
binary.relevance -= 3 if binary.name =~ /-doc$/
binary.relevance += 15 if /^#{quoted_query}$/i.match?(binary.name)
binary.relevance += 5 if /^#{quoted_query}/i.match?(binary.name)
binary.relevance += 15 if /^openSUSE:/i.match?(binary.project)
binary.relevance += 5 if /^#{quoted_query}$/i.match?(binary.project)
binary.relevance += 2 if /^#{quoted_query}/i.match?(binary.project)
binary.relevance -= 5 if /unstable/i.match?(binary.project)
binary.relevance -= 10 if /^home:/.match?(binary.project)
binary.relevance -= 20 if /^openSUSE:Maintenance/i.match?(binary.project)
binary.relevance -= 10 if /-debugsource$/.match?(binary.name)
binary.relevance -= 10 if /-debuginfo$/.match?(binary.name)
binary.relevance -= 3 if /-devel$/.match?(binary.name)
binary.relevance -= 3 if /-doc$/.match?(binary.name)
binary
end

Expand Down

0 comments on commit a30256c

Please sign in to comment.