Class: Scrubyt::ScrubytResult
- Inherits:
-
ResultNode
- Object
- Array
- ResultNode
- Scrubyt::ScrubytResult
- Defined in:
- lib/scrubyt/output/scrubyt_result.rb
Constant Summary
Constants inherited from ResultNode
Instance Attribute Summary collapse
-
#root_pattern ⇒ Object
Returns the value of attribute root_pattern.
Attributes inherited from ResultNode
#generated_by_leaf, #name, #options, #result
Instance Method Summary collapse
- #export(arg1, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object
- #new_export(wrapper_name, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object
- #old_export(input_file, output_file_name = nil, extractor_result_file_name = nil) ⇒ Object
- #show_stats ⇒ Object
Methods inherited from ResultNode
#has_content?, #initialize, #to_hash, #to_libxml, #to_s, #to_xml, #to_xml_lines, #write_text
Methods inherited from Array
Constructor Details
This class inherits a constructor from Scrubyt::ResultNode
Instance Attribute Details
#root_pattern ⇒ Object
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_stats ⇒ Object
14 15 16 |
# File 'lib/scrubyt/output/scrubyt_result.rb', line 14 def show_stats #Implement me... end |