From dc0e12b6291e2c6126ba4d3fbeeb6c2ee62f7b0b Mon Sep 17 00:00:00 2001 From: Tatum Date: Tue, 30 Apr 2024 10:54:57 -0400 Subject: [PATCH] avoid adding .pdf to Manuscript#pdf_url --- 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 ab52e8e..d0327c4 100644 --- a/lib/arxiv/models/manuscript.rb +++ b/lib/arxiv/models/manuscript.rb @@ -51,8 +51,7 @@ def available_in_pdf? def pdf_url if available_in_pdf? url = links.find { |l| l.content_type == "application/pdf" }.url - url = StringScrubber.force_ssl_url(url) - "#{url}.pdf" unless url =~ /\.pdf$/ + StringScrubber.force_ssl_url(url) end end diff --git a/spec/arxiv/models/manuscript_spec.rb b/spec/arxiv/models/manuscript_spec.rb index 7d52090..99d48df 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('https://arxiv.org/pdf/1202.0819v1') end end