Sha256: 71ac6e8016b2b78535bd0f789a64b0ad887cd04c39bc9139feb8ec8d5329b01b

Contents?: true

Size: 871 Bytes

Versions: 11

Compression:

Stored size: 871 Bytes

Contents

require 'rails/generators'

module BlacklightOembed
  class Install < Rails::Generators::Base

    source_root File.expand_path('../templates', __FILE__)

    def assets
      copy_file "blacklight_oembed.css.scss", "app/assets/stylesheets/blacklight_oembed.css.scss"
      copy_file "blacklight_oembed.js", "app/assets/javascripts/blacklight_oembed.js"
    end

    def inject_routes
      route "mount Blacklight::Oembed::Engine, at: 'oembed'"
    end

    def inject_oembed_configuration
      copy_file "oembed_providers.rb", "config/initializers/oembed_providers.rb"
    end

    def configuration
      inject_into_file 'app/controllers/catalog_controller.rb', after: "configure_blacklight do |config|" do
        <<-EOF

          config.show.oembed_field = :oembed_url_ssm
          config.show.partials.insert(1, :oembed)
        EOF
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-oembed-1.1.1/lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-1.1.1 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-1.1.0 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-1.0.1 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-1.0.0 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.3.0 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.2.0 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.1.0 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.0.4 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.0.3 lib/generators/blacklight_oembed/install_generator.rb
blacklight-oembed-0.0.2 lib/generators/blacklight_oembed/install_generator.rb