kdonovan-trufina 0.1.0 → 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.
- data/README.rdoc +3 -0
- data/VERSION +1 -1
- data/lib/config.rb +3 -1
- data/lib/responses.rb +5 -5
- data/lib/trufina.rb +0 -2
- data/trufina.gemspec +72 -0
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -22,6 +22,9 @@ or
|
|
22
22
|
gem sources -a http://gems.github.com
|
23
23
|
sudo gem install kdonovan-trufina
|
24
24
|
|
25
|
+
# Add this to environment.rb
|
26
|
+
config.gem 'kdonovan-trufina', :lib => 'trufina', :source => "http://gems.github.com"
|
27
|
+
|
25
28
|
|
26
29
|
Once you have the code, you'll need to create a +trufina.yml+ file in your project's config directory. If you don't
|
27
30
|
do this by hand, a template file will be created automatically the first time you load your application after installation.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/config.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
class Trufina
|
2
4
|
# Reads in configuration data from config/trufina.yml (and handles creating it if missing / complaining if it looks unfilled).
|
3
5
|
class Config
|
@@ -27,7 +29,7 @@ class Trufina
|
|
27
29
|
# Ensure config exists
|
28
30
|
unless File.exists?(self.config_file)
|
29
31
|
config_template = File.join(File.dirname(__FILE__), '..', 'trufina.yml.template')
|
30
|
-
|
32
|
+
FileUtils.cp(config_template, self.config_file)
|
31
33
|
raise Exceptions::ConfigFileError.new("Unable to create configuration template at #{self.config_file}") unless File.exists?(self.config_file)
|
32
34
|
end
|
33
35
|
|
data/lib/responses.rb
CHANGED
@@ -8,20 +8,20 @@ class Trufina
|
|
8
8
|
# root node name -- the higher level error checking is handled in the
|
9
9
|
# Trufina.parseFromTrufina method)
|
10
10
|
def self.parse(raw_xml)
|
11
|
-
|
11
|
+
xml = LibXML::XML::Parser.string(raw_xml).parse
|
12
12
|
|
13
13
|
if Trufina::Config.debug?
|
14
14
|
puts "Received XML:\n\n"
|
15
|
-
puts
|
15
|
+
puts xml
|
16
16
|
puts "\n\n"
|
17
17
|
end
|
18
18
|
|
19
19
|
# Try to find an appropriate local happymapper class
|
20
20
|
begin
|
21
|
-
klass = "Trufina::Responses::#{
|
22
|
-
return klass.parse(
|
21
|
+
klass = "Trufina::Responses::#{xml.root.name.gsub('Trufina', '')}".constantize
|
22
|
+
return klass.parse(xml)
|
23
23
|
rescue
|
24
|
-
raise Exceptions::UnknownResponseType.new("Raw XML: \n\n#{
|
24
|
+
raise Exceptions::UnknownResponseType.new("Raw XML: \n\n#{xml}")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/trufina.rb
CHANGED
data/trufina.gemspec
ADDED
@@ -0,0 +1,72 @@
|
|
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{trufina}
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Kali Donovan"]
|
12
|
+
s.date = %q{2009-09-03}
|
13
|
+
s.description = %q{Provides a DSL to easily interact with the XML API offered by Trufina.com, an identity verification company.}
|
14
|
+
s.email = %q{kali.donovan@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.rdoc"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitignore",
|
20
|
+
"MIT-LICENSE",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"TODO",
|
24
|
+
"VERSION",
|
25
|
+
"init.rb",
|
26
|
+
"lib/config.rb",
|
27
|
+
"lib/elements.rb",
|
28
|
+
"lib/exceptions.rb",
|
29
|
+
"lib/requests.rb",
|
30
|
+
"lib/responses.rb",
|
31
|
+
"lib/trufina.rb",
|
32
|
+
"rails/init.rb",
|
33
|
+
"tasks/trufina_tasks.rake",
|
34
|
+
"test/fixtures/requests/access_request.xml",
|
35
|
+
"test/fixtures/requests/info_request.xml",
|
36
|
+
"test/fixtures/requests/login_info_request.xml",
|
37
|
+
"test/fixtures/requests/login_request.xml",
|
38
|
+
"test/fixtures/requests/login_request_simple.xml",
|
39
|
+
"test/fixtures/responses/access_notification.xml",
|
40
|
+
"test/fixtures/responses/access_response.xml",
|
41
|
+
"test/fixtures/responses/info_response.xml",
|
42
|
+
"test/fixtures/responses/login_info_response.xml",
|
43
|
+
"test/fixtures/responses/login_response.xml",
|
44
|
+
"test/fixtures/schema.xsd",
|
45
|
+
"test/test_helper.rb",
|
46
|
+
"test/trufina_test.rb",
|
47
|
+
"trufina.gemspec",
|
48
|
+
"trufina.yml.template"
|
49
|
+
]
|
50
|
+
s.homepage = %q{http://github.com/kdonovan/trufina}
|
51
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
52
|
+
s.require_paths = ["lib"]
|
53
|
+
s.rubygems_version = %q{1.3.5}
|
54
|
+
s.summary = %q{DSL to easily interact with Trufina's verification API}
|
55
|
+
s.test_files = [
|
56
|
+
"test/test_helper.rb",
|
57
|
+
"test/trufina_test.rb"
|
58
|
+
]
|
59
|
+
|
60
|
+
if s.respond_to? :specification_version then
|
61
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
62
|
+
s.specification_version = 3
|
63
|
+
|
64
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
65
|
+
s.add_runtime_dependency(%q<jimmyz-happymapper>, [">= 0"])
|
66
|
+
else
|
67
|
+
s.add_dependency(%q<jimmyz-happymapper>, [">= 0"])
|
68
|
+
end
|
69
|
+
else
|
70
|
+
s.add_dependency(%q<jimmyz-happymapper>, [">= 0"])
|
71
|
+
end
|
72
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kdonovan-trufina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kali Donovan
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-09-
|
12
|
+
date: 2009-09-03 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -59,10 +59,10 @@ files:
|
|
59
59
|
- test/fixtures/schema.xsd
|
60
60
|
- test/test_helper.rb
|
61
61
|
- test/trufina_test.rb
|
62
|
+
- trufina.gemspec
|
62
63
|
- trufina.yml.template
|
63
64
|
has_rdoc: false
|
64
65
|
homepage: http://github.com/kdonovan/trufina
|
65
|
-
licenses:
|
66
66
|
post_install_message:
|
67
67
|
rdoc_options:
|
68
68
|
- --charset=UTF-8
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
requirements: []
|
84
84
|
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.2.0
|
87
87
|
signing_key:
|
88
88
|
specification_version: 3
|
89
89
|
summary: DSL to easily interact with Trufina's verification API
|