canvas_link_migrator 1.0.13 → 1.0.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9b5936b2c0b84390589696838b2f7409d71467a11b20f81c63176e8e99a54caa
4
- data.tar.gz: 49c4a0df338db02c8b658c49249f2fb8c3f9a75d60790f6fd72a405242682fca
3
+ metadata.gz: 404df3ac84fac220f5c7b18e89478b72a7a6cf03d1c41f7ed7d7390ec2da7ba2
4
+ data.tar.gz: a1833675b038c7b285d2589e52e0dd62df0ad77efc92aff8c64021b66d498996
5
5
  SHA512:
6
- metadata.gz: c3c0f69c22fd75d7f783fa017993c7803f7504aa2e4b353917b33ec730a2cf0577e3f8941b58472a6ab694ab92bd667be12c5d65300119d7febea6cca0b9d45f
7
- data.tar.gz: 3e6158123ea5ad27bd55033865474133d9bdc7e663006c05eb3d8efb76bf7fe49a6041e0b37d19d1d0ca606aba4bbb329caa9cd4b92e13db8b97fc65dace5d24
6
+ metadata.gz: 95b7dfbae704889c1d8b2301219c59123f49365d2093bdc426631d3fb45e63ff6813f811561372726ccf18eabe338b5ea056908c9a186b0fefc6d16ba3fe6dd6
7
+ data.tar.gz: 516747d2f7dc023d1a4dbeb49b5b8f51ed827eb9c2aa0486d9a65db1dab708d9f12e450f822d61f063f37bf5319318b9060e83ca4c954f6509a78995dd995401
@@ -211,7 +211,7 @@ module CanvasLinkMigrator
211
211
  elsif url =~ %r{\$CANVAS_COURSE_REFERENCE\$/modules/items/([^?]*)(\?.*)?}
212
212
  unresolved(:module_item, migration_id: $1, query: $2)
213
213
  elsif url =~ %r{\$CANVAS_COURSE_REFERENCE\$/file_ref/([^/?#]+)(.*)}
214
- in_media_iframe = (attr == "src" && ["iframe", "source"].include?(node.name) && node["data-media-id"])
214
+ in_media_iframe = (attr == "src" && ["iframe", "source"].include?(node.name) && (node["data-media-id"] || node["data-media-type"]))
215
215
  rest = in_media_iframe ? media_params(node["data-media-type"]) : $2
216
216
  unresolved(:file_ref,
217
217
  migration_id: $1,
@@ -1,3 +1,3 @@
1
1
  module CanvasLinkMigrator
2
- VERSION = "1.0.13"
2
+ VERSION = "1.0.14"
3
3
  end
@@ -32,6 +32,12 @@ describe CanvasLinkMigrator::LinkParser do
32
32
  expect(parsed[:target_blank]).to be true
33
33
  end
34
34
 
35
+ it "checks data-media-type attribute to determine in_media_iframe" do
36
+ doc = Nokogiri::HTML5.fragment("<p><iframe data-media-type=\"video\" src=\"$CANVAS_COURSE_REFERENCE$/file_ref/whatevs\"></iframe></p>")
37
+ parsed = parser.parse_url("$CANVAS_COURSE_REFERENCE$/file_ref/whatevs", doc.at_css('iframe'), "src")
38
+ expect(parsed[:in_media_iframe]).to eq "video"
39
+ end
40
+
35
41
  it "converts inner html of anchor tags when appropriate" do
36
42
  doc = Nokogiri::HTML5.fragment("<a href=\"$WIKI_REFERENCE$/pages/1\">$WIKI_REFERENCE$/pages/1</a>")
37
43
  parser.convert_link(doc.at_css('a'), "href","wiki_page", "migrationid", "")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canvas_link_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mysti Lilla
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2024-07-24 00:00:00.000000000 Z
14
+ date: 2024-08-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport