bcx 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/.travis.yml +6 -0
  2. data/README.md +57 -4
  3. data/docs/bcx.html +171 -0
  4. data/docs/configuration.html +128 -0
  5. data/docs/docco.css +500 -0
  6. data/docs/http.html +125 -0
  7. data/docs/oauth.html +127 -0
  8. data/docs/person.html +125 -0
  9. data/docs/project.html +143 -0
  10. data/docs/public/fonts/aller-bold.eot +0 -0
  11. data/docs/public/fonts/aller-bold.ttf +0 -0
  12. data/docs/public/fonts/aller-bold.woff +0 -0
  13. data/docs/public/fonts/aller-light.eot +0 -0
  14. data/docs/public/fonts/aller-light.ttf +0 -0
  15. data/docs/public/fonts/aller-light.woff +0 -0
  16. data/docs/public/fonts/fleurons.eot +0 -0
  17. data/docs/public/fonts/fleurons.ttf +0 -0
  18. data/docs/public/fonts/fleurons.woff +0 -0
  19. data/docs/public/fonts/novecento-bold.eot +0 -0
  20. data/docs/public/fonts/novecento-bold.ttf +0 -0
  21. data/docs/public/fonts/novecento-bold.woff +0 -0
  22. data/docs/public/images/gray.png +0 -0
  23. data/docs/public/stylesheets/normalize.css +375 -0
  24. data/docs/response_error.html +117 -0
  25. data/docs/todo.html +138 -0
  26. data/docs/todolist.html +148 -0
  27. data/docs/version.html +103 -0
  28. data/lib/bcx/client/http.rb +25 -0
  29. data/lib/bcx/client/oauth.rb +27 -0
  30. data/lib/bcx/resources/person.rb +30 -7
  31. data/lib/bcx/resources/project.rb +7 -10
  32. data/lib/bcx/resources/todolist.rb +11 -4
  33. data/lib/bcx/version.rb +1 -1
  34. data/lib/bcx.rb +12 -1
  35. data/spec/bcx/client_spec.rb +24 -19
  36. data/spec/bcx/person_spec.rb +55 -0
  37. data/spec/bcx/project_spec.rb +1 -1
  38. data/spec/bcx/todo_spec.rb +43 -0
  39. data/spec/bcx/todolist_spec.rb +19 -3
  40. data/spec/cassettes/Bcx_Client/error_handling/should_raise_exception.yml +56 -0
  41. data/spec/cassettes/Bcx_Resources_Person/DELETE_/people/4904728_json/should_delete_a_todolist.yml +101 -0
  42. data/spec/cassettes/Bcx_Resources_Person/GET_/people/4666033_json/should_have_the_correct_id.yml +58 -0
  43. data/spec/cassettes/Bcx_Resources_Person/GET_/people/4666033_json/should_return_a_hash.yml +58 -0
  44. data/spec/cassettes/Bcx_Resources_Person/GET_/people/me_json/should_have_assigned_todos.yml +58 -0
  45. data/spec/cassettes/Bcx_Resources_Person/GET_/people/me_json/should_have_the_correct_id.yml +58 -0
  46. data/spec/cassettes/Bcx_Resources_Person/GET_/people/me_json/should_return_a_hash.yml +58 -0
  47. data/spec/cassettes/Bcx_Resources_Person/GET_/people_json/first_person_should_have_the_correct_id.yml +56 -0
  48. data/spec/cassettes/Bcx_Resources_Person/GET_/people_json/should_be_an_array.yml +56 -0
  49. data/spec/cassettes/Bcx_Resources_Todo/DELETE_/projects/2951531/todos/48545200_json/should_delete_the_given_todo.yml +101 -0
  50. data/spec/cassettes/Bcx_Resources_Todo/GET_/projects/2951531/todos/48545200_json/should_have_the_correct_id.yml +61 -0
  51. data/spec/cassettes/Bcx_Resources_Todo/GET_/projects/2951531/todos/48545200_json/should_return_a_hash.yml +61 -0
  52. data/spec/cassettes/Bcx_Resources_Todo/POST_/projects/2951531/todolists/2951531/todos_json/should_create_a_new_todo.yml +56 -0
  53. data/spec/cassettes/Bcx_Resources_Todo/POST_/projects/2951531/todolists/8268819/todos_json/should_create_a_new_todo.yml +62 -0
  54. data/spec/cassettes/Bcx_Resources_Todo/PUT_/projects/2951531/todos/48545200_json/should_update_an_existing_todo.yml +61 -0
  55. data/spec/cassettes/Bcx_Resources_Todolist/DELETE_/projects/2956584/todolists/8268819_json/should_create_a_new_todolist.yml +66 -0
  56. data/spec/cassettes/Bcx_Resources_Todolist/DELETE_/projects/2956584/todolists/8268819_json/should_delete_a_todolist.yml +101 -0
  57. data/spec/cassettes/Bcx_Resources_Todolist/POST_/projects/123/todolists_json/should_create_a_new_todolist.yml +62 -0
  58. data/spec/cassettes/Bcx_Resources_Todolist/PUT_/projects/2956584/todolists/8268819_json/should_create_a_new_todolist.yml +186 -0
  59. metadata +88 -14
  60. data/lib/bcx/client.rb +0 -24
data/docs/oauth.html ADDED
@@ -0,0 +1,127 @@
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
+ bcx.rb
24
+ </a>
25
+
26
+
27
+ <a class="source" href="http.html">
28
+ http.rb
29
+ </a>
30
+
31
+
32
+ <a class="source" href="oauth.html">
33
+ oauth.rb
34
+ </a>
35
+
36
+
37
+ <a class="source" href="configuration.html">
38
+ configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="person.html">
43
+ person.rb
44
+ </a>
45
+
46
+
47
+ <a class="source" href="project.html">
48
+ project.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="todo.html">
53
+ todo.rb
54
+ </a>
55
+
56
+
57
+ <a class="source" href="todolist.html">
58
+ todolist.rb
59
+ </a>
60
+
61
+
62
+ <a class="source" href="response_error.html">
63
+ response_error.rb
64
+ </a>
65
+
66
+
67
+ <a class="source" href="version.html">
68
+ version.rb
69
+ </a>
70
+
71
+ </div>
72
+ </li>
73
+ </ul>
74
+
75
+ <ul class="sections">
76
+
77
+ <li id="title">
78
+ <div class="annotation">
79
+ <h1>oauth.rb</h1>
80
+ </div>
81
+ </li>
82
+
83
+
84
+
85
+ <li id="section-1">
86
+ <div class="annotation">
87
+
88
+ <div class="pilwrap ">
89
+ <a class="pilcrow" href="#section-1">&#182;</a>
90
+ </div>
91
+
92
+ </div>
93
+
94
+ <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
95
+ <span class="class"><span class="keyword">module</span> <span class="title">Client</span></span>
96
+ <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>
97
+ method <span class="symbol">:oauth</span>
98
+
99
+ extension <span class="symbol">:json</span>
100
+ encode_post_data_with <span class="symbol">:json</span>
101
+
102
+ raise_errors
103
+
104
+ resource <span class="symbol">:projects</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Project'</span>
105
+ resource <span class="symbol">:todolists</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Todolist'</span>
106
+ resource <span class="symbol">:people</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Person'</span>
107
+
108
+ <span class="function"><span class="keyword">def</span> <span class="title">initialize</span><span class="params">(options = {})</span></span>
109
+ <span class="variable">@account</span> = <span class="constant">Bcx</span>.configuration.account
110
+ <span class="variable">@api_version</span> = <span class="constant">Bcx</span>.configuration.api_version
111
+
112
+ options[<span class="symbol">:site</span>] = <span class="string">"https://basecamp.com/<span class="subst">#{<span class="variable">@account</span>}</span>/api/<span class="subst">#{<span class="variable">@api_version</span>}</span>"</span>
113
+ options[<span class="symbol">:uid</span>] ||= options[<span class="symbol">:client_id</span>]
114
+ options[<span class="symbol">:secret</span>] ||= options[<span class="symbol">:client_secret</span>]
115
+
116
+ <span class="keyword">super</span>(options)
117
+ <span class="keyword">end</span>
118
+ <span class="keyword">end</span>
119
+ <span class="keyword">end</span>
120
+ <span class="keyword">end</span></pre></div></div>
121
+
122
+ </li>
123
+
124
+ </ul>
125
+ </div>
126
+ </body>
127
+ </html>
data/docs/person.html ADDED
@@ -0,0 +1,125 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>person.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
+ bcx.rb
24
+ </a>
25
+
26
+
27
+ <a class="source" href="http.html">
28
+ http.rb
29
+ </a>
30
+
31
+
32
+ <a class="source" href="oauth.html">
33
+ oauth.rb
34
+ </a>
35
+
36
+
37
+ <a class="source" href="configuration.html">
38
+ configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="person.html">
43
+ person.rb
44
+ </a>
45
+
46
+
47
+ <a class="source" href="project.html">
48
+ project.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="todo.html">
53
+ todo.rb
54
+ </a>
55
+
56
+
57
+ <a class="source" href="todolist.html">
58
+ todolist.rb
59
+ </a>
60
+
61
+
62
+ <a class="source" href="response_error.html">
63
+ response_error.rb
64
+ </a>
65
+
66
+
67
+ <a class="source" href="version.html">
68
+ version.rb
69
+ </a>
70
+
71
+ </div>
72
+ </li>
73
+ </ul>
74
+
75
+ <ul class="sections">
76
+
77
+ <li id="title">
78
+ <div class="annotation">
79
+ <h1>person.rb</h1>
80
+ </div>
81
+ </li>
82
+
83
+
84
+
85
+ <li id="section-1">
86
+ <div class="annotation">
87
+
88
+ <div class="pilwrap ">
89
+ <a class="pilcrow" href="#section-1">&#182;</a>
90
+ </div>
91
+ <p><code>Bcx::Resources::Person</code>
92
+ Provides access to people resource</p>
93
+ <h4>Get all people on the account</h4>
94
+ <p><code>GET /people.json</code></p>
95
+ <pre><code>client.people!</code></pre>
96
+ <h4>Get a person</h4>
97
+ <p><code>GET /people/123.json</code></p>
98
+ <pre><code>client.people!(123)</code></pre>
99
+ <h4>Get the current person</h4>
100
+ <p><code>GET /people/me.json</code></p>
101
+ <pre><code>client.people.me!</code></pre>
102
+ <h4>Get assigned todos for a person</h4>
103
+ <p><code>GET /people/1/assigned_todos.json</code></p>
104
+ <pre><code>client.people(1).assigned_todos</code></pre>
105
+ <h4>Delete a person</h4>
106
+ <p><code>DELETE /people/123.json</code></p>
107
+ <pre><code>client.people(123).delete!</code></pre>
108
+
109
+ </div>
110
+
111
+ <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
112
+ <span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span>
113
+ <span class="class"><span class="keyword">class</span> <span class="title">Person</span> <span class="inheritance">&lt; <span class="parent">Rapidash::Base</span></span></span>
114
+ url <span class="symbol">:people</span>
115
+ collection <span class="symbol">:me</span>
116
+ <span class="keyword">end</span>
117
+ <span class="keyword">end</span>
118
+ <span class="keyword">end</span></pre></div></div>
119
+
120
+ </li>
121
+
122
+ </ul>
123
+ </div>
124
+ </body>
125
+ </html>
data/docs/project.html ADDED
@@ -0,0 +1,143 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <title>project.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
+ bcx.rb
24
+ </a>
25
+
26
+
27
+ <a class="source" href="http.html">
28
+ http.rb
29
+ </a>
30
+
31
+
32
+ <a class="source" href="oauth.html">
33
+ oauth.rb
34
+ </a>
35
+
36
+
37
+ <a class="source" href="configuration.html">
38
+ configuration.rb
39
+ </a>
40
+
41
+
42
+ <a class="source" href="person.html">
43
+ person.rb
44
+ </a>
45
+
46
+
47
+ <a class="source" href="project.html">
48
+ project.rb
49
+ </a>
50
+
51
+
52
+ <a class="source" href="todo.html">
53
+ todo.rb
54
+ </a>
55
+
56
+
57
+ <a class="source" href="todolist.html">
58
+ todolist.rb
59
+ </a>
60
+
61
+
62
+ <a class="source" href="response_error.html">
63
+ response_error.rb
64
+ </a>
65
+
66
+
67
+ <a class="source" href="version.html">
68
+ version.rb
69
+ </a>
70
+
71
+ </div>
72
+ </li>
73
+ </ul>
74
+
75
+ <ul class="sections">
76
+
77
+ <li id="title">
78
+ <div class="annotation">
79
+ <h1>project.rb</h1>
80
+ </div>
81
+ </li>
82
+
83
+
84
+
85
+ <li id="section-1">
86
+ <div class="annotation">
87
+
88
+ <div class="pilwrap ">
89
+ <a class="pilcrow" href="#section-1">&#182;</a>
90
+ </div>
91
+
92
+ </div>
93
+
94
+ <div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
95
+ <span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span></pre></div></div>
96
+
97
+ </li>
98
+
99
+
100
+ <li id="section-2">
101
+ <div class="annotation">
102
+
103
+ <div class="pilwrap ">
104
+ <a class="pilcrow" href="#section-2">&#182;</a>
105
+ </div>
106
+ <p>Bcx::Resources::Project
107
+ Provides access to projects resoource and other nested resources</p>
108
+ <p>Fetch all projects
109
+ GET /projects.json</p>
110
+ <p> client.projects!</p>
111
+ <p>Fetch archived projects
112
+ GET /projects/archived.json</p>
113
+ <p> clients.projects.archived!</p>
114
+ <p>Fetch single project with ID of 123
115
+ GET /projects/123.json</p>
116
+ <p> client.projects!(123)</p>
117
+ <p>Create a project
118
+ POST /projects.json</p>
119
+ <p> client.projects.create!(name: &#39;Acme project&#39;, description: &#39;This is a new project&#39;)</p>
120
+ <p>Update an existing project
121
+ PUT /projects/123.json</p>
122
+ <p> client.projects(123).update!(description: &#39;A new description&#39;)</p>
123
+ <p>Delete a project
124
+ DELETE /projects/123.json</p>
125
+ <p> client.projects(123).delete!</p>
126
+
127
+ </div>
128
+
129
+ <div class="content"><div class='highlight'><pre> <span class="class"><span class="keyword">class</span> <span class="title">Project</span> <span class="inheritance">&lt; <span class="parent">Rapidash::Base</span></span></span>
130
+ resource <span class="symbol">:todolists</span>
131
+ resource <span class="symbol">:todos</span>
132
+
133
+ collection <span class="symbol">:archived</span>
134
+ <span class="keyword">end</span>
135
+ <span class="keyword">end</span>
136
+ <span class="keyword">end</span></pre></div></div>
137
+
138
+ </li>
139
+
140
+ </ul>
141
+ </div>
142
+ </body>
143
+ </html>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file