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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -1
  3. data/CONTRIBUTING.md +9 -11
  4. data/Gemfile +6 -3
  5. data/MANIFEST +7 -1
  6. data/README.md +15 -24
  7. data/benchmark/bootup.rb +13 -0
  8. data/checksum/ruby-lint-0.9.1.gem.sha512 +1 -0
  9. data/doc/code_analysis.md +20 -0
  10. data/doc/css/common.css +1 -0
  11. data/doc/images/flow.png +0 -0
  12. data/lib/ruby-lint.rb +1 -3
  13. data/lib/ruby-lint/analysis/base.rb +12 -2
  14. data/lib/ruby-lint/analysis/undefined_variables.rb +3 -2
  15. data/lib/ruby-lint/analysis/unused_variables.rb +3 -2
  16. data/lib/ruby-lint/ast/node.rb +1 -1
  17. data/lib/ruby-lint/benchmark/average.rb +115 -0
  18. data/lib/ruby-lint/cli/analyze.rb +19 -1
  19. data/lib/ruby-lint/constant_loader.rb +1 -3
  20. data/lib/ruby-lint/constant_path.rb +112 -0
  21. data/lib/ruby-lint/definition_builder/base.rb +0 -2
  22. data/lib/ruby-lint/definition_builder/ruby_module.rb +1 -1
  23. data/lib/ruby-lint/definitions/core/array.rb +304 -73
  24. data/lib/ruby-lint/definitions/core/fixnum.rb +575 -19
  25. data/lib/ruby-lint/definitions/core/float.rb +2650 -95
  26. data/lib/ruby-lint/definitions/core/hash.rb +926 -85
  27. data/lib/ruby-lint/definitions/core/ruby_copyright.rb +3 -1
  28. data/lib/ruby-lint/definitions/core/ruby_description.rb +3 -1
  29. data/lib/ruby-lint/definitions/core/ruby_engine.rb +3 -1
  30. data/lib/ruby-lint/definitions/core/ruby_patchlevel.rb +3 -1
  31. data/lib/ruby-lint/definitions/core/ruby_platform.rb +3 -1
  32. data/lib/ruby-lint/definitions/core/ruby_release_date.rb +3 -1
  33. data/lib/ruby-lint/definitions/core/ruby_version.rb +3 -1
  34. data/lib/ruby-lint/definitions/core/string.rb +847 -134
  35. data/lib/ruby-lint/definitions/core/string_io.rb +370 -25
  36. data/lib/ruby-lint/definitions/core/struct.rb +611 -146
  37. data/lib/ruby-lint/file_loader.rb +5 -6
  38. data/lib/ruby-lint/file_scanner.rb +44 -11
  39. data/lib/ruby-lint/inspector.rb +12 -2
  40. data/lib/ruby-lint/runner.rb +6 -2
  41. data/lib/ruby-lint/version.rb +1 -1
  42. data/lib/ruby-lint/virtual_machine.rb +19 -5
  43. data/ruby-lint.gemspec +1 -3
  44. data/spec/ruby-lint/analysis/argument_amount_spec.rb +5 -5
  45. data/spec/ruby-lint/analysis/base_spec.rb +4 -0
  46. data/spec/ruby-lint/analysis/shadowing_variables_spec.rb +4 -4
  47. data/spec/ruby-lint/analysis/undefined_methods_spec.rb +6 -6
  48. data/spec/ruby-lint/analysis/undefined_variables_spec.rb +5 -5
  49. data/spec/ruby-lint/analysis/unused_variables_spec.rb +12 -12
  50. data/spec/ruby-lint/cli/analyze_spec.rb +10 -0
  51. data/spec/ruby-lint/constant_path.rb +63 -0
  52. data/spec/ruby-lint/definition/ruby_object_spec.rb +2 -2
  53. data/spec/ruby-lint/report_spec.rb +2 -2
  54. data/spec/ruby-lint/runner_spec.rb +17 -0
  55. data/spec/ruby-lint/virtual_machine/assignments/assignment_arguments_spec.rb +14 -0
  56. data/spec/ruby-lint/virtual_machine/assignments/constants_spec.rb +23 -0
  57. data/spec/ruby-lint/virtual_machine/location_spec.rb +4 -4
  58. data/spec/ruby-lint/virtual_machine/method_call_tracking_spec.rb +4 -4
  59. data/task/build.rake +2 -7
  60. data/task/doc.rake +3 -1
  61. data/task/generate.rake +3 -0
  62. metadata +20 -36
  63. checksums.yaml.gz.asc +0 -17
  64. data.tar.gz.asc +0 -17
  65. data/lib/ruby-lint/helper/constant_paths.rb +0 -50
  66. metadata.gz.asc +0 -17
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_COPYRIGHT') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_COPYRIGHT').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_COPYRIGHT').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_DESCRIPTION') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_DESCRIPTION').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_DESCRIPTION').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_ENGINE') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_ENGINE').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_ENGINE').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_PATCHLEVEL') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_PATCHLEVEL').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_PATCHLEVEL').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_PLATFORM') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_PLATFORM').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_PLATFORM').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_RELEASE_DATE') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_RELEASE_DATE').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_RELEASE_DATE').deep_freeze
@@ -4,6 +4,8 @@
4
4
  # Platform: rbx 2.0.0.rc1
5
5
  #
6
6
  RubyLint::GlobalScope.definitions.define_constant('RUBY_VERSION') do |klass|
7
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('String'))
8
+ klass.instance!
7
9
  end
8
10
 
9
- RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_VERSION').deep_freeze
11
+ RubyLint::GlobalScope.definitions.lookup(:const, 'RUBY_VERSION').deep_freeze
@@ -1,14 +1,15 @@
1
- ##
2
- # Constant: String
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 20:14:20 +0100
5
+ # Platform: rbx 2.1.1
6
+
6
7
  RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
7
8
  klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
8
9
 
9
- klass.define_method('__allocate__')
10
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('Comparable'))
10
11
 
11
- klass.define_method('__class_init__')
12
+ klass.define_method('__allocate__')
12
13
 
13
14
  klass.define_method('allocate')
14
15
 
@@ -48,10 +49,18 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
48
49
  method.define_argument('other')
49
50
  end
50
51
 
52
+ klass.define_instance_method('<') do |method|
53
+ method.define_argument('other')
54
+ end
55
+
51
56
  klass.define_instance_method('<<') do |method|
52
57
  method.define_argument('other')
53
58
  end
54
59
 
60
+ klass.define_instance_method('<=') do |method|
61
+ method.define_argument('other')
62
+ end
63
+
55
64
  klass.define_instance_method('<=>') do |method|
56
65
  method.define_argument('other')
57
66
  end
@@ -64,6 +73,14 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
64
73
  method.define_argument('pattern')
65
74
  end
66
75
 
76
+ klass.define_instance_method('>') do |method|
77
+ method.define_argument('other')
78
+ end
79
+
80
+ klass.define_instance_method('>=') do |method|
81
+ method.define_argument('other')
82
+ end
83
+
67
84
  klass.define_instance_method('[]') do |method|
68
85
  method.define_argument('index')
69
86
  method.define_optional_argument('other')
@@ -99,6 +116,17 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
99
116
 
100
117
  klass.define_instance_method('ascii_only?')
101
118
 
119
+ klass.define_instance_method('b')
120
+
121
+ klass.define_instance_method('between?') do |method|
122
+ method.define_argument('min')
123
+ method.define_argument('max')
124
+ end
125
+
126
+ klass.define_instance_method('byte_append') do |method|
127
+ method.define_argument('str')
128
+ end
129
+
102
130
  klass.define_instance_method('bytes')
103
131
 
104
132
  klass.define_instance_method('bytesize')
@@ -121,9 +149,7 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
121
149
  method.define_optional_argument('padding')
122
150
  end
123
151
 
124
- klass.define_instance_method('chars') do |method|
125
- method.define_block_argument('block')
126
- end
152
+ klass.define_instance_method('chars')
127
153
 
128
154
  klass.define_instance_method('chomp') do |method|
129
155
  method.define_optional_argument('separator')
@@ -145,6 +171,8 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
145
171
 
146
172
  klass.define_instance_method('clear')
147
173
 
174
+ klass.define_instance_method('clone')
175
+
148
176
  klass.define_instance_method('codepoints')
149
177
 
150
178
  klass.define_instance_method('compare_substring') do |method|
@@ -193,9 +221,7 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
193
221
 
194
222
  klass.define_instance_method('each_byte')
195
223
 
196
- klass.define_instance_method('each_char') do |method|
197
- method.define_block_argument('block')
198
- end
224
+ klass.define_instance_method('each_char')
199
225
 
200
226
  klass.define_instance_method('each_codepoint')
201
227
 
@@ -537,7 +563,6 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
537
563
 
538
564
  klass.define_instance_method('transform') do |method|
539
565
  method.define_argument('tbl')
540
- method.define_argument('respect_kcode')
541
566
  end
542
567
 
543
568
  klass.define_instance_method('unpack') do |method|
@@ -558,16 +583,9 @@ RubyLint::GlobalScope.definitions.define_constant('String') do |klass|
558
583
  klass.define_instance_method('valid_encoding?')
559
584
  end
560
585
 
561
- ##
562
- # Constant: String::Complexifier
563
- # Created: 2013-04-01 18:33:55 +0200
564
- # Platform: rbx 2.0.0.rc1
565
- #
566
586
  RubyLint::GlobalScope.definitions.define_constant('String::Complexifier') do |klass|
567
587
  klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
568
588
 
569
- klass.define_method('__class_init__')
570
-
571
589
  klass.define_instance_method('convert')
572
590
 
573
591
  klass.define_instance_method('initialize') do |method|
@@ -575,141 +593,836 @@ RubyLint::GlobalScope.definitions.define_constant('String::Complexifier') do |kl
575
593
  end
576
594
  end
577
595
 
578
- ##
579
- # Constant: String::Complexifier::DENOMINATOR
580
- # Created: 2013-04-01 18:33:55 +0200
581
- # Platform: rbx 2.0.0.rc1
582
- #
583
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::DENOMINATOR') do |klass|
584
- end
596
+ RubyLint::GlobalScope.definitions.define_constant('String::ControlCharacters') do |klass|
597
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
585
598
 
586
- ##
587
- # Constant: String::Complexifier::NUMBER
588
- # Created: 2013-04-01 18:33:55 +0200
589
- # Platform: rbx 2.0.0.rc1
590
- #
591
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::NUMBER') do |klass|
592
- end
599
+ klass.define_method('&') do |method|
600
+ method.define_argument('other')
601
+ end
593
602
 
594
- ##
595
- # Constant: String::Complexifier::NUMBERNOS
596
- # Created: 2013-04-01 18:33:55 +0200
597
- # Platform: rbx 2.0.0.rc1
598
- #
599
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::NUMBERNOS') do |klass|
600
- end
603
+ klass.define_method('*') do |method|
604
+ method.define_argument('multiplier')
605
+ end
601
606
 
602
- ##
603
- # Constant: String::Complexifier::NUMERATOR
604
- # Created: 2013-04-01 18:33:55 +0200
605
- # Platform: rbx 2.0.0.rc1
606
- #
607
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::NUMERATOR') do |klass|
608
- end
607
+ klass.define_method('+') do |method|
608
+ method.define_argument('other')
609
+ end
609
610
 
610
- ##
611
- # Constant: String::Complexifier::PATTERN0
612
- # Created: 2013-04-01 18:33:55 +0200
613
- # Platform: rbx 2.0.0.rc1
614
- #
615
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::PATTERN0') do |klass|
616
- end
611
+ klass.define_method('-') do |method|
612
+ method.define_argument('other')
613
+ end
617
614
 
618
- ##
619
- # Constant: String::Complexifier::PATTERN1
620
- # Created: 2013-04-01 18:33:55 +0200
621
- # Platform: rbx 2.0.0.rc1
622
- #
623
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::PATTERN1') do |klass|
624
- end
615
+ klass.define_method('<<') do |method|
616
+ method.define_argument('obj')
617
+ end
625
618
 
626
- ##
627
- # Constant: String::Complexifier::PATTERN2
628
- # Created: 2013-04-01 18:33:55 +0200
629
- # Platform: rbx 2.0.0.rc1
630
- #
631
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::PATTERN2') do |klass|
632
- end
619
+ klass.define_method('[]') do |method|
620
+ method.define_argument('arg1')
621
+ method.define_optional_argument('arg2')
622
+ end
633
623
 
634
- ##
635
- # Constant: String::Complexifier::SPACE
636
- # Created: 2013-04-01 18:33:55 +0200
637
- # Platform: rbx 2.0.0.rc1
638
- #
639
- RubyLint::GlobalScope.definitions.define_constant('String::Complexifier::SPACE') do |klass|
640
- end
624
+ klass.define_method('[]=') do |method|
625
+ method.define_argument('index')
626
+ method.define_argument('ent')
627
+ method.define_optional_argument('fin')
628
+ end
641
629
 
642
- ##
643
- # Constant: String::ControlCharacters
644
- # Created: 2013-04-01 18:33:55 +0200
645
- # Platform: rbx 2.0.0.rc1
646
- #
647
- RubyLint::GlobalScope.definitions.define_constant('String::ControlCharacters') do |klass|
648
- end
630
+ klass.define_method('__append__') do |method|
631
+ method.define_argument('obj')
632
+ end
649
633
 
650
- ##
651
- # Constant: String::ControlPrintValue
652
- # Created: 2013-04-01 18:33:55 +0200
653
- # Platform: rbx 2.0.0.rc1
654
- #
655
- RubyLint::GlobalScope.definitions.define_constant('String::ControlPrintValue') do |klass|
634
+ klass.define_method('__rescue_match__') do |method|
635
+ method.define_argument('exception')
636
+ end
637
+
638
+ klass.define_method('all?')
639
+
640
+ klass.define_method('any?')
641
+
642
+ klass.define_method('assoc') do |method|
643
+ method.define_argument('obj')
644
+ end
645
+
646
+ klass.define_method('at') do |method|
647
+ method.define_argument('idx')
648
+ end
649
+
650
+ klass.define_method('chunk') do |method|
651
+ method.define_optional_argument('initial_state')
652
+ end
653
+
654
+ klass.define_method('clear')
655
+
656
+ klass.define_method('collect')
657
+
658
+ klass.define_method('collect!')
659
+
660
+ klass.define_method('collect_concat')
661
+
662
+ klass.define_method('combination') do |method|
663
+ method.define_argument('num')
664
+ end
665
+
666
+ klass.define_method('compact')
667
+
668
+ klass.define_method('compact!')
669
+
670
+ klass.define_method('concat') do |method|
671
+ method.define_argument('other')
672
+ end
673
+
674
+ klass.define_method('count') do |method|
675
+ method.define_optional_argument('item')
676
+ end
677
+
678
+ klass.define_method('cycle') do |method|
679
+ method.define_optional_argument('n')
680
+ end
681
+
682
+ klass.define_method('delete') do |method|
683
+ method.define_argument('obj')
684
+ end
685
+
686
+ klass.define_method('delete_at') do |method|
687
+ method.define_argument('idx')
688
+ end
689
+
690
+ klass.define_method('delete_if')
691
+
692
+ klass.define_method('detect') do |method|
693
+ method.define_optional_argument('ifnone')
694
+ end
695
+
696
+ klass.define_method('drop') do |method|
697
+ method.define_argument('n')
698
+ end
699
+
700
+ klass.define_method('drop_while')
701
+
702
+ klass.define_method('each')
703
+
704
+ klass.define_method('each_cons') do |method|
705
+ method.define_argument('num')
706
+ end
707
+
708
+ klass.define_method('each_entry') do |method|
709
+ method.define_rest_argument('pass')
710
+ end
711
+
712
+ klass.define_method('each_index')
713
+
714
+ klass.define_method('each_slice') do |method|
715
+ method.define_argument('slice_size')
716
+ end
717
+
718
+ klass.define_method('each_with_index') do |method|
719
+ method.define_rest_argument('args')
720
+ end
721
+
722
+ klass.define_method('each_with_object') do |method|
723
+ method.define_argument('memo')
724
+ end
725
+
726
+ klass.define_method('empty?')
727
+
728
+ klass.define_method('entries') do |method|
729
+ method.define_rest_argument('arg')
730
+ end
731
+
732
+ klass.define_method('fetch') do |method|
733
+ method.define_argument('idx')
734
+ method.define_optional_argument('default')
735
+ end
736
+
737
+ klass.define_method('fill') do |method|
738
+ method.define_optional_argument('a')
739
+ method.define_optional_argument('b')
740
+ method.define_optional_argument('c')
741
+ end
742
+
743
+ klass.define_method('find') do |method|
744
+ method.define_optional_argument('ifnone')
745
+ end
746
+
747
+ klass.define_method('find_all')
748
+
749
+ klass.define_method('find_index') do |method|
750
+ method.define_optional_argument('obj')
751
+ end
752
+
753
+ klass.define_method('first') do |method|
754
+ method.define_optional_argument('n')
755
+ end
756
+
757
+ klass.define_method('flat_map')
758
+
759
+ klass.define_method('flatten') do |method|
760
+ method.define_optional_argument('level')
761
+ end
762
+
763
+ klass.define_method('flatten!') do |method|
764
+ method.define_optional_argument('level')
765
+ end
766
+
767
+ klass.define_method('grep') do |method|
768
+ method.define_argument('pattern')
769
+ end
770
+
771
+ klass.define_method('group_by')
772
+
773
+ klass.define_method('index') do |method|
774
+ method.define_optional_argument('obj')
775
+ end
776
+
777
+ klass.define_method('inject') do |method|
778
+ method.define_optional_argument('initial')
779
+ method.define_optional_argument('sym')
780
+ end
781
+
782
+ klass.define_method('insert') do |method|
783
+ method.define_argument('idx')
784
+ method.define_rest_argument('items')
785
+ end
786
+
787
+ klass.define_method('join') do |method|
788
+ method.define_optional_argument('sep')
789
+ end
790
+
791
+ klass.define_method('keep_if')
792
+
793
+ klass.define_method('last') do |method|
794
+ method.define_optional_argument('n')
795
+ end
796
+
797
+ klass.define_method('lazy')
798
+
799
+ klass.define_method('length')
800
+
801
+ klass.define_method('map')
802
+
803
+ klass.define_method('map!')
804
+
805
+ klass.define_method('max')
806
+
807
+ klass.define_method('max_by')
808
+
809
+ klass.define_method('member?') do |method|
810
+ method.define_argument('obj')
811
+ end
812
+
813
+ klass.define_method('min')
814
+
815
+ klass.define_method('min_by')
816
+
817
+ klass.define_method('minmax')
818
+
819
+ klass.define_method('minmax_by')
820
+
821
+ klass.define_method('new_range') do |method|
822
+ method.define_argument('start')
823
+ method.define_argument('count')
824
+ end
825
+
826
+ klass.define_method('new_reserved') do |method|
827
+ method.define_argument('count')
828
+ end
829
+
830
+ klass.define_method('nitems')
831
+
832
+ klass.define_method('none?')
833
+
834
+ klass.define_method('one?')
835
+
836
+ klass.define_method('pack') do |method|
837
+ method.define_argument('directives')
838
+ end
839
+
840
+ klass.define_method('partition')
841
+
842
+ klass.define_method('permutation') do |method|
843
+ method.define_optional_argument('num')
844
+ end
845
+
846
+ klass.define_method('pop') do |method|
847
+ method.define_optional_argument('many')
848
+ end
849
+
850
+ klass.define_method('product') do |method|
851
+ method.define_rest_argument('args')
852
+ end
853
+
854
+ klass.define_method('push') do |method|
855
+ method.define_rest_argument('args')
856
+ end
857
+
858
+ klass.define_method('rassoc') do |method|
859
+ method.define_argument('obj')
860
+ end
861
+
862
+ klass.define_method('reduce') do |method|
863
+ method.define_optional_argument('initial')
864
+ method.define_optional_argument('sym')
865
+ end
866
+
867
+ klass.define_method('reject')
868
+
869
+ klass.define_method('reject!')
870
+
871
+ klass.define_method('repeated_combination') do |method|
872
+ method.define_argument('combination_size')
873
+ end
874
+
875
+ klass.define_method('repeated_permutation') do |method|
876
+ method.define_argument('combination_size')
877
+ end
878
+
879
+ klass.define_method('replace') do |method|
880
+ method.define_argument('other')
881
+ end
882
+
883
+ klass.define_method('reverse')
884
+
885
+ klass.define_method('reverse!')
886
+
887
+ klass.define_method('reverse_each')
888
+
889
+ klass.define_method('rindex') do |method|
890
+ method.define_optional_argument('obj')
891
+ end
892
+
893
+ klass.define_method('rotate') do |method|
894
+ method.define_optional_argument('n')
895
+ end
896
+
897
+ klass.define_method('rotate!') do |method|
898
+ method.define_optional_argument('cnt')
899
+ end
900
+
901
+ klass.define_method('sample') do |method|
902
+ method.define_optional_argument('count')
903
+ method.define_optional_argument('options')
904
+ end
905
+
906
+ klass.define_method('select')
907
+
908
+ klass.define_method('select!')
909
+
910
+ klass.define_method('shelljoin')
911
+
912
+ klass.define_method('shift') do |method|
913
+ method.define_optional_argument('n')
914
+ end
915
+
916
+ klass.define_method('shuffle') do |method|
917
+ method.define_optional_argument('options')
918
+ end
919
+
920
+ klass.define_method('shuffle!') do |method|
921
+ method.define_optional_argument('options')
922
+ end
923
+
924
+ klass.define_method('size')
925
+
926
+ klass.define_method('slice') do |method|
927
+ method.define_argument('arg1')
928
+ method.define_optional_argument('arg2')
929
+ end
930
+
931
+ klass.define_method('slice!') do |method|
932
+ method.define_argument('start')
933
+ method.define_optional_argument('length')
934
+ end
935
+
936
+ klass.define_method('slice_before') do |method|
937
+ method.define_optional_argument('arg')
938
+ end
939
+
940
+ klass.define_method('sort')
941
+
942
+ klass.define_method('sort!')
943
+
944
+ klass.define_method('sort_by')
945
+
946
+ klass.define_method('sort_by!')
947
+
948
+ klass.define_method('sort_inplace')
949
+
950
+ klass.define_method('start')
951
+
952
+ klass.define_method('start=')
953
+
954
+ klass.define_method('take') do |method|
955
+ method.define_argument('n')
956
+ end
957
+
958
+ klass.define_method('take_while')
959
+
960
+ klass.define_method('to_a')
961
+
962
+ klass.define_method('to_ary')
963
+
964
+ klass.define_method('to_set') do |method|
965
+ method.define_optional_argument('klass')
966
+ method.define_rest_argument('args')
967
+ method.define_block_argument('block')
968
+ end
969
+
970
+ klass.define_method('to_tuple')
971
+
972
+ klass.define_method('total')
973
+
974
+ klass.define_method('total=')
975
+
976
+ klass.define_method('transpose')
977
+
978
+ klass.define_method('tuple')
979
+
980
+ klass.define_method('tuple=')
981
+
982
+ klass.define_method('uniq')
983
+
984
+ klass.define_method('uniq!')
985
+
986
+ klass.define_method('unshift') do |method|
987
+ method.define_rest_argument('values')
988
+ end
989
+
990
+ klass.define_method('values_at') do |method|
991
+ method.define_rest_argument('args')
992
+ end
993
+
994
+ klass.define_method('with_object') do |method|
995
+ method.define_argument('memo')
996
+ end
997
+
998
+ klass.define_method('zip') do |method|
999
+ method.define_rest_argument('others')
1000
+ end
1001
+
1002
+ klass.define_method('|') do |method|
1003
+ method.define_argument('other')
1004
+ end
656
1005
  end
657
1006
 
658
- ##
659
- # Constant: String::Rationalizer
660
- # Created: 2013-04-01 18:33:55 +0200
661
- # Platform: rbx 2.0.0.rc1
662
- #
663
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer') do |klass|
1007
+ RubyLint::GlobalScope.definitions.define_constant('String::ControlPrintValue') do |klass|
664
1008
  klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
665
1009
 
666
- klass.define_method('__class_init__')
1010
+ klass.define_method('&') do |method|
1011
+ method.define_argument('other')
1012
+ end
667
1013
 
668
- klass.define_instance_method('convert')
1014
+ klass.define_method('*') do |method|
1015
+ method.define_argument('multiplier')
1016
+ end
669
1017
 
670
- klass.define_instance_method('initialize') do |method|
671
- method.define_argument('value')
1018
+ klass.define_method('+') do |method|
1019
+ method.define_argument('other')
672
1020
  end
673
- end
674
1021
 
675
- ##
676
- # Constant: String::Rationalizer::DENOMINATOR
677
- # Created: 2013-04-01 18:33:55 +0200
678
- # Platform: rbx 2.0.0.rc1
679
- #
680
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer::DENOMINATOR') do |klass|
681
- end
1022
+ klass.define_method('-') do |method|
1023
+ method.define_argument('other')
1024
+ end
682
1025
 
683
- ##
684
- # Constant: String::Rationalizer::NUMERATOR
685
- # Created: 2013-04-01 18:33:55 +0200
686
- # Platform: rbx 2.0.0.rc1
687
- #
688
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer::NUMERATOR') do |klass|
689
- end
1026
+ klass.define_method('<<') do |method|
1027
+ method.define_argument('obj')
1028
+ end
690
1029
 
691
- ##
692
- # Constant: String::Rationalizer::PATTERN
693
- # Created: 2013-04-01 18:33:55 +0200
694
- # Platform: rbx 2.0.0.rc1
695
- #
696
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer::PATTERN') do |klass|
697
- end
1030
+ klass.define_method('[]') do |method|
1031
+ method.define_argument('arg1')
1032
+ method.define_optional_argument('arg2')
1033
+ end
698
1034
 
699
- ##
700
- # Constant: String::Rationalizer::RATIONAL
701
- # Created: 2013-04-01 18:33:55 +0200
702
- # Platform: rbx 2.0.0.rc1
703
- #
704
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer::RATIONAL') do |klass|
1035
+ klass.define_method('[]=') do |method|
1036
+ method.define_argument('index')
1037
+ method.define_argument('ent')
1038
+ method.define_optional_argument('fin')
1039
+ end
1040
+
1041
+ klass.define_method('__append__') do |method|
1042
+ method.define_argument('obj')
1043
+ end
1044
+
1045
+ klass.define_method('__rescue_match__') do |method|
1046
+ method.define_argument('exception')
1047
+ end
1048
+
1049
+ klass.define_method('all?')
1050
+
1051
+ klass.define_method('any?')
1052
+
1053
+ klass.define_method('assoc') do |method|
1054
+ method.define_argument('obj')
1055
+ end
1056
+
1057
+ klass.define_method('at') do |method|
1058
+ method.define_argument('idx')
1059
+ end
1060
+
1061
+ klass.define_method('chunk') do |method|
1062
+ method.define_optional_argument('initial_state')
1063
+ end
1064
+
1065
+ klass.define_method('clear')
1066
+
1067
+ klass.define_method('collect')
1068
+
1069
+ klass.define_method('collect!')
1070
+
1071
+ klass.define_method('collect_concat')
1072
+
1073
+ klass.define_method('combination') do |method|
1074
+ method.define_argument('num')
1075
+ end
1076
+
1077
+ klass.define_method('compact')
1078
+
1079
+ klass.define_method('compact!')
1080
+
1081
+ klass.define_method('concat') do |method|
1082
+ method.define_argument('other')
1083
+ end
1084
+
1085
+ klass.define_method('count') do |method|
1086
+ method.define_optional_argument('item')
1087
+ end
1088
+
1089
+ klass.define_method('cycle') do |method|
1090
+ method.define_optional_argument('n')
1091
+ end
1092
+
1093
+ klass.define_method('delete') do |method|
1094
+ method.define_argument('obj')
1095
+ end
1096
+
1097
+ klass.define_method('delete_at') do |method|
1098
+ method.define_argument('idx')
1099
+ end
1100
+
1101
+ klass.define_method('delete_if')
1102
+
1103
+ klass.define_method('detect') do |method|
1104
+ method.define_optional_argument('ifnone')
1105
+ end
1106
+
1107
+ klass.define_method('drop') do |method|
1108
+ method.define_argument('n')
1109
+ end
1110
+
1111
+ klass.define_method('drop_while')
1112
+
1113
+ klass.define_method('each')
1114
+
1115
+ klass.define_method('each_cons') do |method|
1116
+ method.define_argument('num')
1117
+ end
1118
+
1119
+ klass.define_method('each_entry') do |method|
1120
+ method.define_rest_argument('pass')
1121
+ end
1122
+
1123
+ klass.define_method('each_index')
1124
+
1125
+ klass.define_method('each_slice') do |method|
1126
+ method.define_argument('slice_size')
1127
+ end
1128
+
1129
+ klass.define_method('each_with_index') do |method|
1130
+ method.define_rest_argument('args')
1131
+ end
1132
+
1133
+ klass.define_method('each_with_object') do |method|
1134
+ method.define_argument('memo')
1135
+ end
1136
+
1137
+ klass.define_method('empty?')
1138
+
1139
+ klass.define_method('entries') do |method|
1140
+ method.define_rest_argument('arg')
1141
+ end
1142
+
1143
+ klass.define_method('fetch') do |method|
1144
+ method.define_argument('idx')
1145
+ method.define_optional_argument('default')
1146
+ end
1147
+
1148
+ klass.define_method('fill') do |method|
1149
+ method.define_optional_argument('a')
1150
+ method.define_optional_argument('b')
1151
+ method.define_optional_argument('c')
1152
+ end
1153
+
1154
+ klass.define_method('find') do |method|
1155
+ method.define_optional_argument('ifnone')
1156
+ end
1157
+
1158
+ klass.define_method('find_all')
1159
+
1160
+ klass.define_method('find_index') do |method|
1161
+ method.define_optional_argument('obj')
1162
+ end
1163
+
1164
+ klass.define_method('first') do |method|
1165
+ method.define_optional_argument('n')
1166
+ end
1167
+
1168
+ klass.define_method('flat_map')
1169
+
1170
+ klass.define_method('flatten') do |method|
1171
+ method.define_optional_argument('level')
1172
+ end
1173
+
1174
+ klass.define_method('flatten!') do |method|
1175
+ method.define_optional_argument('level')
1176
+ end
1177
+
1178
+ klass.define_method('grep') do |method|
1179
+ method.define_argument('pattern')
1180
+ end
1181
+
1182
+ klass.define_method('group_by')
1183
+
1184
+ klass.define_method('index') do |method|
1185
+ method.define_optional_argument('obj')
1186
+ end
1187
+
1188
+ klass.define_method('inject') do |method|
1189
+ method.define_optional_argument('initial')
1190
+ method.define_optional_argument('sym')
1191
+ end
1192
+
1193
+ klass.define_method('insert') do |method|
1194
+ method.define_argument('idx')
1195
+ method.define_rest_argument('items')
1196
+ end
1197
+
1198
+ klass.define_method('join') do |method|
1199
+ method.define_optional_argument('sep')
1200
+ end
1201
+
1202
+ klass.define_method('keep_if')
1203
+
1204
+ klass.define_method('last') do |method|
1205
+ method.define_optional_argument('n')
1206
+ end
1207
+
1208
+ klass.define_method('lazy')
1209
+
1210
+ klass.define_method('length')
1211
+
1212
+ klass.define_method('map')
1213
+
1214
+ klass.define_method('map!')
1215
+
1216
+ klass.define_method('max')
1217
+
1218
+ klass.define_method('max_by')
1219
+
1220
+ klass.define_method('member?') do |method|
1221
+ method.define_argument('obj')
1222
+ end
1223
+
1224
+ klass.define_method('min')
1225
+
1226
+ klass.define_method('min_by')
1227
+
1228
+ klass.define_method('minmax')
1229
+
1230
+ klass.define_method('minmax_by')
1231
+
1232
+ klass.define_method('new_range') do |method|
1233
+ method.define_argument('start')
1234
+ method.define_argument('count')
1235
+ end
1236
+
1237
+ klass.define_method('new_reserved') do |method|
1238
+ method.define_argument('count')
1239
+ end
1240
+
1241
+ klass.define_method('nitems')
1242
+
1243
+ klass.define_method('none?')
1244
+
1245
+ klass.define_method('one?')
1246
+
1247
+ klass.define_method('pack') do |method|
1248
+ method.define_argument('directives')
1249
+ end
1250
+
1251
+ klass.define_method('partition')
1252
+
1253
+ klass.define_method('permutation') do |method|
1254
+ method.define_optional_argument('num')
1255
+ end
1256
+
1257
+ klass.define_method('pop') do |method|
1258
+ method.define_optional_argument('many')
1259
+ end
1260
+
1261
+ klass.define_method('product') do |method|
1262
+ method.define_rest_argument('args')
1263
+ end
1264
+
1265
+ klass.define_method('push') do |method|
1266
+ method.define_rest_argument('args')
1267
+ end
1268
+
1269
+ klass.define_method('rassoc') do |method|
1270
+ method.define_argument('obj')
1271
+ end
1272
+
1273
+ klass.define_method('reduce') do |method|
1274
+ method.define_optional_argument('initial')
1275
+ method.define_optional_argument('sym')
1276
+ end
1277
+
1278
+ klass.define_method('reject')
1279
+
1280
+ klass.define_method('reject!')
1281
+
1282
+ klass.define_method('repeated_combination') do |method|
1283
+ method.define_argument('combination_size')
1284
+ end
1285
+
1286
+ klass.define_method('repeated_permutation') do |method|
1287
+ method.define_argument('combination_size')
1288
+ end
1289
+
1290
+ klass.define_method('replace') do |method|
1291
+ method.define_argument('other')
1292
+ end
1293
+
1294
+ klass.define_method('reverse')
1295
+
1296
+ klass.define_method('reverse!')
1297
+
1298
+ klass.define_method('reverse_each')
1299
+
1300
+ klass.define_method('rindex') do |method|
1301
+ method.define_optional_argument('obj')
1302
+ end
1303
+
1304
+ klass.define_method('rotate') do |method|
1305
+ method.define_optional_argument('n')
1306
+ end
1307
+
1308
+ klass.define_method('rotate!') do |method|
1309
+ method.define_optional_argument('cnt')
1310
+ end
1311
+
1312
+ klass.define_method('sample') do |method|
1313
+ method.define_optional_argument('count')
1314
+ method.define_optional_argument('options')
1315
+ end
1316
+
1317
+ klass.define_method('select')
1318
+
1319
+ klass.define_method('select!')
1320
+
1321
+ klass.define_method('shelljoin')
1322
+
1323
+ klass.define_method('shift') do |method|
1324
+ method.define_optional_argument('n')
1325
+ end
1326
+
1327
+ klass.define_method('shuffle') do |method|
1328
+ method.define_optional_argument('options')
1329
+ end
1330
+
1331
+ klass.define_method('shuffle!') do |method|
1332
+ method.define_optional_argument('options')
1333
+ end
1334
+
1335
+ klass.define_method('size')
1336
+
1337
+ klass.define_method('slice') do |method|
1338
+ method.define_argument('arg1')
1339
+ method.define_optional_argument('arg2')
1340
+ end
1341
+
1342
+ klass.define_method('slice!') do |method|
1343
+ method.define_argument('start')
1344
+ method.define_optional_argument('length')
1345
+ end
1346
+
1347
+ klass.define_method('slice_before') do |method|
1348
+ method.define_optional_argument('arg')
1349
+ end
1350
+
1351
+ klass.define_method('sort')
1352
+
1353
+ klass.define_method('sort!')
1354
+
1355
+ klass.define_method('sort_by')
1356
+
1357
+ klass.define_method('sort_by!')
1358
+
1359
+ klass.define_method('sort_inplace')
1360
+
1361
+ klass.define_method('start')
1362
+
1363
+ klass.define_method('start=')
1364
+
1365
+ klass.define_method('take') do |method|
1366
+ method.define_argument('n')
1367
+ end
1368
+
1369
+ klass.define_method('take_while')
1370
+
1371
+ klass.define_method('to_a')
1372
+
1373
+ klass.define_method('to_ary')
1374
+
1375
+ klass.define_method('to_set') do |method|
1376
+ method.define_optional_argument('klass')
1377
+ method.define_rest_argument('args')
1378
+ method.define_block_argument('block')
1379
+ end
1380
+
1381
+ klass.define_method('to_tuple')
1382
+
1383
+ klass.define_method('total')
1384
+
1385
+ klass.define_method('total=')
1386
+
1387
+ klass.define_method('transpose')
1388
+
1389
+ klass.define_method('tuple')
1390
+
1391
+ klass.define_method('tuple=')
1392
+
1393
+ klass.define_method('uniq')
1394
+
1395
+ klass.define_method('uniq!')
1396
+
1397
+ klass.define_method('unshift') do |method|
1398
+ method.define_rest_argument('values')
1399
+ end
1400
+
1401
+ klass.define_method('values_at') do |method|
1402
+ method.define_rest_argument('args')
1403
+ end
1404
+
1405
+ klass.define_method('with_object') do |method|
1406
+ method.define_argument('memo')
1407
+ end
1408
+
1409
+ klass.define_method('zip') do |method|
1410
+ method.define_rest_argument('others')
1411
+ end
1412
+
1413
+ klass.define_method('|') do |method|
1414
+ method.define_argument('other')
1415
+ end
705
1416
  end
706
1417
 
707
- ##
708
- # Constant: String::Rationalizer::SPACE
709
- # Created: 2013-04-01 18:33:55 +0200
710
- # Platform: rbx 2.0.0.rc1
711
- #
712
- RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer::SPACE') do |klass|
1418
+ RubyLint::GlobalScope.definitions.define_constant('String::Rationalizer') do |klass|
1419
+ klass.inherits(RubyLint::GlobalScope.constant_proxy('Object'))
1420
+
1421
+ klass.define_instance_method('convert')
1422
+
1423
+ klass.define_instance_method('initialize') do |method|
1424
+ method.define_argument('value')
1425
+ end
713
1426
  end
714
1427
 
715
- RubyLint::GlobalScope.definitions.lookup(:const, 'String').deep_freeze
1428
+ RubyLint::GlobalScope.definitions.lookup(:const, 'String').deep_freeze