Class: Revelry::Content::JsExporter
- Inherits:
-
Object
- Object
- Revelry::Content::JsExporter
- Defined in:
- lib/revelry/content/js_exporter.rb
Class Method Summary collapse
Class Method Details
.write_export ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/revelry/content/js_exporter.rb', line 2 def self.write_export directory = Rails.root.join('vendor', 'assets', 'javascripts', 'revelry_content') FileUtils.mkdir_p(directory) File.open File.join(directory, 'content.js'), 'w' do |f| f.write <<-JS if(typeof Rev.Content === 'undefined') { var Rev.Content = {}; } Rev.Content.Contents = #{ Revelry::Content::Content.as_lookup_table.to_json }; JS end end |