gedcom 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- === 0.9.1 / 2012-19-27
1
+ === 0.9.3 / 2013-01-10
2
2
 
3
3
  * transcription of code from original C source base.
4
4
  * Bug fix to GEDCOMBase.xref_check, which didn't qualify index lookup when printing an error message.
@@ -1,6 +1,6 @@
1
1
  History.txt
2
2
  Manifest.txt
3
- README.txt
3
+ README.md
4
4
  Rakefile
5
5
  lib/gedcom/address_record.rb
6
6
  lib/gedcom/adoption_record.rb
@@ -1,6 +1,8 @@
1
1
  = gedcom
2
2
 
3
- * http://rubyforge.org/projects/gedcom/
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
@@ -51,20 +51,15 @@
51
51
  #objects to_gedcom() method. This can occur at any level, from Transmission downward.
52
52
  #
53
53
 
54
- def path(s,fs='/')
55
- last_fs = s.rindex(fs)
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.3'
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(*a)
70
+ def self.file(*args)
76
71
  g = Gedcom.new
77
- g.file(*a)
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 file(*a)
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
- File.open(*a) do |file|
86
- file.each_line("\n") do |line|
87
- begin
88
- gedcom_parser.parse( file.lineno, line )
89
- rescue => exception
90
- puts "#{file.lineno}: #{exception} - " + line
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)
@@ -3,7 +3,7 @@
3
3
  #Or 1.9 version at
4
4
  #!/usr/local/bin/ruby
5
5
  require 'rubygems'
6
- require '../pkg/gedcom-0.9.3/lib/gedcom.rb'
6
+ require '../pkg/gedcom-0.9.4/lib/gedcom.rb'
7
7
  require 'versioncheck'
8
8
 
9
9
 
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.3
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-01-09 00:00:00.000000000 Z
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.txt
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://rubyforge.org/projects/gedcom/
145
+ homepage: http://rbur004.github.com/gedcom/
147
146
  licenses: []
148
147
  post_install_message:
149
148
  rdoc_options:
150
149
  - --main
151
- - README.txt
150
+ - README.md
152
151
  require_paths:
153
152
  - lib
154
153
  required_ruby_version: !ruby/object:Gem::Requirement