steep 0.11.1 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +27 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +5 -0
- data/README.md +48 -90
- data/Rakefile +10 -6
- data/Steepfile +1 -0
- data/bin/setup +1 -0
- data/bin/smoke_runner.rb +9 -14
- data/exe/rbs +3 -0
- data/exe/ruby-signature +3 -0
- data/exe/steep +1 -0
- data/lib/steep.rb +32 -26
- data/lib/steep/annotation_parser.rb +167 -0
- data/lib/steep/ast/annotation/collection.rb +7 -7
- data/lib/steep/ast/types.rb +60 -0
- data/lib/steep/ast/types/any.rb +1 -1
- data/lib/steep/ast/types/factory.rb +535 -0
- data/lib/steep/ast/types/name.rb +3 -3
- data/lib/steep/ast/types/var.rb +1 -1
- data/lib/steep/cli.rb +56 -240
- data/lib/steep/drivers/annotations.rb +36 -19
- data/lib/steep/drivers/check.rb +55 -91
- data/lib/steep/drivers/init.rb +54 -0
- data/lib/steep/drivers/langserver.rb +241 -150
- data/lib/steep/drivers/print_project.rb +56 -0
- data/lib/steep/drivers/signature_error_printer.rb +25 -0
- data/lib/steep/drivers/trace_printer.rb +25 -0
- data/lib/steep/drivers/utils/driver_helper.rb +26 -0
- data/lib/steep/drivers/validate.rb +18 -38
- data/lib/steep/drivers/vendor.rb +46 -0
- data/lib/steep/drivers/watch.rb +78 -140
- data/lib/steep/errors.rb +22 -13
- data/lib/steep/interface/interface.rb +91 -0
- data/lib/steep/interface/method.rb +0 -4
- data/lib/steep/interface/method_type.rb +362 -2
- data/lib/steep/interface/substitution.rb +22 -0
- data/lib/steep/project.rb +25 -233
- data/lib/steep/project/dsl.rb +132 -0
- data/lib/steep/project/file.rb +93 -76
- data/lib/steep/project/file_loader.rb +63 -0
- data/lib/steep/project/options.rb +7 -0
- data/lib/steep/project/target.rb +190 -0
- data/lib/steep/signature/errors.rb +25 -77
- data/lib/steep/signature/validator.rb +122 -0
- data/lib/steep/source.rb +12 -7
- data/lib/steep/subtyping/check.rb +357 -633
- data/lib/steep/subtyping/constraints.rb +2 -2
- data/lib/steep/subtyping/trace.rb +23 -0
- data/lib/steep/type_construction.rb +509 -455
- data/lib/steep/type_inference/constant_env.rb +16 -24
- data/lib/steep/type_inference/type_env.rb +26 -18
- data/lib/steep/version.rb +1 -1
- data/sample/Steepfile +6 -0
- data/sample/lib/conference.rb +12 -0
- data/sample/sig/conference.rbs +6 -0
- data/smoke/alias/Steepfile +4 -0
- data/smoke/alias/a.rb +2 -2
- data/smoke/alias/{a.rbi → a.rbs} +1 -1
- data/smoke/and/Steepfile +4 -0
- data/smoke/array/Steepfile +4 -0
- data/smoke/array/a.rb +2 -2
- data/smoke/array/b.rb +4 -4
- data/smoke/array/c.rb +2 -2
- data/smoke/block/Steepfile +5 -0
- data/smoke/block/{a.rbi → a.rbs} +1 -1
- data/smoke/block/{c.rbi → c.rbs} +0 -0
- data/smoke/block/d.rb +6 -6
- data/smoke/case/Steepfile +4 -0
- data/smoke/case/a.rb +4 -3
- data/smoke/class/Steepfile +4 -0
- data/smoke/class/a.rb +1 -4
- data/smoke/class/a.rbs +24 -0
- data/smoke/class/h.rb +6 -2
- data/smoke/class/{h.rbi → h.rbs} +1 -2
- data/smoke/class/i.rb +1 -2
- data/smoke/class/i.rbs +9 -0
- data/smoke/const/Steepfile +4 -0
- data/smoke/dstr/Steepfile +4 -0
- data/smoke/ensure/Steepfile +4 -0
- data/smoke/ensure/a.rb +1 -1
- data/smoke/enumerator/Steepfile +4 -0
- data/smoke/enumerator/a.rb +7 -7
- data/smoke/enumerator/b.rb +6 -6
- data/smoke/extension/Steepfile +4 -0
- data/smoke/extension/{a.rbi → a.rbs} +2 -2
- data/smoke/extension/{e.rbi → e.rbs} +2 -2
- data/smoke/hash/Steepfile +4 -0
- data/smoke/hash/{a.rbi → a.rbs} +0 -0
- data/smoke/hash/b.rb +2 -2
- data/smoke/hash/c.rb +1 -1
- data/smoke/hash/e.rbs +3 -0
- data/smoke/hash/f.rb +1 -1
- data/smoke/hello/Steepfile +4 -0
- data/smoke/hello/hello.rbs +7 -0
- data/smoke/if/Steepfile +4 -0
- data/smoke/implements/Steepfile +4 -0
- data/smoke/implements/a.rbs +6 -0
- data/smoke/initialize/Steepfile +4 -0
- data/smoke/initialize/a.rbs +3 -0
- data/smoke/integer/Steepfile +4 -0
- data/smoke/integer/a.rb +5 -3
- data/smoke/interface/Steepfile +4 -0
- data/smoke/interface/{a.rbi → a.rbs} +0 -0
- data/smoke/kwbegin/Steepfile +4 -0
- data/smoke/lambda/Steepfile +4 -0
- data/smoke/lambda/a.rb +9 -2
- data/smoke/literal/Steepfile +4 -0
- data/smoke/literal/{literal_methods.rbi → literal_methods.rbs} +0 -0
- data/smoke/map/Steepfile +4 -0
- data/smoke/map/a.rb +1 -1
- data/smoke/method/Steepfile +4 -0
- data/smoke/method/{a.rbi → a.rbs} +0 -0
- data/smoke/method/b.rb +1 -4
- data/smoke/method/d.rb +1 -0
- data/smoke/method/d.rbs +3 -0
- data/smoke/module/Steepfile +4 -0
- data/smoke/module/a.rb +1 -1
- data/smoke/module/a.rbs +16 -0
- data/smoke/module/c.rb +1 -1
- data/smoke/regexp/Steepfile +4 -0
- data/smoke/regexp/a.rb +2 -2
- data/smoke/regexp/b.rb +16 -16
- data/smoke/regression/Steepfile +5 -0
- data/smoke/regression/array.rb +2 -2
- data/smoke/regression/hash.rb +2 -2
- data/smoke/regression/poly_new.rb +2 -0
- data/smoke/regression/poly_new.rbs +4 -0
- data/smoke/regression/set_divide.rb +2 -2
- data/smoke/rescue/Steepfile +4 -0
- data/smoke/rescue/a.rb +1 -1
- data/smoke/self/Steepfile +4 -0
- data/smoke/self/a.rbs +4 -0
- data/smoke/skip/Steepfile +4 -0
- data/smoke/stdout/Steepfile +4 -0
- data/smoke/stdout/{a.rbi → a.rbs} +1 -1
- data/smoke/super/Steepfile +4 -0
- data/smoke/super/a.rbs +10 -0
- data/smoke/type_case/Steepfile +4 -0
- data/smoke/type_case/a.rb +1 -1
- data/smoke/yield/Steepfile +4 -0
- data/smoke/yield/a.rb +2 -2
- data/steep.gemspec +14 -7
- data/vendor/ruby-signature/.github/workflows/ruby.yml +27 -0
- data/vendor/ruby-signature/.gitignore +12 -0
- data/vendor/ruby-signature/.rubocop.yml +15 -0
- data/vendor/ruby-signature/BSDL +22 -0
- data/vendor/ruby-signature/COPYING +56 -0
- data/vendor/ruby-signature/Gemfile +6 -0
- data/vendor/ruby-signature/README.md +93 -0
- data/vendor/ruby-signature/Rakefile +66 -0
- data/vendor/ruby-signature/bin/annotate-with-rdoc +156 -0
- data/vendor/ruby-signature/bin/console +14 -0
- data/vendor/ruby-signature/bin/query-rdoc +103 -0
- data/vendor/ruby-signature/bin/setup +10 -0
- data/vendor/ruby-signature/bin/sort +88 -0
- data/vendor/ruby-signature/bin/test_runner.rb +17 -0
- data/vendor/ruby-signature/docs/CONTRIBUTING.md +97 -0
- data/vendor/ruby-signature/docs/sigs.md +148 -0
- data/vendor/ruby-signature/docs/stdlib.md +152 -0
- data/vendor/ruby-signature/docs/syntax.md +528 -0
- data/vendor/ruby-signature/exe/rbs +3 -0
- data/vendor/ruby-signature/exe/ruby-signature +7 -0
- data/vendor/ruby-signature/lib/ruby/signature.rb +64 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +391 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +364 -0
- data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +52 -0
- data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +54 -0
- data/vendor/ruby-signature/lib/ruby/signature/cli.rb +534 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +152 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition.rb +172 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +921 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment.rb +283 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +138 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +126 -0
- data/vendor/ruby-signature/lib/ruby/signature/errors.rb +189 -0
- data/vendor/ruby-signature/lib/ruby/signature/location.rb +104 -0
- data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +125 -0
- data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +93 -0
- data/vendor/ruby-signature/lib/ruby/signature/parser.y +1343 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +441 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +579 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +383 -0
- data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +48 -0
- data/vendor/ruby-signature/lib/ruby/signature/test.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +63 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +290 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +58 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +324 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +185 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +256 -0
- data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +72 -0
- data/vendor/ruby-signature/lib/ruby/signature/types.rb +932 -0
- data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +140 -0
- data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +49 -0
- data/vendor/ruby-signature/lib/ruby/signature/version.rb +5 -0
- data/vendor/ruby-signature/lib/ruby/signature/writer.rb +271 -0
- data/vendor/ruby-signature/ruby-signature.gemspec +45 -0
- data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +3 -0
- data/vendor/ruby-signature/stdlib/base64/base64.rbs +15 -0
- data/vendor/ruby-signature/stdlib/builtin/array.rbs +1997 -0
- data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +280 -0
- data/vendor/ruby-signature/stdlib/builtin/binding.rbs +177 -0
- data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +35 -0
- data/vendor/ruby-signature/stdlib/builtin/class.rbs +145 -0
- data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +116 -0
- data/vendor/ruby-signature/stdlib/builtin/complex.rbs +400 -0
- data/vendor/ruby-signature/stdlib/builtin/constants.rbs +37 -0
- data/vendor/ruby-signature/stdlib/builtin/data.rbs +5 -0
- data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +2 -0
- data/vendor/ruby-signature/stdlib/builtin/dir.rbs +419 -0
- data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +606 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +404 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +260 -0
- data/vendor/ruby-signature/stdlib/builtin/errno.rbs +781 -0
- data/vendor/ruby-signature/stdlib/builtin/errors.rbs +582 -0
- data/vendor/ruby-signature/stdlib/builtin/exception.rbs +193 -0
- data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +68 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +12 -0
- data/vendor/ruby-signature/stdlib/builtin/file.rbs +476 -0
- data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +59 -0
- data/vendor/ruby-signature/stdlib/builtin/float.rbs +696 -0
- data/vendor/ruby-signature/stdlib/builtin/gc.rbs +121 -0
- data/vendor/ruby-signature/stdlib/builtin/hash.rbs +1029 -0
- data/vendor/ruby-signature/stdlib/builtin/integer.rbs +710 -0
- data/vendor/ruby-signature/stdlib/builtin/io.rbs +683 -0
- data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +574 -0
- data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +135 -0
- data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +141 -0
- data/vendor/ruby-signature/stdlib/builtin/math.rbs +66 -0
- data/vendor/ruby-signature/stdlib/builtin/method.rbs +182 -0
- data/vendor/ruby-signature/stdlib/builtin/module.rbs +248 -0
- data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +82 -0
- data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +409 -0
- data/vendor/ruby-signature/stdlib/builtin/object.rbs +824 -0
- data/vendor/ruby-signature/stdlib/builtin/proc.rbs +426 -0
- data/vendor/ruby-signature/stdlib/builtin/process.rbs +354 -0
- data/vendor/ruby-signature/stdlib/builtin/random.rbs +93 -0
- data/vendor/ruby-signature/stdlib/builtin/range.rbs +226 -0
- data/vendor/ruby-signature/stdlib/builtin/rational.rbs +424 -0
- data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +10 -0
- data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +131 -0
- data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +14 -0
- data/vendor/ruby-signature/stdlib/builtin/signal.rbs +55 -0
- data/vendor/ruby-signature/stdlib/builtin/string.rbs +770 -0
- data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +13 -0
- data/vendor/ruby-signature/stdlib/builtin/struct.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +230 -0
- data/vendor/ruby-signature/stdlib/builtin/thread.rbs +1112 -0
- data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +23 -0
- data/vendor/ruby-signature/stdlib/builtin/time.rbs +739 -0
- data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +91 -0
- data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +46 -0
- data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +159 -0
- data/vendor/ruby-signature/stdlib/builtin/warning.rbs +17 -0
- data/vendor/ruby-signature/stdlib/erb/erb.rbs +18 -0
- data/vendor/ruby-signature/stdlib/find/find.rbs +44 -0
- data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +21 -0
- data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +23 -0
- data/vendor/ruby-signature/stdlib/prime/prime.rbs +188 -0
- data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +9 -0
- data/vendor/ruby-signature/stdlib/set/set.rbs +77 -0
- data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +53 -0
- metadata +244 -54
- data/.travis.yml +0 -7
- data/lib/steep/ast/signature/alias.rb +0 -19
- data/lib/steep/ast/signature/class.rb +0 -33
- data/lib/steep/ast/signature/const.rb +0 -17
- data/lib/steep/ast/signature/env.rb +0 -138
- data/lib/steep/ast/signature/extension.rb +0 -21
- data/lib/steep/ast/signature/gvar.rb +0 -17
- data/lib/steep/ast/signature/interface.rb +0 -31
- data/lib/steep/ast/signature/members.rb +0 -115
- data/lib/steep/ast/signature/module.rb +0 -21
- data/lib/steep/drivers/print_interface.rb +0 -94
- data/lib/steep/drivers/scaffold.rb +0 -321
- data/lib/steep/drivers/utils/each_signature.rb +0 -31
- data/lib/steep/interface/abstract.rb +0 -68
- data/lib/steep/interface/builder.rb +0 -637
- data/lib/steep/interface/instantiated.rb +0 -163
- data/lib/steep/interface/ivar_chain.rb +0 -26
- data/lib/steep/parser.y +0 -1278
- data/lib/steep/project/listener.rb +0 -53
- data/smoke/class/a.rbi +0 -24
- data/smoke/class/d.rb +0 -9
- data/smoke/class/e.rb +0 -12
- data/smoke/class/i.rbi +0 -9
- data/smoke/hash/e.rbi +0 -3
- data/smoke/hello/hello.rbi +0 -7
- data/smoke/implements/a.rbi +0 -6
- data/smoke/initialize/a.rbi +0 -3
- data/smoke/module/a.rbi +0 -16
- data/smoke/self/a.rbi +0 -4
- data/smoke/super/a.rbi +0 -10
- data/stdlib/builtin.rbi +0 -787
@@ -0,0 +1,606 @@
|
|
1
|
+
class Encoding < Object
|
2
|
+
# Returns the hash of available encoding alias and original encoding name.
|
3
|
+
#
|
4
|
+
# Encoding.aliases
|
5
|
+
# #=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1986"=>"US-ASCII",
|
6
|
+
# "SJIS"=>"Shift_JIS", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
|
7
|
+
def self.aliases: () -> ::Hash[String, String]
|
8
|
+
|
9
|
+
def self.compatible?: (untyped obj1, untyped obj2) -> Encoding?
|
10
|
+
|
11
|
+
# Returns default external encoding.
|
12
|
+
#
|
13
|
+
# The default external encoding is used by default for strings created
|
14
|
+
# from the following locations:
|
15
|
+
#
|
16
|
+
# - CSV
|
17
|
+
#
|
18
|
+
# - [File](https://ruby-doc.org/core-2.6.3/File.html) data read from
|
19
|
+
# disk
|
20
|
+
#
|
21
|
+
# - SDBM
|
22
|
+
#
|
23
|
+
# - StringIO
|
24
|
+
#
|
25
|
+
# - Zlib::GzipReader
|
26
|
+
#
|
27
|
+
# - Zlib::GzipWriter
|
28
|
+
#
|
29
|
+
# - [String\#inspect](https://ruby-doc.org/core-2.6.3/String.html#method-i-inspect)
|
30
|
+
#
|
31
|
+
# - [Regexp\#inspect](https://ruby-doc.org/core-2.6.3/Regexp.html#method-i-inspect)
|
32
|
+
#
|
33
|
+
# While strings created from these locations will have this encoding, the
|
34
|
+
# encoding may not be valid. Be sure to check
|
35
|
+
# [String\#valid\_encoding?](https://ruby-doc.org/core-2.6.3/String.html#method-i-valid_encoding-3F)
|
36
|
+
# .
|
37
|
+
#
|
38
|
+
# [File](https://ruby-doc.org/core-2.6.3/File.html) data written to disk
|
39
|
+
# will be transcoded to the default external encoding when written.
|
40
|
+
#
|
41
|
+
# The default external encoding is initialized by the locale or -E option.
|
42
|
+
def self.default_external: () -> Encoding
|
43
|
+
|
44
|
+
def self.default_external=: (String arg0) -> String
|
45
|
+
| (Encoding arg0) -> Encoding
|
46
|
+
|
47
|
+
# Returns default internal encoding. Strings will be transcoded to the
|
48
|
+
# default internal encoding in the following places if the default
|
49
|
+
# internal encoding is not nil:
|
50
|
+
#
|
51
|
+
# - CSV
|
52
|
+
#
|
53
|
+
# - Etc.sysconfdir and Etc.systmpdir
|
54
|
+
#
|
55
|
+
# - [File](https://ruby-doc.org/core-2.6.3/File.html) data read from
|
56
|
+
# disk
|
57
|
+
#
|
58
|
+
# - [File](https://ruby-doc.org/core-2.6.3/File.html) names from
|
59
|
+
# [Dir](https://ruby-doc.org/core-2.6.3/Dir.html)
|
60
|
+
#
|
61
|
+
# - [Integer\#chr](https://ruby-doc.org/core-2.6.3/Integer.html#method-i-chr)
|
62
|
+
#
|
63
|
+
# - [String\#inspect](https://ruby-doc.org/core-2.6.3/String.html#method-i-inspect)
|
64
|
+
# and
|
65
|
+
# [Regexp\#inspect](https://ruby-doc.org/core-2.6.3/Regexp.html#method-i-inspect)
|
66
|
+
#
|
67
|
+
# - Strings returned from Readline
|
68
|
+
#
|
69
|
+
# - Strings returned from SDBM
|
70
|
+
#
|
71
|
+
# - [Time\#zone](https://ruby-doc.org/core-2.6.3/Time.html#method-i-zone)
|
72
|
+
#
|
73
|
+
# - Values from [ENV](https://ruby-doc.org/core-2.6.3/ENV.html)
|
74
|
+
#
|
75
|
+
# - Values in ARGV including $PROGRAM\_NAME
|
76
|
+
#
|
77
|
+
# Additionally
|
78
|
+
# [String\#encode](https://ruby-doc.org/core-2.6.3/String.html#method-i-encode)
|
79
|
+
# and
|
80
|
+
# [String\#encode\!](https://ruby-doc.org/core-2.6.3/String.html#method-i-encode-21)
|
81
|
+
# use the default internal encoding if no encoding is given.
|
82
|
+
#
|
83
|
+
# The locale encoding (\_\_ENCODING\_\_), not
|
84
|
+
# [::default\_internal](Encoding.downloaded.ruby_doc#method-c-default_internal)
|
85
|
+
# , is used as the encoding of created strings.
|
86
|
+
#
|
87
|
+
# [::default\_internal](Encoding.downloaded.ruby_doc#method-c-default_internal)
|
88
|
+
# is initialized by the source file's internal\_encoding or -E option.
|
89
|
+
def self.default_internal: () -> Encoding
|
90
|
+
|
91
|
+
def self.default_internal=: (String arg0) -> String?
|
92
|
+
| (Encoding arg0) -> Encoding?
|
93
|
+
|
94
|
+
def self.find: (String | Encoding arg0) -> Encoding
|
95
|
+
|
96
|
+
def self.list: () -> ::Array[Encoding]
|
97
|
+
|
98
|
+
# Returns the list of available encoding names.
|
99
|
+
#
|
100
|
+
# Encoding.name_list
|
101
|
+
# #=> ["US-ASCII", "ASCII-8BIT", "UTF-8",
|
102
|
+
# "ISO-8859-1", "Shift_JIS", "EUC-JP",
|
103
|
+
# "Windows-31J",
|
104
|
+
# "BINARY", "CP932", "eucJP"]
|
105
|
+
def self.name_list: () -> ::Array[String]
|
106
|
+
|
107
|
+
# Returns whether ASCII-compatible or not.
|
108
|
+
#
|
109
|
+
# ```ruby
|
110
|
+
# Encoding::UTF_8.ascii_compatible? #=> true
|
111
|
+
# Encoding::UTF_16BE.ascii_compatible? #=> false
|
112
|
+
# ```
|
113
|
+
def ascii_compatible?: () -> bool
|
114
|
+
|
115
|
+
# Returns true for dummy encodings. A dummy encoding is an encoding for
|
116
|
+
# which character handling is not properly implemented. It is used for
|
117
|
+
# stateful encodings.
|
118
|
+
#
|
119
|
+
# ```ruby
|
120
|
+
# Encoding::ISO_2022_JP.dummy? #=> true
|
121
|
+
# Encoding::UTF_8.dummy? #=> false
|
122
|
+
# ```
|
123
|
+
def dummy?: () -> bool
|
124
|
+
|
125
|
+
def inspect: () -> String
|
126
|
+
|
127
|
+
# Returns the name of the encoding.
|
128
|
+
#
|
129
|
+
# ```ruby
|
130
|
+
# Encoding::UTF_8.name #=> "UTF-8"
|
131
|
+
# ```
|
132
|
+
def name: () -> String
|
133
|
+
|
134
|
+
# Returns the list of name and aliases of the encoding.
|
135
|
+
#
|
136
|
+
# ```ruby
|
137
|
+
# Encoding::WINDOWS_31J.names #=> ["Windows-31J", "CP932", "csWindows31J"]
|
138
|
+
# ```
|
139
|
+
def names: () -> ::Array[String]
|
140
|
+
|
141
|
+
def replicate: (String name) -> Encoding
|
142
|
+
|
143
|
+
# Returns the name of the encoding.
|
144
|
+
#
|
145
|
+
# ```ruby
|
146
|
+
# Encoding::UTF_8.name #=> "UTF-8"
|
147
|
+
# ```
|
148
|
+
def to_s: () -> String
|
149
|
+
end
|
150
|
+
|
151
|
+
Encoding::ANSI_X3_4_1968: Encoding
|
152
|
+
|
153
|
+
Encoding::ASCII: Encoding
|
154
|
+
|
155
|
+
Encoding::ASCII_8BIT: Encoding
|
156
|
+
|
157
|
+
Encoding::BIG5: Encoding
|
158
|
+
|
159
|
+
Encoding::BIG5_HKSCS: Encoding
|
160
|
+
|
161
|
+
Encoding::BIG5_HKSCS_2008: Encoding
|
162
|
+
|
163
|
+
Encoding::BIG5_UAO: Encoding
|
164
|
+
|
165
|
+
Encoding::BINARY: Encoding
|
166
|
+
|
167
|
+
Encoding::Big5: Encoding
|
168
|
+
|
169
|
+
Encoding::Big5_HKSCS: Encoding
|
170
|
+
|
171
|
+
Encoding::Big5_HKSCS_2008: Encoding
|
172
|
+
|
173
|
+
Encoding::Big5_UAO: Encoding
|
174
|
+
|
175
|
+
Encoding::CP1250: Encoding
|
176
|
+
|
177
|
+
Encoding::CP1251: Encoding
|
178
|
+
|
179
|
+
Encoding::CP1252: Encoding
|
180
|
+
|
181
|
+
Encoding::CP1253: Encoding
|
182
|
+
|
183
|
+
Encoding::CP1254: Encoding
|
184
|
+
|
185
|
+
Encoding::CP1255: Encoding
|
186
|
+
|
187
|
+
Encoding::CP1256: Encoding
|
188
|
+
|
189
|
+
Encoding::CP1257: Encoding
|
190
|
+
|
191
|
+
Encoding::CP1258: Encoding
|
192
|
+
|
193
|
+
Encoding::CP437: Encoding
|
194
|
+
|
195
|
+
Encoding::CP50220: Encoding
|
196
|
+
|
197
|
+
Encoding::CP50221: Encoding
|
198
|
+
|
199
|
+
Encoding::CP51932: Encoding
|
200
|
+
|
201
|
+
Encoding::CP65000: Encoding
|
202
|
+
|
203
|
+
Encoding::CP65001: Encoding
|
204
|
+
|
205
|
+
Encoding::CP737: Encoding
|
206
|
+
|
207
|
+
Encoding::CP775: Encoding
|
208
|
+
|
209
|
+
Encoding::CP850: Encoding
|
210
|
+
|
211
|
+
Encoding::CP852: Encoding
|
212
|
+
|
213
|
+
Encoding::CP855: Encoding
|
214
|
+
|
215
|
+
Encoding::CP857: Encoding
|
216
|
+
|
217
|
+
Encoding::CP860: Encoding
|
218
|
+
|
219
|
+
Encoding::CP861: Encoding
|
220
|
+
|
221
|
+
Encoding::CP862: Encoding
|
222
|
+
|
223
|
+
Encoding::CP863: Encoding
|
224
|
+
|
225
|
+
Encoding::CP864: Encoding
|
226
|
+
|
227
|
+
Encoding::CP865: Encoding
|
228
|
+
|
229
|
+
Encoding::CP866: Encoding
|
230
|
+
|
231
|
+
Encoding::CP869: Encoding
|
232
|
+
|
233
|
+
Encoding::CP874: Encoding
|
234
|
+
|
235
|
+
Encoding::CP878: Encoding
|
236
|
+
|
237
|
+
Encoding::CP932: Encoding
|
238
|
+
|
239
|
+
Encoding::CP936: Encoding
|
240
|
+
|
241
|
+
Encoding::CP949: Encoding
|
242
|
+
|
243
|
+
Encoding::CP950: Encoding
|
244
|
+
|
245
|
+
Encoding::CP951: Encoding
|
246
|
+
|
247
|
+
Encoding::CSWINDOWS31J: Encoding
|
248
|
+
|
249
|
+
Encoding::CsWindows31J: Encoding
|
250
|
+
|
251
|
+
Encoding::EBCDIC_CP_US: Encoding
|
252
|
+
|
253
|
+
Encoding::EMACS_MULE: Encoding
|
254
|
+
|
255
|
+
Encoding::EUCCN: Encoding
|
256
|
+
|
257
|
+
Encoding::EUCJP: Encoding
|
258
|
+
|
259
|
+
Encoding::EUCJP_MS: Encoding
|
260
|
+
|
261
|
+
Encoding::EUCKR: Encoding
|
262
|
+
|
263
|
+
Encoding::EUCTW: Encoding
|
264
|
+
|
265
|
+
Encoding::EUC_CN: Encoding
|
266
|
+
|
267
|
+
Encoding::EUC_JISX0213: Encoding
|
268
|
+
|
269
|
+
Encoding::EUC_JIS_2004: Encoding
|
270
|
+
|
271
|
+
Encoding::EUC_JP: Encoding
|
272
|
+
|
273
|
+
Encoding::EUC_JP_MS: Encoding
|
274
|
+
|
275
|
+
Encoding::EUC_KR: Encoding
|
276
|
+
|
277
|
+
Encoding::EUC_TW: Encoding
|
278
|
+
|
279
|
+
Encoding::Emacs_Mule: Encoding
|
280
|
+
|
281
|
+
Encoding::EucCN: Encoding
|
282
|
+
|
283
|
+
Encoding::EucJP: Encoding
|
284
|
+
|
285
|
+
Encoding::EucJP_ms: Encoding
|
286
|
+
|
287
|
+
Encoding::EucKR: Encoding
|
288
|
+
|
289
|
+
Encoding::EucTW: Encoding
|
290
|
+
|
291
|
+
Encoding::GB12345: Encoding
|
292
|
+
|
293
|
+
Encoding::GB18030: Encoding
|
294
|
+
|
295
|
+
Encoding::GB1988: Encoding
|
296
|
+
|
297
|
+
Encoding::GB2312: Encoding
|
298
|
+
|
299
|
+
Encoding::GBK: Encoding
|
300
|
+
|
301
|
+
Encoding::IBM037: Encoding
|
302
|
+
|
303
|
+
Encoding::IBM437: Encoding
|
304
|
+
|
305
|
+
Encoding::IBM737: Encoding
|
306
|
+
|
307
|
+
Encoding::IBM775: Encoding
|
308
|
+
|
309
|
+
Encoding::IBM850: Encoding
|
310
|
+
|
311
|
+
Encoding::IBM852: Encoding
|
312
|
+
|
313
|
+
Encoding::IBM855: Encoding
|
314
|
+
|
315
|
+
Encoding::IBM857: Encoding
|
316
|
+
|
317
|
+
Encoding::IBM860: Encoding
|
318
|
+
|
319
|
+
Encoding::IBM861: Encoding
|
320
|
+
|
321
|
+
Encoding::IBM862: Encoding
|
322
|
+
|
323
|
+
Encoding::IBM863: Encoding
|
324
|
+
|
325
|
+
Encoding::IBM864: Encoding
|
326
|
+
|
327
|
+
Encoding::IBM865: Encoding
|
328
|
+
|
329
|
+
Encoding::IBM866: Encoding
|
330
|
+
|
331
|
+
Encoding::IBM869: Encoding
|
332
|
+
|
333
|
+
Encoding::ISO2022_JP: Encoding
|
334
|
+
|
335
|
+
Encoding::ISO2022_JP2: Encoding
|
336
|
+
|
337
|
+
Encoding::ISO8859_1: Encoding
|
338
|
+
|
339
|
+
Encoding::ISO8859_10: Encoding
|
340
|
+
|
341
|
+
Encoding::ISO8859_11: Encoding
|
342
|
+
|
343
|
+
Encoding::ISO8859_13: Encoding
|
344
|
+
|
345
|
+
Encoding::ISO8859_14: Encoding
|
346
|
+
|
347
|
+
Encoding::ISO8859_15: Encoding
|
348
|
+
|
349
|
+
Encoding::ISO8859_16: Encoding
|
350
|
+
|
351
|
+
Encoding::ISO8859_2: Encoding
|
352
|
+
|
353
|
+
Encoding::ISO8859_3: Encoding
|
354
|
+
|
355
|
+
Encoding::ISO8859_4: Encoding
|
356
|
+
|
357
|
+
Encoding::ISO8859_5: Encoding
|
358
|
+
|
359
|
+
Encoding::ISO8859_6: Encoding
|
360
|
+
|
361
|
+
Encoding::ISO8859_7: Encoding
|
362
|
+
|
363
|
+
Encoding::ISO8859_8: Encoding
|
364
|
+
|
365
|
+
Encoding::ISO8859_9: Encoding
|
366
|
+
|
367
|
+
Encoding::ISO_2022_JP: Encoding
|
368
|
+
|
369
|
+
Encoding::ISO_2022_JP_2: Encoding
|
370
|
+
|
371
|
+
Encoding::ISO_2022_JP_KDDI: Encoding
|
372
|
+
|
373
|
+
Encoding::ISO_8859_1: Encoding
|
374
|
+
|
375
|
+
Encoding::ISO_8859_10: Encoding
|
376
|
+
|
377
|
+
Encoding::ISO_8859_11: Encoding
|
378
|
+
|
379
|
+
Encoding::ISO_8859_13: Encoding
|
380
|
+
|
381
|
+
Encoding::ISO_8859_14: Encoding
|
382
|
+
|
383
|
+
Encoding::ISO_8859_15: Encoding
|
384
|
+
|
385
|
+
Encoding::ISO_8859_16: Encoding
|
386
|
+
|
387
|
+
Encoding::ISO_8859_2: Encoding
|
388
|
+
|
389
|
+
Encoding::ISO_8859_3: Encoding
|
390
|
+
|
391
|
+
Encoding::ISO_8859_4: Encoding
|
392
|
+
|
393
|
+
Encoding::ISO_8859_5: Encoding
|
394
|
+
|
395
|
+
Encoding::ISO_8859_6: Encoding
|
396
|
+
|
397
|
+
Encoding::ISO_8859_7: Encoding
|
398
|
+
|
399
|
+
Encoding::ISO_8859_8: Encoding
|
400
|
+
|
401
|
+
Encoding::ISO_8859_9: Encoding
|
402
|
+
|
403
|
+
Encoding::KOI8_R: Encoding
|
404
|
+
|
405
|
+
Encoding::KOI8_U: Encoding
|
406
|
+
|
407
|
+
Encoding::MACCENTEURO: Encoding
|
408
|
+
|
409
|
+
Encoding::MACCROATIAN: Encoding
|
410
|
+
|
411
|
+
Encoding::MACCYRILLIC: Encoding
|
412
|
+
|
413
|
+
Encoding::MACGREEK: Encoding
|
414
|
+
|
415
|
+
Encoding::MACICELAND: Encoding
|
416
|
+
|
417
|
+
Encoding::MACJAPAN: Encoding
|
418
|
+
|
419
|
+
Encoding::MACJAPANESE: Encoding
|
420
|
+
|
421
|
+
Encoding::MACROMAN: Encoding
|
422
|
+
|
423
|
+
Encoding::MACROMANIA: Encoding
|
424
|
+
|
425
|
+
Encoding::MACTHAI: Encoding
|
426
|
+
|
427
|
+
Encoding::MACTURKISH: Encoding
|
428
|
+
|
429
|
+
Encoding::MACUKRAINE: Encoding
|
430
|
+
|
431
|
+
Encoding::MacCentEuro: Encoding
|
432
|
+
|
433
|
+
Encoding::MacCroatian: Encoding
|
434
|
+
|
435
|
+
Encoding::MacCyrillic: Encoding
|
436
|
+
|
437
|
+
Encoding::MacGreek: Encoding
|
438
|
+
|
439
|
+
Encoding::MacIceland: Encoding
|
440
|
+
|
441
|
+
Encoding::MacJapan: Encoding
|
442
|
+
|
443
|
+
Encoding::MacJapanese: Encoding
|
444
|
+
|
445
|
+
Encoding::MacRoman: Encoding
|
446
|
+
|
447
|
+
Encoding::MacRomania: Encoding
|
448
|
+
|
449
|
+
Encoding::MacThai: Encoding
|
450
|
+
|
451
|
+
Encoding::MacTurkish: Encoding
|
452
|
+
|
453
|
+
Encoding::MacUkraine: Encoding
|
454
|
+
|
455
|
+
Encoding::PCK: Encoding
|
456
|
+
|
457
|
+
Encoding::SHIFT_JIS: Encoding
|
458
|
+
|
459
|
+
Encoding::SJIS: Encoding
|
460
|
+
|
461
|
+
Encoding::SJIS_DOCOMO: Encoding
|
462
|
+
|
463
|
+
Encoding::SJIS_DoCoMo: Encoding
|
464
|
+
|
465
|
+
Encoding::SJIS_KDDI: Encoding
|
466
|
+
|
467
|
+
Encoding::SJIS_SOFTBANK: Encoding
|
468
|
+
|
469
|
+
Encoding::SJIS_SoftBank: Encoding
|
470
|
+
|
471
|
+
Encoding::STATELESS_ISO_2022_JP: Encoding
|
472
|
+
|
473
|
+
Encoding::STATELESS_ISO_2022_JP_KDDI: Encoding
|
474
|
+
|
475
|
+
Encoding::Shift_JIS: Encoding
|
476
|
+
|
477
|
+
Encoding::Stateless_ISO_2022_JP: Encoding
|
478
|
+
|
479
|
+
Encoding::Stateless_ISO_2022_JP_KDDI: Encoding
|
480
|
+
|
481
|
+
Encoding::TIS_620: Encoding
|
482
|
+
|
483
|
+
Encoding::UCS_2BE: Encoding
|
484
|
+
|
485
|
+
Encoding::UCS_4BE: Encoding
|
486
|
+
|
487
|
+
Encoding::UCS_4LE: Encoding
|
488
|
+
|
489
|
+
Encoding::US_ASCII: Encoding
|
490
|
+
|
491
|
+
Encoding::UTF8_DOCOMO: Encoding
|
492
|
+
|
493
|
+
Encoding::UTF8_DoCoMo: Encoding
|
494
|
+
|
495
|
+
Encoding::UTF8_KDDI: Encoding
|
496
|
+
|
497
|
+
Encoding::UTF8_MAC: Encoding
|
498
|
+
|
499
|
+
Encoding::UTF8_SOFTBANK: Encoding
|
500
|
+
|
501
|
+
Encoding::UTF8_SoftBank: Encoding
|
502
|
+
|
503
|
+
Encoding::UTF_16: Encoding
|
504
|
+
|
505
|
+
Encoding::UTF_16BE: Encoding
|
506
|
+
|
507
|
+
Encoding::UTF_16LE: Encoding
|
508
|
+
|
509
|
+
Encoding::UTF_32: Encoding
|
510
|
+
|
511
|
+
Encoding::UTF_32BE: Encoding
|
512
|
+
|
513
|
+
Encoding::UTF_32LE: Encoding
|
514
|
+
|
515
|
+
Encoding::UTF_7: Encoding
|
516
|
+
|
517
|
+
Encoding::UTF_8: Encoding
|
518
|
+
|
519
|
+
Encoding::UTF_8_HFS: Encoding
|
520
|
+
|
521
|
+
Encoding::UTF_8_MAC: Encoding
|
522
|
+
|
523
|
+
Encoding::WINDOWS_1250: Encoding
|
524
|
+
|
525
|
+
Encoding::WINDOWS_1251: Encoding
|
526
|
+
|
527
|
+
Encoding::WINDOWS_1252: Encoding
|
528
|
+
|
529
|
+
Encoding::WINDOWS_1253: Encoding
|
530
|
+
|
531
|
+
Encoding::WINDOWS_1254: Encoding
|
532
|
+
|
533
|
+
Encoding::WINDOWS_1255: Encoding
|
534
|
+
|
535
|
+
Encoding::WINDOWS_1256: Encoding
|
536
|
+
|
537
|
+
Encoding::WINDOWS_1257: Encoding
|
538
|
+
|
539
|
+
Encoding::WINDOWS_1258: Encoding
|
540
|
+
|
541
|
+
Encoding::WINDOWS_31J: Encoding
|
542
|
+
|
543
|
+
Encoding::WINDOWS_874: Encoding
|
544
|
+
|
545
|
+
Encoding::Windows_1250: Encoding
|
546
|
+
|
547
|
+
Encoding::Windows_1251: Encoding
|
548
|
+
|
549
|
+
Encoding::Windows_1252: Encoding
|
550
|
+
|
551
|
+
Encoding::Windows_1253: Encoding
|
552
|
+
|
553
|
+
Encoding::Windows_1254: Encoding
|
554
|
+
|
555
|
+
Encoding::Windows_1255: Encoding
|
556
|
+
|
557
|
+
Encoding::Windows_1256: Encoding
|
558
|
+
|
559
|
+
Encoding::Windows_1257: Encoding
|
560
|
+
|
561
|
+
Encoding::Windows_1258: Encoding
|
562
|
+
|
563
|
+
Encoding::Windows_31J: Encoding
|
564
|
+
|
565
|
+
Encoding::Windows_874: Encoding
|
566
|
+
|
567
|
+
class Encoding::Converter < Data
|
568
|
+
end
|
569
|
+
|
570
|
+
Encoding::Converter::AFTER_OUTPUT: Integer
|
571
|
+
|
572
|
+
Encoding::Converter::CRLF_NEWLINE_DECORATOR: Integer
|
573
|
+
|
574
|
+
Encoding::Converter::CR_NEWLINE_DECORATOR: Integer
|
575
|
+
|
576
|
+
Encoding::Converter::INVALID_MASK: Integer
|
577
|
+
|
578
|
+
Encoding::Converter::INVALID_REPLACE: Integer
|
579
|
+
|
580
|
+
Encoding::Converter::PARTIAL_INPUT: Integer
|
581
|
+
|
582
|
+
Encoding::Converter::UNDEF_HEX_CHARREF: Integer
|
583
|
+
|
584
|
+
Encoding::Converter::UNDEF_MASK: Integer
|
585
|
+
|
586
|
+
Encoding::Converter::UNDEF_REPLACE: Integer
|
587
|
+
|
588
|
+
Encoding::Converter::UNIVERSAL_NEWLINE_DECORATOR: Integer
|
589
|
+
|
590
|
+
Encoding::Converter::XML_ATTR_CONTENT_DECORATOR: Integer
|
591
|
+
|
592
|
+
Encoding::Converter::XML_ATTR_QUOTE_DECORATOR: Integer
|
593
|
+
|
594
|
+
Encoding::Converter::XML_TEXT_DECORATOR: Integer
|
595
|
+
|
596
|
+
class Encoding::CompatibilityError < EncodingError
|
597
|
+
end
|
598
|
+
|
599
|
+
class Encoding::ConverterNotFoundError < EncodingError
|
600
|
+
end
|
601
|
+
|
602
|
+
class Encoding::InvalidByteSequenceError < EncodingError
|
603
|
+
end
|
604
|
+
|
605
|
+
class Encoding::UndefinedConversionError < EncodingError
|
606
|
+
end
|