add initial Ledger and capability to open a gnucash file

This commit is contained in:
Josh Holtrop 2013-07-24 19:45:18 -04:00
parent 9d04d1f81a
commit abdbfcd222
2 changed files with 14 additions and 1 deletions

View File

@ -1,5 +1,8 @@
require "gnucash/ledger"
require "gnucash/version"
module Gnucash
# Your code goes here...
def self.open(fname)
Ledger.new(fname)
end
end

10
lib/gnucash/ledger.rb Normal file
View File

@ -0,0 +1,10 @@
require "zlib"
require "nokogiri"
module Gnucash
class Ledger
def initialize(fname)
@ng = Nokogiri.XML(Zlib::GzipReader.open(fname).read)
end
end
end