Sha256: bf46df07028ecbc9989f694baf7c6cdeaab29e5142771bc77f28ea82af5a0ac1
Contents?: true
Size: 1.41 KB
Versions: 7
Compression:
Stored size: 1.41 KB
Contents
require 'rails_kindeditor/engine' require 'rails_kindeditor/helper' require 'rails_kindeditor/controller_additions' require 'carrierwave' require 'mini_magick' module RailsKindeditor mattr_accessor :upload_dir @@upload_dir = 'uploads' mattr_accessor :upload_image_ext @@upload_image_ext = %w[gif jpg jpeg png bmp] mattr_accessor :upload_flash_ext @@upload_flash_ext = %w[swf flv] mattr_accessor :upload_media_ext @@upload_media_ext = %w[swf flv mp3 wav wma wmv mid avi mpg asf rm rmvb] mattr_accessor :upload_file_ext @@upload_file_ext = %w[doc docx xls xlsx ppt htm html txt zip rar gz bz2] mattr_accessor :image_resize_to_fit def self.root_path @root_path ||= Pathname.new(File.dirname(File.expand_path('../', __FILE__))) end 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')) end end def self.upload_store_dir dirs = upload_dir.gsub(/^\/+/,'').gsub(/\/+$/,'').split('/') dirs.each { |dir| dir.gsub!(/\W/, '') } dirs.delete('') dirs.join('/') end def self.resize_to_fit if !image_resize_to_fit.nil? && image_resize_to_fit.is_a?(Array) [image_resize_to_fit[0], image_resize_to_fit[1]] else [800, 800] end end def self.setup yield self end end
Version data entries
7 entries across 7 versions & 1 rubygems