From 798e5bb4a76f30d73ca2cd2c18709ac24209749a Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Fri, 17 Nov 2023 11:21:37 -0600 Subject: [PATCH] Remove unused methods that were previously identified for removal --- app/models/embed/purl/resource_file.rb | 16 --------- spec/models/embed/purl/resource_file_spec.rb | 34 -------------------- 2 files changed, 50 deletions(-) diff --git a/app/models/embed/purl/resource_file.rb b/app/models/embed/purl/resource_file.rb index 46d836d06..c7d3450ff 100644 --- a/app/models/embed/purl/resource_file.rb +++ b/app/models/embed/purl/resource_file.rb @@ -70,7 +70,6 @@ def previewable? preview_types.include?(mimetype) end - # unused (9/2016) - candidate for removal? def image? mimetype =~ %r{image/jp2}i end @@ -80,26 +79,11 @@ def size @file.attributes['size'].try(:value).to_i end - # unused (9/2016) - candidate for removal? - def height - @file.xpath('./*/@height').first.try(:text) if @file.xpath('./*/@height').present? - end - - # unused (9/2016) - candidate for removal? - def width - @file.xpath('./*/@width').first.try(:text) if @file.xpath('./*/@width').present? - end - def duration md = Embed::MediaDuration.new(@file.xpath('./*[@duration]').first) if @file.xpath('./*/@duration').present? md&.to_s end - # unused (9/2016) - candidate for removal? - def location - @file.xpath('./location[@type="url"]').first.try(:text) if @file.xpath('./location[@type="url"]').present? - end - def stanford_only? value, _rule = @rights.stanford_only_rights_for_file(title) diff --git a/spec/models/embed/purl/resource_file_spec.rb b/spec/models/embed/purl/resource_file_spec.rb index eefd85f4f..18cfb2b03 100644 --- a/spec/models/embed/purl/resource_file_spec.rb +++ b/spec/models/embed/purl/resource_file_spec.rb @@ -204,27 +204,6 @@ end end - describe 'image data' do - before { stub_purl_xml_response_with_fixture(image_purl_xml) } - - let(:image) { Embed::Purl.new('12345').contents.first.files.first } - - it 'gets the image height and width for image objects' do - expect(image.height).to eq '6123' - expect(image.width).to eq '5321' - end - end - - describe 'file data' do - before { stub_purl_xml_response_with_fixture(file_purl_xml) } - - let(:file) { Embed::Purl.new('12345').contents.first.files.first } - - it 'gets the location data when available' do - expect(file.location).to eq 'http://stacks.stanford.edu/file/druid:abc123/Title_of_the_PDF.pdf' - end - end - describe 'duration' do it 'gets duration string from videoData' do f = double('File') @@ -266,19 +245,6 @@ end end - describe 'video_data' do - context 'with valid videoData' do - before { stub_purl_xml_response_with_fixture(multi_media_purl) } - - let(:video) { Embed::Purl.new('12345').contents.first.files.first } - - it 'gets the height and width for the video object' do - expect(video.height).to eq '288' - expect(video.width).to eq '352' - end - end - end - describe '#vtt?' do subject { file.vtt? }