Sha256: 7e56f43235c58be1dc13cd4861b3c8ae41d2fa102fc4ad81d84dbafeffa14206

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 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
    
    initializer "#{engine_name}.asset_pipeline" do |app|
      app.config.assets.precompile << 'ex_cite.js'
    end
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ex_cite-2.1.0 lib/ex_cite/engine.rb
ex_cite-2.0.0 lib/ex_cite/engine.rb
ex_cite-2.0.0.pre.alpha.1 lib/ex_cite/engine.rb
ex_cite-2.0.0.pre.alpha lib/ex_cite/engine.rb
ex_cite-1.3.2 lib/ex_cite/engine.rb
ex_cite-1.3.1 lib/ex_cite/engine.rb
ex_cite-1.3.0 lib/ex_cite/engine.rb