Merge commit 'f877aa9d70
' into kb_migration
This commit is contained in:
commit
32f0e619f0
440 changed files with 6249 additions and 3435 deletions
|
@ -121,10 +121,10 @@ module Mastodon
|
|||
say('OK', :green)
|
||||
say("New password: #{password}")
|
||||
else
|
||||
user.errors.to_h.each do |key, error|
|
||||
user.errors.each do |error|
|
||||
say('Failure/Error: ', :red)
|
||||
say(key)
|
||||
say(" #{error}", :red)
|
||||
say(error.attribute)
|
||||
say(" #{error.type}", :red)
|
||||
end
|
||||
|
||||
exit(1)
|
||||
|
@ -197,10 +197,10 @@ module Mastodon
|
|||
say('OK', :green)
|
||||
say("New password: #{password}") if options[:reset_password]
|
||||
else
|
||||
user.errors.to_h.each do |key, error|
|
||||
user.errors.each do |error|
|
||||
say('Failure/Error: ', :red)
|
||||
say(key)
|
||||
say(" #{error}", :red)
|
||||
say(error.attribute)
|
||||
say(" #{error.type}", :red)
|
||||
end
|
||||
|
||||
exit(1)
|
||||
|
@ -353,7 +353,7 @@ module Mastodon
|
|||
|
||||
begin
|
||||
code = Request.new(:head, account.uri).perform(&:code)
|
||||
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError
|
||||
rescue HTTP::TimeoutError, HTTP::ConnectionError, OpenSSL::SSL::SSLError, Mastodon::PrivateNetworkAddressError
|
||||
skip_domains << account.domain
|
||||
end
|
||||
|
||||
|
|
|
@ -73,7 +73,6 @@ module Mastodon
|
|||
end
|
||||
end
|
||||
|
||||
puts
|
||||
say("Imported #{imported}, skipped #{skipped}, failed to import #{failed}", color(imported, skipped, failed))
|
||||
end
|
||||
|
||||
|
|
|
@ -664,9 +664,7 @@ module Mastodon
|
|||
|
||||
def remove_index_if_exists!(table, name)
|
||||
ActiveRecord::Base.connection.remove_index(table, name: name)
|
||||
rescue ArgumentError
|
||||
nil
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
rescue ArgumentError, ActiveRecord::StatementInvalid
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,6 +9,8 @@ module Mastodon
|
|||
include ActionView::Helpers::NumberHelper
|
||||
include CLIHelper
|
||||
|
||||
VALID_PATH_SEGMENTS_SIZE = [7, 10].freeze
|
||||
|
||||
def self.exit_on_failure?
|
||||
true
|
||||
end
|
||||
|
@ -133,7 +135,7 @@ module Mastodon
|
|||
path_segments = object.key.split('/')
|
||||
path_segments.delete('cache')
|
||||
|
||||
unless [7, 10].include?(path_segments.size)
|
||||
unless VALID_PATH_SEGMENTS_SIZE.include?(path_segments.size)
|
||||
progress.log(pastel.yellow("Unrecognized file found: #{object.key}"))
|
||||
next
|
||||
end
|
||||
|
@ -177,7 +179,7 @@ module Mastodon
|
|||
path_segments = key.split(File::SEPARATOR)
|
||||
path_segments.delete('cache')
|
||||
|
||||
unless [7, 10].include?(path_segments.size)
|
||||
unless VALID_PATH_SEGMENTS_SIZE.include?(path_segments.size)
|
||||
progress.log(pastel.yellow("Unrecognized file found: #{key}"))
|
||||
next
|
||||
end
|
||||
|
@ -310,7 +312,7 @@ module Mastodon
|
|||
path_segments = path.split('/')[2..]
|
||||
path_segments.delete('cache')
|
||||
|
||||
unless [7, 10].include?(path_segments.size)
|
||||
unless VALID_PATH_SEGMENTS_SIZE.include?(path_segments.size)
|
||||
say('Not a media URL', :red)
|
||||
exit(1)
|
||||
end
|
||||
|
@ -363,7 +365,7 @@ module Mastodon
|
|||
segments = object.key.split('/')
|
||||
segments.delete('cache')
|
||||
|
||||
next unless [7, 10].include?(segments.size)
|
||||
next unless VALID_PATH_SEGMENTS_SIZE.include?(segments.size)
|
||||
|
||||
model_name = segments.first.classify
|
||||
record_id = segments[2..-2].join.to_i
|
||||
|
|
|
@ -17,11 +17,11 @@ module Mastodon
|
|||
end
|
||||
|
||||
def flags
|
||||
''
|
||||
ENV.fetch('MASTODON_VERSION_FLAGS', '')
|
||||
end
|
||||
|
||||
def suffix
|
||||
''
|
||||
ENV.fetch('MASTODON_VERSION_SUFFIX', '')
|
||||
end
|
||||
|
||||
def to_a
|
||||
|
|
|
@ -173,7 +173,7 @@ module Paperclip
|
|||
def palette_from_histogram(result, quantity)
|
||||
frequencies = result.scan(/([0-9]+)\:/).flatten.map(&:to_f)
|
||||
hex_values = result.scan(/\#([0-9A-Fa-f]{6,8})/).flatten
|
||||
total_frequencies = frequencies.reduce(&:+).to_f
|
||||
total_frequencies = frequencies.sum.to_f
|
||||
|
||||
frequencies.map.with_index { |f, i| [f / total_frequencies, hex_values[i]] }
|
||||
.sort_by { |r| -r[0] }
|
||||
|
|
|
@ -13,7 +13,7 @@ module Terrapin
|
|||
|
||||
def pipe_options
|
||||
# Add some flags to explicitly close the other end of the pipes
|
||||
{ out: @stdout_out, err: @stderr_out, @stdout_in => :close, @stderr_in => :close }
|
||||
{ :out => @stdout_out, :err => @stderr_out, @stdout_in => :close, @stderr_in => :close }
|
||||
end
|
||||
|
||||
def read
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue