ruby-fs-stack 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +7 -0
- data/LICENSE +20 -0
- data/README.rdoc +26 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/examples/familytree_example.rb +26 -0
- data/examples/login_example.rb +11 -0
- data/lib/ruby-fs-stack/assets/entrust-ca.crt +104 -0
- data/lib/ruby-fs-stack/enunciate/LICENSE +15 -0
- data/lib/ruby-fs-stack/enunciate/README +6 -0
- data/lib/ruby-fs-stack/enunciate/familytree.rb +12608 -0
- data/lib/ruby-fs-stack/enunciate/identity.rb +964 -0
- data/lib/ruby-fs-stack/familytree.rb +827 -0
- data/lib/ruby-fs-stack/fs_communicator.rb +109 -0
- data/lib/ruby-fs-stack/fs_utils.rb +27 -0
- data/lib/ruby-fs-stack/identity.rb +45 -0
- data/lib/ruby-fs-stack/warning_suppressor.rb +18 -0
- data/lib/ruby-fs-stack.rb +2 -0
- data/spec/communicator_spec.rb +214 -0
- data/spec/familytree_v2/familytree_communicator_spec.rb +309 -0
- data/spec/familytree_v2/json/match_KW3B-NNM.js +1 -0
- data/spec/familytree_v2/json/person/KJ86-3VD_all.js +1 -0
- data/spec/familytree_v2/json/person/KJ86-3VD_version.js +1 -0
- data/spec/familytree_v2/json/person/post_response.js +1 -0
- data/spec/familytree_v2/json/person/relationship_not_found.js +1 -0
- data/spec/familytree_v2/json/person/relationship_read.js +1 -0
- data/spec/familytree_v2/json/person/relationship_update.js +1 -0
- data/spec/familytree_v2/json/search.js +1 -0
- data/spec/familytree_v2/person_spec.rb +563 -0
- data/spec/familytree_v2/search_results_spec.rb +131 -0
- data/spec/fs_utils_spec.rb +33 -0
- data/spec/identity_v1/identity_spec.rb +50 -0
- data/spec/identity_v1/json/login.js +1 -0
- data/spec/ruby-fs-stack_spec.rb +6 -0
- data/spec/spec_helper.rb +27 -0
- metadata +119 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Jimmy Zimmerman
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
= ruby-fs-stack
|
2
|
+
|
3
|
+
This project aims to provide functionality for all of the
|
4
|
+
API modules provided by FamilySearch.
|
5
|
+
|
6
|
+
== Installation
|
7
|
+
|
8
|
+
This project is being configured as a Ruby Gem. Instructions will be posted here
|
9
|
+
as soon you can install the gem from RubyForge.
|
10
|
+
|
11
|
+
== Example Usage
|
12
|
+
|
13
|
+
# Example code will be posted here as soon as it is packaged as a gem.
|
14
|
+
|
15
|
+
See examples/login_example.rb[http://github.com/jimmyz/ruby-fs-stack/tree/master/examples/login_example.rb]
|
16
|
+
|
17
|
+
See examples/familytree_example.rb[http://github.com/jimmyz/ruby-fs-stack/tree/master/examples/familytree_example.rb]
|
18
|
+
|
19
|
+
== Discussion
|
20
|
+
|
21
|
+
A Google Group has been set up for questions and discussion
|
22
|
+
around the ruby-fs-stack project.
|
23
|
+
|
24
|
+
== Copyright
|
25
|
+
|
26
|
+
Copyright (c) 2009 Jimmy Zimmerman. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "ruby-fs-stack"
|
8
|
+
gem.summary = %Q{Ruby wrapper for all FamilySearch APIs.}
|
9
|
+
gem.description = %Q{A library that enables you to read and update information with the new.familysearch.org API.}
|
10
|
+
gem.email = "jimmy.zimmerman@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/jimmyz/ruby-fs-stack"
|
12
|
+
gem.authors = ["Jimmy Zimmerman"]
|
13
|
+
gem.add_development_dependency "rspec"
|
14
|
+
gem.add_dependency('json', '>=1.1.7')
|
15
|
+
gem.files << "lib/ruby-fs-stack/enunciate/identity.rb"
|
16
|
+
gem.files << "lib/ruby-fs-stack/enunciate/familytree.rb"
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
19
|
+
rescue LoadError
|
20
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'spec/rake/spectask'
|
24
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
+
spec.libs << 'lib' << 'spec'
|
26
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
+
end
|
28
|
+
|
29
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
+
spec.rcov = true
|
33
|
+
end
|
34
|
+
|
35
|
+
task :spec => :check_dependencies
|
36
|
+
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'rake/rdoctask'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
if File.exist?('VERSION')
|
42
|
+
version = File.read('VERSION')
|
43
|
+
else
|
44
|
+
version = ""
|
45
|
+
end
|
46
|
+
|
47
|
+
rdoc.rdoc_dir = 'rdoc'
|
48
|
+
rdoc.title = "ruby-fs-stack #{version}"
|
49
|
+
rdoc.rdoc_files.include('README*')
|
50
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
51
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.7
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Put the lib directory on the load path
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'ruby-fs-stack'
|
4
|
+
require 'pp'
|
5
|
+
|
6
|
+
communicator = FsCommunicator.new :domain => 'http://www.dev.usys.org',
|
7
|
+
:key => '',
|
8
|
+
:user_agent => 'Ruby-Fs-Stack/v.1 (JimmyZimmerman) FsCommunicator/0.1 (Ruby)'
|
9
|
+
|
10
|
+
if communicator.identity_v1.authenticate :username => '', :password => ''
|
11
|
+
me = ftcom.person :me
|
12
|
+
puts "My name: " + me.full_name
|
13
|
+
puts "My birthdate: " + me.birth.value.date.normalized
|
14
|
+
|
15
|
+
vperson = ftcom.person 'KW3B-NNM', :names => 'none', :genders => 'none', :events => 'none'
|
16
|
+
puts "Version Person"
|
17
|
+
pp vperson
|
18
|
+
|
19
|
+
person = ftcom.person 'KW3B-NNM', :parents => 'summary', :families => 'all', :children => 'all'
|
20
|
+
|
21
|
+
puts person.gender
|
22
|
+
puts "First parent ID: " + person.parents[0].parents[0].id
|
23
|
+
puts "First child ID: " + person.families[0].children[0].id
|
24
|
+
puts "First spouse's gender: " + person.families[0].parents[1].gender
|
25
|
+
puts "First spouse's ID: " + person.families[0].parents[1].id
|
26
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Put the lib directory on the load path
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'ruby-fs-stack/identity'
|
4
|
+
|
5
|
+
communicator = FsCommunicator.new :domain => 'http://www.dev.usys.org',
|
6
|
+
:key => 'KEY',
|
7
|
+
:user_agent => 'Ruby-Fs-Stack/v.1 (JimmyZimmerman) FsCommunicator/0.1 (Ruby)'
|
8
|
+
|
9
|
+
if communicator.identity_v1.authenticate :username => '', :password => ''
|
10
|
+
puts communicator.session
|
11
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
##
|
2
|
+
## $Id: ca-bundle.crt,v 1.2 2003/03/24 11:06:57 bagder Exp $
|
3
|
+
##
|
4
|
+
## ca-bundle.crt -- Bundle of CA Root Certificates
|
5
|
+
## Last Modified: Thu Mar 2 09:32:46 CET 2000
|
6
|
+
##
|
7
|
+
## This is a bundle of X.509 certificates of public
|
8
|
+
## Certificate Authorities (CA). These were automatically
|
9
|
+
## extracted from Netscape Communicator 4.72's certificate database
|
10
|
+
## (the file `cert7.db'). It contains the certificates in both
|
11
|
+
## plain text and PEM format and therefore can be directly used
|
12
|
+
## with an Apache+mod_ssl webserver for SSL client authentication.
|
13
|
+
## Just configure this file as the SSLCACertificateFile.
|
14
|
+
##
|
15
|
+
## (SKIPME)
|
16
|
+
##
|
17
|
+
|
18
|
+
|
19
|
+
Entrust.net Secure Server CA
|
20
|
+
============================
|
21
|
+
MD5 Fingerprint: DF:F2:80:73:CC:F1:E6:61:73:FC:F5:42:E9:C5:7C:EE
|
22
|
+
PEM Data:
|
23
|
+
-----BEGIN CERTIFICATE-----
|
24
|
+
MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
|
25
|
+
VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTsw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MgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk
|
41
|
+
MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp
|
42
|
+
b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu
|
43
|
+
dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
|
44
|
+
MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
|
45
|
+
E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
|
46
|
+
MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
|
47
|
+
hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
|
48
|
+
95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
|
49
|
+
2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
|
50
|
+
-----END CERTIFICATE-----
|
51
|
+
Certificate Ingredients:
|
52
|
+
Data:
|
53
|
+
Version: 3 (0x2)
|
54
|
+
Serial Number: 927650371 (0x374ad243)
|
55
|
+
Signature Algorithm: sha1WithRSAEncryption
|
56
|
+
Issuer: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority
|
57
|
+
Validity
|
58
|
+
Not Before: May 25 16:09:40 1999 GMT
|
59
|
+
Not After : May 25 16:39:40 2019 GMT
|
60
|
+
Subject: C=US, O=Entrust.net, OU=www.entrust.net/CPS incorp. by ref. (limits liab.), OU=(c) 1999 Entrust.net Limited, CN=Entrust.net Secure Server Certification Authority
|
61
|
+
Subject Public Key Info:
|
62
|
+
Public Key Algorithm: rsaEncryption
|
63
|
+
RSA Public Key: (1024 bit)
|
64
|
+
Modulus (1024 bit):
|
65
|
+
00:cd:28:83:34:54:1b:89:f3:0f:af:37:91:31:ff:
|
66
|
+
af:31:60:c9:a8:e8:b2:10:68:ed:9f:e7:93:36:f1:
|
67
|
+
0a:64:bb:47:f5:04:17:3f:23:47:4d:c5:27:19:81:
|
68
|
+
26:0c:54:72:0d:88:2d:d9:1f:9a:12:9f:bc:b3:71:
|
69
|
+
d3:80:19:3f:47:66:7b:8c:35:28:d2:b9:0a:df:24:
|
70
|
+
da:9c:d6:50:79:81:7a:5a:d3:37:f7:c2:4a:d8:29:
|
71
|
+
92:26:64:d1:e4:98:6c:3a:00:8a:f5:34:9b:65:f8:
|
72
|
+
ed:e3:10:ff:fd:b8:49:58:dc:a0:de:82:39:6b:81:
|
73
|
+
b1:16:19:61:b9:54:b6:e6:43
|
74
|
+
Exponent: 3 (0x3)
|
75
|
+
X509v3 extensions:
|
76
|
+
Netscape Cert Type:
|
77
|
+
SSL CA, S/MIME CA, Object Signing CA
|
78
|
+
X509v3 CRL Distribution Points:
|
79
|
+
DirName:/C=US/O=Entrust.net/OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Secure Server Certification Authority/CN=CRL1
|
80
|
+
URI:http://www.entrust.net/CRL/net1.crl
|
81
|
+
|
82
|
+
X509v3 Private Key Usage Period:
|
83
|
+
Not Before: May 25 16:09:40 1999 GMT, Not After: May 25 16:09:40 2019 GMT
|
84
|
+
X509v3 Key Usage:
|
85
|
+
Certificate Sign, CRL Sign
|
86
|
+
X509v3 Authority Key Identifier:
|
87
|
+
keyid:F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A
|
88
|
+
|
89
|
+
X509v3 Subject Key Identifier:
|
90
|
+
F0:17:62:13:55:3D:B3:FF:0A:00:6B:FB:50:84:97:F3:ED:62:D0:1A
|
91
|
+
X509v3 Basic Constraints:
|
92
|
+
CA:TRUE
|
93
|
+
1.2.840.113533.7.65.0:
|
94
|
+
0
|
95
|
+
..V4.0....
|
96
|
+
Signature Algorithm: sha1WithRSAEncryption
|
97
|
+
90:dc:30:02:fa:64:74:c2:a7:0a:a5:7c:21:8d:34:17:a8:fb:
|
98
|
+
47:0e:ff:25:7c:8d:13:0a:fb:e4:98:b5:ef:8c:f8:c5:10:0d:
|
99
|
+
f7:92:be:f1:c3:d5:d5:95:6a:04:bb:2c:ce:26:36:65:c8:31:
|
100
|
+
c6:e7:ee:3f:e3:57:75:84:7a:11:ef:46:4f:18:f4:d3:98:bb:
|
101
|
+
a8:87:32:ba:72:f6:3c:e2:3d:9f:d7:1d:d9:c3:60:43:8c:58:
|
102
|
+
0e:22:96:2f:62:a3:2c:1f:ba:ad:05:ef:ab:32:78:87:a0:54:
|
103
|
+
73:19:b5:5c:05:f9:52:3e:6d:2d:45:0b:f7:0a:93:ea:ed:06:
|
104
|
+
f9:b2
|
@@ -0,0 +1,15 @@
|
|
1
|
+
===FamilySearch Enunciate-generated Sample Code License Agreement
|
2
|
+
|
3
|
+
Code located in the lib/ruby-fs-stack/enunciate directory is licensed
|
4
|
+
under the FamilySearch API License Agreement as "Sample Code"
|
5
|
+
|
6
|
+
https://devnet.familysearch.org/certification/affiliate-programs/familysearch-legal-agreements/APILicense.pdf
|
7
|
+
|
8
|
+
It can be Sublicensed under the conditions of Section 2.1(a)
|
9
|
+
|
10
|
+
4.2 Limits on Sublicensing. Except as set forth in this section (and Sections 2.1(a), 2.1(e), and 2.1(f) with respect to the Sample Code),
|
11
|
+
|
12
|
+
You may do the following under this Agreement:
|
13
|
+
2.1(a) Use the Sample Code within Your Application or within an open source project used to interface with the API;
|
14
|
+
2.1(e) Disclose to the public, including through open source software development projects or online forums, the structure of the API, the Sample Code, and the structure of Databases or Content, provided that (i) You properly identify these by reference to the FamilySearch trademark; and (ii) You do not violate any other term of this Agreement that relates to the protection of personal information;
|
15
|
+
2.1(f) Disclose to the public, including through open source software development projects or online forums, the means by which third party developers can (i) interface with the API to create new applications; or (ii) interface with Your Application or an open source project that interfaces with the API to make use of any functionality that Your Application or an open source project that interfaces with the API provides;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
The FamilySearch API License agreement has been modified
|
2
|
+
to allow the distribution of the enunciate code libraries
|
3
|
+
to be distributed in Open Source projects under the terms
|
4
|
+
in lib/ruby-fs-stack/enunciate/LICENSE.
|
5
|
+
|
6
|
+
No further action needs to be taken to use this library.
|