packwerk 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +29 -20
  3. data/.github/workflows/cla.yml +22 -0
  4. data/.rubocop.yml +48 -19
  5. data/Gemfile +7 -2
  6. data/Gemfile.lock +201 -175
  7. data/README.md +1 -1
  8. data/RESOLVING_VIOLATIONS.md +81 -0
  9. data/Rakefile +1 -1
  10. data/USAGE.md +14 -5
  11. data/bin/m +1 -1
  12. data/bin/rake +1 -1
  13. data/bin/rubocop +1 -1
  14. data/bin/srb +1 -1
  15. data/bin/tapioca +1 -1
  16. data/gemfiles/Gemfile-rails-6-0 +1 -1
  17. data/gemfiles/Gemfile-rails-6-1 +22 -0
  18. data/lib/packwerk/application_validator.rb +7 -6
  19. data/lib/packwerk/association_inspector.rb +17 -15
  20. data/lib/packwerk/cache.rb +36 -29
  21. data/lib/packwerk/cli.rb +5 -6
  22. data/lib/packwerk/const_node_inspector.rb +8 -7
  23. data/lib/packwerk/constant_name_inspector.rb +2 -2
  24. data/lib/packwerk/deprecated_references.rb +34 -19
  25. data/lib/packwerk/file_processor.rb +14 -14
  26. data/lib/packwerk/files_for_processing.rb +27 -31
  27. data/lib/packwerk/formatters/offenses_formatter.rb +3 -3
  28. data/lib/packwerk/formatters/progress_formatter.rb +2 -2
  29. data/lib/packwerk/node.rb +1 -294
  30. data/lib/packwerk/node_helpers.rb +335 -0
  31. data/lib/packwerk/node_processor.rb +6 -5
  32. data/lib/packwerk/node_processor_factory.rb +3 -3
  33. data/lib/packwerk/node_visitor.rb +1 -1
  34. data/lib/packwerk/offense_collection.rb +6 -3
  35. data/lib/packwerk/offenses_formatter.rb +2 -2
  36. data/lib/packwerk/package.rb +3 -0
  37. data/lib/packwerk/package_set.rb +2 -0
  38. data/lib/packwerk/parse_run.rb +15 -13
  39. data/lib/packwerk/parsed_constant_definitions.rb +23 -20
  40. data/lib/packwerk/parsers/erb.rb +3 -3
  41. data/lib/packwerk/reference_checking/checkers/checker.rb +16 -3
  42. data/lib/packwerk/reference_checking/checkers/dependency_checker.rb +16 -0
  43. data/lib/packwerk/reference_checking/checkers/privacy_checker.rb +18 -0
  44. data/lib/packwerk/reference_checking/reference_checker.rb +3 -1
  45. data/lib/packwerk/reference_extractor.rb +51 -48
  46. data/lib/packwerk/reference_offense.rb +3 -27
  47. data/lib/packwerk/run_context.rb +3 -3
  48. data/lib/packwerk/spring_command.rb +1 -1
  49. data/lib/packwerk/version.rb +1 -1
  50. data/lib/packwerk.rb +1 -0
  51. data/packwerk.gemspec +4 -12
  52. data/sorbet/rbi/gems/actioncable@7.0.3.1.rbi +2754 -0
  53. data/sorbet/rbi/gems/actionmailbox@7.0.3.1.rbi +1496 -0
  54. data/sorbet/rbi/gems/actionmailer@7.0.3.1.rbi +2362 -0
  55. data/sorbet/rbi/gems/actionpack@7.0.3.1.rbi +19397 -0
  56. data/sorbet/rbi/gems/actiontext@7.0.3.1.rbi +1569 -0
  57. data/sorbet/rbi/gems/actionview@7.0.3.1.rbi +14907 -0
  58. data/sorbet/rbi/gems/activejob@7.0.3.1.rbi +2553 -0
  59. data/sorbet/rbi/gems/activemodel@7.0.3.1.rbi +5999 -0
  60. data/sorbet/rbi/gems/activerecord@7.0.3.1.rbi +37832 -0
  61. data/sorbet/rbi/gems/activestorage@7.0.3.1.rbi +2321 -0
  62. data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +18818 -0
  63. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +11722 -0
  64. data/sorbet/rbi/gems/constant_resolver@0.2.0.rbi +90 -0
  65. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1079 -0
  66. data/sorbet/rbi/gems/digest@3.1.0.rbi +189 -0
  67. data/sorbet/rbi/gems/erubi@1.11.0.rbi +140 -0
  68. data/sorbet/rbi/gems/globalid@1.0.0.rbi +572 -0
  69. data/sorbet/rbi/gems/i18n@1.12.0.rbi +2296 -0
  70. data/sorbet/rbi/gems/json@2.6.2.rbi +1548 -0
  71. data/sorbet/rbi/gems/language_server-protocol@3.16.0.3.rbi +8 -0
  72. data/sorbet/rbi/gems/loofah@2.18.0.rbi +877 -0
  73. data/sorbet/rbi/gems/m@1.6.0.rbi +257 -0
  74. data/sorbet/rbi/gems/marcel@1.0.2.rbi +220 -0
  75. data/sorbet/rbi/gems/mini_mime@1.1.2.rbi +170 -0
  76. data/sorbet/rbi/gems/mini_portile2@2.8.0.rbi +8 -0
  77. data/sorbet/rbi/gems/minitest-focus@1.3.1.rbi +104 -0
  78. data/sorbet/rbi/gems/minitest@5.16.2.rbi +2136 -0
  79. data/sorbet/rbi/gems/mocha@1.14.0.rbi +4177 -0
  80. data/sorbet/rbi/gems/net-imap@0.2.3.rbi +2147 -0
  81. data/sorbet/rbi/gems/net-pop@0.1.1.rbi +926 -0
  82. data/sorbet/rbi/gems/net-protocol@0.1.3.rbi +11 -0
  83. data/sorbet/rbi/gems/net-smtp@0.3.1.rbi +1108 -0
  84. data/sorbet/rbi/gems/netrc@0.11.0.rbi +153 -0
  85. data/sorbet/rbi/gems/nio4r@2.5.8.rbi +292 -0
  86. data/sorbet/rbi/gems/nokogiri@1.13.8.rbi +6478 -0
  87. data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
  88. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +9029 -0
  89. data/sorbet/rbi/gems/prettier_print@0.1.0.rbi +8 -0
  90. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  91. data/sorbet/rbi/gems/racc@1.6.0.rbi +152 -0
  92. data/sorbet/rbi/gems/rack-test@2.0.2.rbi +953 -0
  93. data/sorbet/rbi/gems/rack@2.2.4.rbi +5636 -0
  94. data/sorbet/rbi/gems/rails-html-sanitizer@1.4.3.rbi +688 -0
  95. data/sorbet/rbi/gems/rails@7.0.3.1.rbi +8 -0
  96. data/sorbet/rbi/gems/railties@7.0.3.1.rbi +3507 -0
  97. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +392 -0
  98. data/sorbet/rbi/gems/rake@13.0.6.rbi +2924 -0
  99. data/sorbet/rbi/gems/rbi@0.0.15.rbi +3007 -0
  100. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +3383 -0
  101. data/sorbet/rbi/gems/rexml@3.2.5.rbi +4714 -0
  102. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +6961 -0
  103. data/sorbet/rbi/gems/rubocop-performance@1.14.3.rbi +2986 -0
  104. data/sorbet/rbi/gems/{rubocop-shopify@2.0.1.rbi → rubocop-shopify@2.9.0.rbi} +4 -4
  105. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +992 -0
  106. data/sorbet/rbi/gems/rubocop@1.34.1.rbi +51820 -0
  107. data/sorbet/rbi/gems/ruby-lsp@0.2.1.rbi +11 -0
  108. data/sorbet/rbi/gems/smart_properties@1.17.0.rbi +474 -0
  109. data/sorbet/rbi/gems/spoom@1.1.11.rbi +2181 -0
  110. data/sorbet/rbi/gems/spring@4.0.0.rbi +411 -0
  111. data/sorbet/rbi/gems/strscan@3.0.4.rbi +8 -0
  112. data/sorbet/rbi/gems/syntax_tree@3.3.0.rbi +8 -0
  113. data/sorbet/rbi/gems/tapioca@0.9.2.rbi +3181 -0
  114. data/sorbet/rbi/gems/thor@1.2.1.rbi +3956 -0
  115. data/sorbet/rbi/gems/timeout@0.3.0.rbi +142 -0
  116. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +5896 -0
  117. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +48 -0
  118. data/sorbet/rbi/gems/unparser@0.6.5.rbi +4529 -0
  119. data/sorbet/rbi/gems/webrick@1.7.0.rbi +2582 -0
  120. data/sorbet/rbi/gems/websocket-driver@0.7.5.rbi +993 -0
  121. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +388 -0
  122. data/sorbet/rbi/gems/yard@0.9.28.rbi +18242 -0
  123. data/sorbet/rbi/gems/zeitwerk@2.6.0.rbi +867 -0
  124. data/sorbet/rbi/shims/psych.rbi +5 -0
  125. data/sorbet/tapioca/require.rb +2 -3
  126. metadata +88 -157
  127. data/.github/probots.yml +0 -2
  128. data/library.yml +0 -6
  129. data/service.yml +0 -1
  130. data/sorbet/rbi/gems/actioncable@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -860
  131. data/sorbet/rbi/gems/actionmailbox@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -568
  132. data/sorbet/rbi/gems/actionmailer@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -587
  133. data/sorbet/rbi/gems/actionpack@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -5314
  134. data/sorbet/rbi/gems/actiontext@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -699
  135. data/sorbet/rbi/gems/actionview@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -2515
  136. data/sorbet/rbi/gems/activejob@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -624
  137. data/sorbet/rbi/gems/activemodel@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -1248
  138. data/sorbet/rbi/gems/activerecord@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8363
  139. data/sorbet/rbi/gems/activestorage@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -876
  140. data/sorbet/rbi/gems/activesupport@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -3987
  141. data/sorbet/rbi/gems/colorize@0.8.1.rbi +0 -40
  142. data/sorbet/rbi/gems/commander@4.5.2.rbi +0 -8
  143. data/sorbet/rbi/gems/concurrent-ruby@1.1.8.rbi +0 -1969
  144. data/sorbet/rbi/gems/constant_resolver@0.1.5.rbi +0 -26
  145. data/sorbet/rbi/gems/erubi@1.10.0.rbi +0 -41
  146. data/sorbet/rbi/gems/globalid@0.4.2.rbi +0 -178
  147. data/sorbet/rbi/gems/highline@2.0.3.rbi +0 -8
  148. data/sorbet/rbi/gems/i18n@1.8.10.rbi +0 -600
  149. data/sorbet/rbi/gems/loofah@2.9.0.rbi +0 -274
  150. data/sorbet/rbi/gems/m@1.5.1.rbi +0 -108
  151. data/sorbet/rbi/gems/marcel@1.0.0.rbi +0 -70
  152. data/sorbet/rbi/gems/mini_mime@1.0.3.rbi +0 -71
  153. data/sorbet/rbi/gems/minitest-focus@1.2.1.rbi +0 -8
  154. data/sorbet/rbi/gems/minitest@5.14.4.rbi +0 -544
  155. data/sorbet/rbi/gems/mocha@1.12.0.rbi +0 -953
  156. data/sorbet/rbi/gems/nio4r@2.5.7.rbi +0 -90
  157. data/sorbet/rbi/gems/nokogiri@1.11.2.rbi +0 -1647
  158. data/sorbet/rbi/gems/parallel@1.20.1.rbi +0 -117
  159. data/sorbet/rbi/gems/parlour@6.0.0.rbi +0 -1272
  160. data/sorbet/rbi/gems/parser@3.0.0.0.rbi +0 -1745
  161. data/sorbet/rbi/gems/pry@0.14.0.rbi +0 -8
  162. data/sorbet/rbi/gems/psych@3.3.2.rbi +0 -24
  163. data/sorbet/rbi/gems/racc@1.5.2.rbi +0 -57
  164. data/sorbet/rbi/gems/rack-test@1.1.0.rbi +0 -335
  165. data/sorbet/rbi/gems/rack@2.2.3.rbi +0 -1718
  166. data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +0 -213
  167. data/sorbet/rbi/gems/rails@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -8
  168. data/sorbet/rbi/gems/railties@7.0.0.alpha-d612542336d9a61381311c95a27d801bb4094779.rbi +0 -880
  169. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +0 -155
  170. data/sorbet/rbi/gems/rake@13.0.3.rbi +0 -837
  171. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +0 -8
  172. data/sorbet/rbi/gems/rexml@3.2.4.rbi +0 -8
  173. data/sorbet/rbi/gems/rubocop-ast@1.4.1.rbi +0 -8
  174. data/sorbet/rbi/gems/rubocop-performance@1.10.2.rbi +0 -8
  175. data/sorbet/rbi/gems/rubocop-sorbet@0.6.1.rbi +0 -8
  176. data/sorbet/rbi/gems/rubocop@1.12.0.rbi +0 -8
  177. data/sorbet/rbi/gems/smart_properties@1.15.0.rbi +0 -168
  178. data/sorbet/rbi/gems/spoom@1.1.0.rbi +0 -1061
  179. data/sorbet/rbi/gems/spring@2.1.1.rbi +0 -160
  180. data/sorbet/rbi/gems/sprockets-rails@3.2.2.rbi +0 -451
  181. data/sorbet/rbi/gems/sprockets@4.0.2.rbi +0 -1133
  182. data/sorbet/rbi/gems/tapioca@0.4.19.rbi +0 -603
  183. data/sorbet/rbi/gems/thor@1.1.0.rbi +0 -893
  184. data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +0 -566
  185. data/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi +0 -8
  186. data/sorbet/rbi/gems/websocket-driver@0.7.3.rbi +0 -438
  187. data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +0 -177
@@ -0,0 +1,153 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `netrc` gem.
5
+ # Please instead update this file by running `bin/tapioca gem netrc`.
6
+
7
+ # source://netrc-0.11.0/lib/netrc.rb:3
8
+ class Netrc
9
+ # @return [Netrc] a new instance of Netrc
10
+ #
11
+ # source://netrc-0.11.0/lib/netrc.rb:166
12
+ def initialize(path, data); end
13
+
14
+ # source://netrc-0.11.0/lib/netrc.rb:180
15
+ def [](k); end
16
+
17
+ # source://netrc-0.11.0/lib/netrc.rb:188
18
+ def []=(k, info); end
19
+
20
+ # source://netrc-0.11.0/lib/netrc.rb:200
21
+ def delete(key); end
22
+
23
+ # source://netrc-0.11.0/lib/netrc.rb:211
24
+ def each(&block); end
25
+
26
+ # source://netrc-0.11.0/lib/netrc.rb:196
27
+ def length; end
28
+
29
+ # source://netrc-0.11.0/lib/netrc.rb:215
30
+ def new_item(m, l, p); end
31
+
32
+ # Returns the value of attribute new_item_prefix.
33
+ #
34
+ # source://netrc-0.11.0/lib/netrc.rb:178
35
+ def new_item_prefix; end
36
+
37
+ # Sets the attribute new_item_prefix
38
+ #
39
+ # @param value the value to set the attribute new_item_prefix to.
40
+ #
41
+ # source://netrc-0.11.0/lib/netrc.rb:178
42
+ def new_item_prefix=(_arg0); end
43
+
44
+ # source://netrc-0.11.0/lib/netrc.rb:219
45
+ def save; end
46
+
47
+ # source://netrc-0.11.0/lib/netrc.rb:233
48
+ def unparse; end
49
+
50
+ class << self
51
+ # source://netrc-0.11.0/lib/netrc.rb:42
52
+ def check_permissions(path); end
53
+
54
+ # source://netrc-0.11.0/lib/netrc.rb:33
55
+ def config; end
56
+
57
+ # @yield [self.config]
58
+ #
59
+ # source://netrc-0.11.0/lib/netrc.rb:37
60
+ def configure; end
61
+
62
+ # source://netrc-0.11.0/lib/netrc.rb:10
63
+ def default_path; end
64
+
65
+ # source://netrc-0.11.0/lib/netrc.rb:14
66
+ def home_path; end
67
+
68
+ # source://netrc-0.11.0/lib/netrc.rb:85
69
+ def lex(lines); end
70
+
71
+ # source://netrc-0.11.0/lib/netrc.rb:29
72
+ def netrc_filename; end
73
+
74
+ # Returns two values, a header and a list of items.
75
+ # Each item is a tuple, containing some or all of:
76
+ # - machine keyword (including trailing whitespace+comments)
77
+ # - machine name
78
+ # - login keyword (including surrounding whitespace+comments)
79
+ # - login
80
+ # - password keyword (including surrounding whitespace+comments)
81
+ # - password
82
+ # - trailing chars
83
+ # This lets us change individual fields, then write out the file
84
+ # with all its original formatting.
85
+ #
86
+ # source://netrc-0.11.0/lib/netrc.rb:129
87
+ def parse(ts); end
88
+
89
+ # Reads path and parses it as a .netrc file. If path doesn't
90
+ # exist, returns an empty object. Decrypt paths ending in .gpg.
91
+ #
92
+ # source://netrc-0.11.0/lib/netrc.rb:51
93
+ def read(path = T.unsafe(nil)); end
94
+
95
+ # @return [Boolean]
96
+ #
97
+ # source://netrc-0.11.0/lib/netrc.rb:112
98
+ def skip?(s); end
99
+ end
100
+ end
101
+
102
+ # source://netrc-0.11.0/lib/netrc.rb:244
103
+ class Netrc::Entry < ::Struct
104
+ # Returns the value of attribute login
105
+ #
106
+ # @return [Object] the current value of login
107
+ def login; end
108
+
109
+ # Sets the attribute login
110
+ #
111
+ # @param value [Object] the value to set the attribute login to.
112
+ # @return [Object] the newly set value
113
+ #
114
+ # source://netrc-0.11.0/lib/netrc.rb:244
115
+ def login=(_); end
116
+
117
+ # Returns the value of attribute password
118
+ #
119
+ # @return [Object] the current value of password
120
+ def password; end
121
+
122
+ # Sets the attribute password
123
+ #
124
+ # @param value [Object] the value to set the attribute password to.
125
+ # @return [Object] the newly set value
126
+ #
127
+ # source://netrc-0.11.0/lib/netrc.rb:244
128
+ def password=(_); end
129
+
130
+ def to_ary; end
131
+
132
+ class << self
133
+ def [](*_arg0); end
134
+ def inspect; end
135
+ def members; end
136
+ def new(*_arg0); end
137
+ end
138
+ end
139
+
140
+ # source://netrc-0.11.0/lib/netrc.rb:250
141
+ class Netrc::Error < ::StandardError; end
142
+
143
+ # source://netrc-0.11.0/lib/netrc.rb:68
144
+ class Netrc::TokenArray < ::Array
145
+ # source://netrc-0.11.0/lib/netrc.rb:76
146
+ def readto; end
147
+
148
+ # source://netrc-0.11.0/lib/netrc.rb:69
149
+ def take; end
150
+ end
151
+
152
+ # source://netrc-0.11.0/lib/netrc.rb:4
153
+ Netrc::VERSION = T.let(T.unsafe(nil), String)
@@ -0,0 +1,292 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `nio4r` gem.
5
+ # Please instead update this file by running `bin/tapioca gem nio4r`.
6
+
7
+ # New I/O for Ruby
8
+ #
9
+ # source://nio4r-2.5.8/lib/nio/version.rb:3
10
+ module NIO
11
+ class << self
12
+ # NIO implementation, one of the following (as a string):
13
+ # * select: in pure Ruby using Kernel.select
14
+ # * libev: as a C extension using libev
15
+ # * java: using Java NIO
16
+ #
17
+ # source://nio4r-2.5.8/lib/nio.rb:12
18
+ def engine; end
19
+
20
+ # @return [Boolean]
21
+ #
22
+ # source://nio4r-2.5.8/lib/nio.rb:16
23
+ def pure?(env = T.unsafe(nil)); end
24
+ end
25
+ end
26
+
27
+ # Efficient byte buffers for performant I/O operations
28
+ class NIO::ByteBuffer
29
+ include ::Enumerable
30
+
31
+ # Create a new ByteBuffer, either with a specified capacity or populating
32
+ # it from a given string
33
+ #
34
+ # @param capacity [Integer] size of buffer in bytes
35
+ # @raise [TypeError]
36
+ # @return [NIO::ByteBuffer]
37
+ def initialize(_arg0); end
38
+
39
+ # Add a String to the buffer
40
+ #
41
+ # @param str [#to_str] data to add to the buffer
42
+ # @raise [TypeError] given a non-string type
43
+ # @raise [NIO::ByteBuffer::OverflowError] buffer is full
44
+ # @return [self]
45
+ def <<(_arg0); end
46
+
47
+ # Obtain the byte at a given index in the buffer as an Integer
48
+ #
49
+ # @raise [ArgumentError] index is invalid (either negative or larger than limit)
50
+ # @return [Integer] byte at the given index
51
+ def [](_arg0); end
52
+
53
+ # Returns the value of attribute capacity.
54
+ def capacity; end
55
+
56
+ # Clear the buffer, resetting it to the default state
57
+ def clear; end
58
+
59
+ # Move data between the position and limit to the beginning of the buffer
60
+ # Sets the position to the end of the moved data, and the limit to the capacity
61
+ def compact; end
62
+
63
+ # Iterate over the bytes in the buffer (as Integers)
64
+ #
65
+ # @return [self]
66
+ def each; end
67
+
68
+ # Set the buffer's current position as the limit and set the position to 0
69
+ def flip; end
70
+
71
+ # Does the ByteBuffer have any space remaining?
72
+ #
73
+ # @return [true, false]
74
+ def full?; end
75
+
76
+ # Obtain the requested number of bytes from the buffer, advancing the position.
77
+ # If no length is given, all remaining bytes are consumed.
78
+ #
79
+ # @raise [NIO::ByteBuffer::UnderflowError] not enough data remaining in buffer
80
+ # @return [String] bytes read from buffer
81
+ def get(*_arg0); end
82
+
83
+ # Inspect the state of the buffer
84
+ #
85
+ # @return [String] string describing the state of the buffer
86
+ def inspect; end
87
+
88
+ # Returns the value of attribute limit.
89
+ def limit; end
90
+
91
+ # Set the limit to the given value. New limit must be less than capacity.
92
+ # Preserves limit and mark if they're less than the new limit, otherwise
93
+ # sets position to the new limit and clears the mark.
94
+ #
95
+ # @param new_limit [Integer] position in the buffer
96
+ # @raise [ArgumentError] new limit was invalid
97
+ def limit=(_arg0); end
98
+
99
+ # Mark a position to return to using the `#reset` method
100
+ def mark; end
101
+
102
+ # Returns the value of attribute position.
103
+ def position; end
104
+
105
+ # Set the position to the given value. New position must be less than limit.
106
+ # Preserves mark if it's less than the new position, otherwise clears it.
107
+ #
108
+ # @param new_position [Integer] position in the buffer
109
+ # @raise [ArgumentError] new position was invalid
110
+ def position=(_arg0); end
111
+
112
+ # Perform a non-blocking read from the given IO object into the buffer
113
+ # Reads as much data as is immediately available and returns
114
+ #
115
+ # @param Ruby [IO] IO object to read from
116
+ # @raise [OverflowError]
117
+ # @return [Integer] number of bytes read (0 if none were available)
118
+ def read_from(_arg0); end
119
+
120
+ # Number of bytes remaining in the buffer before the limit
121
+ #
122
+ # @return [Integer] number of bytes remaining
123
+ def remaining; end
124
+
125
+ # Reset position to the previously marked location
126
+ #
127
+ # @raise [NIO::ByteBuffer::MarkUnsetError] mark has not been set (call `#mark` first)
128
+ def reset; end
129
+
130
+ # Set the buffer's current position to 0, leaving the limit unchanged
131
+ def rewind; end
132
+
133
+ def size; end
134
+
135
+ # Perform a non-blocking write of the buffer's contents to the given I/O object
136
+ # Writes as much data as is immediately possible and returns
137
+ #
138
+ # @param Ruby [IO] IO object to write to
139
+ # @raise [UnderflowError]
140
+ # @return [Integer] number of bytes written (0 if the write would block)
141
+ def write_to(_arg0); end
142
+ end
143
+
144
+ # Mark has not been set
145
+ class NIO::ByteBuffer::MarkUnsetError < ::IOError; end
146
+
147
+ # Insufficient capacity in buffer
148
+ class NIO::ByteBuffer::OverflowError < ::IOError; end
149
+
150
+ # Not enough data remaining in buffer
151
+ class NIO::ByteBuffer::UnderflowError < ::IOError; end
152
+
153
+ # source://nio4r-2.5.8/lib/nio.rb:50
154
+ NIO::ENGINE = T.let(T.unsafe(nil), String)
155
+
156
+ # Monitors watch IO objects for specific events
157
+ class NIO::Monitor
158
+ # @return [Monitor] a new instance of Monitor
159
+ def initialize(_arg0, _arg1, _arg2); end
160
+
161
+ # Add new interests to the existing interest set
162
+ #
163
+ # @param interests [:r, :w, :rw] new I/O interests (read/write/readwrite)
164
+ # @return [self]
165
+ def add_interest(_arg0); end
166
+
167
+ # Deactivate this monitor
168
+ def close(*_arg0); end
169
+
170
+ # Is this monitor closed?
171
+ #
172
+ # @return [Boolean]
173
+ def closed?; end
174
+
175
+ # Returns the value of attribute interests.
176
+ def interests; end
177
+
178
+ # Replace the existing interest set with a new one
179
+ #
180
+ # @param interests [:r, :w, :rw, nil] I/O readiness we're interested in (read/write/readwrite)
181
+ # @raise [EOFError]
182
+ # @return [Symbol] new interests
183
+ def interests=(_arg0); end
184
+
185
+ # Returns the value of attribute io.
186
+ def io; end
187
+
188
+ # Is the IO object readable?
189
+ #
190
+ # @return [Boolean]
191
+ def readable?; end
192
+
193
+ # Returns the value of attribute readiness.
194
+ def readiness; end
195
+
196
+ # Remove interests from the existing interest set
197
+ #
198
+ # @param interests [:r, :w, :rw] I/O interests to remove (read/write/readwrite)
199
+ # @return [self]
200
+ def remove_interest(_arg0); end
201
+
202
+ # Returns the value of attribute selector.
203
+ def selector; end
204
+
205
+ # Returns the value of attribute value.
206
+ def value; end
207
+
208
+ # Sets the attribute value
209
+ #
210
+ # @param value the value to set the attribute value to.
211
+ def value=(_arg0); end
212
+
213
+ # Is the IO object writable?
214
+ #
215
+ # @return [Boolean]
216
+ def writable?; end
217
+
218
+ # Is the IO object writable?
219
+ #
220
+ # @return [Boolean]
221
+ def writeable?; end
222
+ end
223
+
224
+ # Selectors monitor IO objects for events of interest
225
+ class NIO::Selector
226
+ # Create a new NIO::Selector
227
+ #
228
+ # @raise [ArgumentError]
229
+ # @return [Selector] a new instance of Selector
230
+ def initialize(*_arg0); end
231
+
232
+ # Return a symbol representing the backend I/O multiplexing mechanism used.
233
+ # Supported backends are:
234
+ # * :ruby - pure Ruby (i.e IO.select)
235
+ # * :java - Java NIO on JRuby
236
+ # * :epoll - libev w\ Linux epoll
237
+ # * :poll - libev w\ POSIX poll
238
+ # * :kqueue - libev w\ BSD kqueue
239
+ # * :select - libev w\ SysV select
240
+ # * :port - libev w\ I/O completion ports
241
+ # * :linuxaio - libev w\ Linux AIO io_submit (experimental)
242
+ # * :io_uring - libev w\ Linux io_uring (experimental)
243
+ # * :unknown - libev w\ unknown backend
244
+ def backend; end
245
+
246
+ # Close this selector and free its resources
247
+ def close; end
248
+
249
+ # Is this selector closed?
250
+ #
251
+ # @return [Boolean]
252
+ def closed?; end
253
+
254
+ # Deregister the given IO object from the selector
255
+ def deregister(_arg0); end
256
+
257
+ # @return [Boolean]
258
+ def empty?; end
259
+
260
+ # Register interest in an IO object with the selector for the given types
261
+ # of events. Valid event types for interest are:
262
+ # * :r - is the IO readable?
263
+ # * :w - is the IO writeable?
264
+ # * :rw - is the IO either readable or writeable?
265
+ def register(_arg0, _arg1); end
266
+
267
+ # Is the given IO object registered with the selector?
268
+ #
269
+ # @return [Boolean]
270
+ def registered?(_arg0); end
271
+
272
+ # Select which monitors are ready
273
+ def select(*_arg0); end
274
+
275
+ # Wake up a thread that's in the middle of selecting on this selector, if
276
+ # any such thread exists.
277
+ #
278
+ # Invoking this method more than once between two successive select calls
279
+ # has the same effect as invoking it just once. In other words, it provides
280
+ # level-triggered behavior.
281
+ def wakeup; end
282
+
283
+ class << self
284
+ # Return supported backends as symbols
285
+ #
286
+ # See `#backend` method definition for all possible backends
287
+ def backends; end
288
+ end
289
+ end
290
+
291
+ # source://nio4r-2.5.8/lib/nio/version.rb:4
292
+ NIO::VERSION = T.let(T.unsafe(nil), String)