A way to read Microsoft's binary resource files in Ruby.
Installation
Add this line to your application's Gemfile:
gem 'ms-binary-resources'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ms-binary-resources
Usage
reader = Ms::BinaryResources::Reader.new('/path/to/File.resources')
reader.keys
=> ['key1', 'key2', ...]
reader.key? 'key1'
=> true
reader.key? 'keyxx'
=> false
reader['key1']
=> 'some value'
reader.type_of 'key2'
=> :int32
reader['key2']
=> 8675309
Caveats
Currently only string, uint and int value types are supported. Pull requests with additional types are great, include tests!
Thanks
This is largely cribbed off of the Mono Project's class library implementation of ResourceReader and friends.
Contributing
- Fork it ( https://github.com/code-lever/ms-binary-resources/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request