From 77a76f6d722a6362969b227be8f6c6be9a593b6a Mon Sep 17 00:00:00 2001 From: Tatum Date: Tue, 30 Apr 2024 10:26:53 -0400 Subject: [PATCH] removes trailing .pdf --- lib/arxiv/models/manuscript.rb | 3 +-- spec/arxiv/models/manuscript_spec.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/arxiv/models/manuscript.rb b/lib/arxiv/models/manuscript.rb index 8e03334..8841b38 100644 --- a/lib/arxiv/models/manuscript.rb +++ b/lib/arxiv/models/manuscript.rb @@ -50,8 +50,7 @@ def available_in_pdf? def pdf_url if available_in_pdf? - url = links.find { |l| l.content_type == "application/pdf" }.url - "#{url}.pdf" unless url =~ /\.pdf$/ + links.find { |l| l.content_type == "application/pdf" }.url end end end diff --git a/spec/arxiv/models/manuscript_spec.rb b/spec/arxiv/models/manuscript_spec.rb index 7d52090..4c98e7c 100644 --- a/spec/arxiv/models/manuscript_spec.rb +++ b/spec/arxiv/models/manuscript_spec.rb @@ -93,7 +93,7 @@ module Arxiv describe "pdf_url" do it "should return the url to download the manuscript in PDF format" do - expect(@manuscript.pdf_url).to eql('https://arxiv.org/pdf/1202.0819v1.pdf') + expect(@manuscript.pdf_url).to eql('http://arxiv.org/pdf/1202.0819v1') end end