Class: Scrubyt::ScrubytResult

Inherits:
ResultNode show all
Defined in:
lib/scrubyt/output/scrubyt_result.rb

Constant Summary

Constants inherited from ResultNode

ResultNode::OUTPUT_OPTIONS

Instance Attribute Summary collapse

Attributes inherited from ResultNode

#generated_by_leaf, #name, #options, #result

Instance Method Summary collapse

Methods inherited from ResultNode

#has_content?, #initialize, #to_hash, #to_libxml, #to_s, #to_xml, #to_xml_lines, #write_text

Methods inherited from Array

#to_sexp, #to_sexp_array

Constructor Details

This class inherits a constructor from Scrubyt::ResultNode

Instance Attribute Details

#root_patternObject

Returns the value of attribute root_pattern.



3
4
5
# File 'lib/scrubyt/output/scrubyt_result.rb', line 3

def root_pattern
  @root_pattern
end

Instance Method Details

#export(arg1, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/scrubyt/output/scrubyt_result.rb', line 5

def export(arg1, output_file_name=nil, extractor_result_file_name=nil)
  #      require 'scrubyt/output/export_old'; Scrubyt::ExportOld.export(arg1, self, output_file_name, extractor_result_file_name) ; return
  if File.exists? arg1
    old_export(arg1, output_file_name, extractor_result_file_name)
  else
    new_export(arg1, output_file_name, extractor_result_file_name)
  end
end

#new_export(wrapper_name, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object



24
25
26
# File 'lib/scrubyt/output/scrubyt_result.rb', line 24

def new_export(wrapper_name, output_file_name=nil, extractor_result_file_name=nil)
  Scrubyt::Export.export(@root_pattern, wrapper_name, output_file_name, extractor_result_file_name)
end

#old_export(input_file, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object



18
19
20
21
22
# File 'lib/scrubyt/output/scrubyt_result.rb', line 18

def old_export(input_file, output_file_name=nil, extractor_result_file_name=nil)
  contents = open(input_file).read
  wrapper_name = contents.scan(/\s+(.+)\s+=.*Extractor\.define.*/)[0][0]
  Scrubyt::Export.export(@root_pattern, wrapper_name, output_file_name, extractor_result_file_name)
end

#show_statsObject



14
15
16
# File 'lib/scrubyt/output/scrubyt_result.rb', line 14

def show_stats
  #Implement me...
end