Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fixes Performance/StartWith offenses

Klaus Zandersda93dcca67ca
diff --git a/lib/open_project/scm/adapters/local_client.rb b/lib/open_project/scm/adapters/local_client.rb
index 1b1b8da0ada..1b3c2062f2e 100644
--- a/lib/open_project/scm/adapters/local_client.rb
+++ b/lib/open_project/scm/adapters/local_client.rb
@@ -129,7 +129,7 @@ module OpenProject
end
def target(path = '')
- base = path.match?(/\A\//) ? root_url : url
+ base = path.start_with?('/') ? root_url : url
"#{base}/#{path}"
end
diff --git a/spec/lib/redmine/i18n_spec.rb b/spec/lib/redmine/i18n_spec.rb
index 4057fa8a710..b174e3c97a1 100644
--- a/spec/lib/redmine/i18n_spec.rb
+++ b/spec/lib/redmine/i18n_spec.rb
@@ -86,7 +86,7 @@ module OpenProject
end
it 'returns no js language as they are duplicates of the rest of the other language' do
- expect(all_languages).not_to be_any { |l| /\Ajs-/.match(l.to_s) }
+ expect(all_languages).not_to be_any { |l| l.to_s.start_with?('js-') }
end
# it is OK if more languages exist