files.com 1.1.743 → 1.1.744
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -22
- data/_VERSION +1 -1
- data/lib/files.com/path_util.rb +4 -11
- data/lib/files.com/version.rb +1 -1
- data/shared/comparison_examples.json +20 -0
- data/shared/normalization_for_comparison_test_data.json +11 -11
- data/shared/path_comparison.json +20621 -0
- data/shared/path_comparison.md +20 -0
- data/spec/path_util_spec.rb +8 -0
- data/test.sh +3 -3
- metadata +4 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Path comparison data
|
|
2
|
+
|
|
3
|
+
`path_comparison.json` is the version 1 comparison map for MySQL
|
|
4
|
+
`utf8mb4_0900_ai_ci`, shared with Files.com server path comparison.
|
|
5
|
+
`comparison_examples.json` contains exact input/output examples.
|
|
6
|
+
|
|
7
|
+
Source: `files-rails` commit `41cec53c4cc711a193a16fff5d1dbadaffb32de4`,
|
|
8
|
+
`gems/files-path-native/data`, published in `files-path-native` 0.1.1914082.
|
|
9
|
+
SHA-256 of `path_comparison.json`: `a64d5de7fd4450f9889b57a5ac3088eb41451545985017a2beada38aaad2e371`.
|
|
10
|
+
|
|
11
|
+
Normalize path syntax first, then replace each Unicode scalar once using the
|
|
12
|
+
hexadecimal keys in `mapping`. Preserve scalars without entries. An empty value
|
|
13
|
+
removes a scalar; a value can also contain several scalars. Do not normalize,
|
|
14
|
+
lowercase, trim, or apply path syntax normalization after replacement. Keep the
|
|
15
|
+
original path for requests and display; comparison keys are for matching only.
|
|
16
|
+
|
|
17
|
+
Update the map and server examples together from an approved server revision,
|
|
18
|
+
record the new digest here, and run every SDK's path comparison tests. Runtime
|
|
19
|
+
resources under each generated SDK are copied from this shared source by the
|
|
20
|
+
generator; do not edit those copies independently.
|
data/spec/path_util_spec.rb
CHANGED
|
@@ -8,10 +8,18 @@ RSpec.describe Files::PathUtil do
|
|
|
8
8
|
test_cases.each do |test_case_info|
|
|
9
9
|
src_chars, dst_chars = test_case_info
|
|
10
10
|
example "normalizes #{src_chars} to #{dst_chars}" do
|
|
11
|
+
expect(Files::PathUtil.normalize_for_comparison(src_chars)).to eq(dst_chars)
|
|
12
|
+
expect(Files::PathUtil.normalize_for_comparison(dst_chars)).to eq(dst_chars)
|
|
11
13
|
expect(Files::PathUtil.same?(src_chars, dst_chars)).to eq(true)
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
16
|
|
|
17
|
+
it "matches the server comparison examples without rewriting the result" do
|
|
18
|
+
JSON.parse(File.read("shared/comparison_examples.json")).each do |input, expected|
|
|
19
|
+
expect(Files::PathUtil.normalize_for_comparison(input)).to eq(expected)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
15
23
|
it "normalizes API paths without changing path identity" do
|
|
16
24
|
expect(Files::PathUtil.normalize("/../../remote\\path//./to/file.txt")).to eq("remote/path/to/file.txt")
|
|
17
25
|
expect(Files::PathUtil.normalize("remote/../path/to/file.txt")).to eq("remote/path/to/file.txt")
|
data/test.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
require "bundler"
|
|
3
3
|
Bundler.with_unbundled_env do
|
|
4
4
|
Dir.chdir("generated/ruby") do
|
|
5
|
-
|
|
6
|
-
system
|
|
5
|
+
exit 1 if ARGV[0] == "true" && !system("bundle install")
|
|
6
|
+
exit(system("bundle exec rspec") ? 0 : 1)
|
|
7
7
|
end
|
|
8
|
-
end
|
|
8
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: files.com
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.744
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- files.com
|
|
@@ -477,8 +477,11 @@ files:
|
|
|
477
477
|
- lib/files.com/util.rb
|
|
478
478
|
- lib/files.com/version.rb
|
|
479
479
|
- setup.sh
|
|
480
|
+
- shared/comparison_examples.json
|
|
480
481
|
- shared/header_test_data.json
|
|
481
482
|
- shared/normalization_for_comparison_test_data.json
|
|
483
|
+
- shared/path_comparison.json
|
|
484
|
+
- shared/path_comparison.md
|
|
482
485
|
- shared/url_test_data.json
|
|
483
486
|
- spec/decimal_contract_spec.rb
|
|
484
487
|
- spec/language_spec.rb
|