sourcify 0.2.0 → 0.2.1
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/HISTORY.txt +7 -0
- data/VERSION +1 -1
- data/lib/sourcify/proc.rb +28 -5
- data/lib/sourcify/proc/parser.rb +6 -34
- data/lib/sourcify/proc/scanner.rb +1312 -1242
- data/lib/sourcify/proc/scanner.rl +103 -92
- data/lib/sourcify/proc/scanner/extensions.rb +0 -1
- data/sourcify.gemspec +2 -4
- data/spec/dump_object_space_procs.rb +1 -1
- data/spec/proc/created_on_the_fly_proc_spec.rb +33 -125
- data/spec/proc_scanner/double_quote_str_wo_interpolation_spec.rb +13 -0
- data/spec/proc_scanner/single_quote_str_spec.rb +13 -0
- metadata +4 -6
- data/spec/proc_scanner/to_proc_spec.rb +0 -15
@@ -36,6 +36,11 @@ describe 'Double quote strings (wo interpolation)' do
|
|
36
36
|
include([:dstring, "%#{t}#{q1}\\\\#{q2}"])
|
37
37
|
end
|
38
38
|
|
39
|
+
should "handle %#{t}#{q1}#{q2}" do
|
40
|
+
process(" xx %#{t}#{q1}#{q2} %#{t}#{q2}lo#{q2} ").should.
|
41
|
+
include([:dstring, "%#{t}#{q1}#{q2}"])
|
42
|
+
end
|
43
|
+
|
39
44
|
end
|
40
45
|
|
41
46
|
end
|
@@ -70,6 +75,14 @@ describe 'Double quote strings (wo interpolation)' do
|
|
70
75
|
)).should.include([:dstring, "#{q}\\\\#{q}"])
|
71
76
|
end
|
72
77
|
|
78
|
+
should "handle #{q}#{q}" do
|
79
|
+
process(%Q(
|
80
|
+
aa #{q}#{q}
|
81
|
+
cc
|
82
|
+
#{q}dd#{q}
|
83
|
+
)).should.include([:dstring, "#{q}#{q}"])
|
84
|
+
end
|
85
|
+
|
73
86
|
end
|
74
87
|
|
75
88
|
end
|
@@ -36,6 +36,11 @@ describe 'Single quote strings (\', %q & %w)' do
|
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
39
|
+
should "handle %#{t}#{q1}#{q2}" do
|
40
|
+
process(" xx %#{t}#{q1}#{q2} %#{t}#{q2}lo#{q2} ").should.
|
41
|
+
include([:sstring, "%#{t}#{q1}#{q2}"])
|
42
|
+
end
|
43
|
+
|
39
44
|
end
|
40
45
|
end
|
41
46
|
|
@@ -65,4 +70,12 @@ describe 'Single quote strings (\', %q & %w)' do
|
|
65
70
|
)).should.include([:sstring, "'\\\\'"])
|
66
71
|
end
|
67
72
|
|
73
|
+
should "handle ''" do
|
74
|
+
process(%q(
|
75
|
+
aa ''
|
76
|
+
cc
|
77
|
+
'dd'
|
78
|
+
)).should.include([:sstring, "''"])
|
79
|
+
end
|
80
|
+
|
68
81
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sourcify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- NgTzeYang
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-14 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -114,7 +114,6 @@ files:
|
|
114
114
|
- spec/proc_scanner/per_line_comment_spec.rb
|
115
115
|
- spec/proc_scanner/single_quote_str_spec.rb
|
116
116
|
- spec/proc_scanner/spec_helper.rb
|
117
|
-
- spec/proc_scanner/to_proc_spec.rb
|
118
117
|
- spec/spec_helper.rb
|
119
118
|
has_rdoc: true
|
120
119
|
homepage: http://github.com/ngty/sourcify
|
@@ -153,7 +152,6 @@ summary: Workarounds before ruby-core officially supports Proc#to_source (& frie
|
|
153
152
|
test_files:
|
154
153
|
- spec/proc_scanner/kw_do_alias1_spec.rb
|
155
154
|
- spec/proc_scanner/single_quote_str_spec.rb
|
156
|
-
- spec/proc_scanner/to_proc_spec.rb
|
157
155
|
- spec/proc_scanner/kw_do_alias2_spec.rb
|
158
156
|
- spec/proc_scanner/double_colons_spec.rb
|
159
157
|
- spec/proc_scanner/block_comment_spec.rb
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe "#to_proc" do
|
4
|
-
|
5
|
-
should 'handle &:xxx' do
|
6
|
-
process(" &:xxx ").should.include([:to_proc, '&:xxx'])
|
7
|
-
end
|
8
|
-
|
9
|
-
%w{&xxx :xxx}.each do |expr|
|
10
|
-
should "handle not #{expr}" do
|
11
|
-
process(" #{expr} ").map(&:first).should.not.include(:to_proc)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|