files.com 1.0.133 → 1.0.134
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_VERSION +1 -1
- data/lib/files.com/uri.rb +5 -11
- data/spec/uri_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d09ff92ef54d2ff2b07c7677e9998262d07534c2f1970fec953066b6c646f769
|
4
|
+
data.tar.gz: 11d4e18d9ab273f09c9170dd6e12dc8ca5b55c17914df0764681c884d6a3fbc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f40491abab773ec451d0a880b4870a1bcb9796e4b5ee67c5fa2481cc0cfd10855c12d6bd460736541271b4a70300809caf10f4fb1d8f229236025a21ee0de6b
|
7
|
+
data.tar.gz: c0d39193c030c2004a0f2859142322ece43bec229aea4fcf6b47f05a998242aa055044ef78ded5da996e689f9c3f76e2459dbdb92f08fd39c93ee8025972e3e2
|
data/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.134
|
data/lib/files.com/uri.rb
CHANGED
@@ -34,17 +34,11 @@ module Files
|
|
34
34
|
# here we need to, so switch to ASCII.
|
35
35
|
component = component.dup
|
36
36
|
component.force_encoding(Encoding::ASCII_8BIT)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
character_class,
|
43
|
-
leave_encoded
|
44
|
-
)
|
45
|
-
rescue ArgumentError
|
46
|
-
encoded = encode_component(unencoded)
|
47
|
-
end
|
37
|
+
encoded = Addressable::URI.encode_component(
|
38
|
+
component,
|
39
|
+
character_class,
|
40
|
+
leave_encoded
|
41
|
+
)
|
48
42
|
encoded.force_encoding(Encoding::UTF_8)
|
49
43
|
encoded
|
50
44
|
end
|
data/spec/uri_spec.rb
CHANGED
@@ -2,10 +2,14 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
RSpec.describe Files::URI do
|
4
4
|
describe "normalized_path" do
|
5
|
-
it { expect(described_class.normalized_path("[[strange stuff]]#yes.text")).to eq("
|
5
|
+
it { expect(described_class.normalized_path("path/[[strange stuff]]#yes.text")).to eq("path/%5B%5Bstrange%20stuff%5D%5D%23yes.text") }
|
6
6
|
it { expect(Addressable::URI.unencode_component(described_class.normalized_path("[[strange stuff]]#yes.text"))).to eq("[[strange stuff]]#yes.text") }
|
7
7
|
|
8
8
|
it { expect(described_class.normalized_path("folder/AdÇe")).to eq("folder/AdC%CC%A7e") }
|
9
9
|
it { expect(Addressable::URI.unencode_component(described_class.normalized_path("AdÇe"))).to eq("AdÇe") }
|
10
|
+
|
11
|
+
it { expect(described_class.normalized_path("lorem%20ipsum.txt")).to eq("lorem%2520ipsum.txt") }
|
12
|
+
it { expect(described_class.normalized_path("lorem%ipsum.txt")).to eq("lorem%25ipsum.txt") }
|
13
|
+
it { expect(described_class.normalized_path("lorem ipsum.txt")).to eq("lorem%20ipsum.txt") }
|
10
14
|
end
|
11
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: files.com
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.134
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- files.com
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|