Sha256: df4bb81d787f774b2fd9971b1ea3961fb25b2dfb94951c5b6869e1076fc3abf9

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

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
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rtml-2.0.4 lib/rtml/environment.rb