immosquare-extensions 0.1.15 → 0.1.17
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65ca43ea6bda3e92d7fa0a419a34029f0856f4687d030b1f4ae142197525ef2c
|
4
|
+
data.tar.gz: d6d16a447632fed299569d3b1b9eebf8cffbe8e1b307a38f20a5e91d66dd82f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ff64eaa5656fa0bc8e0052ca3fba24b16158d7a0498b753ed8756118718d5fb8520f4eeb615da0b91824b1246dc96259698ead7ef42cbd9601d2b1b3227fccd
|
7
|
+
data.tar.gz: 9a3e6d9d6149efc1ba1667feb892784209d791f7fc308b092e0382e9ccebbbd95435a9510ff1b66a6330ec2d120de26bcd56b902712d2af7de33119d83b6b7db
|
@@ -33,7 +33,7 @@ class File
|
|
33
33
|
## Read the content of the file with the detected encoding,
|
34
34
|
## falling back to UTF-8 if the detected encoding is empty or invalid.
|
35
35
|
##============================================================##
|
36
|
-
detected_encoding = `uchardet #{file_path}`.strip
|
36
|
+
detected_encoding = `uchardet #{file_path}`.strip.to_s.upcase
|
37
37
|
encoding_whitelist = [
|
38
38
|
"UTF-8", # Encodage universel pour texte avec ou sans accents
|
39
39
|
"Windows-1252", # Utilisé couramment pour les langues occidentales
|
@@ -64,7 +64,8 @@ class File
|
|
64
64
|
"UTF-16BE", # UTF-16 Big Endian
|
65
65
|
"UTF-32LE", # UTF-32 Little Endian
|
66
66
|
"UTF-32BE" # UTF-32 Big Endian
|
67
|
-
]
|
67
|
+
].map(&:upcase)
|
68
|
+
|
68
69
|
|
69
70
|
|
70
71
|
encoding_to_use = detected_encoding.empty? || !encoding_whitelist.include?(detected_encoding) ? "UTF-8" : "#{detected_encoding}:UTF-8"
|
@@ -7,11 +7,17 @@ module ImmosquareExtensions
|
|
7
7
|
##============================================================##
|
8
8
|
def json_representation(value, align, indent_size, indent)
|
9
9
|
case value
|
10
|
-
when Hash, Array
|
11
|
-
|
12
|
-
when
|
13
|
-
|
14
|
-
|
10
|
+
when Hash, Array
|
11
|
+
dump_beautify_json(value, align, indent_size, indent + indent_size)
|
12
|
+
when String
|
13
|
+
escaped_value = value.gsub("\n", "\\n").gsub("\r", "\\r")
|
14
|
+
"\"#{escaped_value}\""
|
15
|
+
when NilClass
|
16
|
+
"null"
|
17
|
+
when TrueClass, FalseClass
|
18
|
+
value.to_s
|
19
|
+
else
|
20
|
+
value.to_s
|
15
21
|
end
|
16
22
|
end
|
17
23
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IMMO SQUARE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode_utils
|