Sha256: 1db066ade07a5fb6be49f327d2009c5317d7347a241d260a0134710050666422

Contents?: true

Size: 624 Bytes

Versions: 1

Compression:

Stored size: 624 Bytes

Contents

module Kangaroo
  class Railtie < Rails::Railtie
    attr_accessor :configuration

    # Get the client instance configured via config/kangaroo.yml
    #
    # @return [Kangaroo::Util::Client] client
    def client
      @configuration.try :client
    end

    config.to_prepare do
      begin
        config_file = File.join(Rails.root, %w(config kangaroo.yml))
        @configuration = Kangaroo::Util::Configuration.new config_file, Rails.logger
        @configuration.load_models
      rescue Errno::ECONNREFUSED => e
        Rails.logger.error "Could not connect to OpenERP XML-RPC Service."
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kangaroo-0.1.0.alpha1 lib/kangaroo/railtie.rb