aboutsummaryrefslogtreecommitdiffstats
path: root/core/messageconverters.rb
diff options
context:
space:
mode:
Diffstat (limited to 'core/messageconverters.rb')
-rw-r--r--core/messageconverters.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/messageconverters.rb b/core/messageconverters.rb
index 9ee90b84..7ead8521 100644
--- a/core/messageconverters.rb
+++ b/core/messageconverters.rb
@@ -62,14 +62,14 @@ class MessageConverters
# textからURLを抜き出してすべて短縮したテキストを返す
def shrink_url_all(text)
- urls = text.matches(shrinkable_url_regexp)
+ urls = text.to_enum(:scan, shrinkable_url_regexp).map{ Regexp.last_match.to_s }
return text if(urls.empty?)
table = self.shrink_url(urls)
text.gsub(shrinkable_url_regexp){ |k| table[k] } if table end
# textからURLを抜き出してすべて展開したテキストを返す
def expand_url_all(text)
- urls = text.matches(shrinkable_url_regexp)
+ urls = text.to_enum(:scan, shrinkable_url_regexp).map{ Regexp.last_match.to_s }
return text if(urls.empty?)
table = self.expand_url(urls)
text.gsub(shrinkable_url_regexp){ |k| table[k] } if table end