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_html ⇒ Object



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