Class: RubyDetective::UIGenerator
- Inherits:
-
Object
- Object
- RubyDetective::UIGenerator
- Defined in:
- lib/ruby_detective/ui_generator.rb
Class Method Summary collapse
Class Method Details
.generate ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/ruby_detective/ui_generator.rb', line 5 def self.generate # Variable used inside the template classes_data_as_json = JSONBuilder.build template_path = File.join(File.dirname(__FILE__), "../../views/template.html.erb") erb_template = File.read(template_path) ui_source_code = ERB.new(erb_template).result(binding) output_file_path = 'ruby_detective.html' File.delete(output_file_path) if File.exist?(output_file_path) File.open(output_file_path, 'w') { |file| file << ui_source_code } end |