Skip to content

Commit

Permalink
another try to move to conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Semyonov committed Sep 1, 2009
1 parent c98b74d commit 7c87f63
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions lib/tiny_mce.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
module TinyMCE
end

# Require all the necessary files to run TinyMCE
require 'tiny_mce/controller.rb'
require 'tiny_mce/options_validator'
require 'tiny_mce/spellchecker'
require 'tiny_mce/base'
require 'tiny_mce/option_validator'
require 'tiny_mce/spell_checker'
require 'tiny_mce/helpers'

module TinyMCE
module Base
include TinyMCE::OptionValidator
include TinyMCE::SpellChecker
end
end

# Load up the available configuration options (we do it here because
# the result doesn't, so we don't want to load it per request)
TinyMCE::OptionValidator.load

# Include the TinyMCE methods and TinyMCE Helpers into ActionController::Base

if defined?(Rails) && defined?(ActionController)
ActionController::Base.send(:include, TinyMCE::Controller)
ActionController::Base.send(:helper, TinyMCEHelpers)
ActionController::Base.send(:include, TinyMCE::Base)
ActionController::Base.send(:helper, TinyMCE::Helpers)
end
2 changes: 1 addition & 1 deletion lib/tiny_mce/controller.rb → lib/tiny_mce/base.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TinyMCE
# The base module we include into ActionController::Base
module Controller
module Base
# When this module is included, extend it with the available class methods
def self.included(base)
base.extend(ClassMethods)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class << self
# Parse the options file and load it into an array
# (this method is called when tiny_mce is initialized - see init.rb)
def load
@@valid_options = File.open(File.dirname(__FILE__) + "/../tiny_mce_options.yml") { |f| YAML.load(f.read) }
@@valid_options = File.open(File.dirname(__FILE__) + '/../../tiny_mce_options.yml') { |f| YAML.load(f.read) }
self.plugins = Array.new
end

Expand Down
File renamed without changes.

0 comments on commit 7c87f63

Please sign in to comment.