clavem 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Clavem::Exceptions
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -116,9 +116,9 @@
116
116
  </div>
117
117
 
118
118
  <div id="footer">
119
- Generated on Sun Jan 27 17:32:23 2013 by
119
+ Generated on Fri Feb 8 11:54:02 2013 by
120
120
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
121
- 0.8.3 (ruby-1.9.3).
121
+ 0.8.4.1 (ruby-1.9.3).
122
122
  </div>
123
123
 
124
124
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Clavem::Exceptions::AuthorizationDenied
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -124,9 +124,9 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Sun Jan 27 17:32:23 2013 by
127
+ Generated on Fri Feb 8 11:54:02 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
- 0.8.3 (ruby-1.9.3).
129
+ 0.8.4.1 (ruby-1.9.3).
130
130
  </div>
131
131
 
132
132
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Clavem::Exceptions::Failure
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -124,9 +124,9 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Sun Jan 27 17:32:23 2013 by
127
+ Generated on Fri Feb 8 11:54:02 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
- 0.8.3 (ruby-1.9.3).
129
+ 0.8.4.1 (ruby-1.9.3).
130
130
  </div>
131
131
 
132
132
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Exception: Clavem::Exceptions::Timeout
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -124,9 +124,9 @@
124
124
  </div>
125
125
 
126
126
  <div id="footer">
127
- Generated on Sun Jan 27 17:32:23 2013 by
127
+ Generated on Fri Feb 8 11:54:02 2013 by
128
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
- 0.8.3 (ruby-1.9.3).
129
+ 0.8.4.1 (ruby-1.9.3).
130
130
  </div>
131
131
 
132
132
  </body>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: Clavem::Version
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -134,7 +134,7 @@
134
134
 
135
135
  </div>
136
136
  </dt>
137
- <dd><pre class="code"><span class='int'>0</span></pre></dd>
137
+ <dd><pre class="code"><span class='int'>1</span></pre></dd>
138
138
 
139
139
  <dt id="PATCH-constant" class="">PATCH =
140
140
  <div class="docstring">
@@ -149,7 +149,7 @@
149
149
 
150
150
  </div>
151
151
  </dt>
152
- <dd><pre class="code"><span class='int'>3</span></pre></dd>
152
+ <dd><pre class="code"><span class='int'>0</span></pre></dd>
153
153
 
154
154
  <dt id="STRING-constant" class="">STRING =
155
155
  <div class="docstring">
@@ -180,9 +180,9 @@
180
180
  </div>
181
181
 
182
182
  <div id="footer">
183
- Generated on Sun Jan 27 17:32:23 2013 by
183
+ Generated on Fri Feb 8 11:54:02 2013 by
184
184
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
185
- 0.8.3 (ruby-1.9.3).
185
+ 0.8.4.1 (ruby-1.9.3).
186
186
  </div>
187
187
 
188
188
  </body>
data/doc/_index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
6
  <title>
7
- Documentation by YARD 0.8.3
7
+ Documentation by YARD 0.8.4.1
8
8
 
9
9
  </title>
10
10
 
@@ -56,7 +56,7 @@
56
56
 
57
57
  <iframe id="search_frame"></iframe>
58
58
 
59
- <div id="content"><h1 class="noborder title">Documentation by YARD 0.8.3</h1>
59
+ <div id="content"><h1 class="noborder title">Documentation by YARD 0.8.4.1</h1>
60
60
  <div id="listing">
61
61
  <h1 class="alphaindex">Alphabetic Index</h1>
62
62
 
@@ -183,9 +183,9 @@
183
183
  </div>
184
184
 
185
185
  <div id="footer">
186
- Generated on Sun Jan 27 17:32:23 2013 by
186
+ Generated on Fri Feb 8 11:54:02 2013 by
187
187
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
188
- 0.8.3 (ruby-1.9.3).
188
+ 0.8.4.1 (ruby-1.9.3).
189
189
  </div>
190
190
 
191
191
  </body>
data/doc/file.README.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -61,71 +61,72 @@
61
61
 
62
62
  <iframe id="search_frame"></iframe>
63
63
 
64
- <div id="content"><div id='filecontents'><h1>Introduction</h1>
64
+ <div id="content"><div id='filecontents'><h1 id="introduction">Introduction</h1>
65
65
 
66
- <p><a href="https://travis-ci.org/ShogunPanda/clavem"><img src="https://secure.travis-ci.org/ShogunPanda/clavem.png?branch=master" alt="Build Status"></a>
67
- <a href="https://gemnasium.com/ShogunPanda/clavem"><img src="https://gemnasium.com/ShogunPanda/clavem.png?travis" alt="Dependency Status"></a>
68
- <a href="https://codeclimate.com/github/ShogunPanda/clavem"><img src="https://codeclimate.com/badge.png" alt="Code Climate"></a></p>
66
+ <p><a href="https://travis-ci.org/ShogunPanda/clavem"><img src="https://secure.travis-ci.org/ShogunPanda/clavem.png?branch=master" alt="Build Status" /></a>
67
+ <a href="https://gemnasium.com/ShogunPanda/clavem"><img src="https://gemnasium.com/ShogunPanda/clavem.png?travis" alt="Dependency Status" /></a>
68
+ <a href="https://codeclimate.com/github/ShogunPanda/clavem"><img src="https://codeclimate.com/badge.png" alt="Code Climate" /></a></p>
69
69
 
70
70
  <p>A local callback server for oAuth web-flow.</p>
71
71
 
72
- <p><a href="http://sw.cow.tc/clavem">http://sw.cow.tc/clavem</a></p>
72
+ <p>http://sw.cow.tc/clavem</p>
73
73
 
74
- <p><a href="http://rdoc.info/gems/clavem">http://rdoc.info/gems/clavem</a></p>
74
+ <p>http://rdoc.info/gems/clavem</p>
75
75
 
76
- <h2>Usage</h2>
76
+ <h2 id="usage">Usage</h2>
77
77
 
78
78
  <p>clavem allows you to handle a full oAuth authentication flow directly from the console.</p>
79
79
 
80
80
  <p>Simply instantiate the authorizer and run the authorize method with the URL:</p>
81
81
 
82
- <pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>clavem</span><span class='tstring_end'>&quot;</span></span>
82
+ <p>```
83
+ require &#8220;clavem&#8221;</p>
83
84
 
84
- <span class='comment'># Initalize your oAuth access.
85
- </span>
86
- <span class='id identifier rubyid_authorizer'>authorizer</span> <span class='op'>=</span> <span class='const'>Clavem</span><span class='op'>::</span><span class='const'>Authorizer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
85
+ <h1 id="initalize-your-oauth-access">Initalize your oAuth access.</h1>
87
86
 
88
- <span class='comment'># Get your authorization URL and append the callback.
89
- </span>
90
- <span class='id identifier rubyid_url'>url</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>?oauth_callback=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_callback_url'>callback_url</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
91
- <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_authorize'>authorize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
87
+ <p>authorizer = Clavem::Authorizer.new</p>
92
88
 
93
- <span class='kw'>if</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>==</span> <span class='symbol'>:succeded</span> <span class='kw'>then</span>
94
- <span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span>
89
+ <h1 id="get-your-authorization-url-and-append-the-callback">Get your authorization URL and append the callback.</h1>
95
90
 
96
- <span class='comment'># Go on!
97
- </span><span class='kw'>else</span>
98
- <span class='comment'># Authorization denied
99
- </span><span class='kw'>end</span>
100
- </code></pre>
91
+ <p>url += &#8220;?oauth_callback=#authorizerauthorizer.callback_url&#8221;
92
+ authorizer.authorize(url)</p>
93
+
94
+ <p>if authorizer.status == :succeded then
95
+ access_token = authorizer.token</p>
96
+
97
+ <p># Go on!
98
+ else
99
+ # Authorization denied
100
+ end
101
+ ```</p>
101
102
 
102
103
  <p>Alternatively, you can also specify a timeout and a block to the constructor to customizer the response handling.</p>
103
104
 
104
105
  <p>See the <a href="http://rdoc.info/gems/clavem">documentation</a> for more information.</p>
105
106
 
106
- <h2>Contributing to clavem</h2>
107
+ <h2 id="contributing-to-clavem">Contributing to clavem</h2>
107
108
 
108
109
  <ul>
109
- <li>Check out the latest master to make sure the feature hasn&#39;t been implemented or the bug hasn&#39;t been fixed yet.</li>
110
- <li>Check out the issue tracker to make sure someone already hasn&#39;t requested it and/or contributed it.</li>
111
- <li>Fork the project.</li>
112
- <li>Start a feature/bugfix branch.</li>
113
- <li>Commit and push until you are happy with your contribution.</li>
114
- <li>Make sure to add tests for it. This is important so I don&#39;t break it in a future version unintentionally.</li>
115
- <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
110
+ <li>Check out the latest master to make sure the feature hasn&#8217;t been implemented or the bug hasn&#8217;t been fixed yet.</li>
111
+ <li>Check out the issue tracker to make sure someone already hasn&#8217;t requested it and/or contributed it.</li>
112
+ <li>Fork the project.</li>
113
+ <li>Start a feature/bugfix branch.</li>
114
+ <li>Commit and push until you are happy with your contribution.</li>
115
+ <li>Make sure to add tests for it. This is important so I don&#8217;t break it in a future version unintentionally.</li>
116
+ <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
116
117
  </ul>
117
118
 
118
- <h2>Copyright</h2>
119
+ <h2 id="copyright">Copyright</h2>
119
120
 
120
- <p>Copyright (C) 2013 and above Shogun (<a href="mailto:shogun_panda@me.com">shogun_panda@me.com</a>).</p>
121
+ <p>Copyright (C) 2013 and above Shogun (shogun_panda@me.com).</p>
121
122
 
122
- <p>Licensed under the MIT license, which can be found at <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.</p>
123
+ <p>Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.</p>
123
124
  </div></div>
124
125
 
125
126
  <div id="footer">
126
- Generated on Sun Jan 27 17:32:23 2013 by
127
+ Generated on Fri Feb 8 11:54:02 2013 by
127
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
- 0.8.3 (ruby-1.9.3).
129
+ 0.8.4.1 (ruby-1.9.3).
129
130
  </div>
130
131
 
131
132
  </body>
data/doc/frames.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
6
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
- <title>Documentation by YARD 0.8.3</title>
7
+ <title>Documentation by YARD 0.8.4.1</title>
8
8
  </head>
9
9
  <script type="text/javascript" charset="utf-8">
10
10
  window.onload = function() {
data/doc/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.8.3
9
+ &mdash; Documentation by YARD 0.8.4.1
10
10
 
11
11
  </title>
12
12
 
@@ -61,71 +61,72 @@
61
61
 
62
62
  <iframe id="search_frame"></iframe>
63
63
 
64
- <div id="content"><div id='filecontents'><h1>Introduction</h1>
64
+ <div id="content"><div id='filecontents'><h1 id="introduction">Introduction</h1>
65
65
 
66
- <p><a href="https://travis-ci.org/ShogunPanda/clavem"><img src="https://secure.travis-ci.org/ShogunPanda/clavem.png?branch=master" alt="Build Status"></a>
67
- <a href="https://gemnasium.com/ShogunPanda/clavem"><img src="https://gemnasium.com/ShogunPanda/clavem.png?travis" alt="Dependency Status"></a>
68
- <a href="https://codeclimate.com/github/ShogunPanda/clavem"><img src="https://codeclimate.com/badge.png" alt="Code Climate"></a></p>
66
+ <p><a href="https://travis-ci.org/ShogunPanda/clavem"><img src="https://secure.travis-ci.org/ShogunPanda/clavem.png?branch=master" alt="Build Status" /></a>
67
+ <a href="https://gemnasium.com/ShogunPanda/clavem"><img src="https://gemnasium.com/ShogunPanda/clavem.png?travis" alt="Dependency Status" /></a>
68
+ <a href="https://codeclimate.com/github/ShogunPanda/clavem"><img src="https://codeclimate.com/badge.png" alt="Code Climate" /></a></p>
69
69
 
70
70
  <p>A local callback server for oAuth web-flow.</p>
71
71
 
72
- <p><a href="http://sw.cow.tc/clavem">http://sw.cow.tc/clavem</a></p>
72
+ <p>http://sw.cow.tc/clavem</p>
73
73
 
74
- <p><a href="http://rdoc.info/gems/clavem">http://rdoc.info/gems/clavem</a></p>
74
+ <p>http://rdoc.info/gems/clavem</p>
75
75
 
76
- <h2>Usage</h2>
76
+ <h2 id="usage">Usage</h2>
77
77
 
78
78
  <p>clavem allows you to handle a full oAuth authentication flow directly from the console.</p>
79
79
 
80
80
  <p>Simply instantiate the authorizer and run the authorize method with the URL:</p>
81
81
 
82
- <pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>clavem</span><span class='tstring_end'>&quot;</span></span>
82
+ <p>```
83
+ require &#8220;clavem&#8221;</p>
83
84
 
84
- <span class='comment'># Initalize your oAuth access.
85
- </span>
86
- <span class='id identifier rubyid_authorizer'>authorizer</span> <span class='op'>=</span> <span class='const'>Clavem</span><span class='op'>::</span><span class='const'>Authorizer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
85
+ <h1 id="initalize-your-oauth-access">Initalize your oAuth access.</h1>
87
86
 
88
- <span class='comment'># Get your authorization URL and append the callback.
89
- </span>
90
- <span class='id identifier rubyid_url'>url</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>?oauth_callback=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_callback_url'>callback_url</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
91
- <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_authorize'>authorize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
87
+ <p>authorizer = Clavem::Authorizer.new</p>
92
88
 
93
- <span class='kw'>if</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>==</span> <span class='symbol'>:succeded</span> <span class='kw'>then</span>
94
- <span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span>
89
+ <h1 id="get-your-authorization-url-and-append-the-callback">Get your authorization URL and append the callback.</h1>
95
90
 
96
- <span class='comment'># Go on!
97
- </span><span class='kw'>else</span>
98
- <span class='comment'># Authorization denied
99
- </span><span class='kw'>end</span>
100
- </code></pre>
91
+ <p>url += &#8220;?oauth_callback=#authorizerauthorizer.callback_url&#8221;
92
+ authorizer.authorize(url)</p>
93
+
94
+ <p>if authorizer.status == :succeded then
95
+ access_token = authorizer.token</p>
96
+
97
+ <p># Go on!
98
+ else
99
+ # Authorization denied
100
+ end
101
+ ```</p>
101
102
 
102
103
  <p>Alternatively, you can also specify a timeout and a block to the constructor to customizer the response handling.</p>
103
104
 
104
105
  <p>See the <a href="http://rdoc.info/gems/clavem">documentation</a> for more information.</p>
105
106
 
106
- <h2>Contributing to clavem</h2>
107
+ <h2 id="contributing-to-clavem">Contributing to clavem</h2>
107
108
 
108
109
  <ul>
109
- <li>Check out the latest master to make sure the feature hasn&#39;t been implemented or the bug hasn&#39;t been fixed yet.</li>
110
- <li>Check out the issue tracker to make sure someone already hasn&#39;t requested it and/or contributed it.</li>
111
- <li>Fork the project.</li>
112
- <li>Start a feature/bugfix branch.</li>
113
- <li>Commit and push until you are happy with your contribution.</li>
114
- <li>Make sure to add tests for it. This is important so I don&#39;t break it in a future version unintentionally.</li>
115
- <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
110
+ <li>Check out the latest master to make sure the feature hasn&#8217;t been implemented or the bug hasn&#8217;t been fixed yet.</li>
111
+ <li>Check out the issue tracker to make sure someone already hasn&#8217;t requested it and/or contributed it.</li>
112
+ <li>Fork the project.</li>
113
+ <li>Start a feature/bugfix branch.</li>
114
+ <li>Commit and push until you are happy with your contribution.</li>
115
+ <li>Make sure to add tests for it. This is important so I don&#8217;t break it in a future version unintentionally.</li>
116
+ <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
116
117
  </ul>
117
118
 
118
- <h2>Copyright</h2>
119
+ <h2 id="copyright">Copyright</h2>
119
120
 
120
- <p>Copyright (C) 2013 and above Shogun (<a href="mailto:shogun_panda@me.com">shogun_panda@me.com</a>).</p>
121
+ <p>Copyright (C) 2013 and above Shogun (shogun_panda@me.com).</p>
121
122
 
122
- <p>Licensed under the MIT license, which can be found at <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.</p>
123
+ <p>Licensed under the MIT license, which can be found at http://www.opensource.org/licenses/mit-license.php.</p>
123
124
  </div></div>
124
125
 
125
126
  <div id="footer">
126
- Generated on Sun Jan 27 17:32:23 2013 by
127
+ Generated on Fri Feb 8 11:54:02 2013 by
127
128
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
- 0.8.3 (ruby-1.9.3).
129
+ 0.8.4.1 (ruby-1.9.3).
129
130
  </div>
130
131
 
131
132
  </body>
@@ -0,0 +1,133 @@
1
+
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII" />
7
+ <title>
8
+ File: README
9
+
10
+ &mdash; Documentation by YARD 0.8.3
11
+
12
+ </title>
13
+
14
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
15
+
16
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
17
+
18
+ <script type="text/javascript" charset="utf-8">
19
+ hasFrames = window.top.frames.main ? true : false;
20
+ relpath = '';
21
+ framesUrl = "frames.html#!" + escape(window.location.href);
22
+ </script>
23
+
24
+
25
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
26
+
27
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
28
+
29
+
30
+ </head>
31
+ <body>
32
+ <div id="header">
33
+ <div id="menu">
34
+
35
+ <a href="_index.html">Index</a> &raquo;
36
+ <span class="title">File: README</span>
37
+
38
+
39
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
40
+ </div>
41
+
42
+ <div id="search">
43
+
44
+ <a class="full_list_link" id="class_list_link"
45
+ href="class_list.html">
46
+ Class List
47
+ </a>
48
+
49
+ <a class="full_list_link" id="method_list_link"
50
+ href="method_list.html">
51
+ Method List
52
+ </a>
53
+
54
+ <a class="full_list_link" id="file_list_link"
55
+ href="file_list.html">
56
+ File List
57
+ </a>
58
+
59
+ </div>
60
+ <div class="clear"></div>
61
+ </div>
62
+
63
+ <iframe id="search_frame"></iframe>
64
+
65
+ <div id="content"><div id='filecontents'><h1>Introduction</h1>
66
+
67
+ <p><a href="https://travis-ci.org/ShogunPanda/clavem"><img src="https://secure.travis-ci.org/ShogunPanda/clavem.png?branch=master" alt="Build Status"></a>
68
+ <a href="https://gemnasium.com/ShogunPanda/clavem"><img src="https://gemnasium.com/ShogunPanda/clavem.png?travis" alt="Dependency Status"></a>
69
+ <a href="https://codeclimate.com/github/ShogunPanda/clavem"><img src="https://codeclimate.com/badge.png" alt="Code Climate"></a></p>
70
+
71
+ <p>A local callback server for oAuth web-flow.</p>
72
+
73
+ <p><a href="http://sw.cow.tc/clavem">http://sw.cow.tc/clavem</a></p>
74
+
75
+ <p><a href="http://rdoc.info/gems/clavem">http://rdoc.info/gems/clavem</a></p>
76
+
77
+ <h2>Usage</h2>
78
+
79
+ <p>clavem allows you to handle a full oAuth authentication flow directly from the console.</p>
80
+
81
+ <p>Simply instantiate the authorizer and run the authorize method with the URL:</p>
82
+
83
+ <pre class="code ruby"><code><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>clavem</span><span class='tstring_end'>&quot;</span></span>
84
+
85
+ <span class='comment'># Initalize your oAuth access.
86
+ </span>
87
+ <span class='id identifier rubyid_authorizer'>authorizer</span> <span class='op'>=</span> <span class='const'>Clavem</span><span class='op'>::</span><span class='const'>Authorizer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
88
+
89
+ <span class='comment'># Get your authorization URL and append the callback.
90
+ </span>
91
+ <span class='id identifier rubyid_url'>url</span> <span class='op'>+=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>?oauth_callback=</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_callback_url'>callback_url</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
92
+ <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_authorize'>authorize</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
93
+
94
+ <span class='kw'>if</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_status'>status</span> <span class='op'>==</span> <span class='symbol'>:succeded</span> <span class='kw'>then</span>
95
+ <span class='id identifier rubyid_access_token'>access_token</span> <span class='op'>=</span> <span class='id identifier rubyid_authorizer'>authorizer</span><span class='period'>.</span><span class='id identifier rubyid_token'>token</span>
96
+
97
+ <span class='comment'># Go on!
98
+ </span><span class='kw'>else</span>
99
+ <span class='comment'># Authorization denied
100
+ </span><span class='kw'>end</span>
101
+ </code></pre>
102
+
103
+ <p>Alternatively, you can also specify a timeout and a block to the constructor to customizer the response handling.</p>
104
+
105
+ <p>See the <a href="http://rdoc.info/gems/clavem">documentation</a> for more information.</p>
106
+
107
+ <h2>Contributing to clavem</h2>
108
+
109
+ <ul>
110
+ <li>Check out the latest master to make sure the feature hasn&#39;t been implemented or the bug hasn&#39;t been fixed yet.</li>
111
+ <li>Check out the issue tracker to make sure someone already hasn&#39;t requested it and/or contributed it.</li>
112
+ <li>Fork the project.</li>
113
+ <li>Start a feature/bugfix branch.</li>
114
+ <li>Commit and push until you are happy with your contribution.</li>
115
+ <li>Make sure to add tests for it. This is important so I don&#39;t break it in a future version unintentionally.</li>
116
+ <li>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</li>
117
+ </ul>
118
+
119
+ <h2>Copyright</h2>
120
+
121
+ <p>Copyright (C) 2013 and above Shogun (<a href="mailto:shogun_panda@me.com">shogun_panda@me.com</a>).</p>
122
+
123
+ <p>Licensed under the MIT license, which can be found at <a href="http://www.opensource.org/licenses/mit-license.php">http://www.opensource.org/licenses/mit-license.php</a>.</p>
124
+ </div></div>
125
+
126
+ <div id="footer">
127
+ Generated on Sun Jan 27 14:14:59 2013 by
128
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
129
+ 0.8.3 (ruby-1.9.3).
130
+ </div>
131
+
132
+ </body>
133
+ </html>