Class: Recall::SiteGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/recall/site_generator.rb

Instance Method Summary collapse

Constructor Details

#initialize(results) ⇒ SiteGenerator

Returns a new instance of SiteGenerator.



3
4
5
# File 'lib/recall/site_generator.rb', line 3

def initialize(results)
  @results = results
end

Instance Method Details

#make_page!Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/recall/site_generator.rb', line 6

def make_page!



  template_file = File.expand_path("../templates/sublime.rb.erb", __FILE__)
  template_doc= File.open(template_file)
  template = ERB.new(template_doc.read)

  output_file = File.expand_path("../_site/ruby_file.rb", __FILE__)
  File.open(output_file, "w") do |f|
  
      f.write(
        template.result(binding)
      )
    
    f.close
  end

  `open #{output_file}` 
  

end