Skip to content

Commit 830d389

Browse files
authored
Merge pull request #225 from znz/remove-undef-legacy
@undef 段落の後方互換を削除する
2 parents 1a107cf + 86c7d42 commit 830d389

5 files changed

Lines changed: 0 additions & 41 deletions

File tree

lib/bitclust/mdcompiler.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ def entry_chunk
140140
when /\A@todo\b/
141141
# findings#3: rd 側と同じく行頭アンカー付きで
142142
todo
143-
when /\A@undef\b/
144-
# 旧 @undef 段落の後方互換(rd 側と同期。移行完了後に削除する)
145-
@f.gets
146-
undef_message
147143
when RAW_META_RE
148144
entry_info
149145
when /\A\s*\|/

lib/bitclust/rdcompiler.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ def entry_chunk
163163
see
164164
when /\A@todo\b/
165165
todo
166-
when /\A@undef\b/
167-
# 旧 @undef 段落の後方互換(UNKNOWN_META_INFO にすると doctree の
168-
# check_format が落ちる)。{: undef} への移行完了後に削除する
169-
@f.gets
170-
undef_message
171166
when /\A@[a-z]/
172167
entry_info
173168
else

lib/bitclust/rrdparser.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ def define_method(chunk)
486486
:undefined
487487
elsif attrs.include?('nomethod')
488488
:nomethod
489-
elsif chunk.source.match?(/^@undef$/)
490-
# 旧 @undef 段落の後方互換。
491-
# doctree の {: undef} への移行完了後に削除する
492-
:undefined
493489
else
494490
@kind
495491
end

test/test_mdcompiler.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,6 @@ def test_entry_paragraph_with_midline_see_not_swallowed
255255
assert_match(/本文中で @see を説明する行。/, html)
256256
end
257257

258-
def test_legacy_undef_paragraph_renders_dedicated_message
259-
# 旧 @undef 段落の後方互換(doctree master 移行完了後に削除)。
260-
# UNKNOWN_META_INFO にしない(doctree の check_format が落ちるため)
261-
rd_src = "--- <(other) -> bool\n\n@undef\n"
262-
md_src = BitClust::RRDToMarkdown.convert(rd_src)
263-
rd_html = compile_method(@rd, rd_src)
264-
assert_not_match(/UNKNOWN_META_INFO/, rd_html)
265-
assert_match(/このメソッドは定義されていません/, rd_html)
266-
assert_equal rd_html, compile_method(@md, md_src), "md source:\n#{md_src}"
267-
end
268-
269258
def test_undef_renders_dedicated_message
270259
# {: undef} 属性行は専用の説明文を描画する(statichtml は undefined を
271260
# skip するため露出は server 等の動的経路のみ)

test/test_rrdparser.rb

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,3 @@ def test_detached_attribute_line_is_not_a_method_attribute
164164
assert_equal(:defined, db.get_method(BitClust::MethodSpec.parse('Dummy#test_foo')).kind)
165165
end
166166
end
167-
168-
class TestRRDParserLegacyUndef < Test::Unit::TestCase
169-
# 旧 @undef の後方互換。doctree master が {: undef} へ移行するまでの
170-
# 過渡期用で、移行完了後に削除する
171-
def test_legacy_undef_paragraph_still_sets_kind
172-
result = BitClust::RRDParser.parse(<<HERE, 'dummy')
173-
= module Dummy
174-
== Instance Methods
175-
--- test_undef
176-
177-
@undef
178-
179-
HERE
180-
_library, db = result
181-
assert_equal(:undefined, db.get_method(BitClust::MethodSpec.parse('Dummy#test_undef')).kind)
182-
end
183-
end

0 commit comments

Comments
 (0)