rdl 2.0.1 → 2.1.0

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