Sha256: 1c50cb605ec14abcf9c33a29058211478baa0d700dd8a6678304ab4c68f6f569

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
require 'yaml'
require 'restfulx/configuration'
require 'restfulx/amf'

# Settings
module RestfulX
  # Valid types supported internally on top of standard Rails types  
  module Types
    APPLICATION_FXML = 'application/xml'.freeze
    APPLICATION_AMF = 'application/x-amf'.freeze
  end

  VERSION_SOURCE = YAML.load(File.read(File.join(File.dirname(__FILE__), '..', 'VERSION.yml')))
  VERSION = "#{VERSION_SOURCE[:major]}.#{VERSION_SOURCE[:minor]}.#{VERSION_SOURCE[:patch]}"
end

# ActiveRecord extensions
if defined?(ActiveRecord::Base)
  ['rx_active_support', 'rx_active_record'].each { |lib| require "restfulx/#{lib}" }
  ActiveRecord::Base.send :include, 
    RestfulX::ActiveRecord unless ActiveRecord::Base.included_modules.include?(RestfulX::ActiveRecord)
end

# ActionController/ActionView extensions
if defined?(ActionController::Base)
  Mime::Type.register_alias RestfulX::Types::APPLICATION_FXML, :fxml
  Mime::Type.register RestfulX::Types::APPLICATION_AMF, :amf
  
  ['rx_action_controller', 'swf_helper'].each { |lib| require "restfulx/#{lib}" }

  ActionController::Base.send :include, 
    RestfulX::ActionController unless ActionController::Base.included_modules.include?(RestfulX::ActionController)
  ActionView::Base.send :include, 
    RestfulX::SWFHelper unless ActionView::Base.included_modules.include?(RestfulX::SWFHelper)
end

# DataMapper extensions
if defined?(DataMapper)
  require 'restfulx/rx_datamapper'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
restfulx-1.3.1 lib/restfulx.rb