geocerts 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -3
- data/CHANGELOG.markdown +17 -0
- data/Gemfile +1 -1
- data/README.markdown +92 -0
- data/Rakefile +10 -19
- data/geocerts.gemspec +6 -8
- data/lib/geo_certs/version.rb +1 -1
- data/test/test_helper.rb +2 -5
- metadata +103 -124
- data/.document +0 -5
- data/Gemfile.lock +0 -38
- data/README.rdoc +0 -71
data/.gitignore
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
*.gem
|
2
|
+
*.rbc
|
2
3
|
.bundle
|
3
|
-
|
4
|
-
.
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
5
9
|
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
6
13
|
rdoc
|
7
|
-
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
|
8
19
|
test/config/test_credentials.yml
|
data/CHANGELOG.markdown
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# geocerts
|
2
|
+
|
3
|
+
## [HEAD][head] / unreleased
|
4
|
+
|
5
|
+
No significant changes.
|
6
|
+
|
7
|
+
## [1.0.1][v1.0.1] / 2012-07-09
|
8
|
+
|
9
|
+
* Upgrade the libxml-ruby dependency from ~>1.1.0 to ~>2.0 for Ruby 1.9 support.
|
10
|
+
|
11
|
+
## 1.0.0 / 2011-01-12
|
12
|
+
|
13
|
+
* First, stable release.
|
14
|
+
|
15
|
+
|
16
|
+
[head]: https://github.com/geocerts/geocerts/compare/v1.0.1...master
|
17
|
+
[v1.0.1]: https://github.com/geocerts/geocerts/compare/v1.0.0...v1.0.1
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source 'http://rubygems.org'
|
2
2
|
gemspec
|
data/README.markdown
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# GeoCerts
|
2
|
+
|
3
|
+
The GeoCerts library provides a Ruby interface to the GeoCerts REST API. This API allows
|
4
|
+
you to manage (lookup, create, and verify) your GeoCerts orders, events, certificates, and
|
5
|
+
more.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add the following line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'geocerts'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Or, install it directly with:
|
22
|
+
|
23
|
+
```bash
|
24
|
+
$ gem install geocerts
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'geocerts'
|
31
|
+
|
32
|
+
GeoCerts.partner_id = 'example'
|
33
|
+
GeoCerts.api_token = 'abd123DEfg.....'
|
34
|
+
|
35
|
+
begin
|
36
|
+
GeoCerts::Order.all # => [ GeoCerts::Order, GeoCerts::Order, ... ]
|
37
|
+
GeoCerts::Order.find(12345).certificate # => GeoCerts::Certificate
|
38
|
+
GeoCerts::Product.all # => [ GeoCerts::Product, GeoCerts::Product, ... ]
|
39
|
+
|
40
|
+
product = GeoCerts::Product.find('Q')
|
41
|
+
product.user_agreement # => GeoCerts::Agreement
|
42
|
+
puts product.user_agreement.text # => "...."
|
43
|
+
|
44
|
+
# Validate the requested order details
|
45
|
+
validated_order = GeoCerts::Order.validate({
|
46
|
+
:csr => GeoCerts::CSR.new(:body => "-----BEGIN CERTIFICATE REQUEST-----\n...."),
|
47
|
+
:product => product
|
48
|
+
})
|
49
|
+
validated_order.renewal_information.indicator # => true
|
50
|
+
validated_order.renewal_information.months # => 1
|
51
|
+
validated_order.csr.common_name # => 'www.example.com'
|
52
|
+
validated_order.csr.state # => 'Georgia'
|
53
|
+
validated_order.total_price # => 99.00
|
54
|
+
|
55
|
+
# Create a new Order
|
56
|
+
order = GeoCerts::Order.new({
|
57
|
+
:csr => GeoCerts::CSR.new(:body => "-----BEGIN CERTIFICATE REQUEST-----\n...."),
|
58
|
+
:product => product,
|
59
|
+
:years => 3,
|
60
|
+
:licenses => 1
|
61
|
+
}).save
|
62
|
+
|
63
|
+
rescue GeoCerts::Exception
|
64
|
+
puts $!.to_s
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
## Exceptions
|
69
|
+
|
70
|
+
Since this library does interface with an external system, there is a much greater risk of
|
71
|
+
exceptional situations. As such, this library attempts to wrap all raised exceptions (due
|
72
|
+
to authorization, connection, or other unforeseen issues) in the GeoCerts::Exception object.
|
73
|
+
All exceptions raised from within this library should inherit from this class.
|
74
|
+
|
75
|
+
Exceptions which are raised after successful connections, due to server or request issues,
|
76
|
+
will be derived from GeoCerts::ExceptionWithResponse. This object also inherits from
|
77
|
+
GeoCerts::Exception, but contains the actual response details (including HTTP status code,
|
78
|
+
headers, and response body).
|
79
|
+
|
80
|
+
## Contributing
|
81
|
+
|
82
|
+
1. Fork it
|
83
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
84
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
85
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
86
|
+
5. Create new Pull Request
|
87
|
+
|
88
|
+
== Copyright
|
89
|
+
|
90
|
+
Copyright (c) 2009 [GeoCerts Inc.][geocerts]. See LICENSE for details.
|
91
|
+
|
92
|
+
[geocerts]: http://www.geocerts.com/
|
data/Rakefile
CHANGED
@@ -1,30 +1,21 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
4
3
|
require 'rake/testtask'
|
5
|
-
Rake::TestTask.new(:test) do |test|
|
6
|
-
test.libs << 'lib' << 'test'
|
7
|
-
test.pattern = 'test/**/*_test.rb'
|
8
|
-
test.verbose = true
|
9
|
-
end
|
10
4
|
|
11
5
|
begin
|
12
|
-
require '
|
13
|
-
Rcov::RcovTask.new do |test|
|
14
|
-
test.libs << 'test'
|
15
|
-
test.pattern = 'test/**/*_test.rb'
|
16
|
-
test.verbose = true
|
17
|
-
end
|
6
|
+
require 'rdoc/task'
|
18
7
|
rescue LoadError
|
19
|
-
|
20
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
21
|
-
end
|
8
|
+
require 'rake/rdoctask'
|
22
9
|
end
|
23
10
|
|
24
|
-
|
25
11
|
task :default => :test
|
26
12
|
|
27
|
-
|
13
|
+
Rake::TestTask.new(:test) do |test|
|
14
|
+
test.libs << 'lib' << 'test'
|
15
|
+
test.pattern = 'test/**/*_test.rb'
|
16
|
+
test.verbose = true
|
17
|
+
end
|
18
|
+
|
28
19
|
Rake::RDocTask.new do |rdoc|
|
29
20
|
if File.exist?('VERSION.yml')
|
30
21
|
config = YAML.load(File.read('VERSION.yml'))
|
data/geocerts.gemspec
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "geo_certs/version"
|
2
|
+
require File.expand_path("../lib/geo_certs/version", __FILE__)
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
5
|
s.name = "geocerts"
|
@@ -12,11 +11,10 @@ Gem::Specification.new do |s|
|
|
12
11
|
s.summary = %q{A Ruby library for interfacing with the GeoCerts REST API}
|
13
12
|
s.description = %q{A Ruby library for interfacing with the GeoCerts REST API}
|
14
13
|
|
15
|
-
s.
|
16
|
-
|
17
|
-
s.
|
18
|
-
s.
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
s.files = `git ls-files`.split($\)
|
15
|
+
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
16
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
17
|
+
s.name = "geocerts"
|
20
18
|
s.require_paths = ["lib"]
|
21
19
|
|
22
20
|
s.add_development_dependency 'shoulda', '~>2.11.0'
|
@@ -26,5 +24,5 @@ Gem::Specification.new do |s|
|
|
26
24
|
s.add_development_dependency 'fakeweb', '~>1.3.0'
|
27
25
|
|
28
26
|
s.add_dependency 'relax', '~>0.1.0'
|
29
|
-
s.add_dependency 'libxml-ruby', '~>
|
27
|
+
s.add_dependency 'libxml-ruby', '~>2.0'
|
30
28
|
end
|
data/lib/geo_certs/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,151 +1,140 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocerts
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- GeoCerts, Inc.
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-07-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: shoulda
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
18
|
+
requirements:
|
27
19
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 35
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 11
|
33
|
-
- 0
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 2.11.0
|
35
22
|
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: factory_girl
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
25
|
none: false
|
42
|
-
requirements:
|
26
|
+
requirements:
|
43
27
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.11.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: factory_girl
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
50
37
|
version: 1.3.0
|
51
38
|
type: :development
|
52
|
-
version_requirements: *id002
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
name: mocha
|
55
39
|
prerelease: false
|
56
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.3.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: mocha
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
57
49
|
none: false
|
58
|
-
requirements:
|
50
|
+
requirements:
|
59
51
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
hash: 59
|
62
|
-
segments:
|
63
|
-
- 0
|
64
|
-
- 9
|
65
|
-
- 0
|
52
|
+
- !ruby/object:Gem::Version
|
66
53
|
version: 0.9.0
|
67
54
|
type: :development
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: vcr
|
71
55
|
prerelease: false
|
72
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
57
|
none: false
|
74
|
-
requirements:
|
58
|
+
requirements:
|
75
59
|
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.9.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: vcr
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
82
69
|
version: 1.5.0
|
83
70
|
type: :development
|
84
|
-
version_requirements: *id004
|
85
|
-
- !ruby/object:Gem::Dependency
|
86
|
-
name: fakeweb
|
87
71
|
prerelease: false
|
88
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
73
|
none: false
|
90
|
-
requirements:
|
74
|
+
requirements:
|
91
75
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.5.0
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: fakeweb
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
98
85
|
version: 1.3.0
|
99
86
|
type: :development
|
100
|
-
version_requirements: *id005
|
101
|
-
- !ruby/object:Gem::Dependency
|
102
|
-
name: relax
|
103
87
|
prerelease: false
|
104
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.3.0
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: relax
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
105
97
|
none: false
|
106
|
-
requirements:
|
98
|
+
requirements:
|
107
99
|
- - ~>
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
hash: 27
|
110
|
-
segments:
|
111
|
-
- 0
|
112
|
-
- 1
|
113
|
-
- 0
|
100
|
+
- !ruby/object:Gem::Version
|
114
101
|
version: 0.1.0
|
115
102
|
type: :runtime
|
116
|
-
version_requirements: *id006
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: libxml-ruby
|
119
103
|
prerelease: false
|
120
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.1.0
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: libxml-ruby
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
121
113
|
none: false
|
122
|
-
requirements:
|
114
|
+
requirements:
|
123
115
|
- - ~>
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
|
126
|
-
segments:
|
127
|
-
- 1
|
128
|
-
- 1
|
129
|
-
- 0
|
130
|
-
version: 1.1.0
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.0'
|
131
118
|
type: :runtime
|
132
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '2.0'
|
133
126
|
description: A Ruby library for interfacing with the GeoCerts REST API
|
134
|
-
email:
|
127
|
+
email:
|
135
128
|
- sslsupport@geocerts.com
|
136
129
|
executables: []
|
137
|
-
|
138
130
|
extensions: []
|
139
|
-
|
140
131
|
extra_rdoc_files: []
|
141
|
-
|
142
|
-
files:
|
143
|
-
- .document
|
132
|
+
files:
|
144
133
|
- .gitignore
|
134
|
+
- CHANGELOG.markdown
|
145
135
|
- Gemfile
|
146
|
-
- Gemfile.lock
|
147
136
|
- LICENSE
|
148
|
-
- README.
|
137
|
+
- README.markdown
|
149
138
|
- Rakefile
|
150
139
|
- autotest/discover.rb
|
151
140
|
- geocerts.gemspec
|
@@ -218,41 +207,31 @@ files:
|
|
218
207
|
- test/units/order/renewal_information_test.rb
|
219
208
|
- test/units/order_test.rb
|
220
209
|
- test/units/product_test.rb
|
221
|
-
has_rdoc: true
|
222
210
|
homepage: http://www.geocerts.com/
|
223
211
|
licenses: []
|
224
|
-
|
225
212
|
post_install_message:
|
226
213
|
rdoc_options: []
|
227
|
-
|
228
|
-
require_paths:
|
214
|
+
require_paths:
|
229
215
|
- lib
|
230
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
216
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
231
217
|
none: false
|
232
|
-
requirements:
|
233
|
-
- -
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
|
236
|
-
|
237
|
-
- 0
|
238
|
-
version: "0"
|
239
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
223
|
none: false
|
241
|
-
requirements:
|
242
|
-
- -
|
243
|
-
- !ruby/object:Gem::Version
|
244
|
-
|
245
|
-
segments:
|
246
|
-
- 0
|
247
|
-
version: "0"
|
224
|
+
requirements:
|
225
|
+
- - ! '>='
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '0'
|
248
228
|
requirements: []
|
249
|
-
|
250
|
-
|
251
|
-
rubygems_version: 1.3.7
|
229
|
+
rubyforge_project:
|
230
|
+
rubygems_version: 1.8.23
|
252
231
|
signing_key:
|
253
232
|
specification_version: 3
|
254
233
|
summary: A Ruby library for interfacing with the GeoCerts REST API
|
255
|
-
test_files:
|
234
|
+
test_files:
|
256
235
|
- test/config/initializers/_remote_tests.rb
|
257
236
|
- test/config/initializers/geocerts.rb
|
258
237
|
- test/config/initializers/responses.rb
|
data/.document
DELETED
data/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
geocerts (1.0.0)
|
5
|
-
libxml-ruby (~> 1.1.0)
|
6
|
-
relax (~> 0.1.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: http://rubygems.org/
|
10
|
-
specs:
|
11
|
-
factory_girl (1.3.3)
|
12
|
-
fakeweb (1.3.0)
|
13
|
-
libxml-ruby (1.1.4)
|
14
|
-
mocha (0.9.10)
|
15
|
-
rake
|
16
|
-
nokogiri (1.3.3)
|
17
|
-
rake (0.8.7)
|
18
|
-
relax (0.1.3)
|
19
|
-
relief (~> 0.0.4)
|
20
|
-
rest-client (~> 0.9.2)
|
21
|
-
relief (0.0.5)
|
22
|
-
nokogiri (~> 1.3.3)
|
23
|
-
rest-client (0.9.2)
|
24
|
-
shoulda (2.11.3)
|
25
|
-
vcr (1.5.0)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
ruby
|
29
|
-
|
30
|
-
DEPENDENCIES
|
31
|
-
factory_girl (~> 1.3.0)
|
32
|
-
fakeweb (~> 1.3.0)
|
33
|
-
geocerts!
|
34
|
-
libxml-ruby (~> 1.1.0)
|
35
|
-
mocha (~> 0.9.0)
|
36
|
-
relax (~> 0.1.0)
|
37
|
-
shoulda (~> 2.11.0)
|
38
|
-
vcr (~> 1.5.0)
|
data/README.rdoc
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
= GeoCerts
|
2
|
-
|
3
|
-
The GeoCerts library provides a Ruby interface to the GeoCerts REST API. This API allows
|
4
|
-
you to manage (lookup, create, and verify) your GeoCerts orders, events, certificates, and
|
5
|
-
more.
|
6
|
-
|
7
|
-
== Simple example
|
8
|
-
|
9
|
-
require 'geocerts'
|
10
|
-
|
11
|
-
GeoCerts.partner_id = 'example'
|
12
|
-
GeoCerts.api_token = 'abd123DEfg.....'
|
13
|
-
|
14
|
-
begin
|
15
|
-
GeoCerts::Order.all # => [ GeoCerts::Order, GeoCerts::Order, ... ]
|
16
|
-
GeoCerts::Order.find(12345).certificate # => GeoCerts::Certificate
|
17
|
-
GeoCerts::Product.all # => [ GeoCerts::Product, GeoCerts::Product, ... ]
|
18
|
-
|
19
|
-
product = GeoCerts::Product.find('Q')
|
20
|
-
product.user_agreement # => GeoCerts::Agreement
|
21
|
-
puts product.user_agreement.text # => "...."
|
22
|
-
|
23
|
-
# Validate the requested order details
|
24
|
-
validated_order = GeoCerts::Order.validate({
|
25
|
-
:csr => GeoCerts::CSR.new(:body => "-----BEGIN CERTIFICATE REQUEST-----\n...."),
|
26
|
-
:product => product
|
27
|
-
})
|
28
|
-
validated_order.renewal_information.indicator # => true
|
29
|
-
validated_order.renewal_information.months # => 1
|
30
|
-
validated_order.csr.common_name # => 'www.example.com'
|
31
|
-
validated_order.csr.state # => 'Georgia'
|
32
|
-
validated_order.total_price # => 99.00
|
33
|
-
|
34
|
-
# Create a new Order
|
35
|
-
order = GeoCerts::Order.new({
|
36
|
-
:csr => GeoCerts::CSR.new(:body => "-----BEGIN CERTIFICATE REQUEST-----\n...."),
|
37
|
-
:product => product,
|
38
|
-
:years => 3,
|
39
|
-
:licenses => 1
|
40
|
-
}).save
|
41
|
-
|
42
|
-
rescue GeoCerts::Exception
|
43
|
-
puts $!.to_s
|
44
|
-
end
|
45
|
-
|
46
|
-
== Exceptions
|
47
|
-
|
48
|
-
Since this library does interface with an external system, there is a much greater risk of
|
49
|
-
exceptional situations. As such, this library attempts to wrap all raised exceptions (due
|
50
|
-
to authorization, connection, or other unforeseen issues) in the GeoCerts::Exception object.
|
51
|
-
All exceptions raised from within this library should inherit from this class.
|
52
|
-
|
53
|
-
Exceptions which are raised after successful connections, due to server or request issues,
|
54
|
-
will be derived from GeoCerts::ExceptionWithResponse. This object also inherits from
|
55
|
-
GeoCerts::Exception, but contains the actual response details (including HTTP status code,
|
56
|
-
headers, and response body).
|
57
|
-
|
58
|
-
== Note on Patches/Pull Requests
|
59
|
-
|
60
|
-
* Fork the project.
|
61
|
-
* Make your feature addition or bug fix.
|
62
|
-
* Add tests for it. This is important so I don't break it in a
|
63
|
-
future version unintentionally.
|
64
|
-
* Commit, do not mess with Rakefile, version, or history.
|
65
|
-
(if you want to have your own version, that is fine but
|
66
|
-
bump version in a commit by itself so it can be easily ignored when pulled)
|
67
|
-
* Send a pull request. Bonus points for topic branches.
|
68
|
-
|
69
|
-
== Copyright
|
70
|
-
|
71
|
-
Copyright (c) 2009 {GeoCerts Inc.}[http://www.geocerts.com/]. See LICENSE for details.
|