Project

sydney

0.0
No commit activity in last 3 years
No release in over 3 years
A Treetop parser for alias files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.12

Runtime

~> 1.4.12
 Project Readme

Sydney

Gem Version Dependency Status Build Status Code Climate

A Treetop parser for bash alias files. Organize your aliases by sections and keep comments associated with the aliases they document.

Sydney was created to feed my process an alias file and feed it to cheaters, an excellent cheatsheet system by Brett Terpstra. The output from Sydney can be a Treetop::Runtime::SyntaxNode tree, an array of the sections in your alias file, or an array of the aliases without section groupings.

Installation

Install it yourself as:

$ gem install sydney

Usage

Feed your alias file to Sydney as a single string.

Sydney.parse(IO.readlines("/my/home/folder/.aliases").join)

Sydney.parse returns a Treetop syntax tree. If you organize your alias file into sections, preceeding each section with double-banged comments, you can use Sydney.sections to return an array of Section nodes. Sydney.aliases returns an array of AliasEntry nodes, with sections flattened out.

Each section contains one or more AliasEntry nodes. An AliasEntry node ties comments (AliasComment) before an alias to the definition (AliasDefinition). See the documentation

Credits

Sydney was created and is maintained by Geoff Harcourt at Five Tool Development.

Contributing

I'm looking for further ideas for Sydney. Please report parsing issues through Github Issues. Pull requests for feature additions are welcome!

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request