ruby-fs-stack 0.1.7 → 0.2.0
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.
- data/README.rdoc +70 -5
- data/Rakefile +1 -3
- data/VERSION +1 -1
- data/ruby-fs-stack.gemspec +89 -0
- metadata +5 -14
data/README.rdoc
CHANGED
@@ -5,22 +5,87 @@ API modules provided by FamilySearch.
|
|
5
5
|
|
6
6
|
== Installation
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
If you haven't added gemcutter.org to your gem sources, run
|
9
|
+
|
10
|
+
gem sources -a http://gemcutter.org
|
11
|
+
|
12
|
+
Install the ruby-fs-stack gem
|
13
|
+
|
14
|
+
sudo gem install ruby-fs-stack
|
15
|
+
|
16
|
+
=== JSON gem
|
17
|
+
Ruby-fs-stack needs a json gem, but does not force it as a dependency.
|
18
|
+
|
19
|
+
sudo gem install json
|
20
|
+
|
21
|
+
or if you are using JRuby
|
22
|
+
|
23
|
+
sudo gem install json-jruby
|
24
|
+
|
25
|
+
or for the pure Ruby implementation
|
26
|
+
|
27
|
+
sudo gem install json_pure
|
10
28
|
|
11
29
|
== Example Usage
|
12
30
|
|
13
|
-
|
31
|
+
=== Authenticating with FamilySearch
|
32
|
+
|
33
|
+
require 'ruby-fs-stack'
|
34
|
+
|
35
|
+
communicator = FsCommunicator.new :domain => 'http://www.dev.usys.org', # or 'https://api.familysearch.org'
|
36
|
+
:key => 'DEVELOPER-KEY',
|
37
|
+
:user_agent => 'Ruby-Fs-Stack/v.1 (JimmyZimmerman) FsCommunicator/0.1 (Ruby)'
|
38
|
+
|
39
|
+
communicator.identity_v1.authenticate :username => 'USERNAME', :password => 'PASSWORD' #=> true
|
40
|
+
communicator.session #=> "USYSE4EF197..."
|
14
41
|
|
15
|
-
|
42
|
+
=== Reading Person Records
|
16
43
|
|
17
|
-
|
44
|
+
me = communicator.familytree_v2.person :me
|
45
|
+
puts "My name: " + me.full_name
|
46
|
+
puts "My birthdate: " + me.birth.value.date.normalized
|
47
|
+
|
48
|
+
# Read only the version number for a person
|
49
|
+
vperson = communicator.familytree_v2.person 'KW3B-NNM', :names => 'none', :genders => 'none', :events => 'none'
|
50
|
+
puts "Person's version: " + vperson.person
|
51
|
+
|
52
|
+
# read the person and the parent, family, and child information
|
53
|
+
person = ftcom.person 'KW3B-NNM', :parents => 'summary', :families => 'all', :children => 'all'
|
54
|
+
|
55
|
+
puts "Gender: " + person.gender
|
56
|
+
puts "First parent ID: " + person.parents[0].parents[0].id
|
57
|
+
puts "First child ID: " + person.families[0].children[0].id
|
58
|
+
puts "First spouse's gender: " + person.families[0].parents[1].gender
|
59
|
+
puts "First spouse's ID: " + person.families[0].parents[1].id
|
60
|
+
|
61
|
+
=== Searching Records
|
62
|
+
|
63
|
+
search = communicator.familytree_v2.search :givenName => "John",
|
64
|
+
:familyName => "Doe",
|
65
|
+
:birthDate => "12 Jun 1812",
|
66
|
+
:birthPlace => "Virginia, United States",
|
67
|
+
:father => {:givenName => "Robert"},
|
68
|
+
:maxResults => 10
|
69
|
+
search.count #=> 10
|
70
|
+
search.close #=> 2
|
71
|
+
search.partial #=> 16
|
72
|
+
search.results.each do |result|
|
73
|
+
puts result.score #=> 4.0
|
74
|
+
puts result.id #=> "KW3B-JXV"
|
75
|
+
puts result.person.full_name #=> "John Doe"
|
76
|
+
puts result.person.birth.date.original #=> "abt 1812"
|
77
|
+
puts result.father.full_name #=> "Robert Doe"
|
78
|
+
puts result.mother.full_name #=> "Ruby Johnson"
|
79
|
+
puts result.spouses.first.full_name #=> "Sarah Franklin"
|
80
|
+
end
|
18
81
|
|
19
82
|
== Discussion
|
20
83
|
|
21
84
|
A Google Group has been set up for questions and discussion
|
22
85
|
around the ruby-fs-stack project.
|
23
86
|
|
87
|
+
http://groups.google.com/group/ruby-fs-stack
|
88
|
+
|
24
89
|
== Copyright
|
25
90
|
|
26
91
|
Copyright (c) 2009 Jimmy Zimmerman. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -11,9 +11,7 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/jimmyz/ruby-fs-stack"
|
12
12
|
gem.authors = ["Jimmy Zimmerman"]
|
13
13
|
gem.add_development_dependency "rspec"
|
14
|
-
gem.
|
15
|
-
gem.files << "lib/ruby-fs-stack/enunciate/identity.rb"
|
16
|
-
gem.files << "lib/ruby-fs-stack/enunciate/familytree.rb"
|
14
|
+
gem.requirements << "This gem requires a json gem (json, json_pure, or json-jruby)."
|
17
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
16
|
end
|
19
17
|
rescue LoadError
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ruby-fs-stack}
|
8
|
+
s.version = "0.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Jimmy Zimmerman"]
|
12
|
+
s.date = %q{2009-12-05}
|
13
|
+
s.description = %q{A library that enables you to read and update information with the new.familysearch.org API.}
|
14
|
+
s.email = %q{jimmy.zimmerman@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"examples/familytree_example.rb",
|
27
|
+
"examples/login_example.rb",
|
28
|
+
"lib/ruby-fs-stack.rb",
|
29
|
+
"lib/ruby-fs-stack/assets/entrust-ca.crt",
|
30
|
+
"lib/ruby-fs-stack/enunciate/LICENSE",
|
31
|
+
"lib/ruby-fs-stack/enunciate/README",
|
32
|
+
"lib/ruby-fs-stack/enunciate/familytree.rb",
|
33
|
+
"lib/ruby-fs-stack/enunciate/identity.rb",
|
34
|
+
"lib/ruby-fs-stack/familytree.rb",
|
35
|
+
"lib/ruby-fs-stack/fs_communicator.rb",
|
36
|
+
"lib/ruby-fs-stack/fs_utils.rb",
|
37
|
+
"lib/ruby-fs-stack/identity.rb",
|
38
|
+
"lib/ruby-fs-stack/warning_suppressor.rb",
|
39
|
+
"ruby-fs-stack.gemspec",
|
40
|
+
"spec/communicator_spec.rb",
|
41
|
+
"spec/familytree_v2/familytree_communicator_spec.rb",
|
42
|
+
"spec/familytree_v2/json/match_KW3B-NNM.js",
|
43
|
+
"spec/familytree_v2/json/person/KJ86-3VD_all.js",
|
44
|
+
"spec/familytree_v2/json/person/KJ86-3VD_version.js",
|
45
|
+
"spec/familytree_v2/json/person/post_response.js",
|
46
|
+
"spec/familytree_v2/json/person/relationship_not_found.js",
|
47
|
+
"spec/familytree_v2/json/person/relationship_read.js",
|
48
|
+
"spec/familytree_v2/json/person/relationship_update.js",
|
49
|
+
"spec/familytree_v2/json/search.js",
|
50
|
+
"spec/familytree_v2/person_spec.rb",
|
51
|
+
"spec/familytree_v2/search_results_spec.rb",
|
52
|
+
"spec/fs_utils_spec.rb",
|
53
|
+
"spec/identity_v1/identity_spec.rb",
|
54
|
+
"spec/identity_v1/json/login.js",
|
55
|
+
"spec/ruby-fs-stack_spec.rb",
|
56
|
+
"spec/spec_helper.rb"
|
57
|
+
]
|
58
|
+
s.homepage = %q{http://github.com/jimmyz/ruby-fs-stack}
|
59
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
60
|
+
s.require_paths = ["lib"]
|
61
|
+
s.requirements = ["This gem requires a json gem (json, json_pure, or json-jruby)."]
|
62
|
+
s.rubygems_version = %q{1.3.5}
|
63
|
+
s.summary = %q{Ruby wrapper for all FamilySearch APIs.}
|
64
|
+
s.test_files = [
|
65
|
+
"spec/communicator_spec.rb",
|
66
|
+
"spec/familytree_v2/familytree_communicator_spec.rb",
|
67
|
+
"spec/familytree_v2/person_spec.rb",
|
68
|
+
"spec/familytree_v2/search_results_spec.rb",
|
69
|
+
"spec/fs_utils_spec.rb",
|
70
|
+
"spec/identity_v1/identity_spec.rb",
|
71
|
+
"spec/ruby-fs-stack_spec.rb",
|
72
|
+
"spec/spec_helper.rb",
|
73
|
+
"examples/familytree_example.rb",
|
74
|
+
"examples/login_example.rb"
|
75
|
+
]
|
76
|
+
|
77
|
+
if s.respond_to? :specification_version then
|
78
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
79
|
+
s.specification_version = 3
|
80
|
+
|
81
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
82
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
83
|
+
else
|
84
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
85
|
+
end
|
86
|
+
else
|
87
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
88
|
+
end
|
89
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-fs-stack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Zimmerman
|
@@ -22,16 +22,6 @@ dependencies:
|
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: "0"
|
24
24
|
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: json
|
27
|
-
type: :runtime
|
28
|
-
version_requirement:
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 1.1.7
|
34
|
-
version:
|
35
25
|
description: A library that enables you to read and update information with the new.familysearch.org API.
|
36
26
|
email: jimmy.zimmerman@gmail.com
|
37
27
|
executables: []
|
@@ -61,6 +51,7 @@ files:
|
|
61
51
|
- lib/ruby-fs-stack/fs_utils.rb
|
62
52
|
- lib/ruby-fs-stack/identity.rb
|
63
53
|
- lib/ruby-fs-stack/warning_suppressor.rb
|
54
|
+
- ruby-fs-stack.gemspec
|
64
55
|
- spec/communicator_spec.rb
|
65
56
|
- spec/familytree_v2/familytree_communicator_spec.rb
|
66
57
|
- spec/familytree_v2/json/match_KW3B-NNM.js
|
@@ -99,12 +90,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
90
|
- !ruby/object:Gem::Version
|
100
91
|
version: "0"
|
101
92
|
version:
|
102
|
-
requirements:
|
103
|
-
|
93
|
+
requirements:
|
94
|
+
- This gem requires a json gem (json, json_pure, or json-jruby).
|
104
95
|
rubyforge_project:
|
105
96
|
rubygems_version: 1.3.5
|
106
97
|
signing_key:
|
107
|
-
specification_version:
|
98
|
+
specification_version: 3
|
108
99
|
summary: Ruby wrapper for all FamilySearch APIs.
|
109
100
|
test_files:
|
110
101
|
- spec/communicator_spec.rb
|