canvas_link_migrator 1.0.14 → 1.0.15

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: 404df3ac84fac220f5c7b18e89478b72a7a6cf03d1c41f7ed7d7390ec2da7ba2
4
- data.tar.gz: a1833675b038c7b285d2589e52e0dd62df0ad77efc92aff8c64021b66d498996
3
+ metadata.gz: 36b5ebb39673be4a7105bc459809c1faa333899c9d709d665cabd00f4242401d
4
+ data.tar.gz: 6702833e94aa9a7fd3bb3265199c2b7caf269e30fd0c82b5c15028d810d44c14
5
5
  SHA512:
6
- metadata.gz: 95b7dfbae704889c1d8b2301219c59123f49365d2093bdc426631d3fb45e63ff6813f811561372726ccf18eabe338b5ea056908c9a186b0fefc6d16ba3fe6dd6
7
- data.tar.gz: 516747d2f7dc023d1a4dbeb49b5b8f51ed827eb9c2aa0486d9a65db1dab708d9f12e450f822d61f063f37bf5319318b9060e83ca4c954f6509a78995dd995401
6
+ metadata.gz: e8a5d21a3c0a74e5805163d724e42c64a0db4a6d2b18f85f637e401f6ca09089aab287e8afb88b22150cd7eadf90e51a1ba3e78d9bb7892968bbf57055554bfe
7
+ data.tar.gz: 1fd447f0548f8c84a2fdea0a6a791679eea31c6f4dede5502d4191dcf96b994d4072b303a6ba713151bc03aaddefe6ad003e556ffd4ce39880f8ce792a216522
@@ -226,6 +226,7 @@ module CanvasLinkMigrator
226
226
  end
227
227
  end
228
228
  new_url += new_action.presence || "/preview"
229
+ new_url.chomp!("/")
229
230
  new_url += "?#{qs.join("&")}" if qs.present?
230
231
  end
231
232
  rel_path_parts.shift
@@ -1,3 +1,3 @@
1
1
  module CanvasLinkMigrator
2
- VERSION = "1.0.14"
2
+ VERSION = "1.0.15"
3
3
  end
@@ -57,6 +57,17 @@ describe CanvasLinkMigrator::LinkResolver do
57
57
  expect(link[:new_value]).to eq("/courses/2/files/6?verifier=u6")
58
58
  end
59
59
 
60
+ it "does not leave a trailing slash on the url with a `canvas_` query param" do
61
+ link = {
62
+ link_type: :file,
63
+ migration_id: "F",
64
+ rel_path: "subfolder/with a space/test.png?canvas_=1&canvas_qs_wrap=1" }
65
+
66
+ resolver.resolve_link!(link)
67
+
68
+ expect(link[:new_value]).to eq("/courses/2/files/6?verifier=u6&wrap=1")
69
+ end
70
+
60
71
  it "converts attachment urls" do
61
72
  link = { link_type: :object, type: "attachments", migration_id: "E", query: "?foo=bar" }
62
73
  resolver.resolve_link!(link)
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.14
4
+ version: 1.0.15
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-08-12 00:00:00.000000000 Z
14
+ date: 2024-10-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport