lib/writeexcel.rb in writeexcel-0.4.0 vs lib/writeexcel.rb in writeexcel-0.4.1

- old
+ new

@@ -8,11 +8,28 @@ # Copyright 2000-2010, John McNamara, jmcnamara@cpan.org # # original written in Perl by John McNamara # converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp # +require 'writeexcel/biffwriter' +require 'writeexcel/olewriter' +require 'writeexcel/formula' +require 'writeexcel/format' +require 'writeexcel/worksheet' require "writeexcel/workbook" +require 'writeexcel/chart' +require 'writeexcel/charts/area' +require 'writeexcel/charts/bar' +require 'writeexcel/charts/column' +require 'writeexcel/charts/external' +require 'writeexcel/charts/line' +require 'writeexcel/charts/pie' +require 'writeexcel/charts/scatter' +require 'writeexcel/charts/stock' +require 'writeexcel/storage_lite' +require 'writeexcel/compatibility' +require 'writeexcel/debug_info' # # = WriteExcel - Write to a cross-platform Excel binary file. # # == Contents # SYSNOPSYS @@ -56,10 +73,13 @@ # # # Write a number and a formula using A1 notation # worksheet.write('A3', 1.2345) # worksheet.write('A4', '=SIN(PI()/4)') # +# # Save to ruby.xls +# workbook.close +# # == Description # # WriteExcel can be used to create a cross-platform Excel binary file. # Multiple worksheets can be added to a workbook and formatting can be applied # to cells. Text, numbers, formulas, hyperlinks and images can be written to @@ -81,24 +101,27 @@ # # WriteExcel tries to provide an interface to as many of Excel's features as # possible. As a result there is a lot of documentation to accompany the # interface and it can be difficult at first glance to see what it important # and what is not. So for those of you who prefer to assemble Ikea furniture -# first and then read the instructions, here are three easy steps: +# first and then read the instructions, here are four easy steps: # # 1. Create a new Excel workbook (i.e. file) using new(). # # 2. Add a worksheet to the new workbook using add_worksheet(). # # 3. Write to the worksheet using write(). # +# 4. Save to file. +# # Like this: # # require 'WriteExcel' # Step 0 # # workbook = WriteExcel.new('ruby.xls') # Step 1 # worksheet = workbook.add_worksheet # Step 2 # worksheet.write('A1', 'Hi Excel!') # Step 3 +# workbook.close # Step 4 # # This will create an Excel file called ruby.xls with a single worksheet and the # text 'Hi Excel!' in the relevant cell. And that's it. Okay, so there is # actually a zeroth step as well, but use WriteExcel goes without saying. There # are also many examples that come with the distribution and which you can