markdown/use_cases/Rakefile in markdown_helper-1.9.0 vs markdown/use_cases/Rakefile in markdown_helper-1.9.5
- old
+ new
@@ -1,6 +1,7 @@
-require_relative 'include/include_use_case'
+require_relative 'include_files/include_use_case'
+require_relative '../../lib/string_helper'
namespace :build do
def camelize(snake_case_string)
snake_case_string.split('_').collect(&:capitalize).join
@@ -17,32 +18,36 @@
)
dir_path = File.dirname(__FILE__)
Dir.chdir(dir_path) do
IncludeUseCase.write_interface_file
use_case_dirs = {
- :include => %w/
+ :include_files => %w/
reuse_text
include_with_added_comments
nest_inclusions
include_markdown
include_code_block
include_highlighted_code
include_generated_text
diagnose_missing_includee
diagnose_circular_includes
/,
+ :tables_of_contents => %w/
+ create_and_include_page_toc
+ /,
# :resolve => %w/
# resize_images
# resolve_with_added_comments
# gemify_images
- # /
+ # /,
}
use_case_dirs.each_pair do |section, dir_names|
# Header for section, if any dirs therein.
+ title = StringHelper.to_title(section.to_s).sub(/ toc$/i, ' TOC')
use_case_file.puts(<<EOT
-## #{section.to_s.capitalize}
+## #{title}
EOT
) unless dir_names.empty?
backtrace_cases = %w/
@@ -63,9 +68,10 @@
rescue
#
ensure
end
else
+ p command
system(command)
end
end
# If the dir has a use case file, link to it.