Module: Ckeditor::Utils
- Defined in:
- lib/ckeditor/utils.rb
Constant Summary collapse
- CKEDITOR_INSTALL_DIRECTORY =
File.join(RAILS_ROOT, '/public/javascripts/ckeditor/')
Class Method Summary collapse
-
.destroy ⇒ Object
remove the existing install (if any).
- .escape_single_quotes(str) ⇒ Object
Class Method Details
.destroy ⇒ Object
remove the existing install (if any)
9 10 11 12 13 |
# File 'lib/ckeditor/utils.rb', line 9 def self.destroy if File.exist?(CKEDITOR_INSTALL_DIRECTORY) FileUtils.rm_r(CKEDITOR_INSTALL_DIRECTORY) end end |
.escape_single_quotes(str) ⇒ Object
15 16 17 |
# File 'lib/ckeditor/utils.rb', line 15 def self.escape_single_quotes(str) str.gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" } end |