Skip to content

Commit

Permalink
Merge pull request #10910 from openSUSE/depfu/update/srcapi/rubocop-p…
Browse files Browse the repository at this point in the history
…erformance-1.10.1

[src/api] Update rubocop-performance: 1.9.2 → 1.10.1 (minor)
  • Loading branch information
vpereira committed Mar 18, 2021
2 parents c4a6233 + caf47f6 commit 8bd1300
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/api/Gemfile.lock
Expand Up @@ -337,7 +337,7 @@ GEM
rspec-support (3.10.2)
rspec_junit_formatter (0.4.1)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.10.0)
rubocop (1.11.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -348,7 +348,7 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-performance (1.9.2)
rubocop-performance (1.10.1)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.9.1)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/controllers/build/file_controller.rb
Expand Up @@ -97,7 +97,7 @@ def process_regexp
logger.info "streaming #{path}"

c_type =
case params[:filename].split(/\./)[-1]
case params[:filename].split('.')[-1]
when 'rpm' then 'application/x-rpm'
when 'deb' then 'application/x-deb'
when 'iso' then 'application/x-cd-image'
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/attrib_type.rb
Expand Up @@ -30,7 +30,7 @@ def self.find_by_name!(name)
end

def self.find_by_name(name, or_fail = false)
name_parts = name.split(/:/)
name_parts = name.split(':')
raise InvalidAttributeError, "Attribute '#{name}' must be in the $NAMESPACE:$NAME style" if name_parts.length != 2

find_by_namespace_and_name(name_parts[0], name_parts[1], or_fail)
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/branch_package.rb
Expand Up @@ -502,7 +502,7 @@ def set_target_project

def set_update_project_attribute
aname = params[:update_project_attribute] || 'OBS:UpdateProject'
update_project_at = aname.split(/:/)
update_project_at = aname.split(':')
raise ArgumentError, "attribute '#{aname}' must be in the $NAMESPACE:$NAME style" if update_project_at.length != 2

@up_attribute_namespace = update_project_at[0]
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/models/project.rb
Expand Up @@ -313,7 +313,7 @@ def find_by_attribute_type(attrib_type)
def find_remote_project(name, skip_access = false)
return unless name

fragments = name.split(/:/)
fragments = name.split(':')

while fragments.length > 1
remote_project = [fragments.pop, remote_project].compact.join(':')
Expand Down Expand Up @@ -836,7 +836,7 @@ def ancestors
# Calculate all possible ancestors names for a project
# Ex: home:foo:bar:purr => ["home:foo:bar", "home:foo", "home"]
def possible_ancestor_names
names = name.split(/:/)
names = name.split(':')
possible_projects = []
while names.length > 1
names.pop
Expand Down
Expand Up @@ -11,7 +11,7 @@ def call

def extract_auth_token
events = ['Push Hook', 'Tag Push Hook', 'Merge Request Hook']
@auth_token = if events.any? { |event| event == @http_request.env['HTTP_X_GITLAB_EVENT'] }
@auth_token = if events.any?(@http_request.env['HTTP_X_GITLAB_EVENT'])
'Token ' + @http_request.env['HTTP_X_GITLAB_TOKEN']
else
@http_request.env['HTTP_AUTHORIZATION']
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/package/_fileinfo.html.haml
Expand Up @@ -6,7 +6,7 @@
%dd.col-md-10
- description = fileinfo.value('description')
- if description
- description.split(/\n/).each do |line|
- description.split('\n').each do |line|
= line
%br
- else
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/search/_results.html.haml
Expand Up @@ -20,7 +20,7 @@
= '...'
- else
- desc = truncate(result.description, length: 80)
- desc.split(/\n/).each do |line|
- desc.split('\n').each do |line|
= highlight(line, search_text, highlighter: '<b>\1</b>')
- if per_page
= paginate results, views_prefix: 'webui'
2 changes: 1 addition & 1 deletion src/api/lib/tasks/extract.rake
Expand Up @@ -33,7 +33,7 @@ namespace :db do
skip_tables = ['schema_info', 'sessions', 'schema_migrations']
ActiveRecord::Base.establish_connection
User.session = User.find_by_login('Admin')
tables = ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : ActiveRecord::Base.connection.tables - skip_tables
tables = ENV['FIXTURES'] ? ENV['FIXTURES'].split(',') : ActiveRecord::Base.connection.tables - skip_tables
tables.each do |table_name|
i = '000'
begin
Expand Down
2 changes: 1 addition & 1 deletion src/api/script/rubygem_package_names.rb
Expand Up @@ -17,6 +17,6 @@
# rubygem-phantomjs-2_2

Bundler.definition.resolve.any? do |s|
min_version = s.version.to_s.split(/\./)[0..1].join('_')
min_version = s.version.to_s.split('.')[0..1].join('_')
print "rubygem-#{s.name} rubygem-#{s.name}-#{min_version} "
end
4 changes: 2 additions & 2 deletions src/api/spec/controllers/webui/package_controller_spec.rb
Expand Up @@ -581,7 +581,7 @@ def remove_file_post
end

it 'shows the complete diff' do
diff = assigns(:files)['bigfile_archive.tar.gz/bigfile.txt']['diff']['_content'].split(/\n/)
diff = assigns(:files)['bigfile_archive.tar.gz/bigfile.txt']['diff']['_content'].split("\n")
expect(diff).to eq(['@@ -1,6 +1,6 @@', '-a', '-a', '-a', '-a', '-a', '-a', '+b', '+b', '+b', '+b', '+b', '+b'])
end
end
Expand Down Expand Up @@ -613,7 +613,7 @@ def remove_file_post
end

it 'shows the truncated diff' do
diff = assigns(:files)['bigfile_archive.tar.gz/bigfile.txt']['diff']['_content'].split(/\n/)
diff = assigns(:files)['bigfile_archive.tar.gz/bigfile.txt']['diff']['_content'].split("\n")
expect(diff).to eq(['@@ -1,6 +1,6 @@', '-a', '-a', '-a', '-a', '-a', '-a', '+b', '+b', '+b', '+b', '+b', '+b'])
end
end
Expand Down

0 comments on commit 8bd1300

Please sign in to comment.