bearcat 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/bearcat/client.rb +2 -0
- data/lib/bearcat/client/modules.rb +11 -0
- data/lib/bearcat/version.rb +1 -1
- data/spec/bearcat/client/modules_spec.rb +15 -0
- data/spec/fixtures/modules.json +45 -0
- metadata +6 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTQ4OWY2ZjA4ZmJiMWNlNDkxOGQ4YTNlOGE0YzU4NmQxMWI2ZTA5OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGYxYjM2Y2M1NWEyYjlkOTU5MzQ2ZTU1OThkOTM1NTZkYzI2NTU3Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGIxMTMzNWUwNWI4MWQ5ZWZjNzZmMzg3NzMyN2NiYTcxNDhlZjg4YTJmOTMy
|
10
|
+
MzFkMTUxYTFmNDQ1MzI5NTdiNGU3NjlkMTVjOWZkMGRmNmRiZmY4ZWQ3MWZk
|
11
|
+
OGI0MGY5MDAyNjZiYTMxY2UxYzM4MjcyY2JkNjRhMWRkMWYyMjc=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjlhNTYwOTA3ZWVkYzY3MmIwNDU3YzA3NjA0MTAzMTc0NGFkOWMwNTY0ZGE5
|
14
|
+
ZjM5ZGFiZTdhYzc5MjI3MjhhMDAwNDVlZWY5MmJmMTNiZjE2NDA4YTdhOWJj
|
15
|
+
NjQ0Y2JjOTMxNDQ2MDdiYmFiODJlMTBjODA5YjQzOTc2MWNmNGU=
|
data/lib/bearcat/client.rb
CHANGED
@@ -14,6 +14,7 @@ require 'bearcat/client/reports'
|
|
14
14
|
require 'bearcat/client/accounts'
|
15
15
|
require 'bearcat/client/submissions'
|
16
16
|
require 'bearcat/client/conversations'
|
17
|
+
require 'bearcat/client/modules'
|
17
18
|
|
18
19
|
module Bearcat
|
19
20
|
class Client < Footrest::Client
|
@@ -32,6 +33,7 @@ module Bearcat
|
|
32
33
|
include Reports
|
33
34
|
include Submissions
|
34
35
|
include Conversations
|
36
|
+
include Modules
|
35
37
|
|
36
38
|
|
37
39
|
# Override Footrest request for ApiArray support
|
data/lib/bearcat/version.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
describe Bearcat::Client::Modules do
|
4
|
+
before do
|
5
|
+
@client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
|
6
|
+
end
|
7
|
+
|
8
|
+
it "returns course modules" do
|
9
|
+
stub_get(@client, "/api/v1/courses/1/modules").to_return(json_response("modules.json"))
|
10
|
+
modules = @client.course_modules(1)
|
11
|
+
modules.count.should == 3
|
12
|
+
modules.first['id'].should == 1
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"id": 1,
|
4
|
+
"name": "First Module",
|
5
|
+
"position": 1,
|
6
|
+
"unlock_at": null,
|
7
|
+
"require_sequential_progress": true,
|
8
|
+
"publish_final_grade": false,
|
9
|
+
"prerequisite_module_ids": [],
|
10
|
+
"state": "completed",
|
11
|
+
"completed_at": "2014-04-18T19:14:37Z",
|
12
|
+
"items_count": 1,
|
13
|
+
"items_url": "http://localhost:3000/api/v1/courses/1384/modules/1/items"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"id": 2,
|
17
|
+
"name": "Second Module",
|
18
|
+
"position": 2,
|
19
|
+
"unlock_at": null,
|
20
|
+
"require_sequential_progress": true,
|
21
|
+
"publish_final_grade": false,
|
22
|
+
"prerequisite_module_ids": [
|
23
|
+
1
|
24
|
+
],
|
25
|
+
"state": "completed",
|
26
|
+
"completed_at": "2014-04-18T19:38:01Z",
|
27
|
+
"items_count": 1,
|
28
|
+
"items_url": "http://localhost:3000/api/v1/courses/1384/modules/2/items"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"id": 3,
|
32
|
+
"name": "Last Module",
|
33
|
+
"position": 3,
|
34
|
+
"unlock_at": null,
|
35
|
+
"require_sequential_progress": true,
|
36
|
+
"publish_final_grade": false,
|
37
|
+
"prerequisite_module_ids": [
|
38
|
+
2
|
39
|
+
],
|
40
|
+
"state": "completed",
|
41
|
+
"completed_at": "2014-04-18T19:38:14Z",
|
42
|
+
"items_count": 1,
|
43
|
+
"items_url": "http://localhost:3000/api/v1/courses/1384/modules/3/items"
|
44
|
+
}
|
45
|
+
]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bearcat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Mills, Jake Sorce
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/bearcat/client/courses.rb
|
115
115
|
- lib/bearcat/client/enrollments.rb
|
116
116
|
- lib/bearcat/client/groups.rb
|
117
|
+
- lib/bearcat/client/modules.rb
|
117
118
|
- lib/bearcat/client/o_auth2.rb
|
118
119
|
- lib/bearcat/client/outcome_groups.rb
|
119
120
|
- lib/bearcat/client/outcomes.rb
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- spec/bearcat/client/courses_spec.rb
|
130
131
|
- spec/bearcat/client/enrollments_spec.rb
|
131
132
|
- spec/bearcat/client/groups_spec.rb
|
133
|
+
- spec/bearcat/client/modules_spec.rb
|
132
134
|
- spec/bearcat/client/o_auth2_spec.rb
|
133
135
|
- spec/bearcat/client/outcome_groups_spec.rb
|
134
136
|
- spec/bearcat/client/outcomes_spec.rb
|
@@ -164,6 +166,7 @@ files:
|
|
164
166
|
- spec/fixtures/enroll_student.json
|
165
167
|
- spec/fixtures/group_conferences.json
|
166
168
|
- spec/fixtures/link_unlink_outcome.json
|
169
|
+
- spec/fixtures/modules.json
|
167
170
|
- spec/fixtures/no_custom_data.json
|
168
171
|
- spec/fixtures/outcome_group_import.json
|
169
172
|
- spec/fixtures/outcome_groups.json
|
@@ -217,6 +220,7 @@ test_files:
|
|
217
220
|
- spec/bearcat/client/courses_spec.rb
|
218
221
|
- spec/bearcat/client/enrollments_spec.rb
|
219
222
|
- spec/bearcat/client/groups_spec.rb
|
223
|
+
- spec/bearcat/client/modules_spec.rb
|
220
224
|
- spec/bearcat/client/o_auth2_spec.rb
|
221
225
|
- spec/bearcat/client/outcome_groups_spec.rb
|
222
226
|
- spec/bearcat/client/outcomes_spec.rb
|
@@ -252,6 +256,7 @@ test_files:
|
|
252
256
|
- spec/fixtures/enroll_student.json
|
253
257
|
- spec/fixtures/group_conferences.json
|
254
258
|
- spec/fixtures/link_unlink_outcome.json
|
259
|
+
- spec/fixtures/modules.json
|
255
260
|
- spec/fixtures/no_custom_data.json
|
256
261
|
- spec/fixtures/outcome_group_import.json
|
257
262
|
- spec/fixtures/outcome_groups.json
|