rcodetools 0.7.0.0 → 0.8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. data/CHANGES +12 -0
  2. data/README +1 -1
  3. data/README.emacs +21 -4
  4. data/README.ja +1 -1
  5. data/README.xmpfilter +159 -74
  6. data/Rakefile +3 -37
  7. data/anything-rcodetools.el +142 -0
  8. data/bin/rct-complete +1 -1
  9. data/bin/rct-doc +1 -1
  10. data/bin/rct-meth-args +33 -2
  11. data/bin/xmpfilter +5 -1
  12. data/lib/rcodetools/compat.rb +14 -0
  13. data/lib/rcodetools/completion.rb +8 -6
  14. data/lib/rcodetools/fork.rb +15 -8
  15. data/lib/rcodetools/options.rb +8 -0
  16. data/lib/rcodetools/xmpfilter.rb +80 -33
  17. data/lib/rcodetools/xmptestunitfilter.rb +76 -21
  18. data/lib/ruby_toggle_file.rb +1 -1
  19. data/rcodetools.el +213 -20
  20. data/test/test_functional.rb +36 -68
  21. data/test/test_method_analyzer.rb +28 -20
  22. data/test/test_ruby_toggle_file.rb +118 -69
  23. data/test/test_xmpfilter.rb +75 -47
  24. data/test/test_xmptestunitfilter.rb +12 -11
  25. metadata +83 -133
  26. data/test/data/add_markers-input.rb +0 -2
  27. data/test/data/add_markers-output.rb +0 -2
  28. data/test/data/bindings-input.rb +0 -26
  29. data/test/data/bindings-output.rb +0 -31
  30. data/test/data/completion-input.rb +0 -1
  31. data/test/data/completion-output.rb +0 -2
  32. data/test/data/completion_class_info-input.rb +0 -1
  33. data/test/data/completion_class_info-output.rb +0 -10
  34. data/test/data/completion_class_info_no_candidates-input.rb +0 -1
  35. data/test/data/completion_class_info_no_candidates-output.rb +0 -1
  36. data/test/data/completion_detect_rbtest-input.rb +0 -7
  37. data/test/data/completion_detect_rbtest-output.rb +0 -2
  38. data/test/data/completion_detect_rbtest2-input.rb +0 -1
  39. data/test/data/completion_detect_rbtest2-output.rb +0 -2
  40. data/test/data/completion_emacs-input.rb +0 -1
  41. data/test/data/completion_emacs-output.rb +0 -6
  42. data/test/data/completion_emacs_icicles-input.rb +0 -1
  43. data/test/data/completion_emacs_icicles-output.rb +0 -6
  44. data/test/data/completion_in_method-input.rb +0 -3
  45. data/test/data/completion_in_method-output.rb +0 -1
  46. data/test/data/completion_in_method-test.rb +0 -6
  47. data/test/data/completion_rbtest-input.rb +0 -7
  48. data/test/data/completion_rbtest-output.rb +0 -2
  49. data/test/data/doc-input.rb +0 -1
  50. data/test/data/doc-output.rb +0 -1
  51. data/test/data/doc_detect_rbtest-input.rb +0 -1
  52. data/test/data/doc_detect_rbtest-output.rb +0 -1
  53. data/test/data/doc_detect_rbtest2-input.rb +0 -7
  54. data/test/data/doc_detect_rbtest2-output.rb +0 -1
  55. data/test/data/doc_rbtest-input.rb +0 -7
  56. data/test/data/doc_rbtest-output.rb +0 -1
  57. data/test/data/no_warnings-input.rb +0 -3
  58. data/test/data/no_warnings-output.rb +0 -4
  59. data/test/data/refe-input.rb +0 -1
  60. data/test/data/refe-output.rb +0 -1
  61. data/test/data/ri-input.rb +0 -1
  62. data/test/data/ri-output.rb +0 -1
  63. data/test/data/ri_emacs-input.rb +0 -1
  64. data/test/data/ri_emacs-output.rb +0 -1
  65. data/test/data/ri_vim-input.rb +0 -1
  66. data/test/data/ri_vim-output.rb +0 -1
  67. data/test/data/rspec-input.rb +0 -48
  68. data/test/data/rspec-output.rb +0 -52
  69. data/test/data/rspec_poetry-input.rb +0 -48
  70. data/test/data/rspec_poetry-output.rb +0 -52
  71. data/test/data/simple_annotation-input.rb +0 -8
  72. data/test/data/simple_annotation-output.rb +0 -8
  73. data/test/data/unit_test-input.rb +0 -50
  74. data/test/data/unit_test-output.rb +0 -52
  75. data/test/data/unit_test_detect_rbtest-input.rb +0 -50
  76. data/test/data/unit_test_detect_rbtest-output.rb +0 -52
  77. data/test/data/unit_test_detect_rbtest2-input.rb +0 -6
  78. data/test/data/unit_test_detect_rbtest2-output.rb +0 -6
  79. data/test/data/unit_test_poetry-input.rb +0 -50
  80. data/test/data/unit_test_poetry-output.rb +0 -52
  81. data/test/data/unit_test_rbtest-input.rb +0 -6
  82. data/test/data/unit_test_rbtest-output.rb +0 -6
  83. data/test/test_run.rb +0 -45
@@ -5,9 +5,6 @@ require "rcodetools/xmptestunitfilter"
5
5
 
6
6
  class TestXMPTestUnitFilter < Test::Unit::TestCase
7
7
  include Rcodetools
8
- def setup
9
- @xmp = XMPTestUnitFilter.new
10
- end
11
8
 
12
9
  ANNOTATION_VAR_INFERENCE_INPUT = <<EOF
13
10
  arr = []
@@ -31,20 +28,22 @@ assert_equal(\"#<struct X foo=\\\"foo\\\", bar=\\\"bar\\\">\", arr.last.inspect)
31
28
  EOF
32
29
 
33
30
  def test_annotation_var_inference
31
+ xmp = XMPTestUnitFilter.new
34
32
  assert_equal(ANNOTATION_VAR_INFERENCE_OUTPUT,
35
- @xmp.annotate(ANNOTATION_VAR_INFERENCE_INPUT).join(""))
33
+ xmp.annotate(ANNOTATION_VAR_INFERENCE_INPUT).join(""))
36
34
  end
37
35
 
38
36
  def test_equality_assertions
39
- assert_equal(["a = 1\n", "assert_equal(1, a)"], @xmp.annotate("a = 1\na # \=>"))
37
+ xmp = XMPTestUnitFilter.new
38
+ assert_equal(["a = 1\n", "assert_equal(1, a)"], xmp.annotate("a = 1\na # \=>"))
40
39
  assert_equal(["a = {1,2}\n", "assert_equal({1=>2}, a)"],
41
- @xmp.annotate("a = {1,2}\na # \=>"))
40
+ xmp.annotate("a = {1,2}\na # \=>"))
42
41
  assert_equal(["a = [1,2]\n", "assert_equal([1, 2], a)"],
43
- @xmp.annotate("a = [1,2]\na # \=>"))
42
+ xmp.annotate("a = [1,2]\na # \=>"))
44
43
  assert_equal(["a = 'foo'\n", "assert_equal(\"foo\", a)"],
45
- @xmp.annotate("a = 'foo'\na # \=>"))
44
+ xmp.annotate("a = 'foo'\na # \=>"))
46
45
  assert_equal(["a = 1.0\n", "assert_in_delta(1.0, a, 0.0001)"],
47
- @xmp.annotate("a = 1.0\na # \=>"))
46
+ xmp.annotate("a = 1.0\na # \=>"))
48
47
  end
49
48
 
50
49
  def test_raise_assertion
@@ -52,12 +51,14 @@ EOF
52
51
  class NoGood < Exception; end
53
52
  raise NoGood # \=>
54
53
  EOF
54
+ xmp = XMPTestUnitFilter.new
55
55
  assert_equal(["class NoGood < Exception; end\n",
56
- "assert_raise(NoGood){raise NoGood}\n"], @xmp.annotate(code))
56
+ "assert_raise(NoGood){raise NoGood}\n"], xmp.annotate(code))
57
57
  end
58
58
 
59
59
  def test_assert_nil
60
- assert_equal(["a = nil\n", "assert_nil(a)"], @xmp.annotate("a = nil\na # \=>"))
60
+ xmp = XMPTestUnitFilter.new
61
+ assert_equal(["a = nil\n", "assert_nil(a)"], xmp.annotate("a = nil\na # \=>"))
61
62
  end
62
63
 
63
64
  def test_poetry_mode
metadata CHANGED
@@ -1,174 +1,124 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.1
3
- specification_version: 1
4
2
  name: rcodetools
5
3
  version: !ruby/object:Gem::Version
6
- version: 0.7.0.0
7
- date: 2007-06-22 00:00:00 +02:00
8
- summary: rcodetools is a collection of Ruby code manipulation tools
9
- require_paths:
10
- - lib
11
- email: "\"rubikitch\" <rubikitch@ruby-lang.org>, \"Mauricio Fernandez\" <mfp@acm.org>"
12
- homepage: http://eigenclass.org/hiki.rb?rcodetools
13
- rubyforge_project:
14
- description: "rcodetools is a collection of Ruby code manipulation tools. It includes xmpfilter and editor-independent Ruby development helper tools, as well as emacs and vim interfaces. Currently, rcodetools comprises: * xmpfilter: Automagic Test::Unit assertions/RSpec expectations and code annotations * rct-complete: Accurate method/class/constant etc. completions * rct-doc: Document browsing and code navigator * rct-meth-args: Precise method info (meta-prog. aware) and TAGS generation"
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 0.8.0.0
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message: |+
29
-
30
- ==============================================================================
31
-
32
- rcodetools will work better if you use it along with FastRI, an alternative to
33
- the standard 'ri' documentation browser which features intelligent searching,
34
- better RubyGems integration, vastly improved performance, remote queries via
35
- DRb... You can find it at http://eigenclass.org/hiki.rb?fastri and it is also
36
- available in RubyGems format:
37
-
38
- gem install fastri
39
-
40
- Read README.emacs and README.vim for information on how to integrate
41
- rcodetools in your editor.
42
-
43
- ==============================================================================
44
-
45
6
  authors:
46
7
  - rubikitch and Mauricio Fernandez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-08-03 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: "rcodetools is a collection of Ruby code manipulation tools. It includes xmpfilter and editor-independent Ruby development helper tools, as well as emacs and vim interfaces. Currently, rcodetools comprises: * xmpfilter: Automagic Test::Unit assertions/RSpec expectations and code annotations * rct-complete: Accurate method/class/constant etc. completions * rct-doc: Document browsing and code navigator * rct-meth-args: Precise method info (meta-prog. aware) and TAGS generation"
17
+ email: "\"rubikitch\" <rubikitch@ruby-lang.org>, \"Mauricio Fernandez\" <mfp@acm.org>"
18
+ executables:
19
+ - rct-complete
20
+ - rct-doc
21
+ - xmpfilter
22
+ - rct-meth-args
23
+ extensions: []
24
+
25
+ extra_rdoc_files:
26
+ - README
47
27
  files:
48
28
  - bin/rct-complete
49
29
  - bin/rct-doc
50
30
  - bin/xmpfilter
51
31
  - bin/rct-meth-args
52
- - lib/method_analyzer.rb
53
- - lib/ruby_toggle_file.rb
54
- - lib/rcodetools/xmpfilter.rb
55
32
  - lib/rcodetools/fork.rb
56
- - lib/rcodetools/options.rb
57
- - lib/rcodetools/doc.rb
58
33
  - lib/rcodetools/completion.rb
59
- - lib/rcodetools/fork_config.rb
34
+ - lib/rcodetools/compat.rb
35
+ - lib/rcodetools/doc.rb
36
+ - lib/rcodetools/options.rb
37
+ - lib/rcodetools/xmpfilter.rb
60
38
  - lib/rcodetools/xmptestunitfilter.rb
39
+ - lib/rcodetools/fork_config.rb
40
+ - lib/method_analyzer.rb
41
+ - lib/ruby_toggle_file.rb
61
42
  - CHANGES
62
43
  - rcodetools.el
63
44
  - rcodetools.vim
64
45
  - icicles-rcodetools.el
46
+ - anything-rcodetools.el
65
47
  - README
66
- - README.ja
67
- - README.emacs
68
- - README.vim
69
- - README.TDC
70
48
  - README.xmpfilter
71
49
  - README.method_analysis
50
+ - README.TDC
51
+ - README.vim
52
+ - README.emacs
53
+ - README.ja
72
54
  - THANKS
73
55
  - Rakefile
74
56
  - Rakefile.method_analysis
75
57
  - setup.rb
76
- - test/test_functional.rb
77
- - test/test_options.rb
78
- - test/test_doc.rb
79
- - test/test_run.rb
80
58
  - test/test_method_analyzer.rb
81
- - test/test_completion.rb
82
- - test/test_method_args.rb
83
- - test/test_xmptestunitfilter.rb
84
- - test/test_xmpfilter.rb
85
59
  - test/test_ruby_toggle_file.rb
86
- - test/data/completion_class_info-output.rb
87
- - test/data/completion_in_method-test.rb
88
- - test/data/bindings-output.rb
89
- - test/data/completion_rbtest-output.rb
90
- - test/data/ri_vim-output.rb
91
60
  - test/data/method_args.data.rb
92
- - test/data/doc_rbtest-output.rb
93
61
  - test/data/method_analyzer-data.rb
94
- - test/data/ri_vim-input.rb
95
- - test/data/completion_in_method-output.rb
96
- - test/data/rspec-output.rb
97
- - test/data/unit_test-input.rb
98
- - test/data/bindings-input.rb
99
- - test/data/doc_detect_rbtest2-input.rb
100
- - test/data/simple_annotation-output.rb
101
- - test/data/doc_detect_rbtest-input.rb
102
- - test/data/ri-input.rb
103
- - test/data/rspec_poetry-output.rb
104
- - test/data/ri_emacs-input.rb
105
- - test/data/ri-output.rb
106
- - test/data/refe-input.rb
107
- - test/data/rspec-input.rb
108
- - test/data/unit_test_poetry-output.rb
109
- - test/data/unit_test_detect_rbtest2-output.rb
110
- - test/data/doc_detect_rbtest-output.rb
111
- - test/data/doc-input.rb
112
- - test/data/completion-input.rb
113
- - test/data/unit_test_detect_rbtest-input.rb
114
- - test/data/unit_test_detect_rbtest-output.rb
115
- - test/data/completion_class_info_no_candidates-input.rb
116
- - test/data/completion_detect_rbtest2-output.rb
117
- - test/data/no_warnings-input.rb
118
- - test/data/completion-output.rb
119
- - test/data/no_warnings-output.rb
120
- - test/data/completion_emacs_icicles-input.rb
121
- - test/data/completion_in_method-input.rb
122
- - test/data/add_markers-output.rb
123
- - test/data/completion_detect_rbtest-output.rb
124
- - test/data/completion_class_info-input.rb
125
- - test/data/unit_test_poetry-input.rb
126
- - test/data/doc_detect_rbtest2-output.rb
127
- - test/data/completion_detect_rbtest-input.rb
128
- - test/data/unit_test_rbtest-input.rb
129
- - test/data/rspec_poetry-input.rb
130
- - test/data/completion_emacs-output.rb
131
- - test/data/completion_rbtest-input.rb
132
- - test/data/completion_class_info_no_candidates-output.rb
133
- - test/data/unit_test_rbtest-output.rb
134
- - test/data/refe-output.rb
135
62
  - test/data/sample_test_script.rb
136
- - test/data/unit_test-output.rb
137
- - test/data/completion_detect_rbtest2-input.rb
138
- - test/data/simple_annotation-input.rb
139
- - test/data/completion_emacs-input.rb
140
- - test/data/unit_test_detect_rbtest2-input.rb
141
- - test/data/doc_rbtest-input.rb
142
- - test/data/completion_emacs_icicles-output.rb
143
- - test/data/ri_emacs-output.rb
144
- - test/data/doc-output.rb
145
- - test/data/add_markers-input.rb
146
- test_files:
147
- - test/test_functional.rb
148
63
  - test/test_options.rb
149
- - test/test_doc.rb
150
- - test/test_run.rb
151
- - test/test_method_analyzer.rb
64
+ - test/test_xmpfilter.rb
152
65
  - test/test_completion.rb
66
+ - test/test_functional.rb
153
67
  - test/test_method_args.rb
68
+ - test/test_doc.rb
154
69
  - test/test_xmptestunitfilter.rb
155
- - test/test_xmpfilter.rb
156
- - test/test_ruby_toggle_file.rb
70
+ has_rdoc: true
71
+ homepage: http://eigenclass.org/hiki.rb?rcodetools
72
+ post_install_message: |+
73
+
74
+ ==============================================================================
75
+
76
+ rcodetools will work better if you use it along with FastRI, an alternative to
77
+ the standard 'ri' documentation browser which features intelligent searching,
78
+ better RubyGems integration, vastly improved performance, remote queries via
79
+ DRb... You can find it at http://eigenclass.org/hiki.rb?fastri and it is also
80
+ available in RubyGems format:
81
+
82
+ gem install fastri
83
+
84
+ Read README.emacs and README.vim for information on how to integrate
85
+ rcodetools in your editor.
86
+
87
+ ==============================================================================
88
+
157
89
  rdoc_options:
158
90
  - --main
159
91
  - README
160
92
  - --title
161
93
  - rcodetools
162
- extra_rdoc_files:
163
- - README
164
- executables:
165
- - rct-complete
166
- - rct-doc
167
- - xmpfilter
168
- - rct-meth-args
169
- extensions: []
170
-
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: "0"
101
+ version:
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: "0"
107
+ version:
171
108
  requirements: []
172
109
 
173
- dependencies: []
174
-
110
+ rubyforge_project:
111
+ rubygems_version: 1.2.0
112
+ signing_key:
113
+ specification_version: 2
114
+ summary: rcodetools is a collection of Ruby code manipulation tools
115
+ test_files:
116
+ - test/test_method_analyzer.rb
117
+ - test/test_ruby_toggle_file.rb
118
+ - test/test_options.rb
119
+ - test/test_xmpfilter.rb
120
+ - test/test_completion.rb
121
+ - test/test_functional.rb
122
+ - test/test_method_args.rb
123
+ - test/test_doc.rb
124
+ - test/test_xmptestunitfilter.rb
@@ -1,2 +0,0 @@
1
- 1+1
2
- 2+3
@@ -1,2 +0,0 @@
1
- 1+1 # =>
2
- 2+3 # =>
@@ -1,26 +0,0 @@
1
-
2
- require 'test/unit'
3
-
4
- class TestFoo < Test::Unit::TestCase
5
- def setup
6
- @o = []
7
- end
8
-
9
- def test_foo
10
- a = 1
11
- b = a
12
- b # =>
13
- end
14
-
15
- def test_arr
16
- last = 1
17
- @o << last
18
- @o.last # =>
19
- end
20
-
21
- def test_bar
22
- a = b = c = 1
23
- d = a
24
- d # =>
25
- end
26
- end
@@ -1,31 +0,0 @@
1
-
2
- require 'test/unit'
3
-
4
- class TestFoo < Test::Unit::TestCase
5
- def setup
6
- @o = []
7
- end
8
-
9
- def test_foo
10
- a = 1
11
- b = a
12
- assert_equal a, b
13
- assert_equal 1, b
14
- end
15
-
16
- def test_arr
17
- last = 1
18
- @o << last
19
- assert_equal last, @o.last
20
- assert_equal 1, @o.last
21
- end
22
-
23
- def test_bar
24
- a = b = c = 1
25
- d = a
26
- assert_equal a, d
27
- assert_equal b, d
28
- assert_equal c, d
29
- assert_equal 1, d
30
- end
31
- end
@@ -1 +0,0 @@
1
- Array.new(3).uni
@@ -1,2 +0,0 @@
1
- uniq
2
- uniq!
@@ -1 +0,0 @@
1
- Array.new(3).s
@@ -1,10 +0,0 @@
1
- select Array#select
2
- send Object#send
3
- shift Array#shift
4
- singleton_methods Object#singleton_methods
5
- size Array#size
6
- slice Array#slice
7
- slice! Array#slice!
8
- sort Array#sort
9
- sort! Array#sort!
10
- sort_by Enumerable#sort_by
@@ -1 +0,0 @@
1
- Array.new(3).nonexisten
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- =begin test_bar
3
- assert_equal "BAR", bar("bar")
4
- =end
5
- def bar(s)
6
- s.upca
7
- end
@@ -1,2 +0,0 @@
1
- upcase
2
- upcase!
@@ -1 +0,0 @@
1
- Array.new(3).uni
@@ -1,2 +0,0 @@
1
- uniq
2
- uniq!
@@ -1 +0,0 @@
1
- Array.new(3).uni
@@ -1,6 +0,0 @@
1
- (progn
2
- (setq rct-method-completion-table '(("uniq") ("uniq!") ))
3
- (setq alist '(("uniq\t[Array#uniq]") ("uniq!\t[Array#uniq!]") ))
4
- (setq pattern "uni")
5
- (try-completion pattern rct-method-completion-table nil)
6
- )
@@ -1 +0,0 @@
1
- 1.div