lowkey 0.7.4 → 0.7.5
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/lib/lowkey.rb +3 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4f4720b7f316e420b6ae339471c745699a329588893d1bcbd427b01c684edd99
|
|
4
|
+
data.tar.gz: f07a9c88cac3a3c0c5ba868fd0314c583e5ac62661a9d1dc4e27b0ff14e0e856
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47acdeff0183ee3bf789e21bb72503850228a92423f38b8c030b8f7c52b939d79696b0b20f4e7081f56fb485ec49fb410c97cbc2212334ab17957842e5a3668e
|
|
7
|
+
data.tar.gz: d2edae3e7156581a7a36eda2de777429357aebb3346208cd468814b8cf306fe6c73171be61506be06ecd2e3e58dbf166e3ac85ab7dae868ddde1916f229ac2df
|
data/lib/lowkey.rb
CHANGED
|
@@ -49,8 +49,10 @@ module Lowkey
|
|
|
49
49
|
|
|
50
50
|
# Parses a file, and parses it again with the methods Prism couldn't parse masked, like an RBX file's templates, as
|
|
51
51
|
# Prism's guesses at where they end can run on through the rest of the file. Returns the file's own lines too.
|
|
52
|
+
# The file is read as UTF-8, as Ruby reads source files, rather than in the locale's encoding, which is US-ASCII on
|
|
53
|
+
# build servers without a UTF-8 locale.
|
|
52
54
|
def parse(file_path)
|
|
53
|
-
source = File.read(file_path)
|
|
55
|
+
source = File.read(file_path, encoding: Encoding::UTF_8)
|
|
54
56
|
result = Prism.parse(source, filepath: file_path)
|
|
55
57
|
unless result.errors.empty?
|
|
56
58
|
masked = MaskedSource.new(source:, error_lines: result.errors.map { it.location.start_line }).to_s
|
data/lib/version.rb
CHANGED