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
@@ -1,6 +0,0 @@
1
- (progn
2
- (setq rct-method-completion-table '(("div\t[Fixnum#div]") ("divmod\t[Fixnum#divmod]") ))
3
- (setq alist '(("div" . "Fixnum#div")("divmod" . "Fixnum#divmod")))
4
- (setq pattern "div")
5
- (setq klass "Fixnum")
6
- )
@@ -1,3 +0,0 @@
1
- def fooz
2
- [].lengt
3
- end
@@ -1 +0,0 @@
1
- length
@@ -1,6 +0,0 @@
1
- require 'test/unit'
2
- class TestFooz < Test::Unit::TestCase
3
- def test_fooz
4
- assert_equal(0, fooz)
5
- end
6
- end
@@ -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
- [].length
@@ -1 +0,0 @@
1
- Array#length
@@ -1 +0,0 @@
1
- [].length
@@ -1 +0,0 @@
1
- Array#length
@@ -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.upcase
7
- end
@@ -1 +0,0 @@
1
- String#upcase
@@ -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.upcase
7
- end
@@ -1 +0,0 @@
1
- String#upcase
@@ -1,3 +0,0 @@
1
- A = 1
2
- A = 1
3
- p (1)
@@ -1,4 +0,0 @@
1
- A = 1
2
- A = 1
3
- p (1)
4
- # >> 1
@@ -1 +0,0 @@
1
- [].length
@@ -1 +0,0 @@
1
- refe 'Array#length'
@@ -1 +0,0 @@
1
- [].length
@@ -1 +0,0 @@
1
- ri 'Array#length'
@@ -1 +0,0 @@
1
- [].length
@@ -1 +0,0 @@
1
- (rct-find-tag-or-ri "Array#length")
@@ -1 +0,0 @@
1
- [].length
@@ -1 +0,0 @@
1
- call RCT_find_tag_or_ri("Array#length")
@@ -1,48 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1
11
- end
12
-
13
-
14
- describe "xmpfilter's expectation expansion" do
15
- before do
16
- @o = X.new
17
- end
18
-
19
- it "should expand should == expectations" do
20
- @o.foo(true) # =>
21
- @o.foo(true).a # =>
22
- @o.foo(false) # =>
23
- end
24
-
25
- it "should expand should raise_error expectations" do
26
- @o.bar # =>
27
- end
28
-
29
- it "should expand should be_nil expectations" do
30
- @o.baz # =>
31
- end
32
-
33
- it "should expand correct expectations for complex values" do
34
- @o.babar # =>
35
- end
36
-
37
- it "should expand should be_close expectations" do
38
- @o.fubar(10) # =>
39
- end
40
- end
41
-
42
- describe "xmpfilter's automagic binding detection" do
43
- it "should expand should == expectations" do
44
- a = b = c = 1
45
- d = a
46
- d # =>
47
- end
48
- end
@@ -1,52 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1 # !> already initialized constant A
11
- end
12
-
13
-
14
- describe "xmpfilter's expectation expansion" do
15
- before do
16
- @o = X.new
17
- end
18
-
19
- it "should expand should == expectations" do
20
- (@o.foo(true)).should be_a_kind_of(X::Y)
21
- (@o.foo(true).inspect).should == ("#<struct X::Y a=2>")
22
- (@o.foo(true).a).should == (2)
23
- (@o.foo(false)).should == (2)
24
- end
25
-
26
- it "should expand should raise_error expectations" do
27
- lambda{@o.bar}.should raise_error(RuntimeError)
28
- end
29
-
30
- it "should expand should be_nil expectations" do
31
- (@o.baz).should be_nil
32
- end
33
-
34
- it "should expand correct expectations for complex values" do
35
- (@o.babar).should == ([1, 2])
36
- end
37
-
38
- it "should expand should be_close expectations" do
39
- (@o.fubar(10)).should be_close(101.0, 0.0001)
40
- end
41
- end
42
-
43
- describe "xmpfilter's automagic binding detection" do
44
- it "should expand should == expectations" do
45
- a = b = c = 1
46
- d = a
47
- (d).should == (a)
48
- (d).should == (b)
49
- (d).should == (c)
50
- (d).should == (1)
51
- end
52
- end
@@ -1,48 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1
11
- end
12
-
13
-
14
- describe "xmpfilter's expectation expansion" do
15
- before do
16
- @o = X.new
17
- end
18
-
19
- it "should expand should == expectations" do
20
- @o.foo(true) # =>
21
- @o.foo(true).a # =>
22
- @o.foo(false) # =>
23
- end
24
-
25
- it "should expand should raise_error expectations" do
26
- @o.bar # =>
27
- end
28
-
29
- it "should expand should be_nil expectations" do
30
- @o.baz # =>
31
- end
32
-
33
- it "should expand correct expectations for complex values" do
34
- @o.babar # =>
35
- end
36
-
37
- it "should expand should be_close expectations" do
38
- @o.fubar(10) # =>
39
- end
40
- end
41
-
42
- describe "xmpfilter's automagic binding detection" do
43
- it "should expand should == expectations" do
44
- a = b = c = 1
45
- d = a
46
- d # =>
47
- end
48
- end
@@ -1,52 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1 # !> already initialized constant A
11
- end
12
-
13
-
14
- describe "xmpfilter's expectation expansion" do
15
- before do
16
- @o = X.new
17
- end
18
-
19
- it "should expand should == expectations" do
20
- @o.foo(true).should be_a_kind_of(X::Y)
21
- @o.foo(true).inspect.should == "#<struct X::Y a=2>"
22
- @o.foo(true).a.should == 2
23
- @o.foo(false).should == 2
24
- end
25
-
26
- it "should expand should raise_error expectations" do
27
- lambda{@o.bar}.should raise_error(RuntimeError)
28
- end
29
-
30
- it "should expand should be_nil expectations" do
31
- @o.baz.should be_nil
32
- end
33
-
34
- it "should expand correct expectations for complex values" do
35
- @o.babar.should == [1, 2]
36
- end
37
-
38
- it "should expand should be_close expectations" do
39
- @o.fubar(10).should be_close(101.0, 0.0001)
40
- end
41
- end
42
-
43
- describe "xmpfilter's automagic binding detection" do
44
- it "should expand should == expectations" do
45
- a = b = c = 1
46
- d = a
47
- d.should == a
48
- d.should == b
49
- d.should == c
50
- d.should == 1
51
- end
52
- end
@@ -1,8 +0,0 @@
1
-
2
- a = 1
3
- 10.times do |i|
4
- i ** 2 # =>
5
- a += i
6
- end
7
- A = 1
8
- A = 1
@@ -1,8 +0,0 @@
1
-
2
- a = 1
3
- 10.times do |i|
4
- i ** 2 # => 0, 1, 4, 9, 16, 25, 36, 49, 64, 81
5
- a += i
6
- end
7
- A = 1
8
- A = 1 # !> already initialized constant A
@@ -1,50 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1
11
- def difftype() [1, "s"] end
12
- end
13
-
14
-
15
- require 'test/unit'
16
- class Test_X < Test::Unit::TestCase
17
- def setup
18
- @o = X.new
19
- end
20
-
21
- def test_foo
22
- @o.foo(true) # =>
23
- @o.foo(true).a # =>
24
- @o.foo(false) # =>
25
- end
26
-
27
- def test_bar
28
- @o.bar # =>
29
- end
30
-
31
- def test_baz
32
- @o.baz # =>
33
- end
34
-
35
- def test_babar
36
- @o.babar # =>
37
- end
38
-
39
- def test_fubar
40
- @o.fubar(10) # =>
41
- end
42
-
43
- def test_difftype
44
- for x in @o.difftype
45
- x # =>
46
- end
47
- end
48
-
49
- end
50
-
@@ -1,52 +0,0 @@
1
-
2
- class X
3
- Y = Struct.new(:a)
4
- def foo(b); b ? Y.new(2) : 2 end
5
- def bar; raise "No good" end
6
- def baz; nil end
7
- def fubar(x); x ** 2.0 + 1 end
8
- def babar; [1,2] end
9
- A = 1
10
- A = 1 # !> already initialized constant A
11
- def difftype() [1, "s"] end
12
- end
13
-
14
-
15
- require 'test/unit'
16
- class Test_X < Test::Unit::TestCase
17
- def setup
18
- @o = X.new
19
- end
20
-
21
- def test_foo
22
- assert_kind_of(X::Y, @o.foo(true))
23
- assert_equal("#<struct X::Y a=2>", @o.foo(true).inspect)
24
- assert_equal(2, @o.foo(true).a)
25
- assert_equal(2, @o.foo(false))
26
- end
27
-
28
- def test_bar
29
- assert_raise(RuntimeError){@o.bar}
30
- end
31
-
32
- def test_baz
33
- assert_nil(@o.baz)
34
- end
35
-
36
- def test_babar
37
- assert_equal([1, 2], @o.babar)
38
- end
39
-
40
- def test_fubar
41
- assert_in_delta(101.0, @o.fubar(10), 0.0001)
42
- end
43
-
44
- def test_difftype
45
- for x in @o.difftype
46
- #xmpfilter: WARNING!! extra values ignored
47
- assert_equal(1, x)
48
- end
49
- end
50
-
51
- end
52
-