mvz-live_ast 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.rdoc +14 -0
- data/Rakefile +48 -9
- data/devel/levitate.rb +5 -674
- data/lib/live_ast/common.rb +22 -21
- data/lib/live_ast/error.rb +2 -2
- data/lib/live_ast/irb_spy.rb +4 -6
- data/lib/live_ast/linker.rb +7 -7
- data/lib/live_ast/loader.rb +6 -6
- data/lib/live_ast/reader.rb +2 -2
- data/lib/live_ast/replace_eval.rb +27 -31
- data/lib/live_ast/replace_load.rb +1 -1
- data/lib/live_ast/ruby_parser.rb +24 -22
- data/lib/live_ast/ruby_parser/test.rb +183 -179
- data/lib/live_ast/ruby_parser/unparser.rb +10 -6
- data/lib/live_ast/to_ast.rb +1 -1
- data/lib/live_ast/version.rb +1 -1
- data/test/ast_eval/ast_eval_test.rb +11 -0
- data/test/ast_load/ast_load_test.rb +45 -0
- data/test/backtrace_test.rb +29 -28
- data/test/{noninvasive_test.rb → base/noninvasive_test.rb} +7 -5
- data/test/base/reload_test.rb +41 -0
- data/test/covert_define_method_test.rb +1 -1
- data/test/define_method_test.rb +5 -5
- data/test/encoding_test.rb +5 -5
- data/test/error_test.rb +6 -6
- data/test/eval_test.rb +7 -7
- data/test/flush_cache_test.rb +6 -6
- data/test/full/ast_reload_test.rb +39 -0
- data/test/{replace_eval_test.rb → full/replace_eval_test.rb} +31 -12
- data/test/irb_test.rb +1 -1
- data/test/lambda_test.rb +7 -0
- data/test/load_path_test.rb +12 -12
- data/test/load_test.rb +35 -35
- data/test/main.rb +19 -27
- data/test/nested_test.rb +1 -1
- data/test/readme_test.rb +1 -3
- data/test/recursive_eval_test.rb +2 -3
- data/test/redefine_method_test.rb +2 -2
- data/test/rubygems_test.rb +1 -1
- data/test/rubyspec_test.rb +3 -3
- data/test/stdlib_test.rb +1 -1
- data/test/thread_test.rb +1 -2
- data/test/to_ast/to_ast_feature_test.rb +11 -0
- data/test/to_ruby/to_ruby_feature_test.rb +11 -0
- data/test/{to_ruby_test.rb → to_ruby/to_ruby_test.rb} +2 -2
- metadata +93 -91
- data/test/ast_eval_feature_test.rb +0 -11
- data/test/ast_load_feature_test.rb +0 -11
- data/test/reload_test.rb +0 -105
- data/test/to_ast_feature_test.rb +0 -15
- data/test/to_ruby_feature_test.rb +0 -15
data/test/reload_test.rb
DELETED
@@ -1,105 +0,0 @@
|
|
1
|
-
require_relative 'main'
|
2
|
-
|
3
|
-
class AAB_ReloadTest < BaseTest
|
4
|
-
include FileUtils
|
5
|
-
|
6
|
-
def test_reloading
|
7
|
-
raw_reload
|
8
|
-
require 'live_ast/ast_load'
|
9
|
-
noninvasive_ast_reload
|
10
|
-
require 'live_ast/replace_load'
|
11
|
-
ast_reload
|
12
|
-
end
|
13
|
-
|
14
|
-
def raw_reload
|
15
|
-
code_1 = %{
|
16
|
-
class AAB_ReloadTest::A
|
17
|
-
def f
|
18
|
-
"first A#f"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
}
|
22
|
-
|
23
|
-
code_2 = %{
|
24
|
-
class AAB_ReloadTest::A
|
25
|
-
def f
|
26
|
-
"second A#f"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
}
|
30
|
-
|
31
|
-
temp_file code_1 do |file|
|
32
|
-
load file
|
33
|
-
|
34
|
-
LiveAST.ast(A.instance_method(:f))
|
35
|
-
|
36
|
-
write_file file, code_2
|
37
|
-
load file
|
38
|
-
|
39
|
-
# forced a raw-reload inconsistency -- verify bogus
|
40
|
-
|
41
|
-
assert_equal no_arg_def(:f, "first A#f"),
|
42
|
-
LiveAST.ast(A.instance_method(:f))
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def noninvasive_ast_reload
|
47
|
-
code_1 = %{
|
48
|
-
class AAB_ReloadTest::B
|
49
|
-
def f
|
50
|
-
"first B#f"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
}
|
54
|
-
|
55
|
-
code_2 = %{
|
56
|
-
class AAB_ReloadTest::B
|
57
|
-
def f
|
58
|
-
"second B#f"
|
59
|
-
end
|
60
|
-
end
|
61
|
-
}
|
62
|
-
|
63
|
-
temp_file code_1 do |file|
|
64
|
-
load file
|
65
|
-
|
66
|
-
LiveAST.ast(B.instance_method(:f))
|
67
|
-
|
68
|
-
write_file file, code_2
|
69
|
-
ast_load file
|
70
|
-
|
71
|
-
assert_equal no_arg_def(:f, "second B#f"),
|
72
|
-
LiveAST.ast(B.instance_method(:f))
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def ast_reload
|
77
|
-
code_1 = %{
|
78
|
-
class AAB_ReloadTest::C
|
79
|
-
def f
|
80
|
-
"first C#f"
|
81
|
-
end
|
82
|
-
end
|
83
|
-
}
|
84
|
-
|
85
|
-
code_2 = %{
|
86
|
-
class AAB_ReloadTest::C
|
87
|
-
def f
|
88
|
-
"second C#f"
|
89
|
-
end
|
90
|
-
end
|
91
|
-
}
|
92
|
-
|
93
|
-
temp_file code_1 do |file|
|
94
|
-
load file
|
95
|
-
|
96
|
-
LiveAST.ast(C.instance_method(:f))
|
97
|
-
|
98
|
-
write_file file, code_2
|
99
|
-
load file
|
100
|
-
|
101
|
-
assert_equal no_arg_def(:f, "second C#f"),
|
102
|
-
LiveAST.ast(C.instance_method(:f))
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
data/test/to_ast_feature_test.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative 'main'
|
2
|
-
|
3
|
-
class AAB_ToASTFeatureTest < BaseTest
|
4
|
-
def test_require
|
5
|
-
[Method, UnboundMethod, Proc].each { |obj|
|
6
|
-
assert !obj.instance_methods.include?(:to_ast)
|
7
|
-
}
|
8
|
-
|
9
|
-
require 'live_ast/to_ast'
|
10
|
-
|
11
|
-
[Method, UnboundMethod, Proc].each { |obj|
|
12
|
-
assert obj.instance_methods.include?(:to_ast)
|
13
|
-
}
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative 'main'
|
2
|
-
|
3
|
-
class AAB_ToRubyFeatureTest < BaseTest
|
4
|
-
def test_require
|
5
|
-
[Method, UnboundMethod, Proc].each { |obj|
|
6
|
-
assert !obj.instance_methods.include?(:to_ruby)
|
7
|
-
}
|
8
|
-
|
9
|
-
require 'live_ast/to_ruby'
|
10
|
-
|
11
|
-
[Method, UnboundMethod, Proc].each { |obj|
|
12
|
-
assert obj.instance_methods.include?(:to_ruby)
|
13
|
-
}
|
14
|
-
end
|
15
|
-
end
|