debian-mirror-gitlab/lib/gitlab/zoom_link_extractor.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
603 B
Ruby
Raw Permalink Normal View History

2019-09-30 21:07:59 +05:30
# frozen_string_literal: true
# Detect links matching the following formats:
# Zoom Start links: https://zoom.us/s/<meeting-id>
# Zoom Join links: https://zoom.us/j/<meeting-id>
# Personal Zoom links: https://zoom.us/my/<meeting-id>
# Vanity Zoom links: https://gitlab.zoom.us/j/<meeting-id> (also /s and /my)
module Gitlab
class ZoomLinkExtractor
ZOOM_REGEXP = %r{https://(?:[\w-]+\.)?zoom\.us/(?:s|j|my)/\S+}.freeze
def initialize(text)
@text = text.to_s
end
def links
@text.scan(ZOOM_REGEXP)
end
2019-10-12 21:52:04 +05:30
def match?
ZOOM_REGEXP.match?(@text)
end
2019-09-30 21:07:59 +05:30
end
end