yard_ast_editable 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/yard_ast_editable.rb +1 -1
- data/spec/yard_ast_spec.rb +11 -1
- data/yard_ast_editable.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/yard_ast_editable.rb
CHANGED
@@ -30,7 +30,7 @@ module YardAstEditable
|
|
30
30
|
result = block.source
|
31
31
|
case block.type
|
32
32
|
when :do_block then
|
33
|
-
result.sub!(/\Ado\
|
33
|
+
result.sub!(/\Ado[ \t\f]*(\|.*?\|)?\n?/, '')
|
34
34
|
result.sub!(/end[\s\n]*\Z/, '')
|
35
35
|
when :brace_block then
|
36
36
|
result.sub!(/^\{\s*(\|.*?\|)?\n?/, '')
|
data/spec/yard_ast_spec.rb
CHANGED
@@ -147,11 +147,17 @@ describe "YardAst" do
|
|
147
147
|
describe YardAstEditable::Fcall do
|
148
148
|
before do
|
149
149
|
script = <<-EOS
|
150
|
+
# comment1
|
150
151
|
instance("i-12345678") do
|
152
|
+
# comment2
|
151
153
|
agent("mm_system_agent") do
|
154
|
+
# comment3
|
152
155
|
service("system")
|
156
|
+
# comment4
|
153
157
|
end
|
158
|
+
# comment5
|
154
159
|
end
|
160
|
+
# comment6
|
155
161
|
EOS
|
156
162
|
ast = YARD::Parser::Ruby::RubyParser.new(script, nil).parse.root
|
157
163
|
node = ast.fcall_by_ident(:instance){|fcall|
|
@@ -173,9 +179,13 @@ EOS
|
|
173
179
|
@caller.block.nil?.should be_false
|
174
180
|
result = @caller.block_content_source
|
175
181
|
result.should == <<-EXPECT
|
176
|
-
|
182
|
+
# comment2
|
183
|
+
agent("mm_system_agent") do
|
184
|
+
# comment3
|
177
185
|
service("system")
|
186
|
+
# comment4
|
178
187
|
end
|
188
|
+
# comment5
|
179
189
|
EXPECT
|
180
190
|
end
|
181
191
|
end
|
data/yard_ast_editable.gemspec
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- akimatter
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
hash:
|
129
|
+
hash: 3824769518784121840
|
130
130
|
segments:
|
131
131
|
- 0
|
132
132
|
version: "0"
|