onebox 1.7.9 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe Onebox::Engine::PdfOnebox do
4
+ let(:link) { "https://acrobatusers.com/assets/uploads/public_downloads/2217/adobe-acrobat-xi-merge-pdf-files-tutorial-ue.pdf" }
5
+ let(:html) { described_class.new(link).to_html }
6
+
7
+ before do
8
+ fake(link, response("pdf"))
9
+ end
10
+
11
+ describe "#to_html" do
12
+ it "includes title" do
13
+ expect(html).to include("Merge multiple files into one PDF file with Acrobat XI")
14
+ end
15
+
16
+ it "includes description" do
17
+ expect(html).to include("Learn more about Adobe Acrobat XI: Merge multiple files into one PDF file with Acrobat XI")
18
+ end
19
+
20
+ it "includes author" do
21
+ expect(html).to include("Adobe Systems, Inc.")
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,5 @@
1
+ <a href='{{link}}' target="_blank"><span class='pdf-onebox-logo'></span></a>
2
+ <h3><a href='{{link}}' target="_blank">{{title}}</a></h3>
3
+
4
+ {{#description}}<p>{{description}}</p>{{/description}}
5
+ {{#author}}<p>by {{author}}</p>{{/author}}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onebox
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.9
4
+ version: 1.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joanna Zeta
@@ -110,6 +110,20 @@ dependencies:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
+ - !ruby/object:Gem::Dependency
114
+ name: pdf-reader
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :runtime
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
113
127
  - !ruby/object:Gem::Dependency
114
128
  name: bundler
115
129
  requirement: !ruby/object:Gem::Requirement
@@ -354,6 +368,7 @@ files:
354
368
  - lib/onebox/engine/json.rb
355
369
  - lib/onebox/engine/mixcloud_onebox.rb
356
370
  - lib/onebox/engine/pastebin_onebox.rb
371
+ - lib/onebox/engine/pdf_onebox.rb
357
372
  - lib/onebox/engine/pubmed_onebox.rb
358
373
  - lib/onebox/engine/replit_onebox.rb
359
374
  - lib/onebox/engine/sketchfab_onebox.rb
@@ -395,6 +410,7 @@ files:
395
410
  - spec/fixtures/image.response
396
411
  - spec/fixtures/meetup.response.html
397
412
  - spec/fixtures/meetup_oembed.response
413
+ - spec/fixtures/pdf.response
398
414
  - spec/fixtures/pubmed-xml.response
399
415
  - spec/fixtures/pubmed.response
400
416
  - spec/fixtures/slides.response
@@ -424,6 +440,7 @@ files:
424
440
  - spec/lib/onebox/engine/html_spec.rb
425
441
  - spec/lib/onebox/engine/image_onebox_spec.rb
426
442
  - spec/lib/onebox/engine/json_spec.rb
443
+ - spec/lib/onebox/engine/pdf_onebox_spec.rb
427
444
  - spec/lib/onebox/engine/pubmed_onebox_spec.rb
428
445
  - spec/lib/onebox/engine/slides_onebox_spec.rb
429
446
  - spec/lib/onebox/engine/stack_exchange_onebox_spec.rb
@@ -454,6 +471,7 @@ files:
454
471
  - templates/googledocs.mustache
455
472
  - templates/googleplayapp.mustache
456
473
  - templates/pastebin.mustache
474
+ - templates/pdf.mustache
457
475
  - templates/pubmed.mustache
458
476
  - templates/stackexchange.mustache
459
477
  - templates/twitterstatus.mustache
@@ -486,7 +504,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
486
504
  version: '0'
487
505
  requirements: []
488
506
  rubyforge_project:
489
- rubygems_version: 2.5.1
507
+ rubygems_version: 2.6.8
490
508
  signing_key:
491
509
  specification_version: 4
492
510
  summary: A gem for turning URLs into previews.
@@ -502,6 +520,7 @@ test_files:
502
520
  - spec/fixtures/image.response
503
521
  - spec/fixtures/meetup.response.html
504
522
  - spec/fixtures/meetup_oembed.response
523
+ - spec/fixtures/pdf.response
505
524
  - spec/fixtures/pubmed-xml.response
506
525
  - spec/fixtures/pubmed.response
507
526
  - spec/fixtures/slides.response
@@ -531,6 +550,7 @@ test_files:
531
550
  - spec/lib/onebox/engine/html_spec.rb
532
551
  - spec/lib/onebox/engine/image_onebox_spec.rb
533
552
  - spec/lib/onebox/engine/json_spec.rb
553
+ - spec/lib/onebox/engine/pdf_onebox_spec.rb
534
554
  - spec/lib/onebox/engine/pubmed_onebox_spec.rb
535
555
  - spec/lib/onebox/engine/slides_onebox_spec.rb
536
556
  - spec/lib/onebox/engine/stack_exchange_onebox_spec.rb