Sha256: b02964dcf2b8bb902302ad31762817fd56e9e0cf8000a554b1521db93d2b8204

Contents?: true

Size: 833 Bytes

Versions: 14

Compression:

Stored size: 833 Bytes

Contents

require 'jquery-ui-rails'
require 'scrivito_content_browser'

module ScrivitoEditors
  class Engine < ::Rails::Engine
    isolate_namespace ScrivitoEditors

    initializer "scrivito_editors.scrivito_tag_helper" do
      ActionView::Base.send :include, ScrivitoTagHelper
    end

    class << self
      def imgly_assets
        imgly_assets_paths.inject({}) do |asset_map, file|
          asset_map[file] = yield(file)
          asset_map
        end
      end

      private

      def imgly_assets_paths
        images_path = ScrivitoEditors::Engine.root + 'app/assets/images/'
        absolute_paths = Dir[images_path + 'imgly_sdk/**/*'].select { |f| File.file?(f) }

        absolute_paths.map do |absolute_path|
          Pathname.new(absolute_path).relative_path_from(images_path).to_s
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
scrivito_editors-1.1.1 lib/scrivito_editors/engine.rb
scrivito_editors-1.1.0 lib/scrivito_editors/engine.rb
scrivito_editors-1.1.0.rc3 lib/scrivito_editors/engine.rb
scrivito_editors-1.1.0.rc2 lib/scrivito_editors/engine.rb
scrivito_editors-1.1.0.rc1 lib/scrivito_editors/engine.rb
scrivito_editors-1.0.0 lib/scrivito_editors/engine.rb
scrivito_editors-1.0.0.rc4 lib/scrivito_editors/engine.rb
scrivito_editors-1.0.0.rc3 lib/scrivito_editors/engine.rb
scrivito_editors-1.0.0.rc2 lib/scrivito_editors/engine.rb
scrivito_editors-1.0.0.rc1 lib/scrivito_editors/engine.rb
scrivito_editors-0.90.0 lib/scrivito_editors/engine.rb
scrivito_editors-0.90.0.rc3 lib/scrivito_editors/engine.rb
scrivito_editors-0.90.0.rc2 lib/scrivito_editors/engine.rb
scrivito_editors-0.90.0.rc1 lib/scrivito_editors/engine.rb