gedcomx-jruby 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +6 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/gedcomx-jruby.gemspec +27 -0
  8. data/lib/gedcomx/gedcomx.rb +40 -0
  9. data/lib/gedcomx/iterator.rb +20 -0
  10. data/lib/gedcomx/jruby/version.rb +5 -0
  11. data/lib/gedcomx/person.rb +39 -0
  12. data/lib/gedcomx/record.rb +19 -0
  13. data/lib/gedcomx_java_jars/enunciate-gedcomx-support-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  14. data/lib/gedcomx_java_jars/enunciate-gedcomx-support-1.0.82.M1-SNAPSHOT.jar +0 -0
  15. data/lib/gedcomx_java_jars/familysearch-api-client-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  16. data/lib/gedcomx_java_jars/familysearch-api-client-1.0.82.M1-SNAPSHOT.jar +0 -0
  17. data/lib/gedcomx_java_jars/familysearch-api-model-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  18. data/lib/gedcomx_java_jars/familysearch-api-model-1.0.82.M1-SNAPSHOT.jar +0 -0
  19. data/lib/gedcomx_java_jars/gedcomx-atom-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  20. data/lib/gedcomx_java_jars/gedcomx-atom-1.0.82.M1-SNAPSHOT.jar +0 -0
  21. data/lib/gedcomx_java_jars/gedcomx-date-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  22. data/lib/gedcomx_java_jars/gedcomx-date-1.0.82.M1-SNAPSHOT.jar +0 -0
  23. data/lib/gedcomx_java_jars/gedcomx-fileformat-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  24. data/lib/gedcomx_java_jars/gedcomx-fileformat-1.0.82.M1-SNAPSHOT.jar +0 -0
  25. data/lib/gedcomx_java_jars/gedcomx-model-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  26. data/lib/gedcomx_java_jars/gedcomx-model-1.0.82.M1-SNAPSHOT.jar +0 -0
  27. data/lib/gedcomx_java_jars/gedcomx-rs-client-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  28. data/lib/gedcomx_java_jars/gedcomx-rs-client-1.0.82.M1-SNAPSHOT.jar +0 -0
  29. data/lib/gedcomx_java_jars/gedcomx-rs-rt-support-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  30. data/lib/gedcomx_java_jars/gedcomx-rs-rt-support-1.0.82.M1-SNAPSHOT.jar +0 -0
  31. data/lib/gedcomx_java_jars/gedcomx-rt-support-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  32. data/lib/gedcomx_java_jars/gedcomx-rt-support-1.0.82.M1-SNAPSHOT.jar +0 -0
  33. data/lib/gedcomx_java_jars/gedcomx-test-support-1.0.82.M1-SNAPSHOT-sources.jar +0 -0
  34. data/lib/gedcomx_java_jars/gedcomx-test-support-1.0.82.M1-SNAPSHOT.jar +0 -0
  35. data/lib/gedcomx_java_jars/jaxb-all.osgi-2.1.6.jar +0 -0
  36. metadata +106 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 40adac85b323407e4921e797c0264d08a7f3ff6f
4
+ data.tar.gz: 80988d457e366c411415cbcb319d40115f11e741
5
+ SHA512:
6
+ metadata.gz: 2275a81a7cc9c85aa40f71639237c66934037044b9ff4b7beed535d49c609c4a37bbf02edc200767b1e298f56b57fb04588c6b2028d744043f2b33950537b797
7
+ data.tar.gz: a889704e22047d71efe1c7e3956ba4fc155b4357026eb986a465205f3af319aff609f5ce6e4198eb6a1f4cdb33576581a0bde0deb17452d82d032996a6af4751
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gedcomx-jruby.gemspec
4
+ gemspec
5
+
6
+ gem 'andand'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Daniel Alkalai
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Gedcomx::Jruby
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'gedcomx-jruby'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install gedcomx-jruby
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( http://github.com/<my-github-username>/gedcomx-jruby/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gedcomx/jruby/version'
5
+ require 'gedcomx/gedcomx'
6
+ require 'gedcomx/iterator'
7
+ require 'gedcomx/record'
8
+ require 'gedcomx/person'
9
+
10
+ Gem::Specification.new do |spec|
11
+ spec.name = "gedcomx-jruby"
12
+ spec.version = Gedcomx::Jruby::VERSION
13
+ spec.authors = ["Daniel Alkalai"]
14
+ spec.email = ["djalkalai@gmail.com"]
15
+ spec.summary = %q{Gedcomx ruby parser }
16
+ spec.description = %q{Provides ruby calls to import, process, and export Gedcomx files}
17
+ spec.homepage = ""
18
+ spec.license = "MIT"
19
+
20
+ spec.files = `git ls-files`.split($/)
21
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.5"
26
+ spec.add_development_dependency "rake"
27
+ end
@@ -0,0 +1,40 @@
1
+ require "gedcomx/jruby/version"
2
+ Dir.glob('lib/gedcomx_java_jars/*.jar').each { |jar| require jar }
3
+
4
+ module Gedcomx
5
+
6
+ TYPES = {
7
+ birth: 'http://gedcomx.org/Birth',
8
+ birth_place_father: 'http://gedcomx.org/FatherBirthPlace',
9
+ birth_place_mother: 'http://gedcomx.org/MotherBirthPlace',
10
+ census: 'http://gedcomx.org/Census',
11
+ collection: 'http://gedcomx.org/Collection',
12
+ collection_id: 'http://familysearch.org/types/fields/FS_COLLECTION_ID',
13
+ couple: 'http://gedcomx.org/Couple',
14
+ digital_artifact: 'http://gedcomx.org/DigitalArtifact',
15
+ ethnicity: 'http://familysearch.org/types/fields/PR_ETHNICITY_CSS',
16
+ female: 'http://gedcomx.org/Female',
17
+ given: 'http://gedcomx.org/Given',
18
+ household: 'http://familysearch.org/types/fields/HOUSEHOLD_ID',
19
+ image_id: 'http://familysearch.org/types/fields/IMAGE_PAL',
20
+ immigration: 'http://gedcomx.org/Immigration',
21
+ male: 'http://gedcomx.org/Male',
22
+ marital_status: 'http://gedcomx.org/MaritalStatus',
23
+ month: 'http://gedcomx.org/Month',
24
+ parent_child: 'http://gedcomx.org/ParentChild',
25
+ persistent: 'http://gedcomx.org/Persistent',
26
+ race: 'http://gedcomx.org/Race',
27
+ record: 'http://gedcomx.org/Record',
28
+ source_line: 'http://familysearch.org/types/fields/SOURCE_LINE_NBR',
29
+ source_sheet: 'http://familysearch.org/types/fields/SOURCE_SHEET_NBR_LTR',
30
+ source_sheet_letter: 'http://familysearch.org/types/fields/SOURCE_SHEET_LTR',
31
+ source_sheet_number: 'http://familysearch.org/types/fields/SOURCE_SHEET_NBR',
32
+ surname: 'http://gedcomx.org/Surname',
33
+ unique_id: 'http://familysearch.org/types/fields/UNIQUE_IDENTIFIER',
34
+ year: 'http://gedcomx.org/Year',
35
+ years_married: 'http://familysearch.org/types/fields/PR_CNT_YEARS_MARR'
36
+ }
37
+
38
+ end
39
+
40
+
@@ -0,0 +1,20 @@
1
+
2
+ module Gedcomx
3
+ class Iterator
4
+ def initialize(input)
5
+ @iter = org.gedcomx.util.RecordSetIterator.new(input)
6
+ end
7
+
8
+ def has_next?
9
+ @iter.hasNext
10
+ end
11
+
12
+ def done?
13
+ !@iter.hasNext
14
+ end
15
+
16
+ def next
17
+ Record.new(@iter.next)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ module Gedcomx
2
+ module Jruby
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,39 @@
1
+ module Gedcomx
2
+
3
+ class Person
4
+
5
+ def initialize(input)
6
+ @person = input
7
+ end
8
+
9
+ def male?
10
+ gender = @person.get_gender.get_type.to_s
11
+ gender == TYPES[:male]
12
+ end
13
+
14
+ def female?
15
+ gender = @person.get_gender.get_type.to_s
16
+ gender == TYPES[:female]
17
+ end
18
+
19
+ def gender
20
+ return TYPES[:male] if self.male?
21
+ TYPES[:female] if self.female?
22
+ end
23
+
24
+ # Returns a list of name hashes
25
+ def names
26
+ names_list = []
27
+ @person.names.each do |name_obj|
28
+ name_obj.name_forms.each do |name_form_obj|
29
+ name_hash = {}
30
+ name_hash[:full] = name_form_obj.get_full_text
31
+ name_hash[:first] = name_form_obj.parts.find{|part| part.get_type.to_s == TYPES[:given] }.andand.get_value
32
+ name_hash[:last] = name_form_obj.parts.find{|part| part.get_type.to_s == TYPES[:surname] }.andand.get_value
33
+ names_list << name_hash
34
+ end
35
+ end
36
+ names_list
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,19 @@
1
+
2
+ module Gedcomx
3
+ class Record
4
+
5
+ attr_reader :people, :relationships
6
+
7
+ def initialize(input)
8
+ @record = input
9
+ @people = @record.persons.map{|person| Person.new(person) }
10
+ end
11
+
12
+ def each_person
13
+ @people.each do |person|
14
+ yield person
15
+ end
16
+ end
17
+
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gedcomx-jruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Alkalai
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ version_requirements: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ requirement: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ~>
23
+ - !ruby/object:Gem::Version
24
+ version: '1.5'
25
+ prerelease: false
26
+ type: :development
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ prerelease: false
40
+ type: :development
41
+ description: Provides ruby calls to import, process, and export Gedcomx files
42
+ email:
43
+ - djalkalai@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - gedcomx-jruby.gemspec
54
+ - lib/gedcomx/gedcomx.rb
55
+ - lib/gedcomx/iterator.rb
56
+ - lib/gedcomx/jruby/version.rb
57
+ - lib/gedcomx/person.rb
58
+ - lib/gedcomx/record.rb
59
+ - lib/gedcomx_java_jars/enunciate-gedcomx-support-1.0.82.M1-SNAPSHOT-sources.jar
60
+ - lib/gedcomx_java_jars/enunciate-gedcomx-support-1.0.82.M1-SNAPSHOT.jar
61
+ - lib/gedcomx_java_jars/familysearch-api-client-1.0.82.M1-SNAPSHOT-sources.jar
62
+ - lib/gedcomx_java_jars/familysearch-api-client-1.0.82.M1-SNAPSHOT.jar
63
+ - lib/gedcomx_java_jars/familysearch-api-model-1.0.82.M1-SNAPSHOT-sources.jar
64
+ - lib/gedcomx_java_jars/familysearch-api-model-1.0.82.M1-SNAPSHOT.jar
65
+ - lib/gedcomx_java_jars/gedcomx-atom-1.0.82.M1-SNAPSHOT-sources.jar
66
+ - lib/gedcomx_java_jars/gedcomx-atom-1.0.82.M1-SNAPSHOT.jar
67
+ - lib/gedcomx_java_jars/gedcomx-date-1.0.82.M1-SNAPSHOT-sources.jar
68
+ - lib/gedcomx_java_jars/gedcomx-date-1.0.82.M1-SNAPSHOT.jar
69
+ - lib/gedcomx_java_jars/gedcomx-fileformat-1.0.82.M1-SNAPSHOT-sources.jar
70
+ - lib/gedcomx_java_jars/gedcomx-fileformat-1.0.82.M1-SNAPSHOT.jar
71
+ - lib/gedcomx_java_jars/gedcomx-model-1.0.82.M1-SNAPSHOT-sources.jar
72
+ - lib/gedcomx_java_jars/gedcomx-model-1.0.82.M1-SNAPSHOT.jar
73
+ - lib/gedcomx_java_jars/gedcomx-rs-client-1.0.82.M1-SNAPSHOT-sources.jar
74
+ - lib/gedcomx_java_jars/gedcomx-rs-client-1.0.82.M1-SNAPSHOT.jar
75
+ - lib/gedcomx_java_jars/gedcomx-rs-rt-support-1.0.82.M1-SNAPSHOT-sources.jar
76
+ - lib/gedcomx_java_jars/gedcomx-rs-rt-support-1.0.82.M1-SNAPSHOT.jar
77
+ - lib/gedcomx_java_jars/gedcomx-rt-support-1.0.82.M1-SNAPSHOT-sources.jar
78
+ - lib/gedcomx_java_jars/gedcomx-rt-support-1.0.82.M1-SNAPSHOT.jar
79
+ - lib/gedcomx_java_jars/gedcomx-test-support-1.0.82.M1-SNAPSHOT-sources.jar
80
+ - lib/gedcomx_java_jars/gedcomx-test-support-1.0.82.M1-SNAPSHOT.jar
81
+ - lib/gedcomx_java_jars/jaxb-all.osgi-2.1.6.jar
82
+ homepage: ''
83
+ licenses:
84
+ - MIT
85
+ metadata: {}
86
+ post_install_message:
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.2.2
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Gedcomx ruby parser
106
+ test_files: []