path = File.expand_path File.join(File.dirname(__FILE__), '../..') if defined?(Rails.configuration) Rails.configuration.controller_paths << File.join(path, 'builtin/controllers') end %w(document instruction state dom/element dom/frontend_element dom/property dom/screen_element instruction/follow_class_methods state/variable_mapping).each do |fi| require File.join(path, 'builtin/models/rtml', fi) end require File.join(path, 'builtin/rtml_helpers/rtml/get_state') require File.join(path, 'builtin/rtml_helpers/rtml/rescue_action') if defined?(Rails) Rails.configuration.after_initialize do Dir[File.join(path, 'lib/extensions/**/*.rb')].each { |fi| require fi if File.file?(fi) } end else Dir[File.join(path, 'lib/extensions/**/*.rb')].each { |fi| require fi if File.file?(fi) } end # Add RTML routes routes_file = File.join(Rtml.root, 'lib/rtml_routes.rb') unless ActionController::Routing::Routes.configuration_files.include? routes_file ActionController::Routing::Routes.configuration_files << routes_file end Mime::TML = Mime::Type.lookup("text/tml") require File.join(path, "lib/rtml/rules/tml_param_parser") ActionController::Base.param_parsers[Mime::TML] = proc { |data| Rtml::Rules::TmlParamParser.new(data).params }