lib/rubyfromexcel.rb in rubyfromexcel-0.0.10 vs lib/rubyfromexcel.rb in rubyfromexcel-0.0.13
- old
+ new
@@ -15,10 +15,19 @@
require_relative 'optimiser/optimiser'
require_relative 'runtime/runtime_formula_builder'
module RubyFromExcel
+
+ def self.debug(name,message)
+ return "" unless $DEBUG == true
+ file_name = "#{name.to_s}-debug.txt"
+ @files ||= {}
+ file = @files[file_name] ||= File.open(file_name.to_s,'w')
+ file.puts message
+ end
+
class Process
attr_accessor :source_excel_directory
attr_accessor :target_ruby_directory
attr_accessor :workbook
attr_accessor :skip_tests
@@ -52,18 +61,22 @@
end
end
time "Pruning..." do
+ if prune_except_output_sheets || convert_independent_of_input_sheets
+ workbook.work_out_dependencies
+ end
+
checkpoint 1 do
- if prune_except_output_sheets
- workbook.prune_cells_not_needed_for_output_sheets(*prune_except_output_sheets)
+ if convert_independent_of_input_sheets
+ workbook.convert_cells_to_values_when_independent_of_input_sheets(*convert_independent_of_input_sheets)
end
end
checkpoint 2 do
if prune_except_output_sheets
- workbook.convert_cells_to_values_when_independent_of_input_sheets(*convert_independent_of_input_sheets)
+ workbook.prune_cells_not_needed_for_output_sheets(*prune_except_output_sheets)
end
end
end
\ No newline at end of file