rcodetools 0.7.0.0 → 0.8.0.0
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.
- data/CHANGES +12 -0
- data/README +1 -1
- data/README.emacs +21 -4
- data/README.ja +1 -1
- data/README.xmpfilter +159 -74
- data/Rakefile +3 -37
- data/anything-rcodetools.el +142 -0
- data/bin/rct-complete +1 -1
- data/bin/rct-doc +1 -1
- data/bin/rct-meth-args +33 -2
- data/bin/xmpfilter +5 -1
- data/lib/rcodetools/compat.rb +14 -0
- data/lib/rcodetools/completion.rb +8 -6
- data/lib/rcodetools/fork.rb +15 -8
- data/lib/rcodetools/options.rb +8 -0
- data/lib/rcodetools/xmpfilter.rb +80 -33
- data/lib/rcodetools/xmptestunitfilter.rb +76 -21
- data/lib/ruby_toggle_file.rb +1 -1
- data/rcodetools.el +213 -20
- data/test/test_functional.rb +36 -68
- data/test/test_method_analyzer.rb +28 -20
- data/test/test_ruby_toggle_file.rb +118 -69
- data/test/test_xmpfilter.rb +75 -47
- data/test/test_xmptestunitfilter.rb +12 -11
- metadata +83 -133
- data/test/data/add_markers-input.rb +0 -2
- data/test/data/add_markers-output.rb +0 -2
- data/test/data/bindings-input.rb +0 -26
- data/test/data/bindings-output.rb +0 -31
- data/test/data/completion-input.rb +0 -1
- data/test/data/completion-output.rb +0 -2
- data/test/data/completion_class_info-input.rb +0 -1
- data/test/data/completion_class_info-output.rb +0 -10
- data/test/data/completion_class_info_no_candidates-input.rb +0 -1
- data/test/data/completion_class_info_no_candidates-output.rb +0 -1
- data/test/data/completion_detect_rbtest-input.rb +0 -7
- data/test/data/completion_detect_rbtest-output.rb +0 -2
- data/test/data/completion_detect_rbtest2-input.rb +0 -1
- data/test/data/completion_detect_rbtest2-output.rb +0 -2
- data/test/data/completion_emacs-input.rb +0 -1
- data/test/data/completion_emacs-output.rb +0 -6
- data/test/data/completion_emacs_icicles-input.rb +0 -1
- data/test/data/completion_emacs_icicles-output.rb +0 -6
- data/test/data/completion_in_method-input.rb +0 -3
- data/test/data/completion_in_method-output.rb +0 -1
- data/test/data/completion_in_method-test.rb +0 -6
- data/test/data/completion_rbtest-input.rb +0 -7
- data/test/data/completion_rbtest-output.rb +0 -2
- data/test/data/doc-input.rb +0 -1
- data/test/data/doc-output.rb +0 -1
- data/test/data/doc_detect_rbtest-input.rb +0 -1
- data/test/data/doc_detect_rbtest-output.rb +0 -1
- data/test/data/doc_detect_rbtest2-input.rb +0 -7
- data/test/data/doc_detect_rbtest2-output.rb +0 -1
- data/test/data/doc_rbtest-input.rb +0 -7
- data/test/data/doc_rbtest-output.rb +0 -1
- data/test/data/no_warnings-input.rb +0 -3
- data/test/data/no_warnings-output.rb +0 -4
- data/test/data/refe-input.rb +0 -1
- data/test/data/refe-output.rb +0 -1
- data/test/data/ri-input.rb +0 -1
- data/test/data/ri-output.rb +0 -1
- data/test/data/ri_emacs-input.rb +0 -1
- data/test/data/ri_emacs-output.rb +0 -1
- data/test/data/ri_vim-input.rb +0 -1
- data/test/data/ri_vim-output.rb +0 -1
- data/test/data/rspec-input.rb +0 -48
- data/test/data/rspec-output.rb +0 -52
- data/test/data/rspec_poetry-input.rb +0 -48
- data/test/data/rspec_poetry-output.rb +0 -52
- data/test/data/simple_annotation-input.rb +0 -8
- data/test/data/simple_annotation-output.rb +0 -8
- data/test/data/unit_test-input.rb +0 -50
- data/test/data/unit_test-output.rb +0 -52
- data/test/data/unit_test_detect_rbtest-input.rb +0 -50
- data/test/data/unit_test_detect_rbtest-output.rb +0 -52
- data/test/data/unit_test_detect_rbtest2-input.rb +0 -6
- data/test/data/unit_test_detect_rbtest2-output.rb +0 -6
- data/test/data/unit_test_poetry-input.rb +0 -50
- data/test/data/unit_test_poetry-output.rb +0 -52
- data/test/data/unit_test_rbtest-input.rb +0 -6
- data/test/data/unit_test_rbtest-output.rb +0 -6
- data/test/test_run.rb +0 -45
@@ -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
|
-
|
@@ -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
|
-
|
data/test/test_run.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require 'rcodetools/xmpfilter'
|
3
|
-
require 'rcodetools/xmptestunitfilter'
|
4
|
-
require 'rcodetools/completion'
|
5
|
-
require 'rcodetools/doc'
|
6
|
-
require 'rcodetools/options'
|
7
|
-
require 'stringio'
|
8
|
-
|
9
|
-
class TestRun < Test::Unit::TestCase
|
10
|
-
include Rcodetools
|
11
|
-
DIR = File.expand_path(File.dirname(__FILE__))
|
12
|
-
|
13
|
-
tests = {
|
14
|
-
:simple_annotation => {:klass => XMPFilter},
|
15
|
-
:unit_test => {:klass => XMPTestUnitFilter},
|
16
|
-
:rspec => {:klass => XMPRSpecFilter, :interpreter => "spec"},
|
17
|
-
:rspec_poetry => {:klass => XMPRSpecFilter, :interpreter => "spec", :use_parentheses => false},
|
18
|
-
:no_warnings => {:klass => XMPFilter, :warnings => false},
|
19
|
-
:bindings => {:klass => XMPTestUnitFilter, :use_parentheses => false},
|
20
|
-
:unit_test_poetry => {:klass => XMPTestUnitFilter, :use_parentheses => false},
|
21
|
-
:add_markers => {:klass => XMPAddMarkers},
|
22
|
-
|
23
|
-
:completion => {:klass => XMPCompletionFilter, :lineno => 1},
|
24
|
-
:completion_emacs => {:klass => XMPCompletionEmacsFilter, :lineno => 1},
|
25
|
-
:completion_emacs_icicles => {:klass => XMPCompletionEmacsIciclesFilter, :lineno => 1},
|
26
|
-
:completion_class_info => {:klass => XMPCompletionClassInfoFilter, :lineno => 1},
|
27
|
-
:completion_class_info_no_candidates => {:klass => XMPCompletionClassInfoFilter, :lineno => 1},
|
28
|
-
|
29
|
-
:doc => {:klass => XMPDocFilter, :lineno => 1},
|
30
|
-
:refe => {:klass => XMPReFeFilter, :lineno => 1},
|
31
|
-
:ri => {:klass => XMPRiFilter, :lineno => 1},
|
32
|
-
:ri_emacs => {:klass => XMPRiEmacsFilter, :lineno => 1},
|
33
|
-
:ri_vim => {:klass => XMPRiVimFilter, :lineno => 1},
|
34
|
-
|
35
|
-
}
|
36
|
-
tests.each_pair do |test, opts|
|
37
|
-
define_method("test_#{test}") do
|
38
|
-
inputfile = "#{DIR}/data/#{test}-input.rb"
|
39
|
-
outputfile = "#{DIR}/data/#{test}-output.rb"
|
40
|
-
sio = StringIO.new
|
41
|
-
sio.puts opts[:klass].run(File.read(inputfile), DEFAULT_OPTIONS.merge(opts))
|
42
|
-
assert_equal(File.read(outputfile), sio.string)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|