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