markdown/readme/Rakefile in debug_helper-1.7.0 vs markdown/readme/Rakefile in debug_helper-1.8.0
- old
+ new
@@ -1,5 +1,6 @@
+require 'debug_helper'
require 'markdown_helper'
namespace :build do
desc 'Build README.md'
@@ -13,19 +14,39 @@
end
class_dir_names = nil
Dir.chdir('classes') do
class_names = %w/
Array
+ Dir
+ Exception
+ File
Hash
- Struct
+ IO
+ MatchData
+ OpenStruct
+ Range
+ Regexp
+ Set
String
+ Struct
Symbol
- File
- Set
Object
/
- class_dir_names = class_names.collect {|x| x.downcase}
+ class_dir_names = []
+ correct_dir_names = {
+ :IO => 'io',
+ :MatchData => 'match_data',
+ :OpenStruct => 'open_struct',
+ }
+ class_names.each do |class_name|
+ if correct_dir_names.include?(class_name.to_sym)
+ class_dir_name = correct_dir_names.fetch(class_name.to_sym)
+ else
+ class_dir_name = class_name.downcase
+ end
+ class_dir_names.push(class_dir_name)
+ end
class_dir_names.each do |class_dir_name|
Dir.chdir(class_dir_name) do
case_dir_names = Dir.glob('*').select {|f| File.directory? f}
case_dir_names.each do |case_dir_name|
Dir.chdir(case_dir_name) do
@@ -38,13 +59,22 @@
end
end
end
# Make list of links to class sections.
File.open('class_links.md', 'w') do |file|
+ correct_class_names = {
+ :io => 'IO',
+ :match_data => 'MatchData',
+ :open_struct => 'OpenStruct',
+ }
class_dir_names.each do |class_dir_name|
next if class_dir_name == 'object'
- proper_class_name = class_dir_name.capitalize
- link_line = "- [#{proper_class_name}](##{class_dir_name})"
+ if correct_class_names.include?(class_dir_name.to_sym)
+ class_name = correct_class_names.fetch(class_dir_name.to_sym)
+ else
+ class_name = class_dir_name.capitalize
+ end
+ link_line = "- [#{class_name}](##{class_name.downcase})"
file.puts(link_line)
end
end
# Make inclusions for class sections.
File.open('class_inclusions.md', 'w') do |file|
\ No newline at end of file