rdl 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -0
- data/CHANGES.md +35 -0
- data/README.md +153 -116
- data/bin/rdl_query +1 -1
- data/extras/type_tests/typetests.rb +905 -0
- data/lib/rdl.rb +0 -1
- data/lib/rdl/boot.rb +108 -77
- data/lib/rdl/boot_rails.rb +2 -8
- data/lib/rdl/config.rb +44 -17
- data/lib/rdl/contracts/flat.rb +1 -1
- data/lib/rdl/info.rb +3 -3
- data/lib/rdl/query.rb +11 -11
- data/lib/rdl/typecheck.rb +399 -136
- data/lib/rdl/types/finite_hash.rb +3 -2
- data/lib/rdl/types/generic.rb +7 -6
- data/lib/rdl/types/intersection.rb +3 -2
- data/lib/rdl/types/lexer.rex +2 -3
- data/lib/rdl/types/lexer.rex.rb +1 -4
- data/lib/rdl/types/method.rb +7 -6
- data/lib/rdl/types/nominal.rb +10 -1
- data/lib/rdl/types/parser.racc +7 -8
- data/lib/rdl/types/parser.tab.rb +108 -109
- data/lib/rdl/types/structural.rb +1 -0
- data/lib/rdl/types/tuple.rb +2 -2
- data/lib/rdl/types/type.rb +8 -8
- data/lib/rdl/types/type_inferencer.rb +1 -1
- data/lib/rdl/types/union.rb +2 -1
- data/lib/rdl/util.rb +28 -3
- data/lib/rdl/wrap.rb +216 -165
- data/lib/rdl_disable.rb +22 -15
- data/lib/types/core.rb +2 -4
- data/lib/types/core/_aliases.rb +14 -0
- data/lib/types/core/abbrev.rb +3 -0
- data/lib/types/core/array.rb +139 -0
- data/lib/types/core/base64.rb +8 -0
- data/lib/types/core/basic_object.rb +12 -0
- data/lib/types/core/benchmark.rb +9 -0
- data/lib/types/core/bigdecimal.rb +223 -0
- data/lib/types/core/bigmath.rb +10 -0
- data/lib/types/core/bignum.rb +214 -0
- data/lib/types/core/class.rb +15 -0
- data/lib/types/core/complex.rb +123 -0
- data/lib/types/core/coverage.rb +4 -0
- data/lib/types/core/csv.rb +3 -0
- data/lib/types/core/date.rb +4 -0
- data/lib/types/core/dir.rb +37 -0
- data/lib/types/core/encoding.rb +21 -0
- data/lib/types/core/enumerable.rb +96 -0
- data/lib/types/core/enumerator.rb +24 -0
- data/lib/types/core/exception.rb +15 -0
- data/lib/types/core/file.rb +125 -0
- data/lib/types/core/fileutils.rb +4 -0
- data/lib/types/core/fixnum.rb +213 -0
- data/lib/types/core/float.rb +199 -0
- data/lib/types/core/gem.rb +19 -0
- data/lib/types/core/hash.rb +72 -0
- data/lib/types/core/integer.rb +194 -0
- data/lib/types/core/io.rb +101 -0
- data/lib/types/core/kernel.rb +89 -0
- data/lib/types/core/marshal.rb +3 -0
- data/lib/types/core/matchdata.rb +24 -0
- data/lib/types/core/math.rb +50 -0
- data/lib/types/core/module.rb +81 -0
- data/lib/types/core/nil.rb +11 -0
- data/lib/types/core/numeric.rb +56 -0
- data/lib/types/core/object.rb +73 -0
- data/lib/types/core/pathname.rb +104 -0
- data/lib/types/core/proc.rb +12 -0
- data/lib/types/core/process.rb +110 -0
- data/lib/types/core/random.rb +13 -0
- data/lib/types/core/range.rb +37 -0
- data/lib/types/core/rational.rb +207 -0
- data/lib/types/core/regexp.rb +28 -0
- data/lib/types/core/set.rb +56 -0
- data/lib/types/core/string.rb +140 -0
- data/lib/types/core/strscan.rb +6 -0
- data/lib/types/core/symbol.rb +27 -0
- data/lib/types/core/time.rb +66 -0
- data/lib/types/core/uri.rb +18 -0
- data/lib/types/core/yaml.rb +3 -0
- data/lib/types/devise.rb +1 -0
- data/lib/types/devise/controller_helpers.rb +3 -0
- data/lib/types/devise/parameter_sanitizer.rb +2 -0
- data/lib/types/pundit.rb +2 -0
- data/lib/types/rails/_helpers.rb +50 -0
- data/lib/types/rails/abstract_controller/translation.rb +2 -0
- data/lib/types/rails/action_controller/base.rb +3 -0
- data/lib/types/rails/action_controller/instrumentation.rb +6 -0
- data/lib/types/rails/action_controller/metal.rb +3 -0
- data/lib/types/rails/action_controller/mime_responds.rb +13 -0
- data/lib/types/rails/action_controller/parameters.rb +3 -0
- data/lib/types/{rails-5.x → rails}/action_controller/strong_parameters.rb +4 -8
- data/lib/types/rails/action_dispatch/flashhash.rb +8 -0
- data/lib/types/rails/action_dispatch/routing.rb +10 -0
- data/lib/types/rails/action_mailer/base.rb +2 -0
- data/lib/types/rails/action_mailer/message_delivery.rb +2 -0
- data/lib/types/rails/action_view/helpers_sanitizehelper.rb +2 -0
- data/lib/types/rails/action_view/helpers_urlhelper.rb +5 -0
- data/lib/types/rails/active_model/errors.rb +14 -0
- data/lib/types/rails/active_model/validations.rb +2 -0
- data/lib/types/rails/active_record/associations.rb +208 -0
- data/lib/types/rails/active_record/base.rb +2 -0
- data/lib/types/rails/active_record/core.rb +2 -0
- data/lib/types/rails/active_record/finder_methods.rb +2 -0
- data/lib/types/rails/active_record/model_schema.rb +37 -0
- data/lib/types/rails/active_record/relation.rb +11 -0
- data/lib/types/rails/active_record/schema_types.rb +51 -0
- data/lib/types/rails/active_record/validations.rb +2 -0
- data/lib/types/rails/active_support/base.rb +2 -0
- data/lib/types/rails/active_support/logger.rb +3 -0
- data/lib/types/rails/active_support/tagged_logging.rb +2 -0
- data/lib/types/rails/active_support/time_with_zone.rb +13 -0
- data/lib/types/rails/active_support/time_zone.rb +2 -0
- data/lib/types/rails/fixnum.rb +2 -0
- data/lib/types/rails/integer.rb +2 -0
- data/lib/types/rails/rack/request.rb +2 -0
- data/lib/types/rails/string.rb +3 -0
- data/lib/types/rails/time.rb +1 -0
- data/rdl.gemspec +2 -2
- data/test/disabled_test_rdoc.rb +8 -8
- data/test/test_alias.rb +1 -0
- data/test/test_dsl.rb +4 -4
- data/test/test_generic.rb +45 -38
- data/test/test_intersection.rb +10 -10
- data/test/test_le.rb +103 -102
- data/test/test_member.rb +33 -33
- data/test/test_parser.rb +101 -96
- data/test/test_query.rb +84 -84
- data/test/test_rdl.rb +87 -52
- data/test/test_rdl_type.rb +26 -9
- data/test/test_type_contract.rb +32 -31
- data/test/test_typecheck.rb +802 -436
- data/test/test_types.rb +39 -39
- data/test/test_wrap.rb +3 -2
- metadata +91 -120
- data/extras/type_tests/%.rb +0 -171
- data/extras/type_tests/&.rb +0 -159
- data/extras/type_tests/**.rb +0 -222
- data/extras/type_tests/*.rb +0 -177
- data/extras/type_tests/+.rb +0 -170
- data/extras/type_tests/-.rb +0 -171
- data/extras/type_tests/1scomp.rb +0 -157
- data/extras/type_tests/<.rb +0 -170
- data/extras/type_tests/<<.rb +0 -159
- data/extras/type_tests/>>.rb +0 -159
- data/extras/type_tests/[].rb +0 -163
- data/extras/type_tests/^.rb +0 -159
- data/extras/type_tests/abs.rb +0 -155
- data/extras/type_tests/abs2.rb +0 -164
- data/extras/type_tests/angle.rb +0 -157
- data/extras/type_tests/arg.rb +0 -157
- data/extras/type_tests/bit_length.rb +0 -157
- data/extras/type_tests/ceil.rb +0 -157
- data/extras/type_tests/ceilRational.rb +0 -160
- data/extras/type_tests/conj.rb +0 -158
- data/extras/type_tests/defwhere.rb +0 -86
- data/extras/type_tests/denominator.rb +0 -157
- data/extras/type_tests/div.rb +0 -172
- data/extras/type_tests/divslash.rb +0 -179
- data/extras/type_tests/even?.rb +0 -157
- data/extras/type_tests/fdiv.rb +0 -244
- data/extras/type_tests/finite?.rb +0 -157
- data/extras/type_tests/floor.rb +0 -157
- data/extras/type_tests/floorRational.rb +0 -161
- data/extras/type_tests/hash.rb +0 -157
- data/extras/type_tests/imag.rb +0 -158
- data/extras/type_tests/infinite?.rb +0 -157
- data/extras/type_tests/modulo.rb +0 -171
- data/extras/type_tests/nan?.rb +0 -157
- data/extras/type_tests/neg.rb +0 -155
- data/extras/type_tests/next.rb +0 -157
- data/extras/type_tests/next_float.rb +0 -157
- data/extras/type_tests/numerator.rb +0 -157
- data/extras/type_tests/phase.rb +0 -157
- data/extras/type_tests/prev_float.rb +0 -157
- data/extras/type_tests/quo.rb +0 -179
- data/extras/type_tests/rationalize.rb +0 -157
- data/extras/type_tests/rationalizeArg.rb +0 -198
- data/extras/type_tests/real.rb +0 -157
- data/extras/type_tests/real?.rb +0 -157
- data/extras/type_tests/round.rb +0 -157
- data/extras/type_tests/roundArg.rb +0 -169
- data/extras/type_tests/size.rb +0 -157
- data/extras/type_tests/to_c.rb +0 -157
- data/extras/type_tests/to_f.rb +0 -155
- data/extras/type_tests/to_i.rb +0 -157
- data/extras/type_tests/to_r.rb +0 -157
- data/extras/type_tests/to_s.rb +0 -157
- data/extras/type_tests/truncate.rb +0 -157
- data/extras/type_tests/truncateArg.rb +0 -166
- data/extras/type_tests/type tests +0 -1
- data/extras/type_tests/zero?.rb +0 -155
- data/extras/type_tests/|.rb +0 -159
- data/lib/types/core-ruby-2.x/_aliases.rb +0 -15
- data/lib/types/core-ruby-2.x/abbrev.rb +0 -5
- data/lib/types/core-ruby-2.x/array.rb +0 -137
- data/lib/types/core-ruby-2.x/base64.rb +0 -10
- data/lib/types/core-ruby-2.x/basic_object.rb +0 -14
- data/lib/types/core-ruby-2.x/benchmark.rb +0 -11
- data/lib/types/core-ruby-2.x/bigdecimal.rb +0 -224
- data/lib/types/core-ruby-2.x/bigmath.rb +0 -12
- data/lib/types/core-ruby-2.x/bignum.rb +0 -214
- data/lib/types/core-ruby-2.x/class.rb +0 -17
- data/lib/types/core-ruby-2.x/complex.rb +0 -124
- data/lib/types/core-ruby-2.x/coverage.rb +0 -6
- data/lib/types/core-ruby-2.x/csv.rb +0 -5
- data/lib/types/core-ruby-2.x/date.rb +0 -6
- data/lib/types/core-ruby-2.x/dir.rb +0 -38
- data/lib/types/core-ruby-2.x/encoding.rb +0 -23
- data/lib/types/core-ruby-2.x/enumerable.rb +0 -98
- data/lib/types/core-ruby-2.x/enumerator.rb +0 -26
- data/lib/types/core-ruby-2.x/exception.rb +0 -17
- data/lib/types/core-ruby-2.x/file.rb +0 -126
- data/lib/types/core-ruby-2.x/fileutils.rb +0 -6
- data/lib/types/core-ruby-2.x/fixnum.rb +0 -213
- data/lib/types/core-ruby-2.x/float.rb +0 -199
- data/lib/types/core-ruby-2.x/gem.rb +0 -247
- data/lib/types/core-ruby-2.x/hash.rb +0 -72
- data/lib/types/core-ruby-2.x/integer.rb +0 -197
- data/lib/types/core-ruby-2.x/io.rb +0 -103
- data/lib/types/core-ruby-2.x/kernel.rb +0 -90
- data/lib/types/core-ruby-2.x/marshal.rb +0 -5
- data/lib/types/core-ruby-2.x/matchdata.rb +0 -26
- data/lib/types/core-ruby-2.x/math.rb +0 -53
- data/lib/types/core-ruby-2.x/module.rb +0 -83
- data/lib/types/core-ruby-2.x/nil.rb +0 -12
- data/lib/types/core-ruby-2.x/numeric.rb +0 -56
- data/lib/types/core-ruby-2.x/object.rb +0 -75
- data/lib/types/core-ruby-2.x/pathname.rb +0 -106
- data/lib/types/core-ruby-2.x/proc.rb +0 -16
- data/lib/types/core-ruby-2.x/process.rb +0 -127
- data/lib/types/core-ruby-2.x/random.rb +0 -17
- data/lib/types/core-ruby-2.x/range.rb +0 -39
- data/lib/types/core-ruby-2.x/rational.rb +0 -209
- data/lib/types/core-ruby-2.x/regexp.rb +0 -30
- data/lib/types/core-ruby-2.x/set.rb +0 -58
- data/lib/types/core-ruby-2.x/string.rb +0 -143
- data/lib/types/core-ruby-2.x/strscan.rb +0 -7
- data/lib/types/core-ruby-2.x/symbol.rb +0 -29
- data/lib/types/core-ruby-2.x/time.rb +0 -68
- data/lib/types/core-ruby-2.x/uri.rb +0 -20
- data/lib/types/core-ruby-2.x/yaml.rb +0 -5
- data/lib/types/rails-5.x/_helpers.rb +0 -52
- data/lib/types/rails-5.x/action_controller/mime_responds.rb +0 -11
- data/lib/types/rails-5.x/action_dispatch/routing.rb +0 -10
- data/lib/types/rails-5.x/active_model/errors.rb +0 -15
- data/lib/types/rails-5.x/active_model/validations.rb +0 -5
- data/lib/types/rails-5.x/active_record/associations.rb +0 -190
- data/lib/types/rails-5.x/active_record/core.rb +0 -3
- data/lib/types/rails-5.x/active_record/model_schema.rb +0 -39
- data/lib/types/rails-5.x/fixnum.rb +0 -3
@@ -1,83 +0,0 @@
|
|
1
|
-
class Module
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
type 'self.constants', '() -> Array<Fixnum>' # also constants(inherited), but undocumented
|
5
|
-
type 'self.nesting', '() -> Array<Module>'
|
6
|
-
type 'self.new', '() -> Module'
|
7
|
-
type 'self.new', '() { (Module) -> %any } -> Module'
|
8
|
-
|
9
|
-
type :<, '(Module other) -> %bool or nil'
|
10
|
-
type :<=, '(Module other) -> %bool or nil'
|
11
|
-
type :<=>, '(Module other) -> -1 or 0 or 1 or nil'
|
12
|
-
type :==, '(%any other) -> %bool'
|
13
|
-
type :equal, '(%any other) -> %bool'
|
14
|
-
type :eql, '(%any other) -> %bool'
|
15
|
-
type :===, '(%any other) -> %bool'
|
16
|
-
type :>, '(Module other) -> %bool or nil'
|
17
|
-
type :>=, '(Module other) -> %bool or nil'
|
18
|
-
type :ancestors, '() -> Array<Module>'
|
19
|
-
type :autoload, '(Symbol module, String filename) -> nil'
|
20
|
-
type :autoload?, '(Symbol name) -> String or nil'
|
21
|
-
type :class_eval, '(String, ?String filename, ?Fixnum lineno) -> %any'
|
22
|
-
type :class_exec, '(*%any args) { (*%any args) -> %any } -> %any'
|
23
|
-
type :class_variable_defined?, '(Symbol or String) -> %bool'
|
24
|
-
type :class_variable_get, '(Symbol or String) -> %any'
|
25
|
-
type :class_variable_set, '(Symbol or String, %any) -> %any'
|
26
|
-
type :class_variables, '(?%bool inherit) -> Array<Symbol>'
|
27
|
-
type :const_defined?, '(Symbol or String, ?%bool inherit) -> %bool'
|
28
|
-
type :const_get, '(Symbol or String, ?%bool inherit) -> %any'
|
29
|
-
type :const_missing, '(Symbol) -> %any'
|
30
|
-
type :const_set, '(Symbol or String, %any) -> %any'
|
31
|
-
type :constants, '(?%bool inherit) -> Array<Symbol>'
|
32
|
-
type :freeze, '() -> self'
|
33
|
-
type :include, '(*Module) -> self'
|
34
|
-
type :include?, '(Module) -> %bool'
|
35
|
-
type :included_modules, '() -> Array<Module>'
|
36
|
-
rdl_alias :inspect, :to_s
|
37
|
-
type :instance_method, '(Symbol) -> UnboundMethod'
|
38
|
-
type :instance_methods, '(?%bool include_super) -> Array<Symbol>'
|
39
|
-
type :method_defined?, '(Symbol or String) -> %bool'
|
40
|
-
type :module_eval, '(String, ?String filename, ?Fixnum lineno) -> %any' # matches rdoc example but not type
|
41
|
-
type :module_exec, '(*%any args) { (*%any args) -> %any } -> %any'
|
42
|
-
type :name, '() -> String'
|
43
|
-
type :prepend, '(*Module) -> self'
|
44
|
-
type :private_class_method, '(*(Symbol or String)) -> self'
|
45
|
-
type :private_constant, '(*Symbol) -> self'
|
46
|
-
type :private_instance_methods, '(?%bool include_super) -> Array<Symbol>'
|
47
|
-
type :private_method_defined?, '(Symbol or String) -> %bool'
|
48
|
-
type :protected_instance_methods, '(?%bool include_super) -> Array<Symbol>'
|
49
|
-
type :protected_method_defined?, '(Symbol or String) -> %bool'
|
50
|
-
type :public_class_method, '(*(Symbol or String)) -> self'
|
51
|
-
type :public_constant, '(*Symbol) -> self'
|
52
|
-
type :public_instance_method, '(Symbol) -> UnboundMethod'
|
53
|
-
type :public_instance_methods, '(?%bool include_super) -> Array<Symbol>'
|
54
|
-
type :public_method_defined?, '(Symbol or String) -> %bool'
|
55
|
-
type :remove_class_variable, '(Symbol) -> %any'
|
56
|
-
type :singleton_class?, '() -> %bool'
|
57
|
-
type :to_s, '() -> String'
|
58
|
-
# private methods below here
|
59
|
-
type :alias_method, '(Symbol new_name, Symbol old_name) -> self'
|
60
|
-
type :append_features, '(Module) -> self'
|
61
|
-
rdl_alias :attr, :attr_reader
|
62
|
-
type :attr_accessor, '(*(Symbol or String)) -> nil'
|
63
|
-
type :attr_reader, '(*(Symbol or String)) -> nil'
|
64
|
-
type :attr_writer, '(*(Symbol or String)) -> nil'
|
65
|
-
type :define_method, '(Symbol, Method) -> Symbol'
|
66
|
-
type :define_method, '(Symbol) { (*%any) -> %any } -> Symbol'
|
67
|
-
type :extend_object, '(%any) -> %any'
|
68
|
-
type :extended, '(Module othermod) -> %any'
|
69
|
-
type :included, '(Module othermod) -> %any'
|
70
|
-
type :method_added, '(Symbol method_name) -> %any'
|
71
|
-
type :method_removed, '(Symbol method_name) -> %any'
|
72
|
-
type :module_function, '(*(Symbol or String)) -> self'
|
73
|
-
type :prepend_features, '(Module) -> self'
|
74
|
-
type :prepended, '(Module othermod) -> %any'
|
75
|
-
type :private, '(*(Symbol or String)) -> self'
|
76
|
-
type :protected, '(*(Symbol or String)) -> self'
|
77
|
-
type :public, '(*(Symbol or String)) -> self'
|
78
|
-
type :refine, '(Class) { (%any) -> %any } -> self' # ??
|
79
|
-
type :remove_const, '(Symbol) -> %any'
|
80
|
-
type :remove_method, '(Symbol or String) -> self'
|
81
|
-
type :undef_method, '(Symbol or String) -> self'
|
82
|
-
type :using, '(Module) -> self'
|
83
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class NilClass
|
2
|
-
rdl_nowrap
|
3
|
-
type :&, '(%any obj) -> false'
|
4
|
-
type :'^', '(%any obj) -> %bool'
|
5
|
-
type :|, '(%any obj) -> %bool'
|
6
|
-
type :rationalize, '() -> Rational'
|
7
|
-
type :to_a, '() -> []'
|
8
|
-
type :to_c, '() -> Complex'
|
9
|
-
type :to_f, '() -> 0.0'
|
10
|
-
type :to_h, '() -> {}'
|
11
|
-
type :to_r, '() -> Rational'
|
12
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
class Numeric
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
type :%, '(%numeric) -> %numeric'
|
5
|
-
pre(:%) { |x| x!=0}
|
6
|
-
type :+, '(%numeric) -> %numeric'
|
7
|
-
type :-, '() -> %numeric'
|
8
|
-
type :<=>, '(%numeric) -> Object'
|
9
|
-
post(:<=>) { |r,x| r == -1 || r==0 || r==1 || r==nil}
|
10
|
-
type :abs, '() -> %numeric'
|
11
|
-
post(:abs) { |r,x| r >= 0 }
|
12
|
-
type :abs2, '() -> %numeric'
|
13
|
-
post(:abs2) { |r,x| r >= 0 }
|
14
|
-
type :angle, '() -> %numeric'
|
15
|
-
type :arg, '() -> %numeric'
|
16
|
-
type :ceil, '() -> %integer'
|
17
|
-
type :coerce, '(%numeric) -> [%numeric, %numeric]'
|
18
|
-
type :conj, '() -> %numeric'
|
19
|
-
type :conjugate, '() -> %numeric'
|
20
|
-
type :denominator, '() -> %integer'
|
21
|
-
post(:denominator) { |r,x| r >= 0 }
|
22
|
-
type :div, '(%numeric) -> %integer'
|
23
|
-
pre(:div) { |x| x!=0}
|
24
|
-
type :divmod, '(%numeric) -> [%numeric, %numeric]'
|
25
|
-
pre(:divmod) { |x| x!=0 }
|
26
|
-
type :eql?, '(%numeric) -> %bool'
|
27
|
-
type :fdiv, '(%numeric) -> %numeric'
|
28
|
-
type :floor, '() -> %integer'
|
29
|
-
type :i, '() -> Complex'
|
30
|
-
type :imag, '() -> %numeric'
|
31
|
-
type :imaginary, '() -> %numeric'
|
32
|
-
type :integer?, '() -> %bool'
|
33
|
-
type :magnitude, '() -> %numeric'
|
34
|
-
type :modulo, '(%numeric) -> %real'
|
35
|
-
pre(:modulo) { |x| x!=0 }
|
36
|
-
type :nonzero?, '() -> self or nil'
|
37
|
-
type :numerator, '() -> %integer'
|
38
|
-
type :phase, '() -> %numeric'
|
39
|
-
type :polar, '() -> [%numeric, %numeric]'
|
40
|
-
type :quo, '(%numeric) -> %numeric'
|
41
|
-
type :real, '() -> %numeric'
|
42
|
-
type :real?, '() -> %numeric'
|
43
|
-
type :rect, '() -> [%numeric, %numeric]'
|
44
|
-
type :rectangular, '() -> [%numeric, %numeric]'
|
45
|
-
type :remainder, '(%numeric) -> %real'
|
46
|
-
type :round, '(%numeric) -> %numeric'
|
47
|
-
type :singleton_method_added, '(Symbol) -> TypeError'
|
48
|
-
type :step, '(%numeric) { (%numeric) -> %any } -> %numeric'
|
49
|
-
type :step, '(%numeric) -> Enumerator<%numeric>'
|
50
|
-
type :step, '(%numeric, %numeric) { (%numeric) -> %any } -> %numeric'
|
51
|
-
type :step, '(%numeric, %numeric) -> Enumerator<%numeric>'
|
52
|
-
type :to_c, '() -> Complex'
|
53
|
-
type :to_int, '() -> %integer'
|
54
|
-
type :truncate, '() -> %integer'
|
55
|
-
type :zero?, '() -> %bool'
|
56
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
class Object
|
2
|
-
# Instead of rdl_nowrap, mark individual methods as not being wrapped so
|
3
|
-
# we can wrap stuff defined by the user at the top level (since those
|
4
|
-
# methods are added to Object).
|
5
|
-
|
6
|
-
# type :ARGF, ARGF
|
7
|
-
# type :ARGV, 'Array<String>'
|
8
|
-
# type :DATA, 'File'
|
9
|
-
# type :ENV, ENV
|
10
|
-
# type :FALSE, '%false'
|
11
|
-
# type :NIL, 'nil'
|
12
|
-
# type :RUBY_COPYRIGHT, 'String'
|
13
|
-
# type :RUBY_DESCRIPTION, 'String'
|
14
|
-
# type :RUBY_ENGINE, 'String'
|
15
|
-
# type :RUBY_PATCHLEVEL, Fixnum
|
16
|
-
# type :RUBY_PLATFORM, 'String'
|
17
|
-
# type :RUBY_RELEASE_DATE, 'String'
|
18
|
-
# type :RUBY_REVISION, Fixnum
|
19
|
-
# type :RUBY_VERSION, 'String'
|
20
|
-
# type :STDERR, 'IO'
|
21
|
-
# type :STDIN, 'IO'
|
22
|
-
# type :STDOUT, 'IO'
|
23
|
-
# type :TOPLEVEL_BINDING, 'Binding'
|
24
|
-
# type :TRUE, '%true'
|
25
|
-
|
26
|
-
type :!~, '(%any other) -> %bool', wrap: false
|
27
|
-
type :<=>, '(%any other) -> Fixnum or nil', wrap: false
|
28
|
-
type :===, '(%any other) -> %bool', wrap: false
|
29
|
-
type :=~, '(%any other) -> nil', wrap: false
|
30
|
-
type :class, '() -> Class', wrap: false
|
31
|
-
type :clone, '() -> self', wrap: false
|
32
|
-
# type :define_singleton_method, '(XXXX : *XXXX)') # TODO
|
33
|
-
type :display, '(IO port) -> nil', wrap: false
|
34
|
-
type :dup, '() -> self an_object', wrap: false
|
35
|
-
type :enum_for, '(?Symbol method, *%any args) -> Enumerator<%any>', wrap: false
|
36
|
-
type :enum_for, '(?Symbol method, *%any args) { (*%any args) -> %any } -> Enumerator<%any>', wrap: false
|
37
|
-
type :eql?, '(%any other) -> %bool', wrap: false
|
38
|
-
# type :extend, '(XXXX : *XXXX)') # TODO
|
39
|
-
type :freeze, '() -> self', wrap: false
|
40
|
-
type :frozen?, '() -> %bool', wrap: false
|
41
|
-
type :hash, '() -> Fixnum', wrap: false
|
42
|
-
type :inspect, '() -> String', wrap: false
|
43
|
-
type :instance_of?, '(Class) -> %bool', wrap: false
|
44
|
-
type :instance_variable_defined?, '(Symbol or String) -> %bool', wrap: false
|
45
|
-
type :instance_variable_get, '(Symbol or String) -> %any', wrap: false
|
46
|
-
type :instance_variable_set, '(Symbol or String, %any) -> %any', wrap: false # returns 2nd argument
|
47
|
-
type :instance_variables, '() -> Array<Symbol>', wrap: false
|
48
|
-
type :is_a?, '(Class or Module) -> %bool', wrap: false
|
49
|
-
type :kind_of?, '(Class) -> %bool', wrap: false
|
50
|
-
type :method, '(Symbol) -> Method', wrap: false
|
51
|
-
type :methods, '(?%bool regular) -> Array<Symbol>', wrap: false
|
52
|
-
type :nil?, '() -> %bool', wrap: false
|
53
|
-
type :private_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
54
|
-
type :protected_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
55
|
-
type :public_method, '(Symbol) -> Method', wrap: false
|
56
|
-
type :public_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
57
|
-
type :public_send, '(Symbol or String, *%any args) -> %any', wrap: false
|
58
|
-
type :remove_instance_variable, '(Symbol) -> %any', wrap: false
|
59
|
-
# type :respond_to?, '(Symbol or String, ?%bool include_all) -> %bool'
|
60
|
-
type :send, '(Symbol or String, *%any args) -> %any', wrap: false # Can't wrap this, used outside wrap switch
|
61
|
-
type :singleton_class, '() -> Class', wrap: false
|
62
|
-
type :singleton_method, '(Symbol) -> Method', wrap: false
|
63
|
-
type :singleton_methods, '(?%bool all) -> Array<Symbol>', wrap: false
|
64
|
-
type :taint, '() -> self', wrap: false
|
65
|
-
type :tainted?, '() -> %bool', wrap: false
|
66
|
-
# type :tap, '()') # TODO
|
67
|
-
type :to_enum, '(?Symbol method, *%any args) -> Enumerator<%any>', wrap: false
|
68
|
-
type :to_enum, '(?Symbol method, *%any args) {(*%any args) -> %any} -> Enumerator<%any>', wrap: false
|
69
|
-
# TODO: above alias for enum_for?
|
70
|
-
type :to_s, '() -> String', wrap: false
|
71
|
-
type :trust, '() -> self', wrap: false
|
72
|
-
type :untaint, '() -> self', wrap: false
|
73
|
-
type :untrust, '() -> self', wrap: false
|
74
|
-
type :untrusted?, '() -> %bool', wrap: false
|
75
|
-
end
|
@@ -1,106 +0,0 @@
|
|
1
|
-
class Pathname
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
type 'self.getwd', '() -> Pathname'
|
5
|
-
type 'self.glob', '(String p1, ?String p2) -> Array<Pathname>'
|
6
|
-
type 'self.new', '(%string or Pathname p1) -> Pathname' # p1 can be String-like
|
7
|
-
rdl_alias 'self.pwd', 'self.getwd'
|
8
|
-
type :+, '(String or Pathname other) -> Pathname'
|
9
|
-
rdl_alias :/, :+
|
10
|
-
type :<=>, '(%any p1) -> -1 or 0 or 1 or nil'
|
11
|
-
type :==, '(%any p1) -> %bool'
|
12
|
-
type :===, '(%any p1) -> %bool'
|
13
|
-
type :absolute?, '() -> %bool'
|
14
|
-
type :ascend, '() { (Pathname) -> %any } -> %any'
|
15
|
-
type :atime, '() -> Time'
|
16
|
-
type :basename, '(?String p1) -> Pathname' # guessing about arg type
|
17
|
-
type :binread, '(?Fixnum length, ?Fixnum offset) -> String'
|
18
|
-
type :binwrite, '(String, ?Fixnum offset) -> Fixnum' # TODO open_args
|
19
|
-
type :birthtime, '() -> Time'
|
20
|
-
type :blockdev?, '() -> %bool'
|
21
|
-
type :chardev?, '() -> %bool'
|
22
|
-
type :children, '(%bool with_directory) -> Array<Pathname>'
|
23
|
-
type :chmod, '(Fixnum mode) -> Fixnum'
|
24
|
-
type :chown, '(Fixnum owner, Fixnum group) -> Fixnum'
|
25
|
-
type :cleanpath, '(?%bool consider_symlink) -> %any'
|
26
|
-
type :ctime, '() -> Time'
|
27
|
-
type :delete, '() -> %any'
|
28
|
-
type :descend, '() { (Pathname) -> %any } -> %any'
|
29
|
-
type :directory?, '() -> %bool'
|
30
|
-
type :dirname, '() -> Pathname'
|
31
|
-
type :each_child, '(%bool with_directory) { (Pathname) -> %any } -> %any'
|
32
|
-
type :each_entry, '() { (Pathname) -> %any } -> %any'
|
33
|
-
type :each_filename, '() { (String) -> %any } -> %any'
|
34
|
-
type :each_filename, '() -> Enumerator<String>'
|
35
|
-
type :each_line, '(?String sep, ?Fixnum limit) { (String) -> %any } -> %any' # TODO open_args
|
36
|
-
type :each_line, '(?String sep, ?Fixnum limit) -> Enumerator<String>'
|
37
|
-
type :entries, '() -> Array<Pathname>'
|
38
|
-
type :eql?, '(%any) -> %bool'
|
39
|
-
type :executable?, '() -> %bool'
|
40
|
-
type :executable_real?, '() -> %bool'
|
41
|
-
type :exist?, '() -> %bool'
|
42
|
-
type :expand_path, '(?(String or Pathname) p1) -> Pathname'
|
43
|
-
type :extname, '() -> String'
|
44
|
-
type :file?, '() -> %bool'
|
45
|
-
type :find, '(%bool ignore_error) { (Pathname) -> %any } -> %any'
|
46
|
-
type :find, '(%bool ignore_error) -> Enumerator<Pathname>'
|
47
|
-
type :fnmatch, '(String pattern, ?Fixnum flags) -> %bool'
|
48
|
-
type :freeze, '() -> self' # TODO return type?
|
49
|
-
type :ftype, '() -> String'
|
50
|
-
type :grpowned?, '() -> %bool'
|
51
|
-
type :join, '(*(String or Pathname) args) -> Pathname'
|
52
|
-
type :lchmod, '(Fixnum mode) -> Fixnum'
|
53
|
-
type :lchown, '(Fixnum owner, Fixnum group) -> Fixnum'
|
54
|
-
type :lstat, '() -> File::Stat'
|
55
|
-
type :make_link, '(String old) -> 0'
|
56
|
-
type :symlink, '(String old) -> 0'
|
57
|
-
type :mkdir, '(String p1) -> 0'
|
58
|
-
type :mkpath, '() -> %any' # TODO return?
|
59
|
-
type :mountpoint?, '() -> %bool'
|
60
|
-
type :mtime, '() -> Time'
|
61
|
-
type :open, '(?String mode, ?String perm, ?Fixnum opt) -> File'
|
62
|
-
type :open, '(?String mode, ?String perm, ?Fixnum opt) { (File) -> t } -> t'
|
63
|
-
type :opendir, '(?Encoding) -> Dir'
|
64
|
-
type :opendir, '(?Encoding) { (Dir) -> u } -> u'
|
65
|
-
type :owned?, '() -> %bool'
|
66
|
-
type :parent, '() -> Pathname'
|
67
|
-
type :pipe?, '() -> %bool'
|
68
|
-
type :read, '(?Fixnum length, ?Fixnum offset, ?Fixnum open_args) -> String'
|
69
|
-
type :readable?, '() -> %bool'
|
70
|
-
type :readable_real, '() -> %bool'
|
71
|
-
type :readlines, '(?String sep, ?Fixnum limit, ?Fixnum open_args) -> Array<String>'
|
72
|
-
type :readlink, '() -> String file'
|
73
|
-
type :realdirpath, '(?String p1) -> String'
|
74
|
-
type :realpath, '(?String p1) -> String'
|
75
|
-
type :relative?, '() -> %bool'
|
76
|
-
type :relative_path_from, '(String or Pathname base_directory) -> Pathname'
|
77
|
-
type :rename, '(String p1) -> 0'
|
78
|
-
type :rmdir, '() -> 0'
|
79
|
-
type :rmtree, '() -> 0'
|
80
|
-
type :root?, '() -> %bool'
|
81
|
-
type :setgid?, '() -> %bool'
|
82
|
-
type :setuid?, '() -> %bool'
|
83
|
-
type :size, '() -> Fixnum'
|
84
|
-
type :size?, '() -> %bool'
|
85
|
-
type :socket?, '() -> %bool'
|
86
|
-
type :split, '() -> [Pathname, Pathname]'
|
87
|
-
type :stat, '() -> File::Stat'
|
88
|
-
type :sticky?, '() -> %bool'
|
89
|
-
type :sub, '(*String args) -> Pathname'
|
90
|
-
type :sub_ext, '(String p1) -> Pathname'
|
91
|
-
type :symlink?, '() -> %bool'
|
92
|
-
type :sysopen, '(?Fixnum mode, ?Fixnum perm) -> Fixnum'
|
93
|
-
type :taint, '() -> self'
|
94
|
-
type :to_path, '() -> String'
|
95
|
-
rdl_alias :to_s, :to_path
|
96
|
-
type :truncate, '(Fixnum length) -> 0'
|
97
|
-
type :unlink, '() -> Fixnum'
|
98
|
-
type :untaint, '() -> self'
|
99
|
-
type :utime, '(Time atime, Time mtime) -> Fixnum'
|
100
|
-
type :world_readable?, '() -> %bool'
|
101
|
-
type :world_writable?, '() -> %bool'
|
102
|
-
type :writable?, '() -> %bool'
|
103
|
-
type :writable_real?, '() -> %bool'
|
104
|
-
type :write, '(String, ?Fixnum offset, ?Fixnum open_args) -> Fixnum'
|
105
|
-
type :zero?, '() -> %bool'
|
106
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class Proc
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
type :arity, '() -> %integer'
|
5
|
-
type :binding, '() -> Binding'
|
6
|
-
type :curry, '(?%integer arity) -> Proc'
|
7
|
-
type :hash, '() -> %integer'
|
8
|
-
rdl_alias :inspect, :to_s
|
9
|
-
type :lambda, '() -> %bool'
|
10
|
-
type :parameters, '() -> Array<[Symbol, Symbol]>'
|
11
|
-
type :source_location, '() -> [String, %integer]'
|
12
|
-
type :to_proc, '() -> self'
|
13
|
-
type :to_s, '() -> String'
|
14
|
-
|
15
|
-
|
16
|
-
end
|
@@ -1,127 +0,0 @@
|
|
1
|
-
module Process
|
2
|
-
rdl_nowrap
|
3
|
-
|
4
|
-
type 'self.abort', '(?String msg) -> %any'
|
5
|
-
type 'self.argv0', '() -> String frozen_string'
|
6
|
-
type 'self.clock_getres', '(Symbol or Fixnum clock_id, ?Symbol unit) -> Float or Integer'
|
7
|
-
type 'self.clock_gettime', '(Symbol or Fixnum clock_id, ?Symbol unit) -> Float or Integer'
|
8
|
-
type 'self.daemon', '(?%any nochdir, ?%any noclose) -> 0'
|
9
|
-
type 'self.detach', '(Fixnum pid) -> Thread'
|
10
|
-
type 'self.egid', '() -> Fixnum'
|
11
|
-
type 'self.egid=', '(Fixnum) -> Fixnum'
|
12
|
-
type 'self.euid', '() -> Fixnum'
|
13
|
-
type 'self.euid=', '(Fixnum) -> Fixnum user'
|
14
|
-
# type 'self.exec', '(env: ?Hash<String, String>, command:String, args:*String) -> %any' # TODO: env
|
15
|
-
type 'self.exit', '(?Fixnum status) -> %any'
|
16
|
-
type 'self.exit!', '(?Fixnum status) -> %any'
|
17
|
-
type 'self.fork', '() -> Fixnum or nil'
|
18
|
-
type 'self.fork', '() { () -> %any } -> Fixnum or nil'
|
19
|
-
type 'self.getpgid', '(Fixnum pid) -> Fixnum'
|
20
|
-
type 'self.getpgrp', '() -> Fixnum'
|
21
|
-
type 'self.getpriority', '(Fixnum kind, Fixnum) -> Fixnum'
|
22
|
-
type 'self.getrlimit', '(Symbol or String or Fixnum resource) -> [Fixnum, Fixnum] cur_max_limit'
|
23
|
-
type 'self.getsid', '(?Fixnum pid) -> Integer'
|
24
|
-
type 'self.gid', '() -> Fixnum'
|
25
|
-
type 'self.gid=', '(Fixnum) -> Fixnum'
|
26
|
-
type 'self.groups', '() -> Array<Fixnum>'
|
27
|
-
type 'self.groups=', '(Array<Fixnum>) -> Array<Fixnum>'
|
28
|
-
type 'self.initgroups', '(String username, Fixnum gid) -> Array<Fixnum>'
|
29
|
-
type 'self.kill', '(Fixnum or Symbol or String signal, *Fixnum pids) -> Fixnum'
|
30
|
-
type 'self.maxgroups', '() -> Fixnum'
|
31
|
-
type 'self.maxgroups=', '(Fixnum) -> Fixnum'
|
32
|
-
type 'self.pid', '() -> Fixnum'
|
33
|
-
type 'self.ppid', '() -> Fixnum'
|
34
|
-
type 'self.pgid', '(Fixnum pid, Fixnum) -> Fixnum'
|
35
|
-
type 'self.setpriority', '(Fixnum kind, Fixnum, Fixnum priority) -> 0'
|
36
|
-
type 'self.setproctitle', '(String) -> String'
|
37
|
-
type 'self.setrlimit', '(Symbol or String or Fixnum resource, Fixnum cur_limit, ?Fixnum max_limit) -> nil'
|
38
|
-
type 'self.setsid', '() -> Fixnum'
|
39
|
-
# type 'self.spawn', '(?Hash<String, String> env, String command, *String args) -> %any' # TODO: env
|
40
|
-
type 'self.times', '() -> Process::Tms'
|
41
|
-
type 'self.uid', '() -> Fixnum'
|
42
|
-
type 'self.uid=', '(Fixnum user) -> Fixnum'
|
43
|
-
type 'self.wait', '(?Fixnum pid, ?Fixnum flags) -> Fixnum'
|
44
|
-
type 'self.wait2', '(?Fixnum pid, ?Fixnum flags) -> [Fixnum, Fixnum] pid_and_status'
|
45
|
-
type 'self.waitall', '() -> Array<[Fixnum, Fixnum]>'
|
46
|
-
type 'self.waitpid', '(?Fixnum pid, ?Fixnum flags) -> Fixnum'
|
47
|
-
type 'self.waitpid2', '(?Fixnum pid, ?Fixnum flags) -> [Fixnum, Fixnum] pid_and_status'
|
48
|
-
|
49
|
-
module GID
|
50
|
-
rdl_nowrap
|
51
|
-
|
52
|
-
type 'self.change_privilege', '(Fixnum group) -> Fixnum'
|
53
|
-
type 'self.eid', '() -> Fixnum'
|
54
|
-
type 'self.from_name', '(String name) -> Fixnum gid'
|
55
|
-
type 'self.grant_privilege', '(Fixnum group) -> Fixnum'
|
56
|
-
rdl_alias 'self.eid=', 'self.grant_privilege'
|
57
|
-
type 'self.re_exchange', '() -> Fixnum'
|
58
|
-
type 'self.re_exchangeable?', '() -> %bool'
|
59
|
-
type 'self.rid', '() -> Fixnum'
|
60
|
-
type 'self.sid_available?', '() -> %bool'
|
61
|
-
type 'self.switch', '() -> Fixnum'
|
62
|
-
type 'self.switch', '() { () -> t } -> t'
|
63
|
-
end
|
64
|
-
|
65
|
-
module UID
|
66
|
-
rdl_nowrap
|
67
|
-
|
68
|
-
type 'self.change_privilege', '(Fixnum user) -> Fixnum'
|
69
|
-
type 'self.eid', '() -> Fixnum'
|
70
|
-
type 'self.from_name', '(String name) -> Fixnum uid'
|
71
|
-
type 'self.grant_privilege', '(Fixnum user) -> Fixnum'
|
72
|
-
rdl_alias 'self.eid=', 'self.grant_privilege'
|
73
|
-
type 'self.re_exchange', '() -> Fixnum'
|
74
|
-
type 'self.re_exchangeable?', '() -> %bool'
|
75
|
-
type 'self.rid', '() -> Fixnum'
|
76
|
-
type 'self.sid_available?', '() -> %bool'
|
77
|
-
type 'self.switch', '() -> Fixnum'
|
78
|
-
type 'self.switch', '() { () -> t } -> t'
|
79
|
-
end
|
80
|
-
|
81
|
-
class Status
|
82
|
-
rdl_nowrap
|
83
|
-
|
84
|
-
type :&, '(Fixnum num) -> Fixnum'
|
85
|
-
type :==, '(%any other) -> %bool'
|
86
|
-
type :>>, '(Fixnum num) -> Fixnum'
|
87
|
-
type :coredump?, '() -> %bool'
|
88
|
-
type :exited?, '() -> %bool'
|
89
|
-
type :exitstatus, '() -> Fixnum or nil'
|
90
|
-
type :inspect, '() -> String'
|
91
|
-
type :pid, '() -> Fixnum'
|
92
|
-
type :signaled?, '() -> %bool'
|
93
|
-
type :stopped?, '() -> %bool'
|
94
|
-
type :stopsig, '() -> Fixnum or nil'
|
95
|
-
type :success?, '() -> %bool'
|
96
|
-
type :termsig, '() -> Fixnum or nil'
|
97
|
-
type :to_i, '() -> Fixnum'
|
98
|
-
rdl_alias :to_int, :to_i
|
99
|
-
type :to_s, '() -> String'
|
100
|
-
end
|
101
|
-
|
102
|
-
module Sys
|
103
|
-
rdl_nowrap
|
104
|
-
|
105
|
-
type 'self.geteid', '() -> Fixnum'
|
106
|
-
type 'self.geteuid', '() -> Fixnum'
|
107
|
-
type 'self.getgid', '() -> Fixnum'
|
108
|
-
type 'self.getuid', '() -> Fixnum'
|
109
|
-
type 'self.issetugid', '() -> %bool'
|
110
|
-
type 'self.setegid', '(Fixnum group) -> nil'
|
111
|
-
type 'self.seteuid', '(Fixnum user) -> nil'
|
112
|
-
type 'self.setgid', '(Fixnum group) -> nil'
|
113
|
-
type 'self.setregid', '(Fixnum rid, Fixnum eid) -> nil'
|
114
|
-
type 'self.setresgid', '(Fixnum rid, Fixnum eid, Fixnum sid) -> nil'
|
115
|
-
type 'self.setresuid', '(Fixnum rid, Fixnum eid, Fixnum sid) -> nil'
|
116
|
-
type 'self.setreuid', '(Fixnum rid, Fixnum eid) -> nil'
|
117
|
-
type 'self.setrgid', '(Fixnum group) -> nil'
|
118
|
-
type 'self.setruid', '(Fixnum user) -> nil'
|
119
|
-
type 'self.setuid', '(Fixnum user) -> nil'
|
120
|
-
end
|
121
|
-
|
122
|
-
class Waiter
|
123
|
-
rdl_nowrap
|
124
|
-
|
125
|
-
type 'pid', '() -> Fixnum'
|
126
|
-
end
|
127
|
-
end
|