Merge commit '3a8370e1f4
' into kb_migration
This commit is contained in:
commit
61e4be24e1
44 changed files with 503 additions and 278 deletions
18
lib/chewy/index_extensions.rb
Normal file
18
lib/chewy/index_extensions.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Chewy
|
||||
module IndexExtensions
|
||||
def index_preset(base_options = {})
|
||||
case ENV['ES_PRESET'].presence
|
||||
when 'single_node_cluster', nil
|
||||
base_options.merge(number_of_replicas: 0)
|
||||
when 'small_cluster'
|
||||
base_options.merge(number_of_replicas: 1)
|
||||
when 'large_cluster'
|
||||
base_options.merge(number_of_replicas: 1, number_of_shards: (base_options[:number_of_shards] || 1) * 2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Chewy::Index.extend(Chewy::IndexExtensions)
|
11
lib/chewy/settings_extensions.rb
Normal file
11
lib/chewy/settings_extensions.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Chewy
|
||||
module SettingsExtensions
|
||||
def enabled?
|
||||
settings[:enabled]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Chewy.extend(Chewy::SettingsExtensions)
|
|
@ -49,8 +49,8 @@ namespace :repo do
|
|||
File.open(path, 'r') do |file|
|
||||
file.each_line do |line|
|
||||
if line.start_with?('-')
|
||||
new_line = line.gsub(/#([[:digit:]]+)*/) do |pull_request_reference|
|
||||
pull_request_number = pull_request_reference[1..]
|
||||
new_line = line.gsub(/[(]#([[:digit:]]+)[)]\Z/) do |pull_request_reference|
|
||||
pull_request_number = pull_request_reference[2..-2]
|
||||
response = nil
|
||||
|
||||
loop do
|
||||
|
@ -66,7 +66,7 @@ namespace :repo do
|
|||
end
|
||||
|
||||
pull_request = Oj.load(response.to_s)
|
||||
"[#{pull_request['user']['login']}](#{pull_request['html_url']})"
|
||||
"([#{pull_request['user']['login']}](#{pull_request['html_url']}))"
|
||||
end
|
||||
|
||||
tmp.puts new_line
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue