Software Details:
Version: 0.15.0
Upload Date: 12 May 15
Distribution Type: Freeware
Downloads: 203
Its main use is in defining network protocol packets used for network protocols (IP).
Installation:
For .gem: Run the command gem install bit-struct
For .tgz, unpack and run these commands:
ruby install.rb config
ruby install.rb setup
ruby install.rb install
Features:
- Extensible with user-defined field classes.
- Fields are fully introspectable and can be defined programmatically.
- BitStruct.describe prints out documentation of all the fields of a BitStruct subclass, based on declarations. This is useful for communicating with developers who are not using ruby, but need to talk the same protocols.
- Fields are inherited by subclasses.
- BitStruct#inspect and BitStruct#inspect_detailed can be used for prettified display of contents.
- BitStruct inherits from String, so all the usual methods are available, and string-sharing (copy-on-write) is in effect.
- Easy access to a "prototype" instance of each BitStruct subclass, from which all instances of that subclass are initialized as a copy (in the absence of other initialization parameters, such as a hash, a string, or a block). See BitStruct.initial_value, and BitStruct#initialize.
- Easy conversion to and from hashes, using BitStruct#to_h and BitStruct.new.
- BitStructs can persist using Marshal (a BitStruct is after all just a string) or using YAML (with human readable representation of the fields).
- Includes tests, examples, and rdoc API documentation.
What is new in this release:
- Modernize rakefile and gemspec.
- Switch to minitest.
What is new in version 0.13.4:
- Packaged as a gem using bones.
- Added nest fields defined with blocks.
- Vector length may be specified as argument or :length option.
Limitations:
- Fields that are not aligned on byte boundaries may cross no more than two bytes boundaries.
- No variable length fields (except the rest field).
Comments not found