Skip to content

Commit

Permalink
Added the builder for creating the XML
Browse files Browse the repository at this point in the history
  • Loading branch information
justincbeck committed Aug 23, 2011
1 parent 00985cb commit a309e0f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gemfile
@@ -1,3 +1,4 @@
source 'http://rubygems.org'

gem 'rspec'
gem 'rspec'
gem 'builder'
2 changes: 2 additions & 0 deletions Gemfile.lock
@@ -1,6 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
builder (3.0.0)
diff-lcs (1.1.2)
rspec (2.3.0)
rspec-core (~> 2.3.0)
Expand All @@ -15,4 +16,5 @@ PLATFORMS
ruby

DEPENDENCIES
builder
rspec
6 changes: 6 additions & 0 deletions lib/gedcom_processor/individual_parser.rb
@@ -1,7 +1,13 @@
require 'builder'

module GedcomProcessor
class IndividualParser < Parser
def parse(input, out)
builder = Builder::XmlMarkup.new

while line = input.gets

end
end
end
end
7 changes: 5 additions & 2 deletions spec/gedcom_processor/individual_parser_spec.rb
Expand Up @@ -3,10 +3,13 @@
module GedcomProcessor
describe IndividualParser do
let(:output) { double('output').as_null_object }
let(:processor) { Processor.new(output) }
let(:parser) { IndividualParser.new(output) }

it "should parse an individual defined in Gedcom and produce valid XML" do
true.should == false
in_file = File.join(File.dirname(__FILE__), '../', 'spec_data', "valid_individual.ged")
out_file = File.join(File.dirname(__FILE__), '../../', 'output', "valid_individual.xml")

parser.parse(File.new(in_file), File.new(out_file))
end
end
end
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
@@ -1,3 +1,3 @@
require 'rspec'
require 'rspec/autorun'
require 'gedcom_processor'
require 'gedcom_processor'

0 comments on commit a309e0f

Please sign in to comment.