Project

pxrowx

0.0
No commit activity in last 3 years
No release in over 3 years
Creates a Polyrex document from a raw Polyrex RowX string.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.5, >= 0.5.6
>= 0.3.0, ~> 0.3
 Project Readme

Introducing the pxrowx gem

require 'pxrowx'

txt =<<EOF
heading: fun 1
when: 
priority:
planned_duration: 22

  heading: fun 2
  when: monday
  priority: 3
  planned_duration: 33

heading: fun 20
when: 
priority:
planned_duration:  

heading: fun 30
when: 
priority: 
planned_duration: 

EOF

pr = PxRowX.new(txt)
puts pr.to_xml pretty: true

Output:

<?xml version='1.0' encoding='UTF-8'?>
<items>
  <item>
    <summary>
      <heading>fun 1</heading>
      <when/>
      <priority/>
      <planned_duration>22</planned_duration>
    </summary>
    <records>
      <item>
        <summary>
          <heading>fun 2</heading>
          <when>monday</when>
          <priority>3</priority>
          <planned_duration>33</planned_duration>
        </summary>
      </item>
    </records>
  </item>
  <item>
    <summary>
      <heading>fun 20</heading>
      <when/>
      <priority/>
      <planned_duration/>
    </summary>
  </item>
  <item>
    <summary>
      <heading>fun 30</heading>
      <when/>
      <priority/>
      <planned_duration/>
    </summary>
  </item>
</items>

Resources

pxrowx gem polyrex rowx