ruby-lint 0.9.1 → 1.0.0.pre.preview1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CONTRIBUTING.md +9 -11
- data/Gemfile +6 -3
- data/MANIFEST +7 -1
- data/README.md +15 -24
- data/benchmark/bootup.rb +13 -0
- data/checksum/ruby-lint-0.9.1.gem.sha512 +1 -0
- data/doc/code_analysis.md +20 -0
- data/doc/css/common.css +1 -0
- data/doc/images/flow.png +0 -0
- data/lib/ruby-lint.rb +1 -3
- data/lib/ruby-lint/analysis/base.rb +12 -2
- data/lib/ruby-lint/analysis/undefined_variables.rb +3 -2
- data/lib/ruby-lint/analysis/unused_variables.rb +3 -2
- data/lib/ruby-lint/ast/node.rb +1 -1
- data/lib/ruby-lint/benchmark/average.rb +115 -0
- data/lib/ruby-lint/cli/analyze.rb +19 -1
- data/lib/ruby-lint/constant_loader.rb +1 -3
- data/lib/ruby-lint/constant_path.rb +112 -0
- data/lib/ruby-lint/definition_builder/base.rb +0 -2
- data/lib/ruby-lint/definition_builder/ruby_module.rb +1 -1
- data/lib/ruby-lint/definitions/core/array.rb +304 -73
- data/lib/ruby-lint/definitions/core/fixnum.rb +575 -19
- data/lib/ruby-lint/definitions/core/float.rb +2650 -95
- data/lib/ruby-lint/definitions/core/hash.rb +926 -85
- data/lib/ruby-lint/definitions/core/ruby_copyright.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_description.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_engine.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_patchlevel.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_platform.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_release_date.rb +3 -1
- data/lib/ruby-lint/definitions/core/ruby_version.rb +3 -1
- data/lib/ruby-lint/definitions/core/string.rb +847 -134
- data/lib/ruby-lint/definitions/core/string_io.rb +370 -25
- data/lib/ruby-lint/definitions/core/struct.rb +611 -146
- data/lib/ruby-lint/file_loader.rb +5 -6
- data/lib/ruby-lint/file_scanner.rb +44 -11
- data/lib/ruby-lint/inspector.rb +12 -2
- data/lib/ruby-lint/runner.rb +6 -2
- data/lib/ruby-lint/version.rb +1 -1
- data/lib/ruby-lint/virtual_machine.rb +19 -5
- data/ruby-lint.gemspec +1 -3
- data/spec/ruby-lint/analysis/argument_amount_spec.rb +5 -5
- data/spec/ruby-lint/analysis/base_spec.rb +4 -0
- data/spec/ruby-lint/analysis/shadowing_variables_spec.rb +4 -4
- data/spec/ruby-lint/analysis/undefined_methods_spec.rb +6 -6
- data/spec/ruby-lint/analysis/undefined_variables_spec.rb +5 -5
- data/spec/ruby-lint/analysis/unused_variables_spec.rb +12 -12
- data/spec/ruby-lint/cli/analyze_spec.rb +10 -0
- data/spec/ruby-lint/constant_path.rb +63 -0
- data/spec/ruby-lint/definition/ruby_object_spec.rb +2 -2
- data/spec/ruby-lint/report_spec.rb +2 -2
- data/spec/ruby-lint/runner_spec.rb +17 -0
- data/spec/ruby-lint/virtual_machine/assignments/assignment_arguments_spec.rb +14 -0
- data/spec/ruby-lint/virtual_machine/assignments/constants_spec.rb +23 -0
- data/spec/ruby-lint/virtual_machine/location_spec.rb +4 -4
- data/spec/ruby-lint/virtual_machine/method_call_tracking_spec.rb +4 -4
- data/task/build.rake +2 -7
- data/task/doc.rake +3 -1
- data/task/generate.rake +3 -0
- metadata +20 -36
- checksums.yaml.gz.asc +0 -17
- data.tar.gz.asc +0 -17
- data/lib/ruby-lint/helper/constant_paths.rb +0 -50
- metadata.gz.asc +0 -17
@@ -1,13 +1,12 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# Created: 2013-04-01 18:33:55 +0200
|
4
|
-
# Platform: rbx 2.0.0.rc1
|
1
|
+
# This file was automatically generated, any manual changes will be lost the
|
2
|
+
# next time this file is generated.
|
5
3
|
#
|
4
|
+
# Created: 2013-11-11 21:42:41 +0100
|
5
|
+
# Platform: rbx 2.1.1
|
6
|
+
|
6
7
|
RubyLint::GlobalScope.definitions.define_constant('Struct') do |klass|
|
7
8
|
klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
|
8
9
|
|
9
|
-
klass.define_method('__class_init__')
|
10
|
-
|
11
10
|
klass.define_method('_specialize') do |method|
|
12
11
|
method.define_argument('attrs')
|
13
12
|
end
|
@@ -24,7 +23,6 @@ RubyLint::GlobalScope.definitions.define_constant('Struct') do |klass|
|
|
24
23
|
klass.define_method('new') do |method|
|
25
24
|
method.define_argument('klass_name')
|
26
25
|
method.define_rest_argument('attrs')
|
27
|
-
method.define_block_argument('block')
|
28
26
|
end
|
29
27
|
|
30
28
|
klass.define_method('subclass_new') do |method|
|
@@ -48,248 +46,526 @@ RubyLint::GlobalScope.definitions.define_constant('Struct') do |klass|
|
|
48
46
|
method.define_argument('ms')
|
49
47
|
end
|
50
48
|
|
51
|
-
klass.define_instance_method('
|
52
|
-
|
49
|
+
klass.define_instance_method('all?')
|
50
|
+
|
51
|
+
klass.define_instance_method('any?')
|
52
|
+
|
53
|
+
klass.define_instance_method('chunk') do |method|
|
54
|
+
method.define_optional_argument('initial_state')
|
55
|
+
end
|
56
|
+
|
57
|
+
klass.define_instance_method('collect')
|
58
|
+
|
59
|
+
klass.define_instance_method('collect_concat')
|
60
|
+
|
61
|
+
klass.define_instance_method('count') do |method|
|
62
|
+
method.define_optional_argument('item')
|
63
|
+
end
|
64
|
+
|
65
|
+
klass.define_instance_method('cycle') do |method|
|
66
|
+
method.define_optional_argument('many')
|
67
|
+
end
|
68
|
+
|
69
|
+
klass.define_instance_method('detect') do |method|
|
70
|
+
method.define_optional_argument('ifnone')
|
71
|
+
end
|
72
|
+
|
73
|
+
klass.define_instance_method('drop') do |method|
|
74
|
+
method.define_argument('n')
|
75
|
+
end
|
76
|
+
|
77
|
+
klass.define_instance_method('drop_while')
|
78
|
+
|
79
|
+
klass.define_instance_method('each')
|
80
|
+
|
81
|
+
klass.define_instance_method('each_cons') do |method|
|
82
|
+
method.define_argument('num')
|
83
|
+
end
|
84
|
+
|
85
|
+
klass.define_instance_method('each_entry') do |method|
|
86
|
+
method.define_rest_argument('pass')
|
53
87
|
end
|
54
88
|
|
55
89
|
klass.define_instance_method('each_pair')
|
56
90
|
|
91
|
+
klass.define_instance_method('each_slice') do |method|
|
92
|
+
method.define_argument('slice_size')
|
93
|
+
end
|
94
|
+
|
95
|
+
klass.define_instance_method('each_with_index') do |method|
|
96
|
+
method.define_rest_argument('args')
|
97
|
+
end
|
98
|
+
|
99
|
+
klass.define_instance_method('each_with_object') do |method|
|
100
|
+
method.define_argument('memo')
|
101
|
+
end
|
102
|
+
|
103
|
+
klass.define_instance_method('entries') do |method|
|
104
|
+
method.define_rest_argument('arg')
|
105
|
+
end
|
106
|
+
|
57
107
|
klass.define_instance_method('eql?') do |method|
|
58
108
|
method.define_argument('other')
|
59
109
|
end
|
60
110
|
|
111
|
+
klass.define_instance_method('find') do |method|
|
112
|
+
method.define_optional_argument('ifnone')
|
113
|
+
end
|
114
|
+
|
115
|
+
klass.define_instance_method('find_all')
|
116
|
+
|
117
|
+
klass.define_instance_method('find_index') do |method|
|
118
|
+
method.define_optional_argument('value')
|
119
|
+
end
|
120
|
+
|
121
|
+
klass.define_instance_method('first') do |method|
|
122
|
+
method.define_optional_argument('n')
|
123
|
+
end
|
124
|
+
|
125
|
+
klass.define_instance_method('flat_map')
|
126
|
+
|
127
|
+
klass.define_instance_method('grep') do |method|
|
128
|
+
method.define_argument('pattern')
|
129
|
+
end
|
130
|
+
|
131
|
+
klass.define_instance_method('group_by')
|
132
|
+
|
61
133
|
klass.define_instance_method('hash')
|
62
134
|
|
135
|
+
klass.define_instance_method('include?') do |method|
|
136
|
+
method.define_argument('obj')
|
137
|
+
end
|
138
|
+
|
139
|
+
klass.define_instance_method('initialize') do |method|
|
140
|
+
method.define_rest_argument('args')
|
141
|
+
end
|
142
|
+
|
143
|
+
klass.define_instance_method('inject') do |method|
|
144
|
+
method.define_optional_argument('initial')
|
145
|
+
method.define_optional_argument('sym')
|
146
|
+
end
|
147
|
+
|
63
148
|
klass.define_instance_method('inspect')
|
64
149
|
|
65
150
|
klass.define_instance_method('instance_variables')
|
66
151
|
|
152
|
+
klass.define_instance_method('lazy')
|
153
|
+
|
67
154
|
klass.define_instance_method('length')
|
68
155
|
|
156
|
+
klass.define_instance_method('map')
|
157
|
+
|
158
|
+
klass.define_instance_method('max')
|
159
|
+
|
160
|
+
klass.define_instance_method('max_by')
|
161
|
+
|
162
|
+
klass.define_instance_method('member?') do |method|
|
163
|
+
method.define_argument('obj')
|
164
|
+
end
|
165
|
+
|
69
166
|
klass.define_instance_method('members')
|
70
167
|
|
71
|
-
klass.define_instance_method('
|
72
|
-
|
168
|
+
klass.define_instance_method('min')
|
169
|
+
|
170
|
+
klass.define_instance_method('min_by')
|
171
|
+
|
172
|
+
klass.define_instance_method('minmax')
|
173
|
+
|
174
|
+
klass.define_instance_method('minmax_by')
|
175
|
+
|
176
|
+
klass.define_instance_method('none?')
|
177
|
+
|
178
|
+
klass.define_instance_method('one?')
|
179
|
+
|
180
|
+
klass.define_instance_method('partition')
|
181
|
+
|
182
|
+
klass.define_instance_method('reduce') do |method|
|
183
|
+
method.define_optional_argument('initial')
|
184
|
+
method.define_optional_argument('sym')
|
73
185
|
end
|
74
186
|
|
187
|
+
klass.define_instance_method('reject')
|
188
|
+
|
189
|
+
klass.define_instance_method('reverse_each')
|
190
|
+
|
191
|
+
klass.define_instance_method('select')
|
192
|
+
|
75
193
|
klass.define_instance_method('size')
|
76
194
|
|
195
|
+
klass.define_instance_method('slice_before') do |method|
|
196
|
+
method.define_optional_argument('arg')
|
197
|
+
end
|
198
|
+
|
199
|
+
klass.define_instance_method('sort')
|
200
|
+
|
201
|
+
klass.define_instance_method('sort_by')
|
202
|
+
|
203
|
+
klass.define_instance_method('take') do |method|
|
204
|
+
method.define_argument('n')
|
205
|
+
end
|
206
|
+
|
207
|
+
klass.define_instance_method('take_while')
|
208
|
+
|
77
209
|
klass.define_instance_method('to_a')
|
78
210
|
|
211
|
+
klass.define_instance_method('to_h')
|
212
|
+
|
79
213
|
klass.define_instance_method('to_s')
|
80
214
|
|
215
|
+
klass.define_instance_method('to_set') do |method|
|
216
|
+
method.define_optional_argument('klass')
|
217
|
+
method.define_rest_argument('args')
|
218
|
+
method.define_block_argument('block')
|
219
|
+
end
|
220
|
+
|
81
221
|
klass.define_instance_method('values')
|
82
222
|
|
83
223
|
klass.define_instance_method('values_at') do |method|
|
84
224
|
method.define_rest_argument('args')
|
85
225
|
end
|
226
|
+
|
227
|
+
klass.define_instance_method('with_object') do |method|
|
228
|
+
method.define_argument('memo')
|
229
|
+
end
|
230
|
+
|
231
|
+
klass.define_instance_method('zip') do |method|
|
232
|
+
method.define_rest_argument('args')
|
233
|
+
end
|
86
234
|
end
|
87
235
|
|
88
|
-
|
89
|
-
|
90
|
-
# Created: 2013-04-01 18:33:55 +0200
|
91
|
-
# Platform: rbx 2.0.0.rc1
|
92
|
-
#
|
93
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Group') do |klass|
|
94
|
-
klass.inherits(RubyLint::GlobalScope.constant_proxy('Rubinius::FFI::Struct'))
|
236
|
+
RubyLint::GlobalScope.definitions.define_constant('Struct::Enumerator') do |klass|
|
237
|
+
klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
|
95
238
|
|
96
|
-
klass.
|
239
|
+
klass.define_instance_method('all?')
|
97
240
|
|
98
|
-
klass.define_instance_method('
|
241
|
+
klass.define_instance_method('any?')
|
99
242
|
|
100
|
-
klass.define_instance_method('
|
243
|
+
klass.define_instance_method('chunk') do |method|
|
244
|
+
method.define_optional_argument('initial_state')
|
245
|
+
end
|
101
246
|
|
102
|
-
klass.define_instance_method('
|
247
|
+
klass.define_instance_method('collect')
|
103
248
|
|
104
|
-
klass.define_instance_method('
|
105
|
-
end
|
249
|
+
klass.define_instance_method('collect_concat')
|
106
250
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
# Platform: rbx 2.0.0.rc1
|
111
|
-
#
|
112
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Group::FFI') do |klass|
|
251
|
+
klass.define_instance_method('count') do |method|
|
252
|
+
method.define_optional_argument('item')
|
253
|
+
end
|
113
254
|
|
114
|
-
klass.
|
255
|
+
klass.define_instance_method('cycle') do |method|
|
256
|
+
method.define_optional_argument('many')
|
257
|
+
end
|
115
258
|
|
116
|
-
klass.
|
117
|
-
method.
|
118
|
-
method.define_argument('add')
|
259
|
+
klass.define_instance_method('detect') do |method|
|
260
|
+
method.define_optional_argument('ifnone')
|
119
261
|
end
|
120
262
|
|
121
|
-
klass.
|
122
|
-
method.define_argument('
|
263
|
+
klass.define_instance_method('drop') do |method|
|
264
|
+
method.define_argument('n')
|
123
265
|
end
|
124
266
|
|
125
|
-
klass.
|
126
|
-
|
267
|
+
klass.define_instance_method('drop_while')
|
268
|
+
|
269
|
+
klass.define_instance_method('each') do |method|
|
270
|
+
method.define_rest_argument('args')
|
127
271
|
end
|
128
272
|
|
129
|
-
klass.
|
273
|
+
klass.define_instance_method('each_cons') do |method|
|
274
|
+
method.define_argument('num')
|
275
|
+
end
|
130
276
|
|
131
|
-
klass.
|
132
|
-
method.
|
277
|
+
klass.define_instance_method('each_entry') do |method|
|
278
|
+
method.define_rest_argument('pass')
|
133
279
|
end
|
134
280
|
|
135
|
-
klass.
|
136
|
-
method.define_argument('
|
137
|
-
method.define_argument('name')
|
138
|
-
method.define_argument('args')
|
139
|
-
method.define_argument('ret')
|
281
|
+
klass.define_instance_method('each_slice') do |method|
|
282
|
+
method.define_argument('slice_size')
|
140
283
|
end
|
141
284
|
|
142
|
-
klass.
|
143
|
-
|
144
|
-
|
145
|
-
method.define_argument('
|
146
|
-
method.define_argument('ret')
|
285
|
+
klass.define_instance_method('each_with_index')
|
286
|
+
|
287
|
+
klass.define_instance_method('each_with_object') do |method|
|
288
|
+
method.define_argument('memo')
|
147
289
|
end
|
148
290
|
|
149
|
-
klass.
|
150
|
-
method.
|
291
|
+
klass.define_instance_method('entries') do |method|
|
292
|
+
method.define_rest_argument('arg')
|
151
293
|
end
|
152
294
|
|
153
|
-
klass.
|
154
|
-
method.
|
295
|
+
klass.define_instance_method('find') do |method|
|
296
|
+
method.define_optional_argument('ifnone')
|
155
297
|
end
|
156
|
-
end
|
157
298
|
|
158
|
-
|
159
|
-
# Constant: Struct::Group::InlineArray
|
160
|
-
# Created: 2013-04-01 18:33:55 +0200
|
161
|
-
# Platform: rbx 2.0.0.rc1
|
162
|
-
#
|
163
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Group::InlineArray') do |klass|
|
164
|
-
klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
|
299
|
+
klass.define_instance_method('find_all')
|
165
300
|
|
166
|
-
klass.
|
301
|
+
klass.define_instance_method('find_index') do |method|
|
302
|
+
method.define_optional_argument('value')
|
303
|
+
end
|
167
304
|
|
168
|
-
klass.define_instance_method('
|
169
|
-
method.
|
305
|
+
klass.define_instance_method('first') do |method|
|
306
|
+
method.define_optional_argument('n')
|
170
307
|
end
|
171
308
|
|
172
|
-
klass.define_instance_method('
|
173
|
-
|
174
|
-
|
309
|
+
klass.define_instance_method('flat_map')
|
310
|
+
|
311
|
+
klass.define_instance_method('grep') do |method|
|
312
|
+
method.define_argument('pattern')
|
175
313
|
end
|
176
314
|
|
177
|
-
klass.define_instance_method('
|
315
|
+
klass.define_instance_method('group_by')
|
316
|
+
|
317
|
+
klass.define_instance_method('include?') do |method|
|
318
|
+
method.define_argument('obj')
|
319
|
+
end
|
178
320
|
|
179
321
|
klass.define_instance_method('initialize') do |method|
|
180
|
-
method.
|
181
|
-
method.
|
322
|
+
method.define_optional_argument('receiver_or_size')
|
323
|
+
method.define_optional_argument('method_name')
|
324
|
+
method.define_rest_argument('method_args')
|
325
|
+
end
|
326
|
+
|
327
|
+
klass.define_instance_method('inject') do |method|
|
328
|
+
method.define_optional_argument('initial')
|
329
|
+
method.define_optional_argument('sym')
|
330
|
+
end
|
331
|
+
|
332
|
+
klass.define_instance_method('lazy')
|
333
|
+
|
334
|
+
klass.define_instance_method('map')
|
335
|
+
|
336
|
+
klass.define_instance_method('max')
|
337
|
+
|
338
|
+
klass.define_instance_method('max_by')
|
339
|
+
|
340
|
+
klass.define_instance_method('member?') do |method|
|
341
|
+
method.define_argument('obj')
|
342
|
+
end
|
343
|
+
|
344
|
+
klass.define_instance_method('min')
|
345
|
+
|
346
|
+
klass.define_instance_method('min_by')
|
347
|
+
|
348
|
+
klass.define_instance_method('minmax')
|
349
|
+
|
350
|
+
klass.define_instance_method('minmax_by')
|
351
|
+
|
352
|
+
klass.define_instance_method('next')
|
353
|
+
|
354
|
+
klass.define_instance_method('next_values')
|
355
|
+
|
356
|
+
klass.define_instance_method('none?')
|
357
|
+
|
358
|
+
klass.define_instance_method('one?')
|
359
|
+
|
360
|
+
klass.define_instance_method('partition')
|
361
|
+
|
362
|
+
klass.define_instance_method('peek')
|
363
|
+
|
364
|
+
klass.define_instance_method('peek_values')
|
365
|
+
|
366
|
+
klass.define_instance_method('reduce') do |method|
|
367
|
+
method.define_optional_argument('initial')
|
368
|
+
method.define_optional_argument('sym')
|
182
369
|
end
|
183
370
|
|
371
|
+
klass.define_instance_method('reject')
|
372
|
+
|
373
|
+
klass.define_instance_method('reverse_each')
|
374
|
+
|
375
|
+
klass.define_instance_method('rewind')
|
376
|
+
|
377
|
+
klass.define_instance_method('select')
|
378
|
+
|
184
379
|
klass.define_instance_method('size')
|
185
380
|
|
186
|
-
klass.define_instance_method('
|
381
|
+
klass.define_instance_method('slice_before') do |method|
|
382
|
+
method.define_optional_argument('arg')
|
383
|
+
end
|
187
384
|
|
188
|
-
klass.define_instance_method('
|
189
|
-
end
|
385
|
+
klass.define_instance_method('sort')
|
190
386
|
|
191
|
-
|
192
|
-
# Constant: Struct::Group::InlineCharArray
|
193
|
-
# Created: 2013-04-01 18:33:55 +0200
|
194
|
-
# Platform: rbx 2.0.0.rc1
|
195
|
-
#
|
196
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Group::InlineCharArray') do |klass|
|
197
|
-
klass.inherits(RubyLint::GlobalScope.constant_proxy('Rubinius::FFI::Struct::InlineArray'))
|
387
|
+
klass.define_instance_method('sort_by')
|
198
388
|
|
199
|
-
klass.
|
389
|
+
klass.define_instance_method('take') do |method|
|
390
|
+
method.define_argument('n')
|
391
|
+
end
|
200
392
|
|
201
|
-
klass.define_instance_method('
|
393
|
+
klass.define_instance_method('take_while')
|
202
394
|
|
203
|
-
klass.define_instance_method('
|
395
|
+
klass.define_instance_method('to_a') do |method|
|
396
|
+
method.define_rest_argument('arg')
|
397
|
+
end
|
398
|
+
|
399
|
+
klass.define_instance_method('to_set') do |method|
|
400
|
+
method.define_optional_argument('klass')
|
401
|
+
method.define_rest_argument('args')
|
402
|
+
method.define_block_argument('block')
|
403
|
+
end
|
404
|
+
|
405
|
+
klass.define_instance_method('with_index') do |method|
|
406
|
+
method.define_optional_argument('offset')
|
407
|
+
end
|
408
|
+
|
409
|
+
klass.define_instance_method('with_object') do |method|
|
410
|
+
method.define_argument('memo')
|
411
|
+
end
|
204
412
|
|
205
|
-
klass.define_instance_method('
|
413
|
+
klass.define_instance_method('zip') do |method|
|
414
|
+
method.define_rest_argument('args')
|
415
|
+
end
|
206
416
|
end
|
207
417
|
|
208
|
-
|
209
|
-
# Constant: Struct::Passwd
|
210
|
-
# Created: 2013-04-01 18:33:55 +0200
|
211
|
-
# Platform: rbx 2.0.0.rc1
|
212
|
-
#
|
213
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Passwd') do |klass|
|
418
|
+
RubyLint::GlobalScope.definitions.define_constant('Struct::Group') do |klass|
|
214
419
|
klass.inherits(RubyLint::GlobalScope.constant_proxy('Rubinius::FFI::Struct'))
|
215
420
|
|
216
|
-
klass.define_method('
|
421
|
+
klass.define_method('config') do |method|
|
422
|
+
method.define_argument('base')
|
423
|
+
method.define_rest_argument('fields')
|
424
|
+
end
|
217
425
|
|
218
|
-
klass.
|
426
|
+
klass.define_method('find_nested_parent')
|
219
427
|
|
220
|
-
klass.
|
428
|
+
klass.define_method('layout') do |method|
|
429
|
+
method.define_rest_argument('spec')
|
430
|
+
end
|
431
|
+
|
432
|
+
klass.define_method('members')
|
433
|
+
|
434
|
+
klass.define_method('offset_of') do |method|
|
435
|
+
method.define_argument('name')
|
436
|
+
end
|
437
|
+
|
438
|
+
klass.define_method('offsets')
|
439
|
+
|
440
|
+
klass.define_method('size')
|
441
|
+
|
442
|
+
klass.define_instance_method('[]') do |method|
|
443
|
+
method.define_argument('field')
|
444
|
+
end
|
445
|
+
|
446
|
+
klass.define_instance_method('[]=') do |method|
|
447
|
+
method.define_argument('field')
|
448
|
+
method.define_argument('val')
|
449
|
+
end
|
450
|
+
|
451
|
+
klass.define_instance_method('free')
|
221
452
|
|
222
453
|
klass.define_instance_method('gid')
|
223
454
|
|
455
|
+
klass.define_instance_method('initialize') do |method|
|
456
|
+
method.define_optional_argument('pointer')
|
457
|
+
method.define_rest_argument('spec')
|
458
|
+
end
|
459
|
+
|
460
|
+
klass.define_instance_method('initialize_copy') do |method|
|
461
|
+
method.define_argument('ptr')
|
462
|
+
end
|
463
|
+
|
464
|
+
klass.define_instance_method('mem')
|
465
|
+
|
466
|
+
klass.define_instance_method('members')
|
467
|
+
|
224
468
|
klass.define_instance_method('name')
|
225
469
|
|
470
|
+
klass.define_instance_method('null?')
|
471
|
+
|
472
|
+
klass.define_instance_method('offset_of') do |method|
|
473
|
+
method.define_argument('name')
|
474
|
+
end
|
475
|
+
|
476
|
+
klass.define_instance_method('offsets')
|
477
|
+
|
226
478
|
klass.define_instance_method('passwd')
|
227
479
|
|
228
|
-
klass.define_instance_method('
|
480
|
+
klass.define_instance_method('pointer')
|
229
481
|
|
230
|
-
klass.define_instance_method('
|
482
|
+
klass.define_instance_method('size')
|
483
|
+
|
484
|
+
klass.define_instance_method('to_ptr')
|
485
|
+
|
486
|
+
klass.define_instance_method('values')
|
231
487
|
end
|
232
488
|
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
489
|
+
RubyLint::GlobalScope.definitions.define_constant('Struct::Passwd') do |klass|
|
490
|
+
klass.inherits(RubyLint::GlobalScope.constant_proxy('Rubinius::FFI::Struct'))
|
491
|
+
|
492
|
+
klass.define_method('config') do |method|
|
493
|
+
method.define_argument('base')
|
494
|
+
method.define_rest_argument('fields')
|
495
|
+
end
|
240
496
|
|
241
|
-
klass.define_method('
|
497
|
+
klass.define_method('find_nested_parent')
|
498
|
+
|
499
|
+
klass.define_method('layout') do |method|
|
500
|
+
method.define_rest_argument('spec')
|
501
|
+
end
|
502
|
+
|
503
|
+
klass.define_method('members')
|
504
|
+
|
505
|
+
klass.define_method('offset_of') do |method|
|
506
|
+
method.define_argument('name')
|
507
|
+
end
|
508
|
+
|
509
|
+
klass.define_method('offsets')
|
510
|
+
|
511
|
+
klass.define_method('size')
|
242
512
|
|
243
513
|
klass.define_instance_method('[]') do |method|
|
244
|
-
method.define_argument('
|
514
|
+
method.define_argument('field')
|
245
515
|
end
|
246
516
|
|
247
517
|
klass.define_instance_method('[]=') do |method|
|
248
|
-
method.define_argument('
|
518
|
+
method.define_argument('field')
|
249
519
|
method.define_argument('val')
|
250
520
|
end
|
251
521
|
|
252
|
-
klass.define_instance_method('
|
522
|
+
klass.define_instance_method('dir')
|
523
|
+
|
524
|
+
klass.define_instance_method('free')
|
525
|
+
|
526
|
+
klass.define_instance_method('gecos')
|
527
|
+
|
528
|
+
klass.define_instance_method('gid')
|
253
529
|
|
254
530
|
klass.define_instance_method('initialize') do |method|
|
255
|
-
method.
|
531
|
+
method.define_optional_argument('pointer')
|
532
|
+
method.define_rest_argument('spec')
|
533
|
+
end
|
534
|
+
|
535
|
+
klass.define_instance_method('initialize_copy') do |method|
|
256
536
|
method.define_argument('ptr')
|
257
537
|
end
|
258
538
|
|
259
|
-
klass.define_instance_method('
|
539
|
+
klass.define_instance_method('members')
|
260
540
|
|
261
|
-
klass.define_instance_method('
|
541
|
+
klass.define_instance_method('name')
|
262
542
|
|
263
|
-
klass.define_instance_method('
|
264
|
-
end
|
543
|
+
klass.define_instance_method('null?')
|
265
544
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
# Platform: rbx 2.0.0.rc1
|
270
|
-
#
|
271
|
-
RubyLint::GlobalScope.definitions.define_constant('Struct::Passwd::InlineCharArray') do |klass|
|
272
|
-
klass.inherits(RubyLint::GlobalScope.constant_proxy('Rubinius::FFI::Struct::InlineArray'))
|
545
|
+
klass.define_instance_method('offset_of') do |method|
|
546
|
+
method.define_argument('name')
|
547
|
+
end
|
273
548
|
|
274
|
-
klass.
|
549
|
+
klass.define_instance_method('offsets')
|
275
550
|
|
276
|
-
klass.define_instance_method('
|
551
|
+
klass.define_instance_method('passwd')
|
277
552
|
|
278
|
-
klass.define_instance_method('
|
553
|
+
klass.define_instance_method('pointer')
|
554
|
+
|
555
|
+
klass.define_instance_method('shell')
|
556
|
+
|
557
|
+
klass.define_instance_method('size')
|
558
|
+
|
559
|
+
klass.define_instance_method('to_ptr')
|
279
560
|
|
280
|
-
klass.define_instance_method('
|
561
|
+
klass.define_instance_method('uid')
|
562
|
+
|
563
|
+
klass.define_instance_method('values')
|
281
564
|
end
|
282
565
|
|
283
|
-
##
|
284
|
-
# Constant: Struct::SortedElement
|
285
|
-
# Created: 2013-04-01 18:33:55 +0200
|
286
|
-
# Platform: rbx 2.0.0.rc1
|
287
|
-
#
|
288
566
|
RubyLint::GlobalScope.definitions.define_constant('Struct::SortedElement') do |klass|
|
289
567
|
klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
|
290
568
|
|
291
|
-
klass.define_method('__class_init__')
|
292
|
-
|
293
569
|
klass.define_instance_method('<=>') do |method|
|
294
570
|
method.define_argument('other')
|
295
571
|
end
|
@@ -304,11 +580,6 @@ RubyLint::GlobalScope.definitions.define_constant('Struct::SortedElement') do |k
|
|
304
580
|
klass.define_instance_method('value')
|
305
581
|
end
|
306
582
|
|
307
|
-
##
|
308
|
-
# Constant: Struct::Tms
|
309
|
-
# Created: 2013-04-01 18:33:55 +0200
|
310
|
-
# Platform: rbx 2.0.0.rc1
|
311
|
-
#
|
312
583
|
RubyLint::GlobalScope.definitions.define_constant('Struct::Tms') do |klass|
|
313
584
|
klass.inherits(RubyLint::GlobalScope.constant_proxy('Struct'))
|
314
585
|
|
@@ -316,11 +587,50 @@ RubyLint::GlobalScope.definitions.define_constant('Struct::Tms') do |klass|
|
|
316
587
|
method.define_rest_argument('args')
|
317
588
|
end
|
318
589
|
|
319
|
-
klass.define_method('
|
590
|
+
klass.define_method('_specialize') do |method|
|
591
|
+
method.define_argument('attrs')
|
592
|
+
end
|
593
|
+
|
594
|
+
klass.define_method('length')
|
595
|
+
|
596
|
+
klass.define_method('make_struct') do |method|
|
597
|
+
method.define_argument('name')
|
598
|
+
method.define_argument('attrs')
|
599
|
+
end
|
600
|
+
|
601
|
+
klass.define_method('members')
|
320
602
|
|
321
603
|
klass.define_method('new') do |method|
|
322
604
|
method.define_rest_argument('args')
|
323
|
-
|
605
|
+
end
|
606
|
+
|
607
|
+
klass.define_method('subclass_new') do |method|
|
608
|
+
method.define_rest_argument('args')
|
609
|
+
end
|
610
|
+
|
611
|
+
klass.define_instance_method('[]') do |method|
|
612
|
+
method.define_argument('var')
|
613
|
+
end
|
614
|
+
|
615
|
+
klass.define_instance_method('[]=') do |method|
|
616
|
+
method.define_argument('var')
|
617
|
+
method.define_argument('obj')
|
618
|
+
end
|
619
|
+
|
620
|
+
klass.define_instance_method('all?')
|
621
|
+
|
622
|
+
klass.define_instance_method('any?')
|
623
|
+
|
624
|
+
klass.define_instance_method('chunk') do |method|
|
625
|
+
method.define_optional_argument('initial_state')
|
626
|
+
end
|
627
|
+
|
628
|
+
klass.define_instance_method('collect')
|
629
|
+
|
630
|
+
klass.define_instance_method('collect_concat')
|
631
|
+
|
632
|
+
klass.define_instance_method('count') do |method|
|
633
|
+
method.define_optional_argument('item')
|
324
634
|
end
|
325
635
|
|
326
636
|
klass.define_instance_method('cstime')
|
@@ -331,10 +641,159 @@ RubyLint::GlobalScope.definitions.define_constant('Struct::Tms') do |klass|
|
|
331
641
|
|
332
642
|
klass.define_instance_method('cutime=')
|
333
643
|
|
644
|
+
klass.define_instance_method('cycle') do |method|
|
645
|
+
method.define_optional_argument('many')
|
646
|
+
end
|
647
|
+
|
648
|
+
klass.define_instance_method('detect') do |method|
|
649
|
+
method.define_optional_argument('ifnone')
|
650
|
+
end
|
651
|
+
|
652
|
+
klass.define_instance_method('drop') do |method|
|
653
|
+
method.define_argument('n')
|
654
|
+
end
|
655
|
+
|
656
|
+
klass.define_instance_method('drop_while')
|
657
|
+
|
658
|
+
klass.define_instance_method('each')
|
659
|
+
|
660
|
+
klass.define_instance_method('each_cons') do |method|
|
661
|
+
method.define_argument('num')
|
662
|
+
end
|
663
|
+
|
664
|
+
klass.define_instance_method('each_entry') do |method|
|
665
|
+
method.define_rest_argument('pass')
|
666
|
+
end
|
667
|
+
|
668
|
+
klass.define_instance_method('each_pair')
|
669
|
+
|
670
|
+
klass.define_instance_method('each_slice') do |method|
|
671
|
+
method.define_argument('slice_size')
|
672
|
+
end
|
673
|
+
|
674
|
+
klass.define_instance_method('each_with_index') do |method|
|
675
|
+
method.define_rest_argument('args')
|
676
|
+
end
|
677
|
+
|
678
|
+
klass.define_instance_method('each_with_object') do |method|
|
679
|
+
method.define_argument('memo')
|
680
|
+
end
|
681
|
+
|
682
|
+
klass.define_instance_method('entries') do |method|
|
683
|
+
method.define_rest_argument('arg')
|
684
|
+
end
|
685
|
+
|
686
|
+
klass.define_instance_method('find') do |method|
|
687
|
+
method.define_optional_argument('ifnone')
|
688
|
+
end
|
689
|
+
|
690
|
+
klass.define_instance_method('find_all')
|
691
|
+
|
692
|
+
klass.define_instance_method('find_index') do |method|
|
693
|
+
method.define_optional_argument('value')
|
694
|
+
end
|
695
|
+
|
696
|
+
klass.define_instance_method('first') do |method|
|
697
|
+
method.define_optional_argument('n')
|
698
|
+
end
|
699
|
+
|
700
|
+
klass.define_instance_method('flat_map')
|
701
|
+
|
702
|
+
klass.define_instance_method('grep') do |method|
|
703
|
+
method.define_argument('pattern')
|
704
|
+
end
|
705
|
+
|
706
|
+
klass.define_instance_method('group_by')
|
707
|
+
|
708
|
+
klass.define_instance_method('include?') do |method|
|
709
|
+
method.define_argument('obj')
|
710
|
+
end
|
711
|
+
|
712
|
+
klass.define_instance_method('initialize') do |method|
|
713
|
+
method.define_optional_argument('utime')
|
714
|
+
method.define_optional_argument('stime')
|
715
|
+
method.define_optional_argument('cutime')
|
716
|
+
method.define_optional_argument('cstime')
|
717
|
+
method.define_optional_argument('tutime')
|
718
|
+
method.define_optional_argument('tstime')
|
719
|
+
end
|
720
|
+
|
721
|
+
klass.define_instance_method('inject') do |method|
|
722
|
+
method.define_optional_argument('initial')
|
723
|
+
method.define_optional_argument('sym')
|
724
|
+
end
|
725
|
+
|
726
|
+
klass.define_instance_method('lazy')
|
727
|
+
|
728
|
+
klass.define_instance_method('length')
|
729
|
+
|
730
|
+
klass.define_instance_method('map')
|
731
|
+
|
732
|
+
klass.define_instance_method('max')
|
733
|
+
|
734
|
+
klass.define_instance_method('max_by')
|
735
|
+
|
736
|
+
klass.define_instance_method('member?') do |method|
|
737
|
+
method.define_argument('obj')
|
738
|
+
end
|
739
|
+
|
740
|
+
klass.define_instance_method('members')
|
741
|
+
|
742
|
+
klass.define_instance_method('min')
|
743
|
+
|
744
|
+
klass.define_instance_method('min_by')
|
745
|
+
|
746
|
+
klass.define_instance_method('minmax')
|
747
|
+
|
748
|
+
klass.define_instance_method('minmax_by')
|
749
|
+
|
750
|
+
klass.define_instance_method('none?')
|
751
|
+
|
752
|
+
klass.define_instance_method('one?')
|
753
|
+
|
754
|
+
klass.define_instance_method('partition')
|
755
|
+
|
756
|
+
klass.define_instance_method('reduce') do |method|
|
757
|
+
method.define_optional_argument('initial')
|
758
|
+
method.define_optional_argument('sym')
|
759
|
+
end
|
760
|
+
|
761
|
+
klass.define_instance_method('reject')
|
762
|
+
|
763
|
+
klass.define_instance_method('reverse_each')
|
764
|
+
|
765
|
+
klass.define_instance_method('select')
|
766
|
+
|
767
|
+
klass.define_instance_method('size')
|
768
|
+
|
769
|
+
klass.define_instance_method('slice_before') do |method|
|
770
|
+
method.define_optional_argument('arg')
|
771
|
+
end
|
772
|
+
|
773
|
+
klass.define_instance_method('sort')
|
774
|
+
|
775
|
+
klass.define_instance_method('sort_by')
|
776
|
+
|
334
777
|
klass.define_instance_method('stime')
|
335
778
|
|
336
779
|
klass.define_instance_method('stime=')
|
337
780
|
|
781
|
+
klass.define_instance_method('take') do |method|
|
782
|
+
method.define_argument('n')
|
783
|
+
end
|
784
|
+
|
785
|
+
klass.define_instance_method('take_while')
|
786
|
+
|
787
|
+
klass.define_instance_method('to_a')
|
788
|
+
|
789
|
+
klass.define_instance_method('to_h')
|
790
|
+
|
791
|
+
klass.define_instance_method('to_set') do |method|
|
792
|
+
method.define_optional_argument('klass')
|
793
|
+
method.define_rest_argument('args')
|
794
|
+
method.define_block_argument('block')
|
795
|
+
end
|
796
|
+
|
338
797
|
klass.define_instance_method('tstime')
|
339
798
|
|
340
799
|
klass.define_instance_method('tstime=')
|
@@ -346,14 +805,20 @@ RubyLint::GlobalScope.definitions.define_constant('Struct::Tms') do |klass|
|
|
346
805
|
klass.define_instance_method('utime')
|
347
806
|
|
348
807
|
klass.define_instance_method('utime=')
|
349
|
-
end
|
350
808
|
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
809
|
+
klass.define_instance_method('values')
|
810
|
+
|
811
|
+
klass.define_instance_method('values_at') do |method|
|
812
|
+
method.define_rest_argument('args')
|
813
|
+
end
|
814
|
+
|
815
|
+
klass.define_instance_method('with_object') do |method|
|
816
|
+
method.define_argument('memo')
|
817
|
+
end
|
818
|
+
|
819
|
+
klass.define_instance_method('zip') do |method|
|
820
|
+
method.define_rest_argument('args')
|
821
|
+
end
|
357
822
|
end
|
358
823
|
|
359
|
-
RubyLint::GlobalScope.definitions.lookup(:const, 'Struct').deep_freeze
|
824
|
+
RubyLint::GlobalScope.definitions.lookup(:const, 'Struct').deep_freeze
|