legalizer 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +30 -1
- data/VERSION +1 -1
- data/legalizer.gemspec +2 -1
- data/lib/legalizer.rb +7 -2
- data/lib/legalizer/oauth.rb +23 -0
- metadata +4 -3
data/README.rdoc
CHANGED
@@ -17,7 +17,8 @@ Establish a connection:
|
|
17
17
|
:oauth_key => 'YOUR OAUTH KEY',
|
18
18
|
:oauth_secret => 'YOUR OAUTH SECRET',
|
19
19
|
:access_token => 'YOUR ACCESS TOKEN',
|
20
|
-
:access_secret => 'YOUR ACCESS SECRET'
|
20
|
+
:access_secret => 'YOUR ACCESS SECRET'
|
21
|
+
})
|
21
22
|
|
22
23
|
List all available templates:
|
23
24
|
|
@@ -49,6 +50,34 @@ Sending is simplified right now, but will be enhanced later. For now you can jus
|
|
49
50
|
|
50
51
|
* gem install leaglizer
|
51
52
|
|
53
|
+
== OAUTH
|
54
|
+
|
55
|
+
Getting this gem to work with OAuth is a little tricky right now, so I added a quick work around for the time being. When you get your API access from RightSignature, they will supply you with an OAuth Key and an OAuth Secret. You will need to generate your own Access Token and Access Secret. To do that, follow these steps:
|
56
|
+
|
57
|
+
In the console:
|
58
|
+
|
59
|
+
Legalizer({
|
60
|
+
:configure_oauth => true,
|
61
|
+
:oauth_key => 'YOUR OAUTH KEY',
|
62
|
+
:oauth_secret => 'YOUR OAUTH SECRET'
|
63
|
+
})
|
64
|
+
|
65
|
+
You will get this response:
|
66
|
+
|
67
|
+
Now visit: https://rightsignature.com/oauth/authorize?oauth_token=SOME_TOKEN
|
68
|
+
|
69
|
+
Visit that URL and grant your application access, you will be redirected to localhost, it doesn't matter if the page loads, just grab the oauth_verifier value from the URL string
|
70
|
+
|
71
|
+
Paste your oauth_verifier after the prompt and hit enter
|
72
|
+
|
73
|
+
What's the value of `oauth_verifier`?
|
74
|
+
|
75
|
+
Then you'll get this response, and you're ready to go:
|
76
|
+
|
77
|
+
Your access token is: YOUR ACCESS TOKEN
|
78
|
+
Your access secret is: YOUR ACCESS SECRET
|
79
|
+
Now you're ready to use these 2 values in your Legalizer configuration
|
80
|
+
|
52
81
|
== LICENSE:
|
53
82
|
|
54
83
|
Copyright (c) 2010 Darby Frey
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/legalizer.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{legalizer}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Darby Frey"]
|
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
"lib/legalizer/document/contract.rb",
|
33
33
|
"lib/legalizer/document/template.rb",
|
34
34
|
"lib/legalizer/find.rb",
|
35
|
+
"lib/legalizer/oauth.rb",
|
35
36
|
"script/console",
|
36
37
|
"script/destroy",
|
37
38
|
"script/generate",
|
data/lib/legalizer.rb
CHANGED
@@ -10,6 +10,7 @@ module Legalizer
|
|
10
10
|
end
|
11
11
|
|
12
12
|
require 'legalizer/base'
|
13
|
+
require 'legalizer/oauth'
|
13
14
|
require 'legalizer/config'
|
14
15
|
require 'legalizer/find'
|
15
16
|
require 'legalizer/document'
|
@@ -17,5 +18,9 @@ require 'legalizer/document/template'
|
|
17
18
|
require 'legalizer/document/contract'
|
18
19
|
|
19
20
|
def Legalizer(options={})
|
20
|
-
|
21
|
-
|
21
|
+
if options[:configure_oauth]
|
22
|
+
Legalizer::ConfigureOAuth.new(options)
|
23
|
+
else
|
24
|
+
Legalizer::Base.new(options)
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Legalizer
|
2
|
+
class ConfigureOAuth
|
3
|
+
def initialize(options={})
|
4
|
+
@connection = OAuth::Consumer.new(options[:oauth_key], options[:oauth_secret], {
|
5
|
+
:site => "https://rightsignature.com",
|
6
|
+
:scheme => :header,
|
7
|
+
:http_method => :post,
|
8
|
+
:request_token_path => "/oauth/request_token",
|
9
|
+
:access_token_path => "/oauth/access_token",
|
10
|
+
:authorize_path => "/oauth/authorize"
|
11
|
+
})
|
12
|
+
|
13
|
+
request_token = @connection.get_request_token(:oauth_callback => "http://localhost:3000/callback")
|
14
|
+
puts "Now visit:\n#{request_token.authorize_url}\n..."
|
15
|
+
puts "What's the value of `oauth_verifier`?"
|
16
|
+
oauth_verifier = gets.chomp
|
17
|
+
access_token = request_token.get_access_token(:oauth_verifier => oauth_verifier)
|
18
|
+
puts "Your access token is: #{access_token.token}\n"
|
19
|
+
puts "Your access secret is: #{access_token.secret}\n"
|
20
|
+
puts "Now you're ready to use these 2 values in your Legalizer configuration\n\n\n"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: legalizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darby Frey
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- lib/legalizer/document/contract.rb
|
136
136
|
- lib/legalizer/document/template.rb
|
137
137
|
- lib/legalizer/find.rb
|
138
|
+
- lib/legalizer/oauth.rb
|
138
139
|
- script/console
|
139
140
|
- script/destroy
|
140
141
|
- script/generate
|