packtemplate

Build Status Gem Version

Description

DSL to build "Pack Template Format(for Array#pack, String#unpack)"

Features

  • Builder
  • Parser
  • Pure Ruby :)

Usage

require 'packtemplate'

template = PackTemplate.build do
  unsigned_char :infinite
  uint16_t
  ber_compressed_int 5
end

p template     #=> "C*S1w5"

summary = PackTemplate.summarize(template)
puts summary #=> unsigned_char :infinite
             #   uint16_t 1
             #   ber_compressed_int 5

p PackTemplate.for_summary(summary) #=> "C*S1w5"

Requirements

Install

gem install packtemplate

Link

License

The MIT X11 License
Copyright (c) 2013 Kenichi Kamiya
See MIT-LICENSE for further details.