Sha256: 65246663051ac62e68ec38aecb786cdf5cf6b713cc4a8057b9ac3b97bc5426ad

Contents?: true

Size: 1.32 KB

Versions: 5

Compression:

Stored size: 1.32 KB

Contents

require 'ex_cite/core_ext'
require "acts_as_citable"

module ExCite
  mattr_accessor :acts_as_citable_class
  mattr_accessor :push_formats
  mattr_accessor :endnote, :easybib, :refworks
  def self.acts_as_citable_class
    @@acts_as_citable_class.constantize
  end

  class Engine < Rails::Engine
    isolate_namespace ExCite
    engine_name "ex_cite"
    ExCite.acts_as_citable_class = "ExCite::Citation"
    config.before_initialize do
      ExCite.easybib ||= PushFormat.new( :name => :easybibpush, :to_format => :easybib, :url => "http://www.easybib.com/cite/bulk")
      ExCite.endnote ||= PushFormat.new :name => :endnote, :to_format => :ris, :action => :redirect, :url => 'http://www.myendnoteweb.com/?func=directExport&partnerName=Primo&dataIdentifier=1&dataRequestUrl='
      ExCite.refworks ||= PushFormat.new( :name => :refworks, :to_format => :refworks_tagged, :element_name=> 'ImportData', :url => "http://www.refworks.com/express/ExpressImport.asp?vendor=Primo&filter=RefWorks%20Tagged%20Format&encoding=65001&url=")
      formats = Hash[ExCite.easybib.name => ExCite.easybib, ExCite.endnote.name => ExCite.endnote, ExCite.refworks.name => ExCite.refworks]
      ExCite.push_formats = formats
    end
  end

  ActiveSupport.on_load(:after_initialize) do
    ActiveRecord::Base.class_eval do
      include ResourceKey
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ex_cite-1.2.7 lib/ex_cite/engine.rb
ex_cite-1.2.6 lib/ex_cite/engine.rb
ex_cite-1.2.5 lib/ex_cite/engine.rb
ex_cite-1.2.4 lib/ex_cite/engine.rb
ex_cite-1.2.3 lib/ex_cite/engine.rb