Merge upstream (#111)

This commit is contained in:
kibigo!
2017-08-01 13:07:43 -07:00
205 changed files with 1927 additions and 1507 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ class Emoji
include Singleton
def initialize
data = Oj.load(File.open(File.join(Rails.root, 'lib', 'assets', 'emoji.json')))
data = Oj.load(File.open(Rails.root.join('lib', 'assets', 'emoji.json')))
@map = {}
@@ -32,7 +32,7 @@ class Emoji
def codepoint_to_unicode(codepoint)
if codepoint.include?('-')
codepoint.split('-').map(&:hex).pack('U')
codepoint.split('-').map(&:hex).pack('U*')
else
[codepoint.hex].pack('U')
end
+5 -5
View File
@@ -8,11 +8,11 @@ module Mastodon
class UnexpectedResponseError < Error
def initialize(response = nil)
@response = response
end
def to_s
"#{@response.uri} returned code #{@response.code}"
if response.respond_to? :uri
super("#{response.uri} returned code #{response.code}")
else
super
end
end
end
end
+1 -3
View File
@@ -33,9 +33,7 @@ class LanguageDetector
def simplified_text
text.dup.tap do |new_text|
URI.extract(new_text).each do |url|
new_text.gsub!(url, '')
end
new_text.gsub!(FetchLinkCardService::URL_PATTERN, '')
new_text.gsub!(Account::MENTION_RE, '')
new_text.gsub!(Tag::HASHTAG_RE, '')
new_text.gsub!(/\s+/, ' ')