RubyGems Navigation menu

vdf4r 0.1.0

# VDF4R Parse Valve Data Format files easily and quickly. ## Context Valve has its own data format for storing game information. This library lets you parse these files into a plain-old Ruby hash easily and quickly. After that, you can do with the data what you will. ## Installation As normal: gem install vdf4r Or in your Gemfile: gem 'vdf4r', '~>0.1.0' ## Usage require 'vdf4r' require 'pp' File.open('vdf_file.txt') do |file| parser = VDF4R::Parser.new(file) pp parser.parse # pretty-printed end ## Caveats This library has only really been used on a few Dota 2 VDF files. It's not battle-tested yet, and there are probably some minor issues. If you find something you'd like to discuss, you can find me on #dota2replay on quakenet IRC. At least one of Dota 2's own VDF files have grammar mistakes. (i.e. npc_abilities.txt) If you get an "ungrammatical content" error while parsing, you will need to fix the error. It will give you the offending line: (RuntimeError)parser.rb:30:in `block in parse': ungrammatical content: ' / Damage. ' Indeed, in the VDF file, there are "comment" lines lacking the proper '//' prefix. When I changed the file to contain '// Damage.' it parsed correctly. I'll think of a way to make the parser more permissive as time allows. ## Hacking Just clone the source from here. If issuing a pull request, make sure your change is on a topic branch accompanied by new tests; all behaviors must pass. ## License VDF4R is offered under the MIT license. See [LICENSE](https://github.com/skadistats/vdf4r/blob/master/README.md) for the license itself.

Gemfile:
= Copy to clipboard Copied!

install:
=

Versions:

  1. 0.2.1 - October 15, 2015 (12 KB)
  2. 0.1.3 - February 06, 2015 (11.5 KB)
  3. 0.1.2 - April 27, 2014 (9 KB)
  4. 0.1.1 - April 24, 2014 (8 KB)
  5. 0.1.0 - April 24, 2014 (9 KB)

Runtime Dependencies (1):

treetop >= 1.5.0

Development Dependencies (1):

rspec >= 2.14.1

Owners:

Authors:

  • Joshua Morris

SHA 256 checksum:

625d7e6412381bbfca022ec85a0f3416c0ecc5bacd42a69a46268a1a6eb18c2d

Total downloads 13,680

For this version 2,393

License:

MIT

Required Ruby Version: >= 0

Links: