Sha256: e55415a48686a84ad1c05e03fd4d40db5acb7c42f74a44dc79dd509b099d86c4

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

require 'fileutils'

module Ckeditor
  module Utils

    # remove the existing install (if any)
    def self.destroy
      directory = Rails.root.join('public', 'javascripts', 'ckeditor')
      if File.exist?(directory)
        FileUtils.rm_r(directory, :force => true)
      end
    end
    
    def self.escape_single_quotes(str)
      str.gsub('\\','\0\0').gsub('</','<\/').gsub(/\r\n|\n|\r/, "\\n").gsub(/["']/) { |m| "\\#{m}" }
    end
    
    def self.parameterize_filename(filename)
      extension = File.extname(filename)
      basename = filename.gsub(/#{extension}$/, "")
      
      [basename.parameterize('_'), extension].join.downcase
    end
    
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
dust-ckeditor-3.5.0 lib/ckeditor/utils.rb
hifi-ckeditor-3.5.2 lib/ckeditor/utils.rb
hifi-ckeditor-3.5.1 lib/ckeditor/utils.rb
ckeditor-3.5.0 lib/ckeditor/utils.rb