Module: CanvasLinkMigrator

Defined in:
lib/canvas_link_migrator/link_replacer.rb,
lib/canvas_link_migrator.rb,
lib/canvas_link_migrator/version.rb,
lib/canvas_link_migrator/link_parser.rb,
lib/canvas_link_migrator/link_resolver.rb,
lib/canvas_link_migrator/resource_map_service.rb,
lib/canvas_link_migrator/imported_html_converter.rb

Overview

Copyright © 2023 - present Instructure, Inc.

This file is part of Canvas.

Canvas is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, version 3 of the License.

Canvas is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <www.gnu.org/licenses/>.

Defined Under Namespace

Classes: ImportedHtmlConverter, LinkParser, LinkReplacer, LinkResolver, ResourceMapService

Constant Summary collapse

VERSION =
"1.0.18"

Class Method Summary collapse

Class Method Details

.relative_url?(url) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
# File 'lib/canvas_link_migrator.rb', line 27

def self.relative_url?(url)
  URI.parse(url).relative? && !url.to_s.start_with?("//")
rescue URI::Error
  # leave the url as it was
  false
end