mootool 0.1.2 → 0.2.2

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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.github/workflows/ci.yml +15 -15
  4. data/.github/workflows/gem-push.yml +26 -26
  5. data/.overcommit.yml +79 -0
  6. data/.rubocop.yml +147 -0
  7. data/.ruby-version +1 -1
  8. data/.run/All Specs.run.xml +46 -0
  9. data/CODE_OF_CONDUCT.md +2 -1
  10. data/Gemfile +14 -11
  11. data/Gemfile.lock +90 -32
  12. data/README.md +12 -6
  13. data/bin/tapioca +27 -0
  14. data/lib/mootool/command.rb +1 -0
  15. data/lib/mootool/controller_base.rb +4 -1
  16. data/lib/mootool/controllers/dwarf.rb +8 -0
  17. data/lib/mootool/controllers/dyld_linker.rb +8 -0
  18. data/lib/mootool/controllers/dyld_shared_cache.rb +8 -0
  19. data/lib/mootool/controllers/fat_binary.rb +8 -0
  20. data/lib/mootool/controllers/kernel_collection.rb +21 -15
  21. data/lib/mootool/controllers/sections.rb +8 -0
  22. data/lib/mootool/core_extensions.rb +26 -0
  23. data/lib/mootool/models/device_tree.rb +85 -0
  24. data/lib/mootool/models/img4.rb +49 -0
  25. data/lib/mootool/models/ipsw.rb +19 -0
  26. data/lib/mootool/version.rb +1 -1
  27. data/lib/mootool/views/sections.full.erb +2 -2
  28. data/lib/mootool.rb +10 -3
  29. data/mootool.gemspec +17 -12
  30. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  31. data/sorbet/rbi/gems/ast@2.4.2.rbi +618 -0
  32. data/sorbet/rbi/gems/childprocess@4.1.0.rbi +447 -0
  33. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  34. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1219 -0
  35. data/sorbet/rbi/gems/iniparse@1.5.0.rbi +1007 -0
  36. data/sorbet/rbi/gems/json@2.6.2.rbi +1650 -0
  37. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  38. data/sorbet/rbi/gems/netrc@0.11.0.rbi +186 -0
  39. data/sorbet/rbi/gems/overcommit@0.59.1.rbi +2747 -0
  40. data/sorbet/rbi/gems/parallel@1.22.1.rbi +353 -0
  41. data/sorbet/rbi/gems/parser@3.1.2.1.rbi +6198 -0
  42. data/sorbet/rbi/gems/plist@3.6.0.rbi +212 -0
  43. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  44. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +452 -0
  45. data/sorbet/rbi/gems/rake@13.0.6.rbi +3587 -0
  46. data/sorbet/rbi/gems/rbi@0.0.15.rbi +3619 -0
  47. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +3927 -0
  48. data/sorbet/rbi/gems/rexml@3.2.5.rbi +5238 -0
  49. data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +12834 -0
  50. data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +9151 -0
  51. data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +6506 -0
  52. data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +2040 -0
  53. data/sorbet/rbi/gems/rspec@3.11.0.rbi +120 -0
  54. data/sorbet/rbi/gems/rubocop-ast@1.21.0.rbi +7990 -0
  55. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +413 -0
  56. data/sorbet/rbi/gems/rubocop-rspec@2.12.1.rbi +7604 -0
  57. data/sorbet/rbi/gems/rubocop@1.35.0.rbi +62260 -0
  58. data/sorbet/rbi/gems/ruby-macho@3.0.0.rbi +5039 -0
  59. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1445 -0
  60. data/sorbet/rbi/gems/rubyzip@2.3.2.rbi +2868 -0
  61. data/sorbet/rbi/gems/spoom@1.1.12.rbi +2829 -0
  62. data/sorbet/rbi/gems/tapioca@0.9.3.rbi +2151 -0
  63. data/sorbet/rbi/gems/thor@1.2.1.rbi +4532 -0
  64. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +60 -0
  65. data/sorbet/rbi/gems/unparser@0.6.5.rbi +8 -0
  66. data/sorbet/rbi/gems/webrick@1.7.0.rbi +3075 -0
  67. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +458 -0
  68. data/sorbet/rbi/gems/yard@0.9.28.rbi +20844 -0
  69. data/sorbet/rbi/sorbet-typed/lib/rainbow/all/rainbow.rbi +72 -24
  70. data/sorbet/rbi/sorbet-typed/lib/rake/all/rake.rbi +1697 -385
  71. data/sorbet/rbi/sorbet-typed/lib/rspec-core/all/rspec-core.rbi +30 -7
  72. data/sorbet/rbi/sorbet-typed/lib/rubocop/>=1.8/rubocop.rbi +3 -1
  73. data/sorbet/rbi/todo.rbi +7 -0
  74. data/sorbet/tapioca/config.yml +13 -0
  75. data/sorbet/tapioca/require.rb +4 -0
  76. metadata +90 -10
@@ -0,0 +1,1007 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `iniparse` gem.
5
+ # Please instead update this file by running `bin/tapioca gem iniparse`.
6
+
7
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:1
8
+ module IniParse
9
+ private
10
+
11
+ # Creates a new IniParse::Document using the specification you provide.
12
+ #
13
+ # See IniParse::Generator.
14
+ #
15
+ # ==== Returns
16
+ # IniParse::Document
17
+ #
18
+ # source://iniparse-1.5.0/lib/iniparse.rb:63
19
+ def gen(&blk)
20
+ ;
21
+ end
22
+
23
+ # Opens the file at +path+, reads and parses it's contents.
24
+ #
25
+ # ==== Parameters
26
+ # path<String>:: The path to the INI document.
27
+ #
28
+ # ==== Returns
29
+ # IniParse::Document
30
+ #
31
+ # source://iniparse-1.5.0/lib/iniparse.rb:50
32
+ def open(path)
33
+ ;
34
+ end
35
+
36
+ # Parse given given INI document source +source+.
37
+ #
38
+ # See IniParse::Parser.parse
39
+ #
40
+ # ==== Parameters
41
+ # source<String>:: The source from the INI document.
42
+ #
43
+ # ==== Returns
44
+ # IniParse::Document
45
+ #
46
+ # source://iniparse-1.5.0/lib/iniparse.rb:38
47
+ def parse(source)
48
+ ;
49
+ end
50
+
51
+ class << self
52
+ # Creates a new IniParse::Document using the specification you provide.
53
+ #
54
+ # See IniParse::Generator.
55
+ #
56
+ # ==== Returns
57
+ # IniParse::Document
58
+ #
59
+ # source://iniparse-1.5.0/lib/iniparse.rb:63
60
+ def gen(&blk)
61
+ ;
62
+ end
63
+
64
+ # Opens the file at +path+, reads and parses it's contents.
65
+ #
66
+ # ==== Parameters
67
+ # path<String>:: The path to the INI document.
68
+ #
69
+ # ==== Returns
70
+ # IniParse::Document
71
+ #
72
+ # source://iniparse-1.5.0/lib/iniparse.rb:50
73
+ def open(path)
74
+ ;
75
+ end
76
+
77
+ # Parse given given INI document source +source+.
78
+ #
79
+ # See IniParse::Parser.parse
80
+ #
81
+ # ==== Parameters
82
+ # source<String>:: The source from the INI document.
83
+ #
84
+ # ==== Returns
85
+ # IniParse::Document
86
+ #
87
+ # source://iniparse-1.5.0/lib/iniparse.rb:38
88
+ def parse(source)
89
+ ;
90
+ end
91
+ end
92
+ end
93
+
94
+ # Represents an INI document.
95
+ #
96
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:3
97
+ class IniParse::Document
98
+ include ::Enumerable
99
+
100
+ # Creates a new Document instance.
101
+ #
102
+ # @return [Document] a new instance of Document
103
+ #
104
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:10
105
+ def initialize(path = T.unsafe(nil))
106
+ ;
107
+ end
108
+
109
+ # Returns the section identified by +key+.
110
+ #
111
+ # Returns nil if there is no Section with the given key.
112
+ #
113
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:31
114
+ def [](key)
115
+ ;
116
+ end
117
+
118
+ # Deletes the section whose name matches the given +key+.
119
+ #
120
+ # Returns the document.
121
+ #
122
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:47
123
+ def delete(*args)
124
+ ;
125
+ end
126
+
127
+ # Enumerates through each Section in this document.
128
+ #
129
+ # Does not yield blank and comment lines by default; if you want _all_
130
+ # lines to be yielded, pass true.
131
+ #
132
+ # ==== Parameters
133
+ # include_blank<Boolean>:: Include blank/comment lines?
134
+ #
135
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:23
136
+ def each(*args, &blk)
137
+ ;
138
+ end
139
+
140
+ # Returns true if a section with the given +key+ exists in this document.
141
+ #
142
+ # @return [Boolean]
143
+ #
144
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:87
145
+ def has_section?(key)
146
+ ;
147
+ end
148
+
149
+ # A human-readable version of the document, for debugging.
150
+ #
151
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:81
152
+ def inspect; end
153
+
154
+ # Returns the value of attribute lines.
155
+ #
156
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:6
157
+ def lines; end
158
+
159
+ # Returns the value of attribute path.
160
+ #
161
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:7
162
+ def path; end
163
+
164
+ # Sets the attribute path
165
+ #
166
+ # @param value the value to set the attribute path to.
167
+ #
168
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:7
169
+ def path=(_arg0)
170
+ ;
171
+ end
172
+
173
+ # Saves a copy of this Document to disk.
174
+ #
175
+ # If a path was supplied when the Document was initialized then nothing
176
+ # needs to be given to Document#save. If Document was not given a file
177
+ # path, or you wish to save the document elsewhere, supply a path when
178
+ # calling Document#save.
179
+ #
180
+ # ==== Parameters
181
+ # path<String>:: A path to which this document will be saved.
182
+ #
183
+ # ==== Raises
184
+ # IniParseError:: If your document couldn't be saved.
185
+ #
186
+ # @raise [IniParseError]
187
+ #
188
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:104
189
+ def save(path = T.unsafe(nil))
190
+ ;
191
+ end
192
+
193
+ # Returns the section identified by +key+.
194
+ #
195
+ # If there is no Section with the given key it will be created.
196
+ #
197
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:39
198
+ def section(key)
199
+ ;
200
+ end
201
+
202
+ # Returns a has representation of the INI with multi-line options
203
+ # as an array
204
+ #
205
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:64
206
+ def to_h; end
207
+
208
+ # Returns a has representation of the INI with multi-line options
209
+ # as an array
210
+ #
211
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:64
212
+ def to_hash; end
213
+
214
+ # Returns this document as a string suitable for saving to a file.
215
+ #
216
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:53
217
+ def to_ini; end
218
+
219
+ # Returns this document as a string suitable for saving to a file.
220
+ #
221
+ # source://iniparse-1.5.0/lib/iniparse/document.rb:53
222
+ def to_s; end
223
+ end
224
+
225
+ # Generator provides a means for easily creating new INI documents.
226
+ #
227
+ # Rather than trying to hack together new INI documents by manually creating
228
+ # Document, Section and Option instances, it is preferable to use Generator
229
+ # which will handle it all for you.
230
+ #
231
+ # The Generator is exposed through IniParse.gen.
232
+ #
233
+ # IniParse.gen do |doc|
234
+ # doc.section("vehicle") do |vehicle|
235
+ # vehicle.option("road_side", "left")
236
+ # vehicle.option("realistic_acceleration", true)
237
+ # vehicle.option("max_trains", 500)
238
+ # end
239
+ #
240
+ # doc.section("construction") do |construction|
241
+ # construction.option("build_on_slopes", true)
242
+ # construction.option("autoslope", true)
243
+ # end
244
+ # end
245
+ #
246
+ # # => IniParse::Document
247
+ #
248
+ # This can be simplified further if you don't mind the small overhead
249
+ # which comes with +method_missing+:
250
+ #
251
+ # IniParse.gen do |doc|
252
+ # doc.vehicle do |vehicle|
253
+ # vehicle.road_side = "left"
254
+ # vehicle.realistic_acceleration = true
255
+ # vehicle.max_trains = 500
256
+ # end
257
+ #
258
+ # doc.construction do |construction|
259
+ # construction.build_on_slopes = true
260
+ # construction.autoslope = true
261
+ # end
262
+ # end
263
+ #
264
+ # # => IniParse::Document
265
+ #
266
+ # If you want to add slightly more complicated formatting to your document,
267
+ # each line type (except blanks) takes a number of optional parameters:
268
+ #
269
+ # :comment::
270
+ # Adds an inline comment at the end of the line.
271
+ # :comment_offset::
272
+ # Indent the comment. Measured in characters from _beginning_ of the line.
273
+ # See String#ljust.
274
+ # :indent::
275
+ # Adds the supplied text to the beginning of the line.
276
+ #
277
+ # If you supply +:indent+, +:comment_sep+, or +:comment_offset+ options when
278
+ # adding a section, the same options will be inherited by all of the options
279
+ # which belong to it.
280
+ #
281
+ # IniParse.gen do |doc|
282
+ # doc.section("vehicle",
283
+ # :comment => "Options for vehicles", :indent => " "
284
+ # ) do |vehicle|
285
+ # vehicle.option("road_side", "left")
286
+ # vehicle.option("realistic_acceleration", true)
287
+ # vehicle.option("max_trains", 500, :comment => "More = slower")
288
+ # end
289
+ # end.to_ini
290
+ #
291
+ # [vehicle] ; Options for vehicles
292
+ # road_side = left
293
+ # realistic_acceleration = true
294
+ # max_trains = 500 ; More = slower
295
+ #
296
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:73
297
+ class IniParse::Generator
298
+ # @return [Generator] a new instance of Generator
299
+ #
300
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:77
301
+ def initialize(opts = T.unsafe(nil))
302
+ ;
303
+ end
304
+
305
+ # Adds a new blank line to the document.
306
+ #
307
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:170
308
+ def blank; end
309
+
310
+ # Adds a new comment line to the document.
311
+ #
312
+ # ==== Parameters
313
+ # comment<String>:: The text for the comment line.
314
+ #
315
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:163
316
+ def comment(comment, opts = T.unsafe(nil))
317
+ ;
318
+ end
319
+
320
+ # Returns the value of attribute context.
321
+ #
322
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:74
323
+ def context; end
324
+
325
+ # Returns the value of attribute document.
326
+ #
327
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:75
328
+ def document; end
329
+
330
+ # @yield [_self]
331
+ # @yieldparam _self [IniParse::Generator] the object that the method was called on
332
+ #
333
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:85
334
+ def gen; end
335
+
336
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:183
337
+ def method_missing(name, *args, &blk)
338
+ ;
339
+ end
340
+
341
+ # Adds a new option to the current section.
342
+ #
343
+ # Can only be called as part of a section block, or after at least one
344
+ # section has been added to the document.
345
+ #
346
+ # ==== Parameters
347
+ # key<String>:: The key (name) for this option.
348
+ # value:: The option's value.
349
+ # opts<Hash>:: Extra options for the line (formatting, etc).
350
+ #
351
+ # ==== Raises
352
+ # IniParse::NoSectionError::
353
+ # If no section has been added to the document yet.
354
+ #
355
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:147
356
+ def option(key, value, opts = T.unsafe(nil))
357
+ ;
358
+ end
359
+
360
+ # Creates a new section with the given name and adds it to the document.
361
+ #
362
+ # You can optionally supply a block (as detailed in the documentation for
363
+ # Generator#gen) in order to add options to the section.
364
+ #
365
+ # ==== Parameters
366
+ # name<String>:: A name for the given section.
367
+ #
368
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:107
369
+ def section(name, opts = T.unsafe(nil))
370
+ ;
371
+ end
372
+
373
+ # Wraps lines, setting default options for each.
374
+ #
375
+ # @yield [_self]
376
+ # @yieldparam _self [IniParse::Generator] the object that the method was called on
377
+ #
378
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:175
379
+ def with_options(opts = T.unsafe(nil))
380
+ ;
381
+ end
382
+
383
+ private
384
+
385
+ # Returns options for a line.
386
+ #
387
+ # If the context is a section, we use the section options as a base,
388
+ # rather than the global defaults.
389
+ #
390
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:200
391
+ def line_options(given_opts)
392
+ ;
393
+ end
394
+
395
+ class << self
396
+ # Creates a new IniParse::Document with the given sections and options.
397
+ #
398
+ # ==== Returns
399
+ # IniParse::Document
400
+ #
401
+ # source://iniparse-1.5.0/lib/iniparse/generator.rb:95
402
+ def gen(opts = T.unsafe(nil), &blk)
403
+ ;
404
+ end
405
+ end
406
+ end
407
+
408
+ # A base class for IniParse errors.
409
+ #
410
+ # source://iniparse-1.5.0/lib/iniparse.rb:13
411
+ class IniParse::IniParseError < ::StandardError; end
412
+
413
+ # Represents a collection of lines in an INI document.
414
+ #
415
+ # LineCollection acts a bit like an Array/Hash hybrid, allowing arbitrary
416
+ # lines to be added to the collection, but also indexes the keys of Section
417
+ # and Option lines to enable O(1) lookup via LineCollection#[].
418
+ #
419
+ # The lines instances are stored in an array, +@lines+, while the index of
420
+ # each Section/Option is held in a Hash, +@indicies+, keyed with the
421
+ # Section/Option#key value (see LineCollection#[]=).
422
+ #
423
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:12
424
+ module IniParse::LineCollection
425
+ include ::Enumerable
426
+
427
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:15
428
+ def initialize; end
429
+
430
+ # Appends a line to the collection.
431
+ #
432
+ # Note that if you pass a line with a key already represented in the
433
+ # collection, the old item will be replaced.
434
+ #
435
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:46
436
+ def <<(line)
437
+ ;
438
+ end
439
+
440
+ # Retrive a value identified by +key+.
441
+ #
442
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:21
443
+ def [](key)
444
+ ;
445
+ end
446
+
447
+ # Set a +value+ identified by +key+.
448
+ #
449
+ # If a value with the given key already exists, the value will be replaced
450
+ # with the new one, with the new value taking the position of the old.
451
+ #
452
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:30
453
+ def []=(key, value)
454
+ ;
455
+ end
456
+
457
+ # Removes the value identified by +key+.
458
+ #
459
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:70
460
+ def delete(key)
461
+ ;
462
+ end
463
+
464
+ # Enumerates through the collection.
465
+ #
466
+ # By default #each does not yield blank and comment lines.
467
+ #
468
+ # ==== Parameters
469
+ # include_blank<Boolean>:: Include blank/comment lines?
470
+ #
471
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:59
472
+ def each(include_blank = T.unsafe(nil))
473
+ ;
474
+ end
475
+
476
+ # Returns whether +key+ is in the collection.
477
+ #
478
+ # @return [Boolean]
479
+ #
480
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:81
481
+ def has_key?(*args)
482
+ ;
483
+ end
484
+
485
+ # Return an array containing the keys for the lines added to this
486
+ # collection.
487
+ #
488
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:87
489
+ def keys; end
490
+
491
+ # Appends a line to the collection.
492
+ #
493
+ # Note that if you pass a line with a key already represented in the
494
+ # collection, the old item will be replaced.
495
+ #
496
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:46
497
+ def push(line)
498
+ ;
499
+ end
500
+
501
+ # Returns this collection as an array. Includes blank and comment lines.
502
+ #
503
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:92
504
+ def to_a; end
505
+
506
+ # Returns this collection as a hash. Does not contain blank and comment
507
+ # lines.
508
+ #
509
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:98
510
+ def to_h; end
511
+
512
+ # Returns this collection as a hash. Does not contain blank and comment
513
+ # lines.
514
+ #
515
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:98
516
+ def to_hash; end
517
+ end
518
+
519
+ # Raised when a line is added to a collection which isn't allowed (e.g.
520
+ # adding a Section line into an OptionCollection).
521
+ #
522
+ # source://iniparse-1.5.0/lib/iniparse.rb:24
523
+ class IniParse::LineNotAllowed < ::IniParse::IniParseError; end
524
+
525
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:2
526
+ module IniParse::Lines
527
+ ;
528
+ end
529
+
530
+ # Stores options which appear at the beginning of a file, without a
531
+ # preceding section.
532
+ #
533
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:225
534
+ class IniParse::Lines::AnonymousSection < ::IniParse::Lines::Section
535
+ # @return [AnonymousSection] a new instance of AnonymousSection
536
+ #
537
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:226
538
+ def initialize; end
539
+
540
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:230
541
+ def to_ini; end
542
+
543
+ private
544
+
545
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:240
546
+ def line_contents; end
547
+ end
548
+
549
+ # Represents a blank line. Used so that we can preserve blank lines when
550
+ # writing back to the file.
551
+ #
552
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:307
553
+ class IniParse::Lines::Blank
554
+ include ::IniParse::Lines::Line
555
+
556
+ # @return [Boolean]
557
+ #
558
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:310
559
+ def blank?; end
560
+
561
+ class << self
562
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:314
563
+ def parse(line, opts)
564
+ ;
565
+ end
566
+ end
567
+ end
568
+
569
+ # Represents a comment. Comment lines begin with a semi-colon or hash.
570
+ #
571
+ # ; this is a comment
572
+ # # also a comment
573
+ #
574
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:337
575
+ class IniParse::Lines::Comment < ::IniParse::Lines::Blank
576
+ # Returns the inline comment for this line. Includes the comment
577
+ # separator at the beginning of the string.
578
+ #
579
+ # In rare cases where a comment seperator appeared in the original file,
580
+ # but without a comment, just the seperator will be returned.
581
+ #
582
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:348
583
+ def comment; end
584
+
585
+ # Returns if this line has an inline comment.
586
+ #
587
+ # Being a Comment this will always return true, even if the comment
588
+ # is nil. This would be the case if the line starts with a comment
589
+ # seperator, but has no comment text. See spec/fixtures/smb.ini for a
590
+ # real-world example.
591
+ #
592
+ # @return [Boolean]
593
+ #
594
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:338
595
+ def has_comment?; end
596
+ end
597
+
598
+ # A base class from which other line types should inherit.
599
+ #
600
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:4
601
+ module IniParse::Lines::Line
602
+ # ==== Parameters
603
+ # opts<Hash>:: Extra options for the line.
604
+ #
605
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:8
606
+ def initialize(opts = T.unsafe(nil))
607
+ ;
608
+ end
609
+
610
+ # Returns whether this is a line which has no data.
611
+ #
612
+ # @return [Boolean]
613
+ #
614
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:47
615
+ def blank?; end
616
+
617
+ # Returns the inline comment for this line. Includes the comment
618
+ # separator at the beginning of the string.
619
+ #
620
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:42
621
+ def comment; end
622
+
623
+ # Returns if this line has an inline comment.
624
+ #
625
+ # @return [Boolean]
626
+ #
627
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:18
628
+ def has_comment?; end
629
+
630
+ # Returns the contents for this line.
631
+ #
632
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:36
633
+ def line_contents; end
634
+
635
+ # Returns the options used to create the line
636
+ #
637
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:52
638
+ def options; end
639
+
640
+ # Returns this line as a string as it would be represented in an INI
641
+ # document.
642
+ #
643
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:24
644
+ def to_ini; end
645
+ end
646
+
647
+ # Represents probably the most common type of line in an INI document:
648
+ # an option. Consists of a key and value, usually separated with an =.
649
+ #
650
+ # key = value
651
+ #
652
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:250
653
+ class IniParse::Lines::Option
654
+ include ::IniParse::Lines::Line
655
+
656
+ # ==== Parameters
657
+ # key<String>:: The option key.
658
+ # value<String>:: The value for this option.
659
+ # opts<Hash>:: Extra options for the line.
660
+ #
661
+ # @return [Option] a new instance of Option
662
+ #
663
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:265
664
+ def initialize(key, value, opts = T.unsafe(nil))
665
+ ;
666
+ end
667
+
668
+ # Returns the value of attribute key.
669
+ #
670
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:258
671
+ def key; end
672
+
673
+ # Sets the attribute key
674
+ #
675
+ # @param value the value to set the attribute key to.
676
+ #
677
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:258
678
+ def key=(_arg0)
679
+ ;
680
+ end
681
+
682
+ # Returns the value of attribute value.
683
+ #
684
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:258
685
+ def value; end
686
+
687
+ # Sets the attribute value
688
+ #
689
+ # @param value the value to set the attribute value to.
690
+ #
691
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:258
692
+ def value=(_arg0)
693
+ ;
694
+ end
695
+
696
+ private
697
+
698
+ # returns an array to support multiple lines or a single one at once
699
+ # because of options key duplication
700
+ #
701
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:296
702
+ def line_contents; end
703
+
704
+ class << self
705
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:271
706
+ def parse(line, opts)
707
+ ;
708
+ end
709
+
710
+ # Attempts to typecast values.
711
+ #
712
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:279
713
+ def typecast(value)
714
+ ;
715
+ end
716
+ end
717
+ end
718
+
719
+ # Represents a section header in an INI document. Section headers consist
720
+ # of a string of characters wrapped in square brackets.
721
+ #
722
+ # [section]
723
+ # key=value
724
+ # etc
725
+ # ...
726
+ #
727
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:72
728
+ class IniParse::Lines::Section
729
+ include ::IniParse::Lines::Line
730
+ include ::Enumerable
731
+
732
+ # ==== Parameters
733
+ # key<String>:: The section name.
734
+ # opts<Hash>:: Extra options for the line.
735
+ #
736
+ # @return [Section] a new instance of Section
737
+ #
738
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:89
739
+ def initialize(key, opts = T.unsafe(nil))
740
+ ;
741
+ end
742
+
743
+ # Returns the value of an option identified by +key+.
744
+ #
745
+ # Returns nil if there is no corresponding option. If the key provided
746
+ # matches a set of duplicate options, an array will be returned containing
747
+ # the value of each option.
748
+ #
749
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:162
750
+ def [](key)
751
+ ;
752
+ end
753
+
754
+ # Adds a new option to this section, or updates an existing one.
755
+ #
756
+ # Note that +[]=+ has no knowledge of duplicate options and will happily
757
+ # overwrite duplicate options with your new value.
758
+ #
759
+ # section['an_option']
760
+ # # => ['duplicate one', 'duplicate two', ...]
761
+ # section['an_option'] = 'new value'
762
+ # section['an_option]
763
+ # # => 'new value'
764
+ #
765
+ # If you do not wish to overwrite duplicates, but wish instead for your
766
+ # new option to be considered a duplicate, use +add_option+ instead.
767
+ #
768
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:145
769
+ def []=(key, value)
770
+ ;
771
+ end
772
+
773
+ # Deletes the option identified by +key+.
774
+ #
775
+ # Returns the section.
776
+ #
777
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:178
778
+ def delete(*args)
779
+ ;
780
+ end
781
+
782
+ # Enumerates through each Option in this section.
783
+ #
784
+ # Does not yield blank and comment lines by default; if you want _all_
785
+ # lines to be yielded, pass true.
786
+ #
787
+ # ==== Parameters
788
+ # include_blank<Boolean>:: Include blank/comment lines?
789
+ #
790
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:127
791
+ def each(*args, &blk)
792
+ ;
793
+ end
794
+
795
+ # Returns true if an option with the given +key+ exists in this section.
796
+ #
797
+ # @return [Boolean]
798
+ #
799
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:193
800
+ def has_option?(key)
801
+ ;
802
+ end
803
+
804
+ # Returns the value of attribute key.
805
+ #
806
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:80
807
+ def key; end
808
+
809
+ # Sets the attribute key
810
+ #
811
+ # @param value the value to set the attribute key to.
812
+ #
813
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:80
814
+ def key=(_arg0)
815
+ ;
816
+ end
817
+
818
+ # Returns the value of attribute lines.
819
+ #
820
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:81
821
+ def lines; end
822
+
823
+ # Merges section +other+ into this one. If the section being merged into
824
+ # this one contains options with the same key, they will be handled as
825
+ # duplicates.
826
+ #
827
+ # ==== Parameters
828
+ # other<IniParse::Section>:: The section to merge into this one.
829
+ #
830
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:204
831
+ def merge!(other)
832
+ ;
833
+ end
834
+
835
+ # Like [], except instead of returning just the option value, it returns
836
+ # the matching line instance.
837
+ #
838
+ # Will return an array of lines if the key matches a set of duplicates.
839
+ #
840
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:188
841
+ def option(key)
842
+ ;
843
+ end
844
+
845
+ # Returns this line as a string as it would be represented in an INI
846
+ # document. Includes options, comments and blanks.
847
+ #
848
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:103
849
+ def to_ini; end
850
+
851
+ private
852
+
853
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:218
854
+ def line_contents; end
855
+
856
+ class << self
857
+ # source://iniparse-1.5.0/lib/iniparse/lines.rb:95
858
+ def parse(line, opts)
859
+ ;
860
+ end
861
+ end
862
+ end
863
+
864
+ # Raised when an option line is found during parsing before the first
865
+ # section.
866
+ #
867
+ # source://iniparse-1.5.0/lib/iniparse.rb:20
868
+ class IniParse::NoSectionError < ::IniParse::ParseError; end
869
+
870
+ # A implementation of LineCollection used for storing (mostly) Option
871
+ # instances contained within a Section.
872
+ #
873
+ # Whenever OptionCollection encounters an Option key already held in the
874
+ # collection, it treats it as a duplicate. This means that instead of
875
+ # overwriting the existing value, the value is changed to an array
876
+ # containing the previous _and_ the new Option instances.
877
+ #
878
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:140
879
+ class IniParse::OptionCollection
880
+ include ::Enumerable
881
+ include ::IniParse::LineCollection
882
+
883
+ # Appends a line to the collection.
884
+ #
885
+ # If you push an Option with a key already represented in the collection,
886
+ # the previous Option will not be overwritten, but treated as a duplicate.
887
+ #
888
+ # ==== Parameters
889
+ # line<IniParse::LineType::Line>:: The line to be added to this section.
890
+ #
891
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:151
892
+ def <<(line)
893
+ ;
894
+ end
895
+
896
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:166
897
+ def each(*args)
898
+ ;
899
+ end
900
+
901
+ # Return an array containing the keys for the lines added to this
902
+ # collection.
903
+ #
904
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:180
905
+ def keys; end
906
+ end
907
+
908
+ # Raised if an error occurs parsing an INI document.
909
+ #
910
+ # source://iniparse-1.5.0/lib/iniparse.rb:16
911
+ class IniParse::ParseError < ::IniParse::IniParseError; end
912
+
913
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:2
914
+ class IniParse::Parser
915
+ # Creates a new Parser instance for parsing string +source+.
916
+ #
917
+ # ==== Parameters
918
+ # source<String>:: The source string.
919
+ #
920
+ # @return [Parser] a new instance of Parser
921
+ #
922
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:31
923
+ def initialize(source)
924
+ ;
925
+ end
926
+
927
+ # Parses the source string and returns the resulting data structure.
928
+ #
929
+ # ==== Returns
930
+ # IniParse::Document
931
+ #
932
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:40
933
+ def parse; end
934
+
935
+ class << self
936
+ # Takes a raw line from an INI document, striping out any inline
937
+ # comment, and indent, then returns the appropriate tuple so that the
938
+ # Generator instance can add the line to the Document.
939
+ #
940
+ # ==== Raises
941
+ # IniParse::ParseError: If the line could not be parsed.
942
+ #
943
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:56
944
+ def parse_line(line)
945
+ ;
946
+ end
947
+
948
+ # Returns the line types.
949
+ #
950
+ # ==== Returns
951
+ # Array
952
+ #
953
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:9
954
+ def parse_types; end
955
+
956
+ # Sets the line types. Handy if you want to add your own custom Line
957
+ # classes.
958
+ #
959
+ # ==== Parameters
960
+ # types<Array[IniParse::Lines::Line]>:: An array containing Line classes.
961
+ #
962
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:19
963
+ def parse_types=(types)
964
+ ;
965
+ end
966
+
967
+ private
968
+
969
+ # Strips in inline comment from a line (or value), removes trailing
970
+ # whitespace and sets the comment options as applicable.
971
+ #
972
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:79
973
+ def strip_comment(line, opts)
974
+ ;
975
+ end
976
+
977
+ # Removes any leading whitespace from a line, and adds it to the options
978
+ # hash.
979
+ #
980
+ # source://iniparse-1.5.0/lib/iniparse/parser.rb:100
981
+ def strip_indent(line, opts)
982
+ ;
983
+ end
984
+ end
985
+ end
986
+
987
+ # A implementation of LineCollection used for storing (mostly) Option
988
+ # instances contained within a Section.
989
+ #
990
+ # Since it is assumed that an INI document will only represent a section
991
+ # once, if SectionCollection encounters a Section key already held in the
992
+ # collection, the existing section is merged with the new one (see
993
+ # IniParse::Lines::Section#merge!).
994
+ #
995
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:112
996
+ class IniParse::SectionCollection
997
+ include ::Enumerable
998
+ include ::IniParse::LineCollection
999
+
1000
+ # source://iniparse-1.5.0/lib/iniparse/line_collection.rb:115
1001
+ def <<(line)
1002
+ ;
1003
+ end
1004
+ end
1005
+
1006
+ # source://iniparse-1.5.0/lib/iniparse.rb:10
1007
+ IniParse::VERSION = T.let(T.unsafe(nil), String)