0.0
No release in over 3 years
Low commit activity in last 3 years
A .xml string will do up to a easy readable tree strcuture for terminal output.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme
Xml Tree Viewer

A .xml string will do up to a easy readable tree strcuture for terminal output.


Examples

Detail

Code

require 'xml_tree_viewer'

xml = XmlTreeViewer.helper()
XmlTreeViewer.generate( xml, :detail )

Output

TREE OVERVIEW
    employees
    doc.css('employees')
    ┗━  employee
        doc.css('employees > employee:nth-of-type(1)')
        ┗━  fullname
            doc.css('employees > employee:nth-of-type(1) > fullname')
    ┗━  employee
        doc.css('employees > employee:nth-of-type(2)')
        ┗━  fullname
            doc.css('employees > employee:nth-of-type(2) > fullname')

Short

Code

require 'xml_tree_viewer'

xml = XmlTreeViewer.helper()
XmlTreeViewer.generate( xml, :short )

Output

TREE OVERVIEW
    employees
    ┗━  employee
        ┗━  fullname
    ┗━  employee
        ┗━  fullname


Table of Contents
  1. Examples
  2. Quickstart
  3. Setup
  4. Methods
  5. Contributing
  6. Limitations
  7. Credits
  8. License
  9. Code of Conduct
  10. Support my Work

Quickstart
require '../lib/xml_tree_viewer'

xml = XmlTreeViewer.helper()
XmlTreeViewer.generate( xml, :detail )

Setup

Add this line to your application's Gemfile:

gem 'xml_tree_viewer'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install xml_tree_viewer

On Rubygems:


Methods

.helper()

Output a sample xml string

xml = XmlTreeViewer.helper()

.generate()

Generate xml tree from string input

XmlTreeViewer.generate( 
    xml, 
    mode 
)

Input

Type Required Description Example Description
xml String Yes "Test" Define path structure
mode Symbol Yes :detail Set console mode. Use :detail, :short or :silent

Return
Boolean


Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/a6b8/xml-tree-viewer-for-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.


Limitations
  • Tested for Rss and Atom Feeds.

Credits

This gem depend on following gems:


License

The gem is available as open source under the terms of the MIT License.


Code of Conduct

Everyone interacting in the xml-tree-viewer-for-ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.


Star us

Please ⭐️ star this Project, every ⭐️ star makes us very happy!