diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/example.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/example.rb b/examples/example.rb index 2191f6a6..85028559 100644 --- a/examples/example.rb +++ b/examples/example.rb @@ -1,6 +1,7 @@ #!/usr/bin/env ruby -w -s # -*- coding: utf-8 -*- -require 'axlsx.rb' +$:.unshift "#{File.dirname(__FILE__)}/../lib" +require 'axlsx' p = Axlsx::Package.new wb = p.workbook @@ -39,7 +40,7 @@ end ##Add an Image wb.add_worksheet(:name => "Images") do |sheet| - img = File.expand_path('examples/image1.jpeg') + img = File.expand_path('../image1.jpeg', __FILE__) sheet.add_image(:image_src => img, :noSelect => true, :noMove => true) do |image| image.width=720 image.height=666 @@ -50,7 +51,7 @@ end ##Add an Image with a hyperlink wb.add_worksheet(:name => "Image with Hyperlink") do |sheet| - img = File.expand_path('examples/image1.jpeg') + img = File.expand_path('../image1.jpeg', __FILE__) sheet.add_image(:image_src => img, :noSelect => true, :noMove => true, :hyperlink=>"http://axlsx.blogspot.com") do |image| image.width=720 image.height=666 |
