diff options
| author | Takuya Noguchi <takninnovationresearch@gmail.com> | 2018-01-27 14:35:53 +0900 |
|---|---|---|
| committer | Takuya Noguchi <takninnovationresearch@gmail.com> | 2018-02-01 02:06:07 +0900 |
| commit | 2b6307f6ad9d09156c42befe4babbfea40dad052 (patch) | |
| tree | 2a05eb3e7a481ed803ea62a2d4e7667baff44375 /config/initializers | |
| parent | 08e013431acb5238b4806260c4b9c304837097a3 (diff) | |
| download | gitlab-ce-2b6307f6ad9d09156c42befe4babbfea40dad052.tar.gz | |
Enable RuboCop Style/RegexpLiteral
Diffstat (limited to 'config/initializers')
| -rw-r--r-- | config/initializers/1_settings.rb | 6 | ||||
| -rw-r--r-- | config/initializers/active_record_data_types.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index 899e612ffbd..5b4e6b5db88 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -110,7 +110,7 @@ class Settings < Settingslogic url = "http://#{url}" unless url.start_with?('http') # Get rid of the path so that we don't even have to encode it - url_without_path = url.sub(%r{(https?://[^\/]+)/?.*}, '\1') + url_without_path = url.sub(%r{(https?://[^/]+)/?.*}, '\1') URI.parse(url_without_path).host end @@ -469,10 +469,10 @@ end # repository_downloads_path value. # repositories_storages = Settings.repositories.storages.values -repository_downloads_path = Settings.gitlab['repository_downloads_path'].to_s.gsub(/\/$/, '') +repository_downloads_path = Settings.gitlab['repository_downloads_path'].to_s.gsub(%r{/$}, '') repository_downloads_full_path = File.expand_path(repository_downloads_path, Settings.gitlab['user_home']) -if repository_downloads_path.blank? || repositories_storages.any? { |rs| [repository_downloads_path, repository_downloads_full_path].include?(rs['path'].gsub(/\/$/, '')) } +if repository_downloads_path.blank? || repositories_storages.any? { |rs| [repository_downloads_path, repository_downloads_full_path].include?(rs['path'].gsub(%r{/$}, '')) } Settings.gitlab['repository_downloads_path'] = File.join(Settings.shared['path'], 'cache/archive') end diff --git a/config/initializers/active_record_data_types.rb b/config/initializers/active_record_data_types.rb index 0359e14b232..fda13d0c4cb 100644 --- a/config/initializers/active_record_data_types.rb +++ b/config/initializers/active_record_data_types.rb @@ -54,7 +54,7 @@ elsif Gitlab::Database.mysql? def initialize_type_map(mapping) super mapping - mapping.register_type(%r(timestamp)i) do |sql_type| + mapping.register_type(/timestamp/i) do |sql_type| precision = extract_precision(sql_type) ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter::MysqlDateTimeWithTimeZone.new(precision: precision) end |
