Skip to content

Commit

Permalink
removes trailing .pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
tatums committed Apr 30, 2024
1 parent 4441285 commit 77a76f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/arxiv/models/manuscript.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/arxiv/models/manuscript_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 77a76f6

Please sign in to comment.