Class: Recall::SiteGenerator
- Inherits:
-
Object
- Object
- Recall::SiteGenerator
- Defined in:
- lib/recall/site_generator.rb
Instance Method Summary collapse
-
#initialize(results) ⇒ SiteGenerator
constructor
A new instance of SiteGenerator.
- #make_page! ⇒ Object
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.("../templates/sublime.rb.erb", __FILE__) template_doc= File.open(template_file) template = ERB.new(template_doc.read) output_file = File.("../_site/ruby_file.rb", __FILE__) File.open(output_file, "w") do |f| f.write( template.result(binding) ) f.close end `open #{output_file}` end |