packtemplate

Build Status Gem Version

Description

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

Features

  • Builder
  • Parser
  • Pure Ruby :)

Usage

“by require ‘packtemplate’

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

p template #=> “CS1w5“

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

p PackTemplate.for_summary(summary) #=> “CS1w5“

Requirements

Install

“sh gem install packtemplate

License

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