bcx 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +17 -1
- data/bcx.gemspec +1 -1
- data/docs/access.html +123 -0
- data/docs/bcx.html +177 -0
- data/docs/configuration.html +9 -27
- data/docs/http.html +134 -0
- data/docs/oauth.html +136 -0
- data/docs/person.html +130 -0
- data/docs/project.html +136 -0
- data/docs/response_error.html +16 -7
- data/docs/todo.html +130 -0
- data/docs/todolist.html +140 -0
- data/docs/version.html +1 -6
- data/lib/bcx.rb +1 -2
- data/lib/bcx/client/http.rb +9 -0
- data/lib/bcx/client/oauth.rb +8 -0
- data/lib/bcx/configuration.rb +10 -9
- data/lib/bcx/resources/access.rb +19 -19
- data/lib/bcx/response_error.rb +20 -0
- data/lib/bcx/version.rb +1 -1
- metadata +51 -37
- data/lib/rapidash/collection.rb +0 -33
data/docs/todolist.html
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title>todolist.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 …</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="access.html">
|
43
|
+
access.rb
|
44
|
+
</a>
|
45
|
+
|
46
|
+
|
47
|
+
<a class="source" href="person.html">
|
48
|
+
person.rb
|
49
|
+
</a>
|
50
|
+
|
51
|
+
|
52
|
+
<a class="source" href="project.html">
|
53
|
+
project.rb
|
54
|
+
</a>
|
55
|
+
|
56
|
+
|
57
|
+
<a class="source" href="todo.html">
|
58
|
+
todo.rb
|
59
|
+
</a>
|
60
|
+
|
61
|
+
|
62
|
+
<a class="source" href="todolist.html">
|
63
|
+
todolist.rb
|
64
|
+
</a>
|
65
|
+
|
66
|
+
|
67
|
+
<a class="source" href="response_error.html">
|
68
|
+
response_error.rb
|
69
|
+
</a>
|
70
|
+
|
71
|
+
|
72
|
+
<a class="source" href="version.html">
|
73
|
+
version.rb
|
74
|
+
</a>
|
75
|
+
|
76
|
+
</div>
|
77
|
+
</li>
|
78
|
+
</ul>
|
79
|
+
|
80
|
+
<ul class="sections">
|
81
|
+
|
82
|
+
<li id="title">
|
83
|
+
<div class="annotation">
|
84
|
+
<h1>todolist.rb</h1>
|
85
|
+
</div>
|
86
|
+
</li>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<li id="section-1">
|
91
|
+
<div class="annotation">
|
92
|
+
|
93
|
+
<div class="pilwrap for-h2">
|
94
|
+
<a class="pilcrow" href="#section-1">¶</a>
|
95
|
+
</div>
|
96
|
+
<h2>Todolists</h2>
|
97
|
+
<p>Provides access to todolist resoource both at the client level and per-project</p>
|
98
|
+
<h4>Get all todolists for a project</h4>
|
99
|
+
<p><code>GET /projects/123/todolists.json</code></p>
|
100
|
+
<pre><code>client.projects(123).todolists!</code></pre>
|
101
|
+
<h4>Get all completed todolists for a project</h4>
|
102
|
+
<p><code>GET /projects/1/todolists/completed.json</code></p>
|
103
|
+
<pre><code>client.projects(123).todolists.completed!</code></pre>
|
104
|
+
<h4>Get todolists for all projects</h4>
|
105
|
+
<p><code>GET /todolists.json</code></p>
|
106
|
+
<pre><code>client.todolists!</code></pre>
|
107
|
+
<h4>Get completed todolists for all projects</h4>
|
108
|
+
<p><code>GET /todolists/completed.json</code></p>
|
109
|
+
<pre><code>client.todolists.completed!</code></pre>
|
110
|
+
<h4>Get specific todolist including the todos</h4>
|
111
|
+
<p><code>GET /projects/123/todolists/456.json</code></p>
|
112
|
+
<pre><code>client.projects(123).todolists!(456)</code></pre>
|
113
|
+
<h4>Create a new todolist</h4>
|
114
|
+
<p><code>POST /projects/1/todolists.json</code></p>
|
115
|
+
<pre><code>client.projects(123).todolists.create!(name: 'My todolist', description: 'This is a todolist')</code></pre>
|
116
|
+
<h4>Update an existing todolist</h4>
|
117
|
+
<p><code>PUT /projects/123/todolists/456.json</code></p>
|
118
|
+
<pre><code>client.projects(123).todolists(456).update!(name: 'Updated todolist')</code></pre>
|
119
|
+
<h4>Delete a todolist</h4>
|
120
|
+
<p><code>DELETE /projects/123/todolists/456.json</code></p>
|
121
|
+
<pre><code>client.projects(123).todolists(456).delete!</code></pre>
|
122
|
+
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
126
|
+
<span class="class"><span class="keyword">module</span> <span class="title">Resources</span></span>
|
127
|
+
<span class="class"><span class="keyword">class</span> <span class="title">Todolist</span> <span class="inheritance">< <span class="parent">Rapidash::Base</span></span></span>
|
128
|
+
resource <span class="symbol">:todos</span>, <span class="symbol">class_name:</span> <span class="string">'Bcx::Resources::Todo'</span>
|
129
|
+
|
130
|
+
collection <span class="symbol">:completed</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>
|
data/docs/version.html
CHANGED
@@ -33,11 +33,6 @@
|
|
33
33
|
version.rb
|
34
34
|
</a>
|
35
35
|
|
36
|
-
|
37
|
-
<a class="source" href="collection.html">
|
38
|
-
collection.rb
|
39
|
-
</a>
|
40
|
-
|
41
36
|
</div>
|
42
37
|
</li>
|
43
38
|
</ul>
|
@@ -62,7 +57,7 @@
|
|
62
57
|
</div>
|
63
58
|
|
64
59
|
<div class="content"><div class='highlight'><pre><span class="class"><span class="keyword">module</span> <span class="title">Bcx</span></span>
|
65
|
-
<span class="constant">VERSION</span> = <span class="string">"0.
|
60
|
+
<span class="constant">VERSION</span> = <span class="string">"0.2.0"</span>
|
66
61
|
<span class="keyword">end</span></pre></div></div>
|
67
62
|
|
68
63
|
</li>
|
data/lib/bcx.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
require 'rapidash'
|
2
|
-
require 'rapidash/collection'
|
3
2
|
require 'bcx/version'
|
4
3
|
|
5
4
|
# ## Bcx
|
6
5
|
# Fully-fledged Ruby API wrapper for Basecamp Next
|
7
6
|
#
|
8
|
-
#
|
7
|
+
# See the [README](https://github.com/paulspringett/bcx#readme) for usage
|
9
8
|
#
|
10
9
|
module Bcx
|
11
10
|
autoload :Configuration, 'bcx/configuration'
|
data/lib/bcx/client/http.rb
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
# ## HTTP Client
|
2
|
+
#
|
3
|
+
# Provides a client to access the Basecamp Next API using HTTP authentication
|
4
|
+
#
|
5
|
+
#
|
6
|
+
# Example:
|
7
|
+
#
|
8
|
+
# client = Bcx::Client::HTTP.new(login: 'username', password: 'secret')
|
9
|
+
#
|
1
10
|
module Bcx
|
2
11
|
module Client
|
3
12
|
class HTTP < Rapidash::Client
|
data/lib/bcx/client/oauth.rb
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
# ## Oauth Client
|
2
|
+
#
|
3
|
+
# Provides a client to access the Basecamp Next API via OAuth credentials
|
4
|
+
#
|
5
|
+
# Example:
|
6
|
+
#
|
7
|
+
# client = Bcx::Client::OAuth.new(client_id: '1234567890', client_secret: '831994c4170', access_token: 'b02ff9345c3')
|
8
|
+
#
|
1
9
|
module Bcx
|
2
10
|
module Client
|
3
11
|
class OAuth < Rapidash::Client
|
data/lib/bcx/configuration.rb
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
+
# ## Configuration
|
2
|
+
#
|
3
|
+
# Provides a configuration block for setting up the Bcx client
|
4
|
+
#
|
5
|
+
# Example:
|
6
|
+
#
|
7
|
+
# Bcx.configure do |config|
|
8
|
+
# config.account = '1234567890'
|
9
|
+
# end
|
10
|
+
#
|
1
11
|
module Bcx
|
2
|
-
|
3
|
-
# Bcx::Configuration
|
4
|
-
# Provides a configuration block for setting up the Bcx client
|
5
|
-
# Example:
|
6
|
-
#
|
7
|
-
# Bcx.configure do |config|
|
8
|
-
# config.account = '1234567890'
|
9
|
-
# end
|
10
|
-
#
|
11
12
|
class Configuration
|
12
13
|
attr_accessor :account, :api_version
|
13
14
|
|
data/lib/bcx/resources/access.rb
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
+
# Bcx::Resources::Access
|
2
|
+
#
|
3
|
+
# Provides access to accesses resource at per-project level
|
4
|
+
#
|
5
|
+
# #### Get accesses for a project
|
6
|
+
# `GET /projects/1/accesses.json`
|
7
|
+
#
|
8
|
+
# client.projects(1).accesses!
|
9
|
+
#
|
10
|
+
# #### Grant access
|
11
|
+
# `POST /projects/1/accesses.json`
|
12
|
+
#
|
13
|
+
# client.projects(1).accesses.create!(ids: [ 5, 6, 10])
|
14
|
+
#
|
15
|
+
# #### Revoke access
|
16
|
+
# `DELETE /projects/1/accesses/1.json`
|
17
|
+
#
|
18
|
+
# client.projects(1).accesses(1).delete!
|
19
|
+
#
|
1
20
|
module Bcx
|
2
21
|
module Resources
|
3
|
-
|
4
|
-
# Bcx::Resources::Access
|
5
|
-
# Provides access to accesses resource at per-project level
|
6
|
-
#
|
7
|
-
# Get accesses for a project
|
8
|
-
# GET /projects/1/accesses.json
|
9
|
-
#
|
10
|
-
# client.projects(1).accesses!
|
11
|
-
#
|
12
|
-
# Grant access
|
13
|
-
# POST /projects/1/accesses.json
|
14
|
-
#
|
15
|
-
# client.projects(1).accesses.create!(ids: [ 5, 6, 10])
|
16
|
-
#
|
17
|
-
# Revoke access
|
18
|
-
# DELETE /projects/1/accesses/1.json
|
19
|
-
#
|
20
|
-
# client.projects(1).accesses(1).delete!
|
21
|
-
#
|
22
22
|
class Access < Rapidash::Base
|
23
23
|
|
24
24
|
end
|
data/lib/bcx/response_error.rb
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# ## Response Error
|
2
|
+
#
|
3
|
+
# If the response whilst fetching a resource is a 4xx or 5xx, Bcx will raise a `Bcx::ResponseError` exception.
|
4
|
+
#
|
5
|
+
# Examples:
|
6
|
+
#
|
7
|
+
# client.projects.create!(name: '')
|
8
|
+
# => Bcx::ResponseError: 422 POST https://basecamp.com/2274488/api/v1/projects.json | Errors: name can't be blank
|
9
|
+
#
|
10
|
+
# You can rescue this exception to grab the status, method, URL and errors individually.
|
11
|
+
#
|
12
|
+
# begin
|
13
|
+
# client.projects.create!(name: '')
|
14
|
+
# rescue Bcx::ResponseError => response
|
15
|
+
# response.method # => "POST"
|
16
|
+
# response.status # => 422
|
17
|
+
# response.url # => "https://basecamp.com/2274488/api/v1/projects.json"
|
18
|
+
# response.errors # => ["name can't be blank"]
|
19
|
+
# end
|
20
|
+
#
|
1
21
|
module Bcx
|
2
22
|
class ResponseError < Rapidash::ResponseError
|
3
23
|
|
data/lib/bcx/version.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Paul Springett
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-25 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rapidash
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.3.0
|
19
|
+
version: 0.3.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.3.0
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rake
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - '>='
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: '0'
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: rspec
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: '0'
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: simplecov
|
49
|
-
requirement:
|
50
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
type: :development
|
56
63
|
prerelease: false
|
57
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: vcr
|
60
|
-
requirement:
|
61
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
62
72
|
requirements:
|
63
|
-
- -
|
73
|
+
- - '>='
|
64
74
|
- !ruby/object:Gem::Version
|
65
75
|
version: '0'
|
66
76
|
type: :development
|
67
77
|
prerelease: false
|
68
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Fully-fledged Ruby API wrapper for Basecamp Next
|
70
84
|
email:
|
71
85
|
- paul@springett.me
|
@@ -81,9 +95,15 @@ files:
|
|
81
95
|
- README.md
|
82
96
|
- Rakefile
|
83
97
|
- bcx.gemspec
|
98
|
+
- docs/access.html
|
99
|
+
- docs/bcx.html
|
84
100
|
- docs/collection.html
|
85
101
|
- docs/configuration.html
|
86
102
|
- docs/docco.css
|
103
|
+
- docs/http.html
|
104
|
+
- docs/oauth.html
|
105
|
+
- docs/person.html
|
106
|
+
- docs/project.html
|
87
107
|
- docs/public/fonts/aller-bold.eot
|
88
108
|
- docs/public/fonts/aller-bold.ttf
|
89
109
|
- docs/public/fonts/aller-bold.woff
|
@@ -95,6 +115,8 @@ files:
|
|
95
115
|
- docs/public/fonts/novecento-bold.woff
|
96
116
|
- docs/public/stylesheets/normalize.css
|
97
117
|
- docs/response_error.html
|
118
|
+
- docs/todo.html
|
119
|
+
- docs/todolist.html
|
98
120
|
- docs/version.html
|
99
121
|
- lib/bcx.rb
|
100
122
|
- lib/bcx/client/http.rb
|
@@ -107,7 +129,6 @@ files:
|
|
107
129
|
- lib/bcx/resources/todolist.rb
|
108
130
|
- lib/bcx/response_error.rb
|
109
131
|
- lib/bcx/version.rb
|
110
|
-
- lib/rapidash/collection.rb
|
111
132
|
- lib/tasks/docs.rake
|
112
133
|
- spec/bcx/access_spec.rb
|
113
134
|
- spec/bcx/client_spec.rb
|
@@ -163,33 +184,26 @@ files:
|
|
163
184
|
- spec/spec_helper.rb
|
164
185
|
homepage: ''
|
165
186
|
licenses: []
|
187
|
+
metadata: {}
|
166
188
|
post_install_message:
|
167
189
|
rdoc_options: []
|
168
190
|
require_paths:
|
169
191
|
- lib
|
170
192
|
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
-
none: false
|
172
193
|
requirements:
|
173
|
-
- -
|
194
|
+
- - '>='
|
174
195
|
- !ruby/object:Gem::Version
|
175
196
|
version: '0'
|
176
|
-
segments:
|
177
|
-
- 0
|
178
|
-
hash: -1568446484117578099
|
179
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
180
|
-
none: false
|
181
198
|
requirements:
|
182
|
-
- -
|
199
|
+
- - '>='
|
183
200
|
- !ruby/object:Gem::Version
|
184
201
|
version: '0'
|
185
|
-
segments:
|
186
|
-
- 0
|
187
|
-
hash: -1568446484117578099
|
188
202
|
requirements: []
|
189
203
|
rubyforge_project:
|
190
|
-
rubygems_version:
|
204
|
+
rubygems_version: 2.0.2
|
191
205
|
signing_key:
|
192
|
-
specification_version:
|
206
|
+
specification_version: 4
|
193
207
|
summary: Fully-fledged Ruby API wrapper for Basecamp Next. Uses the Rapidash gem under
|
194
208
|
the hood.
|
195
209
|
test_files:
|