live_ast 0.2.2 → 0.2.3

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.
data/CHANGES.rdoc CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
2
  = LiveAST ChangeLog
3
3
 
4
+ == Version 0.2.3
5
+
6
+ * fix a utf-8 BOM issue
7
+
4
8
  == Version 0.2.2
5
9
 
6
10
  * handle utf-8 BOMs in loading
data/MANIFEST CHANGED
@@ -37,6 +37,7 @@ test/encoding_test/usascii.rb
37
37
  test/encoding_test/usascii_with_utf8bom.rb
38
38
  test/encoding_test/utf8.rb
39
39
  test/encoding_test/utf8bom.rb
40
+ test/encoding_test/utf8bom_only.rb
40
41
  test/error_test.rb
41
42
  test/eval_test.rb
42
43
  test/flush_cache_test.rb
@@ -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"
@@ -1,3 +1,3 @@
1
1
  module LiveAST
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -0,0 +1,5 @@
1
+ module EncodingTest
2
+ def utf8bom_only_string
3
+ "大きな箱とねこ。"
4
+ end
5
+ end
@@ -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.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