bcx 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -7
  3. data/docs/docco.css +10 -4
  4. data/docs/{bcx.html → lib/bcx.html} +37 -22
  5. data/docs/{http.html → lib/bcx/client/http.html} +32 -22
  6. data/docs/{oauth.html → lib/bcx/client/oauth.html} +33 -23
  7. data/docs/{configuration.html → lib/bcx/configuration.html} +7 -7
  8. data/docs/lib/bcx/launchpad/oauth.html +137 -0
  9. data/docs/{access.html → lib/bcx/resources/access.html} +31 -21
  10. data/docs/lib/bcx/resources/authorization.html +140 -0
  11. data/docs/{person.html → lib/bcx/resources/person.html} +31 -21
  12. data/docs/{project.html → lib/bcx/resources/project.html} +32 -22
  13. data/docs/{todo.html → lib/bcx/resources/todo.html} +33 -23
  14. data/docs/{todolist.html → lib/bcx/resources/todolist.html} +34 -24
  15. data/docs/{response_error.html → lib/bcx/response_error.html} +14 -14
  16. data/docs/{version.html → lib/bcx/version.html} +5 -5
  17. data/docs/public/fonts/aller-bold.eot +0 -0
  18. data/docs/public/fonts/aller-bold.ttf +0 -0
  19. data/docs/public/fonts/aller-bold.woff +0 -0
  20. data/docs/public/fonts/aller-light.eot +0 -0
  21. data/docs/public/fonts/aller-light.ttf +0 -0
  22. data/docs/public/fonts/aller-light.woff +0 -0
  23. data/docs/public/fonts/novecento-bold.eot +0 -0
  24. data/docs/public/fonts/novecento-bold.ttf +0 -0
  25. data/docs/public/fonts/novecento-bold.woff +0 -0
  26. data/lib/bcx.rb +5 -0
  27. data/lib/bcx/client/oauth.rb +1 -1
  28. data/lib/bcx/launchpad/oauth.rb +22 -0
  29. data/lib/bcx/resources/authorization.rb +16 -0
  30. data/lib/bcx/version.rb +1 -1
  31. data/spec/bcx/authorization_spec.rb +13 -0
  32. data/spec/bcx/launchpad_spec.rb +16 -0
  33. data/spec/cassettes/Bcx_Resources_Authorization/GET_/authorization/first_account_should_have_the_correct_id.yml +52 -0
  34. metadata +34 -25
  35. data/docs/collection.html +0 -103
@@ -5,7 +5,7 @@
5
5
  <title>configuration.rb</title>
6
6
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
7
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
- <link rel="stylesheet" media="all" href="docco.css" />
8
+ <link rel="stylesheet" media="all" href="../../docco.css" />
9
9
  </head>
10
10
  <body>
11
11
  <div id="container">
@@ -20,17 +20,17 @@
20
20
 
21
21
 
22
22
  <a class="source" href="configuration.html">
23
- configuration.rb
23
+ lib/bcx/configuration.rb
24
24
  </a>
25
25
 
26
26
 
27
27
  <a class="source" href="response_error.html">
28
- response_error.rb
28
+ lib/bcx/response_error.rb
29
29
  </a>
30
30
 
31
31
 
32
32
  <a class="source" href="version.html">
33
- version.rb
33
+ lib/bcx/version.rb
34
34
  </a>
35
35
 
36
36
  </div>
@@ -56,9 +56,9 @@
56
56
  <h2>Configuration</h2>
57
57
  <p>Provides a configuration block for setting up the Bcx client</p>
58
58
  <p>Example:</p>
59
- <pre><code>Bcx.configure do |config|
60
- config.account = &#39;1234567890&#39;
61
- end</code></pre>
59
+ <pre><code><span class="constant">Bcx</span>.configure <span class="keyword">do</span> |config|
60
+ config.account = <span class="string">'1234567890'</span>
61
+ <span class="keyword">end</span></code></pre>
62
62
 
63
63
  </div>
64
64
 
@@ -0,0 +1,137 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>oauth.rb</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
+ <link rel="stylesheet" media="all" href="../../../docco.css" />
9
+ </head>
10
+ <body>
11
+ <div id="container">
12
+ <div id="background"></div>
13
+
14
+ <ul id="jump_to">
15
+ <li>
16
+ <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
17
+ <a class="small" href="javascript:void(0);">+</a>
18
+ <div id="jump_wrapper">
19
+ <div id="jump_page">
20
+
21
+
22
+ <a class="source" href="../../bcx.html">
23
+ lib/bcx.rb
24
+ </a>
25
+
26
+
27
+ <a class="source" href="../client/http.html">
28
+ lib/bcx/client/http.rb
29
+ </a>
30
+
31
+
32
+ <a class="source" href="../client/oauth.html">
33
+ lib/bcx/client/oauth.rb
34
+ </a>
35
+
36
+
37
+ <a class="source" href="../configuration.html">
38
+ lib/bcx/configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="oauth.html">
43
+ lib/bcx/launchpad/oauth.rb
44
+ </a>
45
+
46
+
47
+ <a class="source" href="../resources/access.html">
48
+ lib/bcx/resources/access.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="../resources/authorization.html">
53
+ lib/bcx/resources/authorization.rb
54
+ </a>
55
+
56
+
57
+ <a class="source" href="../resources/person.html">
58
+ lib/bcx/resources/person.rb
59
+ </a>
60
+
61
+
62
+ <a class="source" href="../resources/project.html">
63
+ lib/bcx/resources/project.rb
64
+ </a>
65
+
66
+
67
+ <a class="source" href="../resources/todo.html">
68
+ lib/bcx/resources/todo.rb
69
+ </a>
70
+
71
+
72
+ <a class="source" href="../resources/todolist.html">
73
+ lib/bcx/resources/todolist.rb
74
+ </a>
75
+
76
+
77
+ <a class="source" href="../response_error.html">
78
+ lib/bcx/response_error.rb
79
+ </a>
80
+
81
+
82
+ <a class="source" href="../version.html">
83
+ lib/bcx/version.rb
84
+ </a>
85
+
86
+ </div>
87
+ </li>
88
+ </ul>
89
+
90
+ <ul class="sections">
91
+
92
+ <li id="title">
93
+ <div class="annotation">
94
+ <h1>oauth.rb</h1>
95
+ </div>
96
+ </li>
97
+
98
+
99
+
100
+ <li id="section-1">
101
+ <div class="annotation">
102
+
103
+ <div class="pilwrap ">
104
+ <a class="pilcrow" href="#section-1">&#182;</a>
105
+ </div>
106
+
107
+ </div>
108
+
109
+ <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
110
+ <span class="class"><span class="keyword">module</span> <span class="title">Launchpad</span></span>
111
+ <span class="class"><span class="keyword">class</span> <span class="title">OAuth</span> <span class="inheritance">&lt; <span class="parent">Rapidash::Client</span></span></span>
112
+ method <span class="symbol">:oauth</span>
113
+
114
+ extension <span class="symbol">:json</span>
115
+ encode_request_with <span class="symbol">:json</span>
116
+
117
+ raise_errors
118
+
119
+ resource <span class="symbol">:authorization</span>, <span class="symbol">class_name:</span> <span class="string">"Bcx::Resources::Authorization"</span>
120
+
121
+ <span class="function"><span class="keyword">def</span> <span class="title">initialize</span><span class="params">(options = {})</span></span>
122
+ options[<span class="symbol">:site</span>] ||= <span class="string">"https://launchpad.37signals.com"</span>
123
+ options[<span class="symbol">:uid</span>] ||= options[<span class="symbol">:client_id</span>]
124
+ options[<span class="symbol">:secret</span>] ||= options[<span class="symbol">:client_secret</span>]
125
+
126
+ <span class="keyword">super</span>(options)
127
+ <span class="keyword">end</span>
128
+ <span class="keyword">end</span>
129
+ <span class="keyword">end</span>
130
+ <span class="keyword">end</span></pre></div></div>
131
+
132
+ </li>
133
+
134
+ </ul>
135
+ </div>
136
+ </body>
137
+ </html>
@@ -5,7 +5,7 @@
5
5
  <title>access.rb</title>
6
6
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
7
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
- <link rel="stylesheet" media="all" href="docco.css" />
8
+ <link rel="stylesheet" media="all" href="../../../docco.css" />
9
9
  </head>
10
10
  <body>
11
11
  <div id="container">
@@ -19,58 +19,68 @@
19
19
  <div id="jump_page">
20
20
 
21
21
 
22
- <a class="source" href="bcx.html">
23
- bcx.rb
22
+ <a class="source" href="../../bcx.html">
23
+ lib/bcx.rb
24
24
  </a>
25
25
 
26
26
 
27
- <a class="source" href="http.html">
28
- http.rb
27
+ <a class="source" href="../client/http.html">
28
+ lib/bcx/client/http.rb
29
29
  </a>
30
30
 
31
31
 
32
- <a class="source" href="oauth.html">
33
- oauth.rb
32
+ <a class="source" href="../client/oauth.html">
33
+ lib/bcx/client/oauth.rb
34
34
  </a>
35
35
 
36
36
 
37
- <a class="source" href="configuration.html">
38
- configuration.rb
37
+ <a class="source" href="../configuration.html">
38
+ lib/bcx/configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="../launchpad/oauth.html">
43
+ lib/bcx/launchpad/oauth.rb
39
44
  </a>
40
45
 
41
46
 
42
47
  <a class="source" href="access.html">
43
- access.rb
48
+ lib/bcx/resources/access.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="authorization.html">
53
+ lib/bcx/resources/authorization.rb
44
54
  </a>
45
55
 
46
56
 
47
57
  <a class="source" href="person.html">
48
- person.rb
58
+ lib/bcx/resources/person.rb
49
59
  </a>
50
60
 
51
61
 
52
62
  <a class="source" href="project.html">
53
- project.rb
63
+ lib/bcx/resources/project.rb
54
64
  </a>
55
65
 
56
66
 
57
67
  <a class="source" href="todo.html">
58
- todo.rb
68
+ lib/bcx/resources/todo.rb
59
69
  </a>
60
70
 
61
71
 
62
72
  <a class="source" href="todolist.html">
63
- todolist.rb
73
+ lib/bcx/resources/todolist.rb
64
74
  </a>
65
75
 
66
76
 
67
- <a class="source" href="response_error.html">
68
- response_error.rb
77
+ <a class="source" href="../response_error.html">
78
+ lib/bcx/response_error.rb
69
79
  </a>
70
80
 
71
81
 
72
- <a class="source" href="version.html">
73
- version.rb
82
+ <a class="source" href="../version.html">
83
+ lib/bcx/version.rb
74
84
  </a>
75
85
 
76
86
  </div>
@@ -97,13 +107,13 @@
97
107
  <p>Provides access to accesses resource at per-project level</p>
98
108
  <h4>Get accesses for a project</h4>
99
109
  <p><code>GET /projects/1/accesses.json</code></p>
100
- <pre><code>client.projects(1).accesses!</code></pre>
110
+ <pre><code>client.projects(<span class="number">1</span>).accesses!</code></pre>
101
111
  <h4>Grant access</h4>
102
112
  <p><code>POST /projects/1/accesses.json</code></p>
103
- <pre><code>client.projects(1).accesses.create!(ids: [ 5, 6, 10])</code></pre>
113
+ <pre><code>client.projects(<span class="number">1</span>).accesses.create!(<span class="symbol">ids:</span> [ <span class="number">5</span>, <span class="number">6</span>, <span class="number">10</span>])</code></pre>
104
114
  <h4>Revoke access</h4>
105
115
  <p><code>DELETE /projects/1/accesses/1.json</code></p>
106
- <pre><code>client.projects(1).accesses(1).delete!</code></pre>
116
+ <pre><code>client.projects(<span class="number">1</span>).accesses(<span class="number">1</span>).delete!</code></pre>
107
117
 
108
118
  </div>
109
119
 
@@ -0,0 +1,140 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>authorization.rb</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
+ <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
+ <link rel="stylesheet" media="all" href="../../../docco.css" />
9
+ </head>
10
+ <body>
11
+ <div id="container">
12
+ <div id="background"></div>
13
+
14
+ <ul id="jump_to">
15
+ <li>
16
+ <a class="large" href="javascript:void(0);">Jump To &hellip;</a>
17
+ <a class="small" href="javascript:void(0);">+</a>
18
+ <div id="jump_wrapper">
19
+ <div id="jump_page">
20
+
21
+
22
+ <a class="source" href="../../bcx.html">
23
+ lib/bcx.rb
24
+ </a>
25
+
26
+
27
+ <a class="source" href="../client/http.html">
28
+ lib/bcx/client/http.rb
29
+ </a>
30
+
31
+
32
+ <a class="source" href="../client/oauth.html">
33
+ lib/bcx/client/oauth.rb
34
+ </a>
35
+
36
+
37
+ <a class="source" href="../configuration.html">
38
+ lib/bcx/configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="../launchpad/oauth.html">
43
+ lib/bcx/launchpad/oauth.rb
44
+ </a>
45
+
46
+
47
+ <a class="source" href="access.html">
48
+ lib/bcx/resources/access.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="authorization.html">
53
+ lib/bcx/resources/authorization.rb
54
+ </a>
55
+
56
+
57
+ <a class="source" href="person.html">
58
+ lib/bcx/resources/person.rb
59
+ </a>
60
+
61
+
62
+ <a class="source" href="project.html">
63
+ lib/bcx/resources/project.rb
64
+ </a>
65
+
66
+
67
+ <a class="source" href="todo.html">
68
+ lib/bcx/resources/todo.rb
69
+ </a>
70
+
71
+
72
+ <a class="source" href="todolist.html">
73
+ lib/bcx/resources/todolist.rb
74
+ </a>
75
+
76
+
77
+ <a class="source" href="../response_error.html">
78
+ lib/bcx/response_error.rb
79
+ </a>
80
+
81
+
82
+ <a class="source" href="../version.html">
83
+ lib/bcx/version.rb
84
+ </a>
85
+
86
+ </div>
87
+ </li>
88
+ </ul>
89
+
90
+ <ul class="sections">
91
+
92
+ <li id="title">
93
+ <div class="annotation">
94
+ <h1>authorization.rb</h1>
95
+ </div>
96
+ </li>
97
+
98
+
99
+
100
+ <li id="section-1">
101
+ <div class="annotation">
102
+
103
+ <div class="pilwrap ">
104
+ <a class="pilcrow" href="#section-1">&#182;</a>
105
+ </div>
106
+
107
+ </div>
108
+
109
+ <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
110
+ <span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span></pre></div></div>
111
+
112
+ </li>
113
+
114
+
115
+ <li id="section-2">
116
+ <div class="annotation">
117
+
118
+ <div class="pilwrap ">
119
+ <a class="pilcrow" href="#section-2">&#182;</a>
120
+ </div>
121
+ <p>Bcx::Resources::Authorization
122
+ Provides access to the authorization resource</p>
123
+ <p>Fetch authorization
124
+ GET /authorization.json</p>
125
+ <p> launchpad.authorization!</p>
126
+
127
+ </div>
128
+
129
+ <div class="content"><div class='highlight'><pre> <span class="class"><span class="keyword">class</span> <span class="title">Authorization</span> <span class="inheritance">&lt; <span class="parent">Rapidash::Base</span></span></span>
130
+ url <span class="symbol">:authorization</span>
131
+ <span class="keyword">end</span>
132
+ <span class="keyword">end</span>
133
+ <span class="keyword">end</span></pre></div></div>
134
+
135
+ </li>
136
+
137
+ </ul>
138
+ </div>
139
+ </body>
140
+ </html>
@@ -5,7 +5,7 @@
5
5
  <title>person.rb</title>
6
6
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7
7
  <meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
8
- <link rel="stylesheet" media="all" href="docco.css" />
8
+ <link rel="stylesheet" media="all" href="../../../docco.css" />
9
9
  </head>
10
10
  <body>
11
11
  <div id="container">
@@ -19,58 +19,68 @@
19
19
  <div id="jump_page">
20
20
 
21
21
 
22
- <a class="source" href="bcx.html">
23
- bcx.rb
22
+ <a class="source" href="../../bcx.html">
23
+ lib/bcx.rb
24
24
  </a>
25
25
 
26
26
 
27
- <a class="source" href="http.html">
28
- http.rb
27
+ <a class="source" href="../client/http.html">
28
+ lib/bcx/client/http.rb
29
29
  </a>
30
30
 
31
31
 
32
- <a class="source" href="oauth.html">
33
- oauth.rb
32
+ <a class="source" href="../client/oauth.html">
33
+ lib/bcx/client/oauth.rb
34
34
  </a>
35
35
 
36
36
 
37
- <a class="source" href="configuration.html">
38
- configuration.rb
37
+ <a class="source" href="../configuration.html">
38
+ lib/bcx/configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="../launchpad/oauth.html">
43
+ lib/bcx/launchpad/oauth.rb
39
44
  </a>
40
45
 
41
46
 
42
47
  <a class="source" href="access.html">
43
- access.rb
48
+ lib/bcx/resources/access.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="authorization.html">
53
+ lib/bcx/resources/authorization.rb
44
54
  </a>
45
55
 
46
56
 
47
57
  <a class="source" href="person.html">
48
- person.rb
58
+ lib/bcx/resources/person.rb
49
59
  </a>
50
60
 
51
61
 
52
62
  <a class="source" href="project.html">
53
- project.rb
63
+ lib/bcx/resources/project.rb
54
64
  </a>
55
65
 
56
66
 
57
67
  <a class="source" href="todo.html">
58
- todo.rb
68
+ lib/bcx/resources/todo.rb
59
69
  </a>
60
70
 
61
71
 
62
72
  <a class="source" href="todolist.html">
63
- todolist.rb
73
+ lib/bcx/resources/todolist.rb
64
74
  </a>
65
75
 
66
76
 
67
- <a class="source" href="response_error.html">
68
- response_error.rb
77
+ <a class="source" href="../response_error.html">
78
+ lib/bcx/response_error.rb
69
79
  </a>
70
80
 
71
81
 
72
- <a class="source" href="version.html">
73
- version.rb
82
+ <a class="source" href="../version.html">
83
+ lib/bcx/version.rb
74
84
  </a>
75
85
 
76
86
  </div>
@@ -100,16 +110,16 @@
100
110
  <pre><code>client.people!</code></pre>
101
111
  <h4>Get a person</h4>
102
112
  <p><code>GET /people/123.json</code></p>
103
- <pre><code>client.people!(123)</code></pre>
113
+ <pre><code>client.people!(<span class="number">123</span>)</code></pre>
104
114
  <h4>Get the current person</h4>
105
115
  <p><code>GET /people/me.json</code></p>
106
116
  <pre><code>client.people.me!</code></pre>
107
117
  <h4>Get assigned todos for a person</h4>
108
118
  <p><code>GET /people/1/assigned_todos.json</code></p>
109
- <pre><code>client.people(1).assigned_todos</code></pre>
119
+ <pre><code>client.people(<span class="number">1</span>).assigned_todos</code></pre>
110
120
  <h4>Delete a person</h4>
111
121
  <p><code>DELETE /people/123.json</code></p>
112
- <pre><code>client.people(123).delete!</code></pre>
122
+ <pre><code>client.people(<span class="number">123</span>).delete!</code></pre>
113
123
 
114
124
  </div>
115
125