Sha256: 7b9f1a5d13d93102b8db66622f6bb7f0991cae6f40df351264fe5b4efc474aec

Contents?: true

Size: 702 Bytes

Versions: 10

Compression:

Stored size: 702 Bytes

Contents

require 'rails'
require 'devise_bootstrap_views_helper'
module DeviseBootstrapViews
  class Engine < ::Rails::Engine
  end

  class Railtie < ::Rails::Railtie #:nodoc:
    initializer 'rails-devise-bootstrap-views' do |app|
      DeviseBootstrapViews::Railtie.instance_eval do
        pattern = pattern_from app.config.i18n.available_locales

        files = Dir[File.join(File.dirname(__FILE__), '../locales', "#{pattern}.yml")]
        I18n.load_path.concat(files)

        ActionView::Base.send :include, DeviseBootstrapViewsHelper
      end
    end

    protected

    def self.pattern_from(args)
      array = Array(args || [])
      array.blank? ? '*' : "{#{array.join ','}}"
    end
  end
end


Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
devise-bootstrap-views-0.0.11 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.10 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.9 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.8 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.7 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.6 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.5 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.4 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.3 lib/devise-bootstrap-views.rb
devise-bootstrap-views-0.0.2 lib/devise-bootstrap-views.rb