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>project.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>
@@ -103,16 +113,16 @@
103
113
  <pre><code>clients.projects.archived!</code></pre>
104
114
  <h4>Fetch single project with ID of 123</h4>
105
115
  <p><code>GET /projects/123.json</code></p>
106
- <pre><code>client.projects!(123)</code></pre>
116
+ <pre><code>client.projects!(<span class="number">123</span>)</code></pre>
107
117
  <h4>Create a project</h4>
108
118
  <p><code>POST /projects.json</code></p>
109
- <pre><code>client.projects.create!(name: &#39;Acme project&#39;, description: &#39;This is a new project&#39;)</code></pre>
119
+ <pre><code>client.projects.create!(<span class="symbol">name:</span> <span class="string">'Acme project'</span>, <span class="symbol">description:</span> <span class="string">'This is a new project'</span>)</code></pre>
110
120
  <h4>Update an existing project</h4>
111
121
  <p><code>PUT /projects/123.json</code></p>
112
- <pre><code>client.projects(123).update!(description: &#39;A new description&#39;)</code></pre>
122
+ <pre><code>client.projects(<span class="number">123</span>).update!(<span class="symbol">description:</span> <span class="string">'A new description'</span>)</code></pre>
113
123
  <h4>Delete a project</h4>
114
124
  <p><code>DELETE /projects/123.json</code></p>
115
- <pre><code>client.projects(123).delete!</code></pre>
125
+ <pre><code>client.projects(<span class="number">123</span>).delete!</code></pre>
116
126
 
117
127
  </div>
118
128
 
@@ -5,7 +5,7 @@
5
5
  <title>todo.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,21 +107,21 @@
97
107
  <p>Provides access to todolist resoource both at the client level and per-project</p>
98
108
  <h4>Get todos for a todolist</h4>
99
109
  <p><code>GET /todolists/1.json</code></p>
100
- <pre><code>todolist = client.todolists!(1)
110
+ <pre><code>todolist = client.todolists!(<span class="number">1</span>)
101
111
  todolist.todos.remaining
102
112
  todolist.todos.completed</code></pre>
103
113
  <h4>Get a specific todo</h4>
104
114
  <p><code>GET /projects/1/todos/2.json</code></p>
105
- <pre><code>client.projects(1).todos!(2)</code></pre>
115
+ <pre><code>client.projects(<span class="number">1</span>).todos!(<span class="number">2</span>)</code></pre>
106
116
  <h4>Create a todo</h4>
107
117
  <p><code>POST /projects/1/todolists/2/todos.json</code></p>
108
- <pre><code>client.projects(1).todolists(2).todos.create!(content: &#39;Update copy text&#39;)</code></pre>
118
+ <pre><code>client.projects(<span class="number">1</span>).todolists(<span class="number">2</span>).todos.create!(<span class="symbol">content:</span> <span class="string">'Update copy text'</span>)</code></pre>
109
119
  <h4>Update a todo</h4>
110
120
  <p><code>PUT /projects/1/todos/2.json</code></p>
111
- <pre><code>client.projects(1).todos(2).update!(completed: true)</code></pre>
121
+ <pre><code>client.projects(<span class="number">1</span>).todos(<span class="number">2</span>).update!(<span class="symbol">completed:</span> <span class="keyword">true</span>)</code></pre>
112
122
  <h4>Delete a todo</h4>
113
123
  <p><code>DELETE /projects/1/todos/2.json</code></p>
114
- <pre><code>client.projects(1).todos(2).delete!</code></pre>
124
+ <pre><code>client.projects(<span class="number">1</span>).todos(<span class="number">2</span>).delete!</code></pre>
115
125
 
116
126
  </div>
117
127
 
@@ -5,7 +5,7 @@
5
5
  <title>todolist.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,10 +107,10 @@
97
107
  <p>Provides access to todolist resoource both at the client level and per-project</p>
98
108
  <h4>Get all todolists for a project</h4>
99
109
  <p><code>GET /projects/123/todolists.json</code></p>
100
- <pre><code>client.projects(123).todolists!</code></pre>
110
+ <pre><code>client.projects(<span class="number">123</span>).todolists!</code></pre>
101
111
  <h4>Get all completed todolists for a project</h4>
102
112
  <p><code>GET /projects/1/todolists/completed.json</code></p>
103
- <pre><code>client.projects(123).todolists.completed!</code></pre>
113
+ <pre><code>client.projects(<span class="number">123</span>).todolists.completed!</code></pre>
104
114
  <h4>Get todolists for all projects</h4>
105
115
  <p><code>GET /todolists.json</code></p>
106
116
  <pre><code>client.todolists!</code></pre>
@@ -109,16 +119,16 @@
109
119
  <pre><code>client.todolists.completed!</code></pre>
110
120
  <h4>Get specific todolist including the todos</h4>
111
121
  <p><code>GET /projects/123/todolists/456.json</code></p>
112
- <pre><code>client.projects(123).todolists!(456)</code></pre>
122
+ <pre><code>client.projects(<span class="number">123</span>).todolists!(<span class="number">456</span>)</code></pre>
113
123
  <h4>Create a new todolist</h4>
114
124
  <p><code>POST /projects/1/todolists.json</code></p>
115
- <pre><code>client.projects(123).todolists.create!(name: &#39;My todolist&#39;, description: &#39;This is a todolist&#39;)</code></pre>
125
+ <pre><code>client.projects(<span class="number">123</span>).todolists.create!(<span class="symbol">name:</span> <span class="string">'My todolist'</span>, <span class="symbol">description:</span> <span class="string">'This is a todolist'</span>)</code></pre>
116
126
  <h4>Update an existing todolist</h4>
117
127
  <p><code>PUT /projects/123/todolists/456.json</code></p>
118
- <pre><code>client.projects(123).todolists(456).update!(name: &#39;Updated todolist&#39;)</code></pre>
128
+ <pre><code>client.projects(<span class="number">123</span>).todolists(<span class="number">456</span>).update!(<span class="symbol">name:</span> <span class="string">'Updated todolist'</span>)</code></pre>
119
129
  <h4>Delete a todolist</h4>
120
130
  <p><code>DELETE /projects/123/todolists/456.json</code></p>
121
- <pre><code>client.projects(123).todolists(456).delete!</code></pre>
131
+ <pre><code>client.projects(<span class="number">123</span>).todolists(<span class="number">456</span>).delete!</code></pre>
122
132
 
123
133
  </div>
124
134
 
@@ -5,7 +5,7 @@
5
5
  <title>response_error.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,17 +56,17 @@
56
56
  <h2>Response Error</h2>
57
57
  <p>If the response whilst fetching a resource is a 4xx or 5xx, Bcx will raise a <code>Bcx::ResponseError</code> exception.</p>
58
58
  <p>Examples:</p>
59
- <pre><code>client.projects.create!(name: &#39;&#39;)
60
- =&gt; Bcx::ResponseError: 422 POST https://basecamp.com/2274488/api/v1/projects.json | Errors: name can&#39;t be blank</code></pre>
59
+ <pre><code>client.projects.create!(<span class="symbol">name:</span> <span class="string">''</span>)
60
+ =&gt; <span class="constant">Bcx::ResponseError</span><span class="symbol">:</span> <span class="number">422</span> <span class="constant">POST</span> <span class="symbol">https:</span>/<span class="regexp">/basecamp.com/</span><span class="number">2274488</span>/api/v1/projects.json | <span class="constant">Errors</span><span class="symbol">:</span> name can<span class="string">'t be blank</code></pre>
61
61
  <p>You can rescue this exception to grab the status, method, URL and errors individually.</p>
62
- <pre><code>begin
63
- client.projects.create!(name: &#39;&#39;)
64
- rescue Bcx::ResponseError =&gt; response
65
- response.method # =&gt; &quot;POST&quot;
66
- response.status # =&gt; 422
67
- response.url # =&gt; &quot;https://basecamp.com/2274488/api/v1/projects.json&quot;
68
- response.errors # =&gt; [&quot;name can&#39;t be blank&quot;]
69
- end</code></pre>
62
+ <pre><code><span class="keyword">begin</span>
63
+ client.projects.create!(<span class="symbol">name:</span> <span class="string">''</span>)
64
+ <span class="keyword">rescue</span> <span class="constant">Bcx::ResponseError</span> =&gt; response
65
+ response.method <span class="comment"># =&gt; "POST"</span>
66
+ response.status <span class="comment"># =&gt; 422</span>
67
+ response.url <span class="comment"># =&gt; "https://basecamp.com/2274488/api/v1/projects.json"</span>
68
+ response.errors <span class="comment"># =&gt; ["name can't be blank"]</span>
69
+ <span class="keyword">end</span></code></pre>
70
70
 
71
71
  </div>
72
72
 
@@ -5,7 +5,7 @@
5
5
  <title>version.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>
@@ -57,7 +57,7 @@
57
57
  </div>
58
58
 
59
59
  <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
60
- <span class="constant">VERSION</span> = <span class="string">"0.2.0"</span>
60
+ <span class="constant">VERSION</span> = <span class="string">"0.2.1"</span>
61
61
  <span class="keyword">end</span></pre></div></div>
62
62
 
63
63
  </li>