Module: NestedList::Task

Includes:
Generator
Defined in:
lib/nested_list/tasks.rb

Instance Method Summary collapse

Methods included from Generator

#nested_options_example, #nested_options_example_ru

Instance Method Details

#generate_htmlObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/nested_list/tasks.rb', line 7

def generate_html
  template = ERB.new "  <!DOCTYPE html>\n  <html>\n   <head>\n    <title>Nested List</title>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n  </head>\n  <body>\n    Nested categories list:<br/>\n    <select><%= nested_options_example %></select><br/><br/>\n    Can be used for other language:<br/>\n    <select><%= nested_options_example_ru %></select>\n  </body>\n  </html>\n  EOF\n  mkdir_p \"lib/public/\"\n  puts \"cd lib/public/\"\n  puts \"File nested_list.html preparing...\"\n  File.open(\"lib/public/nested_list.html\", \"w\") do |f|        \n    f.puts template.result(binding)\n  end\n  puts \"lib/public/nested_list.html was created\"\nend\n"