Sha256: af94c8b73ae9df4578e4a70f1399431731fa9b1fea81de3bfba395daa551e5b4

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

# to load pagination in rails app
require 'will_paginate'
require 'jquery-rails'
require 'popper_js'
require 'bootstrap'
require 'simple_form' if system('gem list -i simple_form', :out => File::NULL)

module UiBibz
  module Rails
    class Engine < ::Rails::Engine

      initializer "ui_bibz.helpers" do
        ActionView::Base.send :include, UiBibz::Helpers::UtilsHelper
      end

      initializer "ui_bibz.helpers.ui" do
        ActionView::Base.send :include, UiBibz::Helpers::Ui::CoreHelper
        ActionView::Base.send :include, UiBibz::Helpers::Ui::UxHelper
      end

      config.autoload_paths += Dir["#{config.root}/lib/ui_bibz/inputs/"] if defined?(::SimpleForm)

      initializer "ui_bibz.helpers.form" do
        ActionView::Base.send :include, UiBibzForm
      end

      initializer 'font-awesome-sass.assets.precompile', group: :all do |app|
        %w[eot svg ttf woff woff2].each do |ext|
          app.config.assets.precompile << "fonts/fa-brands-400.#{ext}"
          app.config.assets.precompile << "fonts/fa-regular-400.#{ext}"
          app.config.assets.precompile << "fonts/fa-solid-900.#{ext}"
        end
      end

      config.after_initialize do
        unless UiBibz.configured?
          warn '[Ui Bibz] Ui Bibz is not configured in the application and will use the default values.' + ' Use `rails generate ui_bibz:install` to generate the Ui Bibz configuration.'
        end
      end

    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ui_bibz-2.4.0 lib/ui_bibz/rails/engine.rb
ui_bibz-2.3.15 lib/ui_bibz/rails/engine.rb
ui_bibz-2.3.14 lib/ui_bibz/rails/engine.rb
ui_bibz-2.3.13 lib/ui_bibz/rails/engine.rb
ui_bibz-2.3.12 lib/ui_bibz/rails/engine.rb