1#!/usr/bin/env ruby 2 3require 'neo' 4 5h=Neo::Hdf.new 6h.set_value "1","farming" 7h.set_value "2","sewing" 8h.set_value "3","bowling" 9 10h.set_value "party.1","baloons" 11h.set_value "party.2","noise makers" 12h.set_value "party.3","telling long\nstories" 13 14h.set_attr "party.1", "Drool", "True" 15h.set_attr "party.2", "Pink", "1" 16 17print h.dump 18 19q=Neo::Hdf.new 20 21q.copy "arf",h 22 23print q.dump 24 25h.get_attr("party.2").each_pair do |k,v| 26 print "party.2 attr (#{k}=#{v})\n" 27end 28 29 30s="This is a funny test. <?cs var:arf.1 ?>. 31<?cs each:p = arf.party ?> 32<?cs var:p ?> 33<?cs /each ?>" 34c = Neo::Cs.new q 35 36c.parse_string(s) 37 38print c.render 39 40