cucumber_table_formatter - A formatter for Cucumber tables…

Simple command line utility for formatting Cucumber tables properly, either from file or piped input

Install with:

$ sudo gem install colszowka-cucumber_table_formatter --source http://gems.github.com

Example from file

Assuming you have a file called ‘some_file_containing_the_table.txt’ that looks something like this:

  | user | email | url |
  | colszowka | [email protected] | http://blog.olszowka.de |
  | ruby-toolbox | [email protected] | http://ruby-toolbox.com |

$ format_cucumber_table some_file_containing_the_table.txt

Will print:

|         user |                   email |                     url |
|    colszowka |   [email protected] | http://blog.olszowka.de |
| ruby-toolbox | [email protected] | http://ruby-toolbox.com |

Example from pipe

$ echo "| a | b |
| cd | ef |" | format_cucumber_table

Will print:

|  a |  b |
| cd | ef |

Piping is particularily useful when set up in your favorite editor as an external command (i.e. in gedit) and you use the selected text as input and let the script output replace it - instant table formatting inside your feature files!

TODO: More description goes here.…

Note: Only a couple of high-level tests and little documentation yet.. Don’t be too picky about the implementation, too - it’s just hacked together so it does what it’s supposed to…

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but

    bump version in a commit by itself I can ignore when I pull)
    
  • Send me a pull request. Bonus points for topic branches.

Copyright © 2009 Christoph Olszowka. See LICENSE for details.