hets_helper.rb revision 4e4dd16617d60a2293b37431ebc21d94aeea80dc
1516N/A# In this file, 'ontology_fixture' is always the path to the ontology file
581N/A# relative to Rails.root.join('spec/fixtures/ontologies/')
581N/A
581N/Adef hets_vcr_file(subdir, ontology_fixture)
581N/A # Replace last occurence of '.' by '_' in the filepath (VCR convention).
581N/A portions = ontology_fixture.split('.')
581N/A path = portions[0..-2].join('.')
581N/A extension = portions[-1]
581N/A
581N/A fixture_file(File.join('vcr', 'hets-out', subdir, "#{path}_#{extension}.yml"))
581N/Aend
581N/A
581N/Adef hets_ontology_vcr_file(ontology_fixture)
581N/A hets_vcr_file('dg', ontology_fixture)
581N/Aend
581N/A
581N/Adef hets_proof_vcr_file(ontology_fixture)
581N/A hets_vcr_file('proof', ontology_fixture)
581N/Aend
581N/A
581N/Adef hets_provers_vcr_file(ontology_fixture)
581N/A hets_vcr_file('provers', ontology_fixture)
1899N/Aend
2859N/A
1899N/A
581N/Adef hets_out_body(subdir, ontology_fixture)
581N/A yaml = YAML.load(File.open(hets_vcr_file(subdir, ontology_fixture)))
581N/A yaml['http_interactions'].first['response']['body']['string']
817N/Aend
1715N/A
581N/Adef hets_out_body_ontology(ontology_fixture)
742N/A hets_out_body('dg', ontology_fixture)
581N/Aend
581N/A
817N/Adef hets_out_body_proof(ontology_fixture)
1020N/A hets_out_body('proof', ontology_fixture)
1117N/Aend
738N/A
742N/Adef hets_out_body_provers(ontology_fixture)
1117N/A hets_out_body('provers', ontology_fixture)
581N/Aend
2028N/A
1507N/A
1507N/Adef parse_ontology_hets_out(user, ontology, io)
1507N/A evaluator = Hets::DG::Evaluator.new(user, ontology, io: io)
1968N/A evaluator.import
1507N/A io.close unless io.closed?
581N/Aend
1715N/A
581N/Adef parse_ontology(user, ontology, ontology_fixture)
1715N/A io = StringIO.new(hets_out_body_ontology(ontology_fixture))
581N/A parse_ontology_hets_out(user, ontology, io)
1151N/Aend
1151N/A