sourcify 0.5.0 → 0.6.0.rc1

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.
Files changed (130) hide show
  1. data/.gitignore +1 -0
  2. data/HISTORY.txt +5 -0
  3. data/README.rdoc +86 -3
  4. data/Rakefile +47 -15
  5. data/lib/sourcify.rb +13 -0
  6. data/lib/sourcify/common/parser/converter.rb +29 -0
  7. data/lib/sourcify/common/parser/raw_scanner/comment.rb +23 -0
  8. data/lib/sourcify/common/parser/raw_scanner/counter.rb +43 -0
  9. data/lib/sourcify/common/parser/raw_scanner/dstring.rb +60 -0
  10. data/lib/sourcify/common/parser/raw_scanner/extensions.rb +121 -0
  11. data/lib/sourcify/common/parser/raw_scanner/heredoc.rb +26 -0
  12. data/lib/sourcify/common/parser/source_code.rb +33 -0
  13. data/lib/sourcify/common/ragel/common.rl +5 -0
  14. data/lib/sourcify/common/ragel/expressions.rl +38 -0
  15. data/lib/sourcify/{proc/scanner.rl → common/ragel/machines.rl} +10 -178
  16. data/lib/sourcify/errors.rb +4 -0
  17. data/lib/sourcify/method.rb +134 -0
  18. data/lib/sourcify/method/methods.rb +3 -0
  19. data/lib/sourcify/method/methods/to_raw_source.rb +30 -0
  20. data/lib/sourcify/method/methods/to_sexp.rb +30 -0
  21. data/lib/sourcify/method/methods/to_source.rb +30 -0
  22. data/lib/sourcify/method/parser.rb +104 -0
  23. data/lib/sourcify/method/parser/converter.rb +8 -0
  24. data/lib/sourcify/method/parser/raw_scanner.rb +2494 -0
  25. data/lib/sourcify/method/parser/raw_scanner.rl +144 -0
  26. data/lib/sourcify/method/parser/raw_scanner_extensions.rb +64 -0
  27. data/lib/sourcify/method/parser/scanner.rb +48 -0
  28. data/lib/sourcify/method/parser/source_code.rb +8 -0
  29. data/lib/sourcify/proc.rb +0 -2
  30. data/lib/sourcify/proc/parser.rb +2 -5
  31. data/lib/sourcify/proc/parser/converter.rb +2 -23
  32. data/lib/sourcify/proc/{scanner.rb → parser/raw_scanner.rb} +808 -806
  33. data/lib/sourcify/proc/parser/raw_scanner.rl +149 -0
  34. data/lib/sourcify/proc/parser/raw_scanner_extensions.rb +72 -0
  35. data/lib/sourcify/proc/parser/{code_scanner.rb → scanner.rb} +9 -5
  36. data/lib/sourcify/proc/parser/source_code.rb +2 -27
  37. data/lib/sourcify/version.rb +1 -1
  38. data/spec/method/others_from_def_end_block_spec.rb +49 -0
  39. data/spec/method/others_from_define_method_spec.rb +62 -0
  40. data/spec/method/raw_scanner/block_comment_spec.rb +8 -0
  41. data/spec/method/raw_scanner/double_colons_spec.rb +8 -0
  42. data/spec/method/raw_scanner/double_quote_str_w_interpolation_spec.rb +8 -0
  43. data/spec/method/raw_scanner/double_quote_str_wo_interpolation_spec.rb +8 -0
  44. data/spec/method/raw_scanner/heredoc_w_indent_spec.rb +8 -0
  45. data/spec/method/raw_scanner/heredoc_wo_indent_spec.rb +8 -0
  46. data/spec/method/raw_scanner/kw_block_start_alias1_spec.rb +20 -0
  47. data/spec/method/raw_scanner/kw_block_start_alias2_spec.rb +20 -0
  48. data/spec/method/raw_scanner/per_line_comment_spec.rb +8 -0
  49. data/spec/method/raw_scanner/single_quote_str_spec.rb +8 -0
  50. data/spec/method/raw_scanner/slash_operator_spec.rb +8 -0
  51. data/spec/method/raw_scanner/spec_helper.rb +80 -0
  52. data/spec/method/spec_helper.rb +1 -0
  53. data/spec/method/to_raw_source_spec.rb +31 -0
  54. data/spec/method/to_raw_source_w_specified_strip_enclosure_spec.rb +148 -0
  55. data/spec/method/to_sexp_from_def_end_block_w_variables_spec.rb +46 -0
  56. data/spec/method/to_sexp_from_def_end_block_within_irb_spec.rb +38 -0
  57. data/spec/method/to_sexp_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb +56 -0
  58. data/spec/method/to_sexp_from_define_method_w_variables_spec.rb +52 -0
  59. data/spec/method/to_sexp_from_define_method_within_irb_spec.rb +42 -0
  60. data/spec/method/to_sexp_w_specified_strip_enclosure_spec.rb +74 -0
  61. data/spec/method/to_source_from_def_end_block_w_19_extras_spec.rb +23 -0
  62. data/spec/method/to_source_from_def_end_block_w_nested_begin_spec.rb +35 -0
  63. data/spec/method/to_source_from_def_end_block_w_nested_case_spec.rb +35 -0
  64. data/spec/method/to_source_from_def_end_block_w_nested_class_spec.rb +51 -0
  65. data/spec/method/to_source_from_def_end_block_w_nested_do_end_block_spec.rb +33 -0
  66. data/spec/method/to_source_from_def_end_block_w_nested_for_spec.rb +126 -0
  67. data/spec/method/to_source_from_def_end_block_w_nested_if_spec.rb +82 -0
  68. data/spec/method/to_source_from_def_end_block_w_nested_literal_keyword_spec.rb +141 -0
  69. data/spec/method/to_source_from_def_end_block_w_nested_method_spec.rb +33 -0
  70. data/spec/method/to_source_from_def_end_block_w_nested_module_spec.rb +59 -0
  71. data/spec/method/to_source_from_def_end_block_w_nested_unless_spec.rb +82 -0
  72. data/spec/method/to_source_from_def_end_block_w_nested_until_spec.rb +179 -0
  73. data/spec/method/to_source_from_def_end_block_w_nested_while_spec.rb +179 -0
  74. data/spec/method/to_source_from_def_end_block_w_singleton_method_spec.rb +19 -0
  75. data/spec/method/to_source_from_def_end_block_within_irb_spec.rb +30 -0
  76. data/spec/method/to_source_from_def_end_w_multi_blocks_and_many_matches_spec.rb +30 -0
  77. data/spec/method/to_source_from_def_end_w_multi_blocks_and_single_match_spec.rb +36 -0
  78. data/spec/method/to_source_from_define_method_w_braced_block_spec.rb +113 -0
  79. data/spec/method/to_source_from_define_method_w_do_end_block_spec.rb +145 -0
  80. data/spec/method/to_source_from_define_method_w_multi_blocks_and_many_matches_spec.rb +56 -0
  81. data/spec/method/to_source_from_define_method_w_multi_blocks_and_single_match_spec.rb +73 -0
  82. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_many_matches_spec.rb +36 -0
  83. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_no_match_spec.rb +36 -0
  84. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_single_match_spec.rb +28 -0
  85. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb +103 -0
  86. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_many_matches_spec.rb +36 -0
  87. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_no_match_spec.rb +36 -0
  88. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_single_match_spec.rb +28 -0
  89. data/spec/method/to_source_from_define_method_w_multi_blocks_and_specified_ignore_nested_spec.rb +36 -0
  90. data/spec/method/to_source_from_define_method_within_irb_spec.rb +32 -0
  91. data/spec/method/to_source_magic_file_var_spec.rb +176 -0
  92. data/spec/method/to_source_magic_line_var_spec.rb +298 -0
  93. data/spec/method/to_source_w_specified_strip_enclosure_spec.rb +39 -0
  94. data/spec/no_method/unsupported_platform_spec.rb +26 -0
  95. data/spec/proc/raw_scanner/block_comment_spec.rb +8 -0
  96. data/spec/proc/raw_scanner/double_colons_spec.rb +8 -0
  97. data/spec/proc/raw_scanner/double_quote_str_w_interpolation_spec.rb +8 -0
  98. data/spec/proc/raw_scanner/double_quote_str_wo_interpolation_spec.rb +8 -0
  99. data/spec/proc/raw_scanner/heredoc_w_indent_spec.rb +8 -0
  100. data/spec/proc/raw_scanner/heredoc_wo_indent_spec.rb +8 -0
  101. data/spec/proc/raw_scanner/kw_block_start_alias1_spec.rb +20 -0
  102. data/spec/proc/raw_scanner/kw_block_start_alias2_spec.rb +20 -0
  103. data/spec/proc/raw_scanner/per_line_comment_spec.rb +8 -0
  104. data/spec/proc/raw_scanner/single_quote_str_spec.rb +8 -0
  105. data/spec/proc/raw_scanner/slash_operator_spec.rb +8 -0
  106. data/spec/proc/raw_scanner/spec_helper.rb +63 -0
  107. data/spec/{proc_scanner/block_comment_spec.rb → raw_scanner/block_comment_shared_spec.rb} +1 -5
  108. data/spec/{proc_scanner/double_colons_spec.rb → raw_scanner/double_colons_shared_spec.rb} +1 -5
  109. data/spec/{proc_scanner/double_quote_str_w_interpolation_spec.rb → raw_scanner/double_quote_str_w_interpolation_shared_spec.rb} +1 -5
  110. data/spec/{proc_scanner/double_quote_str_wo_interpolation_spec.rb → raw_scanner/double_quote_str_wo_interpolation_shared_spec.rb} +1 -5
  111. data/spec/raw_scanner/heredoc_w_indent_shared_spec.rb +69 -0
  112. data/spec/raw_scanner/heredoc_wo_indent_shared_spec.rb +70 -0
  113. data/spec/{proc_scanner/kw_do_alias1_spec.rb → raw_scanner/kw_block_start_alias1_shared_spec.rb} +10 -26
  114. data/spec/{proc_scanner/kw_do_alias2_spec.rb → raw_scanner/kw_block_start_alias2_shared_spec.rb} +10 -25
  115. data/spec/{proc_scanner/per_line_comment_spec.rb → raw_scanner/per_line_comment_shared_spec.rb} +1 -5
  116. data/spec/raw_scanner/shared_specs.rb +3 -0
  117. data/spec/{proc_scanner/single_quote_str_spec.rb → raw_scanner/single_quote_str_shared_spec.rb} +1 -5
  118. data/spec/{proc_scanner/slash_operator_spec.rb → raw_scanner/slash_operator_shared_spec.rb} +1 -5
  119. data/spec/run_spec.sh +7 -1
  120. data/spec/spec_helper.rb +8 -25
  121. metadata +204 -47
  122. data/.rvmrc +0 -1
  123. data/VERSION +0 -1
  124. data/lib/sourcify/proc/scanner/comment.rb +0 -21
  125. data/lib/sourcify/proc/scanner/counter.rb +0 -44
  126. data/lib/sourcify/proc/scanner/dstring.rb +0 -59
  127. data/lib/sourcify/proc/scanner/extensions.rb +0 -171
  128. data/lib/sourcify/proc/scanner/heredoc.rb +0 -24
  129. data/spec/proc_scanner/heredoc_spec.rb +0 -144
  130. data/spec/proc_scanner/spec_helper.rb +0 -33
@@ -1,15 +1,9 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
-
3
- unless has_parsetree?
4
- describe "Keyword do alias #1 (incrementing do...end counter by 1)" do
5
-
6
- behaves_like 'has started do...end counter'
7
-
8
- %w{class def module begin case module if unless}.each do |kw|
1
+ shared "Keyword block start alias #1 (incrementing counter by 1)" do
2
+ kw_block_start_alias1.each do |kw|
9
3
 
10
4
  %w{_ x 1}.each do |c|
11
5
  should "not increment counter with ... (#{kw}#{c} ...)" do
12
- do_end_counter(<<EOL
6
+ kw_block_start_counter(<<EOL
13
7
  aa (#{kw}#{c} bb ... )
14
8
  cc
15
9
  EOL
@@ -18,7 +12,7 @@ EOL
18
12
  end
19
13
 
20
14
  should "increment counter with ... (#{kw} ...)" do
21
- do_end_counter(<<EOL
15
+ kw_block_start_counter(<<EOL
22
16
  aa (#{kw} bb ... )
23
17
  cc
24
18
  EOL
@@ -26,7 +20,7 @@ EOL
26
20
  end
27
21
 
28
22
  should "increment counter with ... ; #{kw} ..." do
29
- do_end_counter(<<EOL
23
+ kw_block_start_counter(<<EOL
30
24
  aa; #{kw} bb ...
31
25
  cc
32
26
  EOL
@@ -34,7 +28,7 @@ EOL
34
28
  end
35
29
 
36
30
  should "increment counter with ... \\n #{kw} ..." do
37
- do_end_counter(<<EOL
31
+ kw_block_start_counter(<<EOL
38
32
  aa
39
33
  #{kw} bb ...
40
34
  cc
@@ -43,7 +37,7 @@ EOL
43
37
  end
44
38
 
45
39
  should "increment counter with ... \\n \t #{kw} ..." do
46
- do_end_counter(<<EOL
40
+ kw_block_start_counter(<<EOL
47
41
  aa
48
42
  \t #{kw} bb ...
49
43
  cc
@@ -52,7 +46,7 @@ EOL
52
46
  end
53
47
 
54
48
  should "increment counter with ... , #{kw} ..." do
55
- do_end_counter(<<EOL
49
+ kw_block_start_counter(<<EOL
56
50
  aa , #{kw} bb ...
57
51
  cc
58
52
  EOL
@@ -60,23 +54,15 @@ EOL
60
54
  end
61
55
 
62
56
  should "increment counter with ... = #{kw} ..." do
63
- do_end_counter(<<EOL
57
+ kw_block_start_counter(<<EOL
64
58
  aa = #{kw} bb ...
65
59
  cc
66
60
  EOL
67
61
  ).should.equal([1,1])
68
62
  end
69
63
 
70
- should "increment counter with ... do #{kw} ..." do
71
- do_end_counter(<<EOL
72
- aa do #{kw} bb ...
73
- cc
74
- EOL
75
- ).should.equal([2,2])
76
- end
77
-
78
64
  should "increment counter with ... then #{kw} ..." do
79
- do_end_counter(<<EOL
65
+ kw_block_start_counter(<<EOL
80
66
  aa then #{kw} bb ...
81
67
  cc
82
68
  EOL
@@ -84,6 +70,4 @@ EOL
84
70
  end
85
71
 
86
72
  end
87
-
88
- end
89
73
  end
@@ -1,15 +1,9 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
-
3
- unless has_parsetree?
4
- describe "Keyword do alias #2 (increment do..end block counter by 0..1)" do
5
-
6
- behaves_like 'has started do...end counter'
7
-
8
- %w{while until for}.each do |kw|
1
+ shared "Keyword block start alias #2 (incrementing counter by 0..1)" do
2
+ kw_block_start_alias2.each do |kw|
9
3
 
10
4
  %w{_ x 1}.each do |c|
11
5
  should "not increment counter with ... (#{kw}#{c} ...)" do
12
- do_end_counter(<<EOL
6
+ kw_block_start_counter(<<EOL
13
7
  aa (#{kw}#{c} bb ... )
14
8
  cc
15
9
  EOL
@@ -18,7 +12,7 @@ EOL
18
12
  end
19
13
 
20
14
  should "increment counter with ... (#{kw} ...)" do
21
- do_end_counter(<<EOL
15
+ kw_block_start_counter(<<EOL
22
16
  aa (#{kw} bb ... )
23
17
  cc
24
18
  EOL
@@ -26,7 +20,7 @@ EOL
26
20
  end
27
21
 
28
22
  should "increment counter with ... ; #{kw} ..." do
29
- do_end_counter(<<EOL
23
+ kw_block_start_counter(<<EOL
30
24
  aa; #{kw} bb ...
31
25
  cc
32
26
  EOL
@@ -34,7 +28,7 @@ EOL
34
28
  end
35
29
 
36
30
  should "increment counter with ... \\n #{kw} ..." do
37
- do_end_counter(<<EOL
31
+ kw_block_start_counter(<<EOL
38
32
  aa
39
33
  #{kw} bb ...
40
34
  cc
@@ -43,7 +37,7 @@ EOL
43
37
  end
44
38
 
45
39
  should "increment counter with ... \\n \t #{kw} ..." do
46
- do_end_counter(<<EOL
40
+ kw_block_start_counter(<<EOL
47
41
  aa
48
42
  \t #{kw} bb ...
49
43
  cc
@@ -52,7 +46,7 @@ EOL
52
46
  end
53
47
 
54
48
  should "increment counter with ... = #{kw} ..." do
55
- do_end_counter(<<EOL
49
+ kw_block_start_counter(<<EOL
56
50
  aa = #{kw} bb ...
57
51
  cc
58
52
  EOL
@@ -60,23 +54,15 @@ EOL
60
54
  end
61
55
 
62
56
  should "increment counter with ... , #{kw} ..." do
63
- do_end_counter(<<EOL
57
+ kw_block_start_counter(<<EOL
64
58
  aa , #{kw} bb ...
65
59
  cc
66
60
  EOL
67
61
  ).should.equal([0,1])
68
62
  end
69
63
 
70
- should "increment counter with ... do #{kw} ..." do
71
- do_end_counter(<<EOL
72
- aa do #{kw} bb ...
73
- cc
74
- EOL
75
- ).should.equal([1,2])
76
- end
77
-
78
64
  should "increment counter with ... then #{kw} ..." do
79
- do_end_counter(<<EOL
65
+ kw_block_start_counter(<<EOL
80
66
  aa then #{kw} bb ...
81
67
  cc
82
68
  EOL
@@ -85,4 +71,3 @@ EOL
85
71
 
86
72
  end
87
73
  end
88
- end
@@ -1,7 +1,4 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
-
3
- unless has_parsetree?
4
- describe "Per line comment (# ...)" do
1
+ shared "Per line comment (# ...)" do
5
2
 
6
3
  should 'handle start of line' do
7
4
  process(<<EOL
@@ -33,4 +30,3 @@ EOL
33
30
  end
34
31
 
35
32
  end
36
- end
@@ -0,0 +1,3 @@
1
+ Dir[File.expand_path('../*_shared_spec.rb', __FILE__)].each do |file|
2
+ require file
3
+ end
@@ -1,7 +1,4 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
-
3
- unless has_parsetree?
4
- describe 'Single quote strings (\', %q & %w)' do
1
+ shared 'Single quote strings (\', %q & %w)' do
5
2
 
6
3
  %w{~ ` ! @ # $ % ^ & * _ - + = \\ | ; : ' " , . ? /}.map{|w| [w,w] }.concat(
7
4
  [%w{( )}, %w{[ ]}, %w({ }), %w{< >}]
@@ -80,4 +77,3 @@ describe 'Single quote strings (\', %q & %w)' do
80
77
  end
81
78
 
82
79
  end
83
- end
@@ -1,7 +1,4 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), 'spec_helper')
2
-
3
- unless has_parsetree?
4
- describe "Shash operator" do
1
+ shared "Slash operator" do
5
2
 
6
3
  should 'handle w preceding variable' do
7
4
  process(%Q(a / b)).should.include([:op, '/'])
@@ -72,4 +69,3 @@ describe "Shash operator" do
72
69
  end
73
70
 
74
71
  end
75
- end
@@ -3,4 +3,10 @@
3
3
  echo ''
4
4
  echo `gem env | grep 'INSTALLATION DIRECTORY' | sed 's/.*\/\(.*\)/\1:/'`
5
5
  rm -rf ~/.ruby_inline/*ParseTree*
6
- bacon spec/**/*_spec.rb
6
+
7
+ if [ "${METHOD_TO_SOURCE}" == "true" ]; then
8
+ bacon spec/{proc,method}/*/*_spec.rb spec/{proc,method}/*_spec.rb
9
+ else
10
+ echo "NOTE: This ruby doesn't support Method#to_source (& friends) !!"
11
+ bacon spec/proc/*/*_spec.rb spec/{proc,no_method}/*_spec.rb
12
+ fi
@@ -58,27 +58,27 @@ def normalize_code(code)
58
58
  end
59
59
 
60
60
  def having_source(expected, opts={}, &matcher)
61
- lambda do |_proc|
62
- normalize_code(expected) # added for bug fixing
63
- normalize_code(block_given? ? _proc.to_source(&matcher) : _proc.to_source(opts)) \
61
+ lambda do |thing|
62
+ #normalize_code(expected) # added for bug fixing
63
+ normalize_code(block_given? ? thing.to_source(&matcher) : thing.to_source(opts)) \
64
64
  == normalize_code(expected)
65
65
  end
66
66
  end
67
67
 
68
68
  def having_raw_source(expected, opts={}, &matcher)
69
- lambda do |_proc|
70
- found = block_given? ? _proc.to_raw_source(&matcher) : _proc.to_raw_source(opts)
69
+ lambda do |thing|
70
+ found = block_given? ? thing.to_raw_source(&matcher) : thing.to_raw_source(opts)
71
71
  found == expected.strip
72
72
  end
73
73
  end
74
74
 
75
75
  def having_sexp(expected, opts={}, &matcher)
76
- lambda do |_proc|
76
+ lambda do |thing|
77
77
  expected = eval(expected) if expected.is_a?(String)
78
78
  if block_given?
79
- _proc.to_sexp(&matcher).inspect == expected.inspect
79
+ thing.to_sexp(&matcher).inspect == expected.inspect
80
80
  else
81
- _proc.to_sexp(opts).inspect == expected.inspect
81
+ thing.to_sexp(opts).inspect == expected.inspect
82
82
  end
83
83
  end
84
84
  end
@@ -106,20 +106,3 @@ def irb_exec(stdin_str)
106
106
  (values[-1].nil? && RUBY_VERSION.include?('1.9.2')) ? values[0 .. -2] : values
107
107
  end
108
108
 
109
- # ///////////////////////////////////////////////////////////
110
- # Regenerate ragel-based scanner
111
- # ///////////////////////////////////////////////////////////
112
-
113
- unless has_parsetree?
114
- ragel_dir = File.join(File.dirname(__FILE__), '..', 'lib', 'sourcify', 'proc')
115
- ragel_file = File.join(ragel_dir, 'scanner.rl')
116
- ruby_file = File.join(ragel_dir, 'scanner.rb')
117
- File.delete(ruby_file) rescue nil
118
- system("ragel -R #{ragel_file}")
119
-
120
- begin
121
- require File.join(ragel_dir, 'scanner.rb')
122
- rescue LoadError
123
- raise $!
124
- end
125
- end
metadata CHANGED
@@ -1,20 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sourcify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
5
- prerelease:
4
+ version: 0.6.0.rc1
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - NgTzeYang
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-05-02 00:00:00.000000000 +08:00
12
+ date: 2011-07-31 00:00:00.000000000 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: ruby2ruby
17
- requirement: &19360780 !ruby/object:Gem::Requirement
17
+ requirement: &21310380 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 1.2.5
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *19360780
25
+ version_requirements: *21310380
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sexp_processor
28
- requirement: &19360280 !ruby/object:Gem::Requirement
28
+ requirement: &21309880 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.0.5
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *19360280
36
+ version_requirements: *21309880
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: ruby_parser
39
- requirement: &19359820 !ruby/object:Gem::Requirement
39
+ requirement: &21309420 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 2.0.5
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *19359820
47
+ version_requirements: *21309420
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: file-tail
50
- requirement: &19359360 !ruby/object:Gem::Requirement
50
+ requirement: &21308960 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.0.5
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *19359360
58
+ version_requirements: *21308960
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: bacon
61
- requirement: &19358980 !ruby/object:Gem::Requirement
61
+ requirement: &21338920 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *19358980
69
+ version_requirements: *21338920
70
70
  description: ''
71
71
  email:
72
72
  - ngty77@gmail.com
@@ -77,15 +77,36 @@ extra_rdoc_files:
77
77
  files:
78
78
  - .document
79
79
  - .gitignore
80
- - .rvmrc
81
80
  - Gemfile
82
81
  - HISTORY.txt
83
82
  - LICENSE
84
83
  - README.rdoc
85
84
  - Rakefile
86
- - VERSION
87
85
  - lib/sourcify.rb
86
+ - lib/sourcify/common/parser/converter.rb
87
+ - lib/sourcify/common/parser/raw_scanner/comment.rb
88
+ - lib/sourcify/common/parser/raw_scanner/counter.rb
89
+ - lib/sourcify/common/parser/raw_scanner/dstring.rb
90
+ - lib/sourcify/common/parser/raw_scanner/extensions.rb
91
+ - lib/sourcify/common/parser/raw_scanner/heredoc.rb
92
+ - lib/sourcify/common/parser/source_code.rb
93
+ - lib/sourcify/common/ragel/common.rl
94
+ - lib/sourcify/common/ragel/expressions.rl
95
+ - lib/sourcify/common/ragel/machines.rl
96
+ - lib/sourcify/errors.rb
88
97
  - lib/sourcify/facets.rb
98
+ - lib/sourcify/method.rb
99
+ - lib/sourcify/method/methods.rb
100
+ - lib/sourcify/method/methods/to_raw_source.rb
101
+ - lib/sourcify/method/methods/to_sexp.rb
102
+ - lib/sourcify/method/methods/to_source.rb
103
+ - lib/sourcify/method/parser.rb
104
+ - lib/sourcify/method/parser/converter.rb
105
+ - lib/sourcify/method/parser/raw_scanner.rb
106
+ - lib/sourcify/method/parser/raw_scanner.rl
107
+ - lib/sourcify/method/parser/raw_scanner_extensions.rb
108
+ - lib/sourcify/method/parser/scanner.rb
109
+ - lib/sourcify/method/parser/source_code.rb
89
110
  - lib/sourcify/proc.rb
90
111
  - lib/sourcify/proc/methods.rb
91
112
  - lib/sourcify/proc/methods/source_location.rb
@@ -93,23 +114,88 @@ files:
93
114
  - lib/sourcify/proc/methods/to_sexp.rb
94
115
  - lib/sourcify/proc/methods/to_source.rb
95
116
  - lib/sourcify/proc/parser.rb
96
- - lib/sourcify/proc/parser/code_scanner.rb
97
117
  - lib/sourcify/proc/parser/converter.rb
98
118
  - lib/sourcify/proc/parser/normalizer.rb
119
+ - lib/sourcify/proc/parser/raw_scanner.rb
120
+ - lib/sourcify/proc/parser/raw_scanner.rl
121
+ - lib/sourcify/proc/parser/raw_scanner_extensions.rb
122
+ - lib/sourcify/proc/parser/scanner.rb
99
123
  - lib/sourcify/proc/parser/source_code.rb
100
- - lib/sourcify/proc/scanner.rb
101
- - lib/sourcify/proc/scanner.rl
102
- - lib/sourcify/proc/scanner/comment.rb
103
- - lib/sourcify/proc/scanner/counter.rb
104
- - lib/sourcify/proc/scanner/dstring.rb
105
- - lib/sourcify/proc/scanner/extensions.rb
106
- - lib/sourcify/proc/scanner/heredoc.rb
107
124
  - lib/sourcify/version.rb
108
125
  - sourcify.gemspec
109
126
  - spec/dump_object_space_procs.rb
127
+ - spec/method/others_from_def_end_block_spec.rb
128
+ - spec/method/others_from_define_method_spec.rb
129
+ - spec/method/raw_scanner/block_comment_spec.rb
130
+ - spec/method/raw_scanner/double_colons_spec.rb
131
+ - spec/method/raw_scanner/double_quote_str_w_interpolation_spec.rb
132
+ - spec/method/raw_scanner/double_quote_str_wo_interpolation_spec.rb
133
+ - spec/method/raw_scanner/heredoc_w_indent_spec.rb
134
+ - spec/method/raw_scanner/heredoc_wo_indent_spec.rb
135
+ - spec/method/raw_scanner/kw_block_start_alias1_spec.rb
136
+ - spec/method/raw_scanner/kw_block_start_alias2_spec.rb
137
+ - spec/method/raw_scanner/per_line_comment_spec.rb
138
+ - spec/method/raw_scanner/single_quote_str_spec.rb
139
+ - spec/method/raw_scanner/slash_operator_spec.rb
140
+ - spec/method/raw_scanner/spec_helper.rb
141
+ - spec/method/spec_helper.rb
142
+ - spec/method/to_raw_source_spec.rb
143
+ - spec/method/to_raw_source_w_specified_strip_enclosure_spec.rb
144
+ - spec/method/to_sexp_from_def_end_block_w_variables_spec.rb
145
+ - spec/method/to_sexp_from_def_end_block_within_irb_spec.rb
146
+ - spec/method/to_sexp_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb
147
+ - spec/method/to_sexp_from_define_method_w_variables_spec.rb
148
+ - spec/method/to_sexp_from_define_method_within_irb_spec.rb
149
+ - spec/method/to_sexp_w_specified_strip_enclosure_spec.rb
150
+ - spec/method/to_source_from_def_end_block_w_19_extras_spec.rb
151
+ - spec/method/to_source_from_def_end_block_w_nested_begin_spec.rb
152
+ - spec/method/to_source_from_def_end_block_w_nested_case_spec.rb
153
+ - spec/method/to_source_from_def_end_block_w_nested_class_spec.rb
154
+ - spec/method/to_source_from_def_end_block_w_nested_do_end_block_spec.rb
155
+ - spec/method/to_source_from_def_end_block_w_nested_for_spec.rb
156
+ - spec/method/to_source_from_def_end_block_w_nested_if_spec.rb
157
+ - spec/method/to_source_from_def_end_block_w_nested_literal_keyword_spec.rb
158
+ - spec/method/to_source_from_def_end_block_w_nested_method_spec.rb
159
+ - spec/method/to_source_from_def_end_block_w_nested_module_spec.rb
160
+ - spec/method/to_source_from_def_end_block_w_nested_unless_spec.rb
161
+ - spec/method/to_source_from_def_end_block_w_nested_until_spec.rb
162
+ - spec/method/to_source_from_def_end_block_w_nested_while_spec.rb
163
+ - spec/method/to_source_from_def_end_block_w_singleton_method_spec.rb
164
+ - spec/method/to_source_from_def_end_block_within_irb_spec.rb
165
+ - spec/method/to_source_from_def_end_w_multi_blocks_and_many_matches_spec.rb
166
+ - spec/method/to_source_from_def_end_w_multi_blocks_and_single_match_spec.rb
167
+ - spec/method/to_source_from_define_method_w_braced_block_spec.rb
168
+ - spec/method/to_source_from_define_method_w_do_end_block_spec.rb
169
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_many_matches_spec.rb
170
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_single_match_spec.rb
171
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_many_matches_spec.rb
172
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_no_match_spec.rb
173
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_single_match_spec.rb
174
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb
175
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_many_matches_spec.rb
176
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_no_match_spec.rb
177
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_single_match_spec.rb
178
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_ignore_nested_spec.rb
179
+ - spec/method/to_source_from_define_method_within_irb_spec.rb
180
+ - spec/method/to_source_magic_file_var_spec.rb
181
+ - spec/method/to_source_magic_line_var_spec.rb
182
+ - spec/method/to_source_w_specified_strip_enclosure_spec.rb
183
+ - spec/no_method/unsupported_platform_spec.rb
110
184
  - spec/proc/19x_extras.rb
111
185
  - spec/proc/created_on_the_fly_proc_spec.rb
112
186
  - spec/proc/others_spec.rb
187
+ - spec/proc/raw_scanner/block_comment_spec.rb
188
+ - spec/proc/raw_scanner/double_colons_spec.rb
189
+ - spec/proc/raw_scanner/double_quote_str_w_interpolation_spec.rb
190
+ - spec/proc/raw_scanner/double_quote_str_wo_interpolation_spec.rb
191
+ - spec/proc/raw_scanner/heredoc_w_indent_spec.rb
192
+ - spec/proc/raw_scanner/heredoc_wo_indent_spec.rb
193
+ - spec/proc/raw_scanner/kw_block_start_alias1_spec.rb
194
+ - spec/proc/raw_scanner/kw_block_start_alias2_spec.rb
195
+ - spec/proc/raw_scanner/per_line_comment_spec.rb
196
+ - spec/proc/raw_scanner/single_quote_str_spec.rb
197
+ - spec/proc/raw_scanner/slash_operator_spec.rb
198
+ - spec/proc/raw_scanner/spec_helper.rb
113
199
  - spec/proc/readme
114
200
  - spec/proc/spec_helper.rb
115
201
  - spec/proc/to_raw_source_spec.rb
@@ -150,17 +236,18 @@ files:
150
236
  - spec/proc/to_source_variables_spec.rb
151
237
  - spec/proc/to_source_w_specified_strip_enclosure_spec.rb
152
238
  - spec/proc/to_source_within_irb_spec.rb
153
- - spec/proc_scanner/block_comment_spec.rb
154
- - spec/proc_scanner/double_colons_spec.rb
155
- - spec/proc_scanner/double_quote_str_w_interpolation_spec.rb
156
- - spec/proc_scanner/double_quote_str_wo_interpolation_spec.rb
157
- - spec/proc_scanner/heredoc_spec.rb
158
- - spec/proc_scanner/kw_do_alias1_spec.rb
159
- - spec/proc_scanner/kw_do_alias2_spec.rb
160
- - spec/proc_scanner/per_line_comment_spec.rb
161
- - spec/proc_scanner/single_quote_str_spec.rb
162
- - spec/proc_scanner/slash_operator_spec.rb
163
- - spec/proc_scanner/spec_helper.rb
239
+ - spec/raw_scanner/block_comment_shared_spec.rb
240
+ - spec/raw_scanner/double_colons_shared_spec.rb
241
+ - spec/raw_scanner/double_quote_str_w_interpolation_shared_spec.rb
242
+ - spec/raw_scanner/double_quote_str_wo_interpolation_shared_spec.rb
243
+ - spec/raw_scanner/heredoc_w_indent_shared_spec.rb
244
+ - spec/raw_scanner/heredoc_wo_indent_shared_spec.rb
245
+ - spec/raw_scanner/kw_block_start_alias1_shared_spec.rb
246
+ - spec/raw_scanner/kw_block_start_alias2_shared_spec.rb
247
+ - spec/raw_scanner/per_line_comment_shared_spec.rb
248
+ - spec/raw_scanner/shared_specs.rb
249
+ - spec/raw_scanner/single_quote_str_shared_spec.rb
250
+ - spec/raw_scanner/slash_operator_shared_spec.rb
164
251
  - spec/run_spec.sh
165
252
  - spec/spec_helper.rb
166
253
  has_rdoc: true
@@ -179,9 +266,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
179
266
  required_rubygems_version: !ruby/object:Gem::Requirement
180
267
  none: false
181
268
  requirements:
182
- - - ! '>='
269
+ - - ! '>'
183
270
  - !ruby/object:Gem::Version
184
- version: '0'
271
+ version: 1.3.1
185
272
  requirements: []
186
273
  rubyforge_project:
187
274
  rubygems_version: 1.6.1
@@ -190,9 +277,78 @@ specification_version: 3
190
277
  summary: Workarounds before ruby-core officially supports Proc#to_source (& friends)
191
278
  test_files:
192
279
  - spec/dump_object_space_procs.rb
280
+ - spec/method/others_from_def_end_block_spec.rb
281
+ - spec/method/others_from_define_method_spec.rb
282
+ - spec/method/raw_scanner/block_comment_spec.rb
283
+ - spec/method/raw_scanner/double_colons_spec.rb
284
+ - spec/method/raw_scanner/double_quote_str_w_interpolation_spec.rb
285
+ - spec/method/raw_scanner/double_quote_str_wo_interpolation_spec.rb
286
+ - spec/method/raw_scanner/heredoc_w_indent_spec.rb
287
+ - spec/method/raw_scanner/heredoc_wo_indent_spec.rb
288
+ - spec/method/raw_scanner/kw_block_start_alias1_spec.rb
289
+ - spec/method/raw_scanner/kw_block_start_alias2_spec.rb
290
+ - spec/method/raw_scanner/per_line_comment_spec.rb
291
+ - spec/method/raw_scanner/single_quote_str_spec.rb
292
+ - spec/method/raw_scanner/slash_operator_spec.rb
293
+ - spec/method/raw_scanner/spec_helper.rb
294
+ - spec/method/spec_helper.rb
295
+ - spec/method/to_raw_source_spec.rb
296
+ - spec/method/to_raw_source_w_specified_strip_enclosure_spec.rb
297
+ - spec/method/to_sexp_from_def_end_block_w_variables_spec.rb
298
+ - spec/method/to_sexp_from_def_end_block_within_irb_spec.rb
299
+ - spec/method/to_sexp_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb
300
+ - spec/method/to_sexp_from_define_method_w_variables_spec.rb
301
+ - spec/method/to_sexp_from_define_method_within_irb_spec.rb
302
+ - spec/method/to_sexp_w_specified_strip_enclosure_spec.rb
303
+ - spec/method/to_source_from_def_end_block_w_19_extras_spec.rb
304
+ - spec/method/to_source_from_def_end_block_w_nested_begin_spec.rb
305
+ - spec/method/to_source_from_def_end_block_w_nested_case_spec.rb
306
+ - spec/method/to_source_from_def_end_block_w_nested_class_spec.rb
307
+ - spec/method/to_source_from_def_end_block_w_nested_do_end_block_spec.rb
308
+ - spec/method/to_source_from_def_end_block_w_nested_for_spec.rb
309
+ - spec/method/to_source_from_def_end_block_w_nested_if_spec.rb
310
+ - spec/method/to_source_from_def_end_block_w_nested_literal_keyword_spec.rb
311
+ - spec/method/to_source_from_def_end_block_w_nested_method_spec.rb
312
+ - spec/method/to_source_from_def_end_block_w_nested_module_spec.rb
313
+ - spec/method/to_source_from_def_end_block_w_nested_unless_spec.rb
314
+ - spec/method/to_source_from_def_end_block_w_nested_until_spec.rb
315
+ - spec/method/to_source_from_def_end_block_w_nested_while_spec.rb
316
+ - spec/method/to_source_from_def_end_block_w_singleton_method_spec.rb
317
+ - spec/method/to_source_from_def_end_block_within_irb_spec.rb
318
+ - spec/method/to_source_from_def_end_w_multi_blocks_and_many_matches_spec.rb
319
+ - spec/method/to_source_from_def_end_w_multi_blocks_and_single_match_spec.rb
320
+ - spec/method/to_source_from_define_method_w_braced_block_spec.rb
321
+ - spec/method/to_source_from_define_method_w_do_end_block_spec.rb
322
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_many_matches_spec.rb
323
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_single_match_spec.rb
324
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_many_matches_spec.rb
325
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_no_match_spec.rb
326
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_and_single_match_spec.rb
327
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_attached_to_spec.rb
328
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_many_matches_spec.rb
329
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_no_match_spec.rb
330
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_body_matcher_and_single_match_spec.rb
331
+ - spec/method/to_source_from_define_method_w_multi_blocks_and_specified_ignore_nested_spec.rb
332
+ - spec/method/to_source_from_define_method_within_irb_spec.rb
333
+ - spec/method/to_source_magic_file_var_spec.rb
334
+ - spec/method/to_source_magic_line_var_spec.rb
335
+ - spec/method/to_source_w_specified_strip_enclosure_spec.rb
336
+ - spec/no_method/unsupported_platform_spec.rb
193
337
  - spec/proc/19x_extras.rb
194
338
  - spec/proc/created_on_the_fly_proc_spec.rb
195
339
  - spec/proc/others_spec.rb
340
+ - spec/proc/raw_scanner/block_comment_spec.rb
341
+ - spec/proc/raw_scanner/double_colons_spec.rb
342
+ - spec/proc/raw_scanner/double_quote_str_w_interpolation_spec.rb
343
+ - spec/proc/raw_scanner/double_quote_str_wo_interpolation_spec.rb
344
+ - spec/proc/raw_scanner/heredoc_w_indent_spec.rb
345
+ - spec/proc/raw_scanner/heredoc_wo_indent_spec.rb
346
+ - spec/proc/raw_scanner/kw_block_start_alias1_spec.rb
347
+ - spec/proc/raw_scanner/kw_block_start_alias2_spec.rb
348
+ - spec/proc/raw_scanner/per_line_comment_spec.rb
349
+ - spec/proc/raw_scanner/single_quote_str_spec.rb
350
+ - spec/proc/raw_scanner/slash_operator_spec.rb
351
+ - spec/proc/raw_scanner/spec_helper.rb
196
352
  - spec/proc/readme
197
353
  - spec/proc/spec_helper.rb
198
354
  - spec/proc/to_raw_source_spec.rb
@@ -233,16 +389,17 @@ test_files:
233
389
  - spec/proc/to_source_variables_spec.rb
234
390
  - spec/proc/to_source_w_specified_strip_enclosure_spec.rb
235
391
  - spec/proc/to_source_within_irb_spec.rb
236
- - spec/proc_scanner/block_comment_spec.rb
237
- - spec/proc_scanner/double_colons_spec.rb
238
- - spec/proc_scanner/double_quote_str_w_interpolation_spec.rb
239
- - spec/proc_scanner/double_quote_str_wo_interpolation_spec.rb
240
- - spec/proc_scanner/heredoc_spec.rb
241
- - spec/proc_scanner/kw_do_alias1_spec.rb
242
- - spec/proc_scanner/kw_do_alias2_spec.rb
243
- - spec/proc_scanner/per_line_comment_spec.rb
244
- - spec/proc_scanner/single_quote_str_spec.rb
245
- - spec/proc_scanner/slash_operator_spec.rb
246
- - spec/proc_scanner/spec_helper.rb
392
+ - spec/raw_scanner/block_comment_shared_spec.rb
393
+ - spec/raw_scanner/double_colons_shared_spec.rb
394
+ - spec/raw_scanner/double_quote_str_w_interpolation_shared_spec.rb
395
+ - spec/raw_scanner/double_quote_str_wo_interpolation_shared_spec.rb
396
+ - spec/raw_scanner/heredoc_w_indent_shared_spec.rb
397
+ - spec/raw_scanner/heredoc_wo_indent_shared_spec.rb
398
+ - spec/raw_scanner/kw_block_start_alias1_shared_spec.rb
399
+ - spec/raw_scanner/kw_block_start_alias2_shared_spec.rb
400
+ - spec/raw_scanner/per_line_comment_shared_spec.rb
401
+ - spec/raw_scanner/shared_specs.rb
402
+ - spec/raw_scanner/single_quote_str_shared_spec.rb
403
+ - spec/raw_scanner/slash_operator_shared_spec.rb
247
404
  - spec/run_spec.sh
248
405
  - spec/spec_helper.rb