module RailsKindeditor
Constants
- VERSION
Public Class Methods
assets()
click to toggle source
# File lib/rails_kindeditor.rb, line 36 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
base_path()
click to toggle source
# File lib/rails_kindeditor.rb, line 28 def self.base_path self.asset_url_prefix ? "#{self.asset_url_prefix}/kindeditor/" : '/assets/kindeditor/' end
resize_to_limit()
click to toggle source
# File lib/rails_kindeditor.rb, line 49 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 32 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 57 def self.setup yield self end
upload_store_dir()
click to toggle source
# File lib/rails_kindeditor.rb, line 42 def self.upload_store_dir dirs = upload_dir.gsub(/^\/+/,'').gsub(/\/+$/,'').split('/') dirs.each { |dir| dir.gsub!(/\W/, '') } dirs.delete('') dirs.join('/') end