summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-03-21 23:25:12 +0900
committerRandy Morgan <[email protected]>2012-03-21 23:25:12 +0900
commitcec81bb125ae4a97d83517e514e9ca9ee387398f (patch)
treea082b4c0cd8dfca953f9d73b9b7690990ff09bc5 /examples
parentbdf77ceb217753b7e09dd54ef1e0a3842859d1b1 (diff)
downloadcaxlsx-cec81bb125ae4a97d83517e514e9ca9ee387398f.tar.gz
caxlsx-cec81bb125ae4a97d83517e514e9ca9ee387398f.zip
@jurriaan is a rockstar.
Diffstat (limited to 'examples')
-rw-r--r--examples/example.rb7
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