gedcom 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +1 -1
- data/Manifest.txt +1 -1
- data/{README.txt → README.md} +4 -2
- data/lib/gedcom.rb +24 -20
- data/test/lds_gedcom_test.rb +1 -1
- metadata +5 -6
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/{README.txt → README.md}
RENAMED
@@ -1,6 +1,8 @@
|
|
1
1
|
= gedcom
|
2
2
|
|
3
|
-
* http://
|
3
|
+
* http://rbur004.github.com/gedcom/
|
4
|
+
* Source https://github.com/rbur004/gedcom
|
5
|
+
* Gem https://rubygems.org/gems/gedcom
|
4
6
|
|
5
7
|
== DESCRIPTION:
|
6
8
|
|
@@ -117,7 +119,7 @@ Copyright (c) 2009
|
|
117
119
|
|
118
120
|
4. You may modify and include the part of the software into any other
|
119
121
|
software (possibly commercial). But some files in the distribution
|
120
|
-
may not written by the author, so that they are not under this terms.
|
122
|
+
may not have been written by the author, so that they are not under this terms.
|
121
123
|
|
122
124
|
5. The scripts and library files supplied as input to or produced as
|
123
125
|
output from the software do not automatically fall under the
|
data/lib/gedcom.rb
CHANGED
@@ -51,20 +51,15 @@
|
|
51
51
|
#objects to_gedcom() method. This can occur at any level, from Transmission downward.
|
52
52
|
#
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
last_fs ? s[0..last_fs] : ""
|
54
|
+
%w(gedcom parser chart).each do |dir|
|
55
|
+
$: << File.join(File.dirname(File.expand_path(__FILE__)), dir)
|
57
56
|
end
|
58
57
|
|
59
|
-
$: << "#{path(__FILE__)}gedcom"
|
60
|
-
$: << "#{path(__FILE__)}parser"
|
61
|
-
$: << "#{path(__FILE__)}chart"
|
62
|
-
|
63
58
|
require 'gedcom_parser.rb'
|
64
59
|
#require 'chart.rb'
|
65
60
|
|
66
61
|
class Gedcom
|
67
|
-
VERSION = '0.9.
|
62
|
+
VERSION = '0.9.4'
|
68
63
|
attr_accessor :transmissions
|
69
64
|
|
70
65
|
def initialize(transmission = nil)
|
@@ -72,29 +67,38 @@ class Gedcom
|
|
72
67
|
add_transmission(transmission) if transmission != nil
|
73
68
|
end
|
74
69
|
|
75
|
-
def self.file(*
|
70
|
+
def self.file(*args)
|
76
71
|
g = Gedcom.new
|
77
|
-
g.file(*
|
72
|
+
g.file(*args)
|
78
73
|
return g
|
79
74
|
end
|
75
|
+
|
76
|
+
def file(*args)
|
77
|
+
File.open(*args) do |file|
|
78
|
+
read(file)
|
79
|
+
end
|
80
|
+
end
|
80
81
|
|
81
|
-
def
|
82
|
+
def self.read(io)
|
83
|
+
g = Gedcom.new
|
84
|
+
g.read(io)
|
85
|
+
return g
|
86
|
+
end
|
87
|
+
|
88
|
+
def read(io)
|
82
89
|
transmission = Transmission.new
|
83
90
|
gedcom_parser = GedcomParser.new(transmission)
|
84
91
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
# raise exception
|
92
|
-
end
|
92
|
+
io.each_line("\n") do |line|
|
93
|
+
begin
|
94
|
+
gedcom_parser.parse( io.lineno, line )
|
95
|
+
rescue => exception
|
96
|
+
puts "#{io.lineno}: #{exception} - " + line
|
97
|
+
# raise exception
|
93
98
|
end
|
94
99
|
end
|
95
100
|
|
96
101
|
@transmissions << transmission
|
97
|
-
|
98
102
|
end
|
99
103
|
|
100
104
|
def add_transmission(transmission)
|
data/test/lds_gedcom_test.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gedcom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdoc
|
@@ -53,12 +53,11 @@ extensions: []
|
|
53
53
|
extra_rdoc_files:
|
54
54
|
- History.txt
|
55
55
|
- Manifest.txt
|
56
|
-
- README.txt
|
57
56
|
- test_data/README.txt
|
58
57
|
files:
|
59
58
|
- History.txt
|
60
59
|
- Manifest.txt
|
61
|
-
- README.
|
60
|
+
- README.md
|
62
61
|
- Rakefile
|
63
62
|
- lib/gedcom/address_record.rb
|
64
63
|
- lib/gedcom/adoption_record.rb
|
@@ -143,12 +142,12 @@ files:
|
|
143
142
|
- test_data/top.mpg
|
144
143
|
- test/test_gedcom.rb
|
145
144
|
- .gemtest
|
146
|
-
homepage: http://
|
145
|
+
homepage: http://rbur004.github.com/gedcom/
|
147
146
|
licenses: []
|
148
147
|
post_install_message:
|
149
148
|
rdoc_options:
|
150
149
|
- --main
|
151
|
-
- README.
|
150
|
+
- README.md
|
152
151
|
require_paths:
|
153
152
|
- lib
|
154
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|