class Weditor::Loader::Template

Public Class Methods

parser(content_str) click to toggle source
# File lib/weditor/loader.rb, line 10
def self.parser (content_str)
  Nokogiri::HTML(content_str, nil, 'UTF-8')
end
read(path) click to toggle source
# File lib/weditor/loader.rb, line 14
def self.read(path)
  file = File.open(path)
  contents = file.read
end
save(path, content) click to toggle source
# File lib/weditor/loader.rb, line 19
def self.save (path, content)
  dir = File.dirname(path)
  FileUtils.mkdir_p dir

  f = File.open(path, 'w')
  f.write(content)
  f.close()

  true
end