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

Development

 Project Readme

StompParser

Build Status Code Climate Gem Version

Fast STOMP parser and serializer for Ruby with native extensions in C for MRI and Rubinius and in Java for JRuby, as well as a pure Ruby parser.

Parsing

parser = StompParser::Parser.new
parser.parse(chunk) do |frame|
  puts "We received #{frame.command} frame with #{frame.body} and headers #{frame.headers}!"
end

The chunks do not have to be complete STOMP frames. The callback will be called whenever a complete frame has been parsed. Additionally, StompParser handles escape sequences in headers and body encoding for you.

Serializing

StompParser::Frame.new("SEND", { some: "header" }, "Hello").to_str

Development

Development should be ez.

git clone git@github.com:elabs/stomp_parser.git # git, http://git-scm.com/
cd stomp_parser
brew bundle # Homebrew, http://brew.sh/
bundle install # Bundler, http://bundler.io/
rake # compile state machine, run test suite

A few notes:

  • Native dependencies are listed in the Brewfile.
  • The stomp message parser is written in Ragel, see parser_common.rl.
  • Graphviz is used to visualize the Ragel state machine.
  • Most rake tasks will compile the state machine anew if needed.

Contributing

  1. Fork it on GitHub (http://github.com/elabs/stomp_parser/fork).
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Follow the Development instructions in this README.
  4. Create your changes, please add tests.
  5. Commit your changes (git commit -am 'Add some feature').
  6. Push to the branch (git push origin my-new-feature).
  7. Create new pull request on GitHub.

License

MIT