28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/moonrope/html_generator.rb', line 28
def generate(output_path)
FileUtils.mkdir_p(output_path)
FileUtils.cp_r(File.join(@template_root_path, 'assets'), File.join(output_path, 'assets'))
FileUtils.touch(File.join(output_path, 'moonrope.txt'))
generate_file(output_path, "index.html", "index")
@base.controllers.select { |c| c.doc != false }.each do |controller|
generate_file(output_path, File.join("controllers", "#{controller.name}.html"), "controller", {:controller => controller})
controller.actions.select { |_,a| a.doc != false }.each do |_, action|
generate_file(output_path, File.join("controllers", controller.name.to_s, "#{action.name}.html"), "action", {:controller => controller, :action => action})
end
end
@base.structures.select { |s| s.doc != false }.each do |structure|
generate_file(output_path, File.join("structures", "#{structure.name}.html"), "structure", {:structure => structure})
end
@base.authenticators.values.select { |s| s.doc != false }.each do |authenticator|
generate_file(output_path, File.join("authenticators", "#{authenticator.name}.html"), "authenticator", {:authenticator => authenticator})
end
end
|