Module: Ueditor

Defined in:
lib/ueditor.rb,
lib/ueditor/utils.rb,
lib/ueditor/config.rb,
lib/ueditor/engine.rb,
lib/ueditor/version.rb,
lib/ueditor/helpers/form_helper.rb,
lib/ueditor/helpers/form_builder.rb,
lib/ueditor/helpers/form_tag_helper.rb,
lib/ueditor/helpers/asset_tag_helper.rb

Defined Under Namespace

Modules: Helpers, Utils Classes: Configuration, Engine

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.assetsObject



21
22
23
24
25
26
# File 'lib/ueditor.rb', line 21

def self.assets
  Dir[root_path.join('app/assets/javascripts/ueditor/**', '*.{js,css}')].inject([]) do |list, path|
    list << Pathname.new(path).relative_path_from(root_path.join('app/assets/javascripts'))
    list
  end << "ueditor.js"
end

.configObject

Global settings for Ueditor



13
14
15
# File 'lib/ueditor/config.rb', line 13

def self.config
  @config
end

.configure {|@config ||= Ueditor::Configuration.new| ... } ⇒ Object

Configures global settings for Ueditor

Ueditor.configure do |config|
  config.default_per_page = 10
end

Yields:



8
9
10
# File 'lib/ueditor/config.rb', line 8

def self.configure(&block)
  yield @config ||= Ueditor::Configuration.new
end

.root_pathObject



17
18
19
# File 'lib/ueditor.rb', line 17

def self.root_path
  @root_path ||= Pathname.new( File.dirname(File.expand_path('../', __FILE__)) )
end