From f906b6fd7e553897c6b301284b89242ce91719c0 Mon Sep 17 00:00:00 2001 From: Marcin Raczkowski Date: Fri, 14 Mar 2014 03:01:45 +0100 Subject: [PATCH] Adjusting column match regexp to match markdown template --- lib/annotate/annotate_models.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/annotate/annotate_models.rb b/lib/annotate/annotate_models.rb index 7c74f96ea..17c7e828a 100644 --- a/lib/annotate/annotate_models.rb +++ b/lib/annotate/annotate_models.rb @@ -222,7 +222,7 @@ def annotate_one_file(file_name, info_block, position, options={}) old_header = old_content.match(header_pattern).to_s new_header = info_block.match(header_pattern).to_s - column_pattern = /^#[\t ]+\w+[\t ]+.+$/ + column_pattern = /^#[\t ]+[\w\*`]+[\t ]+.+$/ old_columns = old_header && old_header.scan(column_pattern).sort new_columns = new_header && new_header.scan(column_pattern).sort @@ -235,7 +235,7 @@ def annotate_one_file(file_name, info_block, position, options={}) # Replace inline the old schema info with the new schema info new_content = old_content.sub(PATTERN, info_block + "\n") - if new_content.end_with? (info_block + "\n") + if new_content.end_with?(info_block + "\n") new_content = old_content.sub(PATTERN, "\n" + info_block) end