live_ast 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.rdoc +4 -0
- data/MANIFEST +1 -0
- data/lib/live_ast/reader.rb +1 -1
- data/lib/live_ast/version.rb +1 -1
- data/test/encoding_test/utf8bom_only.rb +5 -0
- data/test/encoding_test.rb +1 -0
- metadata +4 -1
data/CHANGES.rdoc
CHANGED
data/MANIFEST
CHANGED
data/lib/live_ast/reader.rb
CHANGED
@@ -7,7 +7,7 @@ module LiveAST
|
|
7
7
|
def self.read(file)
|
8
8
|
contents = File.read(file, :encoding => "BINARY")
|
9
9
|
|
10
|
-
utf8 = contents.sub!(UTF8_BOM, "")
|
10
|
+
utf8 = contents.sub!(UTF8_BOM, "") ? "UTF-8" : nil
|
11
11
|
|
12
12
|
# magic comment overrides BOM
|
13
13
|
encoding = contents[MAGIC_COMMENT, 1] || utf8 || "US-ASCII"
|
data/lib/live_ast/version.rb
CHANGED
data/test/encoding_test.rb
CHANGED
@@ -4,6 +4,7 @@ require_relative 'encoding_test/default.rb'
|
|
4
4
|
require_relative 'encoding_test/usascii.rb'
|
5
5
|
require_relative 'encoding_test/utf8.rb'
|
6
6
|
require_relative 'encoding_test/utf8bom.rb'
|
7
|
+
require_relative 'encoding_test/utf8bom_only.rb'
|
7
8
|
require_relative 'encoding_test/usascii_with_utf8bom.rb'
|
8
9
|
require_relative 'encoding_test/koi8_with_utf8bom.rb'
|
9
10
|
require_relative 'encoding_test/cp932.rb'
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: live_ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.2.
|
5
|
+
version: 0.2.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- James M. Lawrence
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- test/encoding_test/usascii_with_utf8bom.rb
|
73
73
|
- test/encoding_test/utf8.rb
|
74
74
|
- test/encoding_test/utf8bom.rb
|
75
|
+
- test/encoding_test/utf8bom_only.rb
|
75
76
|
- test/error_test.rb
|
76
77
|
- test/eval_test.rb
|
77
78
|
- test/flush_cache_test.rb
|
@@ -166,6 +167,8 @@ rdoc_options:
|
|
166
167
|
- --exclude
|
167
168
|
- test/encoding_test/utf8bom.rb
|
168
169
|
- --exclude
|
170
|
+
- test/encoding_test/utf8bom_only.rb
|
171
|
+
- --exclude
|
169
172
|
- test/error_test.rb
|
170
173
|
- --exclude
|
171
174
|
- test/eval_test.rb
|