module RailsKindeditor

Constants

VERSION

Public Class Methods

assets() click to toggle source
# File lib/rails_kindeditor.rb, line 33
def self.assets
  Dir[root_path.join('vendor/assets/javascripts/kindeditor/**', '*.{js,css}')].inject([]) do |assets, path|
    assets << Pathname.new(path).relative_path_from(root_path.join('vendor/assets/javascripts')).to_s
  end
end
resize_to_limit() click to toggle source
# File lib/rails_kindeditor.rb, line 46
def self.resize_to_limit
  if !image_resize_to_limit.nil? && image_resize_to_limit.is_a?(Array)
    [image_resize_to_limit[0], image_resize_to_limit[1]]
  else
    [800, 800]
  end
end
root_path() click to toggle source
# File lib/rails_kindeditor.rb, line 29
def self.root_path
  @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__)))
end
setup() { |self| ... } click to toggle source
# File lib/rails_kindeditor.rb, line 54
def self.setup
  yield self
end
upload_store_dir() click to toggle source
# File lib/rails_kindeditor.rb, line 39
def self.upload_store_dir
  dirs = upload_dir.gsub(/^\/+/,'').gsub(/\/+$/,'').split('/')
  dirs.each { |dir| dir.gsub!(/\W/, '') }
  dirs.delete('')
  dirs.join('/')
end