Mork
Mozilla Thunderbird uses the Mork database format for its folder indexes.
This library reads in a Mork file and produces a Mork::Data
instance.
This provides:
-
tables
- The top-level tables, -
rows
- The top-level rows (i.e. rows not contained in tables).
Usage
require "mork/parser"
parser = Mork::Parser.new
content = File.read("MyFolder.msf")
raw = parser.parse(content)
data = raw.data
Development
After checking out the repo, run bundle
to install dependencies.
Then, run rake spec
to run the tests.
To release a new version, update the version number in version.rb
,
and then run rake release
, which will create a git tag for the version,
push git commits and the created tag,
and push the .gem
file to rubygems.org.
Lexer/Parser Modifications
The lexer, parser/mork.rex
, is written in Rexical grammar.
After changes, regenerate the Ruby lexer code:
$ rex parser/mork.rex --output-file lib/mork/lexer.rb
The parser, which uses the symbols lexed by lib/mork/lexer.rb
,
is parser/mork.y
.
To regenerate the parser:
$ racc parser/mork.y --output-file lib/mork/parser.rb
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/joeyates/mork. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Mork project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.