File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ def images_at(cell_name)
3434 return if pathnames_at_coordinate . empty?
3535
3636 pathnames_at_coordinate . map do |image_pathname |
37- if image_pathname . exist?
38- image_pathname
39- else
40- excel_image_path = "xl/media/ #{ image_pathname . to_path . split ( tmpdir ) . last } "
41- IO . copy_stream ( @book . files . file . open ( excel_image_path ) , image_pathname . to_path )
42- image_pathname
37+ if image_pathname . exist?
38+ image_pathname
39+ else
40+ excel_image_path = "xl/media#{ image_pathname . to_path . split ( tmpdir ) . last } "
41+ IO . copy_stream ( @book . files . file . open ( excel_image_path ) , image_pathname . to_path )
42+ image_pathname
4343 end
4444 end
4545 end
@@ -87,7 +87,7 @@ def load_images_pathnames_by_cells
8787 next if embed . nil?
8888
8989 rid = embed . value
90- path = Pathname . new ( "#{ tmpdir } #{ extract_drawing_path ( rid ) . slice ( /[^\/ ]*$/ ) } " )
90+ path = Pathname . new ( "#{ tmpdir } / #{ extract_drawing_path ( rid ) . slice ( /[^\/ ]*$/ ) } " )
9191
9292 row_from = drawing . xpath ( row_from_selector ) . text . to_i
9393 col_from = drawing . xpath ( col_from_selector ) . text . to_i
@@ -106,4 +106,4 @@ def extract_drawing_path(rid)
106106 @drawings_rels . css ( "Relationship[@Id=#{ rid } ]" ) . first . attributes [ 'Target' ] . value
107107 end
108108 end
109- end
109+ end
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def load_cell(rows, cell_name)
5656 context 'with excel without images' do
5757 it 'does not break on with_images' do
5858 rows = sheet_no_images . with_images . rows . map { |r | r }
59- expect ( load_cell ( rows , 'A10' ) ) . to eq ( nil )
59+ expect ( load_cell ( rows , 'A10' ) ) . to eq ( 0.15 )
6060 end
6161 end
6262 end
You can’t perform that action at this time.
0 commit comments