Sha256: f10cae60661be1ca6c8c35e004d29558131eb4a7c1fbc9bc0e7c08dbe746b471

Contents?: true

Size: 743 Bytes

Versions: 6

Compression:

Stored size: 743 Bytes

Contents

module Onebox
  module Engine
    class GoogleDriveOnebox
      include Engine
      include StandardEmbed
      include LayoutSupport

      matches_regexp /^(https?:)?\/\/(drive\.google\.com)\/file\/d\/(?<key>[\w-]*)\/.+$/
      always_https

      protected

      def data
        og_data = get_opengraph
        title = og_data.title || "Google Drive"
        title = "#{og_data.title} (video)" if og_data.type =~ /^video[\/\.]/
        description = og_data.description || "Google Drive file."

        result = { link: link,
                   title: title,
                   description: Onebox::Helpers.truncate(description, 250),
                   image: og_data.image
                 }
        result
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
onebox-1.8.89 lib/onebox/engine/google_drive_onebox.rb
onebox-1.8.88 lib/onebox/engine/google_drive_onebox.rb
onebox-1.8.87 lib/onebox/engine/google_drive_onebox.rb
onebox-1.8.86 lib/onebox/engine/google_drive_onebox.rb
onebox-1.8.85 lib/onebox/engine/google_drive_onebox.rb
onebox-1.8.84 lib/onebox/engine/google_drive_onebox.rb