bearcat 0.9.15 → 0.9.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,6 +19,7 @@ module Bearcat
19
19
  require 'bearcat/client/modules'
20
20
  require 'bearcat/client/canvas_files'
21
21
  require 'bearcat/client/calendar_events'
22
+ require 'bearcat/client/discussions'
22
23
 
23
24
  include Assignments
24
25
  include Accounts
@@ -37,6 +38,7 @@ module Bearcat
37
38
  include Modules
38
39
  include CanvasFiles
39
40
  include CalendarEvents
41
+ include Discussions
40
42
 
41
43
 
42
44
  # Override Footrest request for ApiArray support
@@ -0,0 +1,11 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module Discussions
4
+
5
+ def create_group_discussion(group_id, params = {})
6
+ post("/api/v1/groups/#{group_id}/discussion_topics", params)
7
+ end
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,20 @@
1
+ module Bearcat
2
+ class Client < Footrest::Client
3
+ module SisImports
4
+
5
+ def sis_imports(account, params = {})
6
+ post("/api/v1/accounts/#{account}/sis_imports", params)
7
+ end
8
+
9
+ def get_sis_imports(account)
10
+ binding.pry
11
+ get("/api/v1/accounts/#{account}/sis_imports")
12
+ end
13
+
14
+ def import_status(account, import_id)
15
+ get("/api/v1/accounts/#{account}/sis_imports/#{import_id}")
16
+ end
17
+
18
+ end
19
+ end
20
+ end
@@ -1,3 +1,3 @@
1
1
  module Bearcat
2
- VERSION = '0.9.15' unless defined?(Bearcat::VERSION)
2
+ VERSION = '0.9.16' unless defined?(Bearcat::VERSION)
3
3
  end
@@ -0,0 +1,15 @@
1
+ require 'helper'
2
+
3
+ describe Bearcat::Client::Discussions do
4
+ before do
5
+ @client = Bearcat::Client.new(prefix: "http://canvas.instructure.com", token: "test_token")
6
+ end
7
+
8
+ it "creates a new group discussion" do
9
+ title = "This is a group discussion"
10
+ stub_post(@client, "/api/v1/groups/2/discussion_topics").with(body: {"title" => title}).to_return(json_response("create_group_discussion.json"))
11
+ discussion = @client.create_group_discussion(2, {'title' => title})
12
+ discussion['title'].should == 'This is a group discussion'
13
+ end
14
+
15
+ end
@@ -0,0 +1,44 @@
1
+ {
2
+ "assignment_id": null,
3
+ "delayed_post_at": null,
4
+ "discussion_type": "side_comment",
5
+ "id": 43,
6
+ "last_reply_at": "2014-07-31T22:30:41Z",
7
+ "lock_at": null,
8
+ "podcast_has_student_posts": null,
9
+ "position": null,
10
+ "posted_at": "2014-07-31T22:30:41Z",
11
+ "root_topic_id": null,
12
+ "title": "This is a group discussion",
13
+ "user_name": "test user",
14
+ "discussion_subentry_count": 0,
15
+ "permissions": {
16
+ "attach": false,
17
+ "update": true,
18
+ "delete": true
19
+ },
20
+ "message": null,
21
+ "require_initial_post": null,
22
+ "user_can_see_posts": true,
23
+ "podcast_url": null,
24
+ "read_state": "read",
25
+ "unread_count": 0,
26
+ "subscribed": true,
27
+ "topic_children": [],
28
+ "attachments": [],
29
+ "published": false,
30
+ "can_unpublish": true,
31
+ "locked": false,
32
+ "author": {
33
+ "id": 1,
34
+ "display_name": "test_user",
35
+ "avatar_image_url": "https://secure.gravatar.com/avatar/avatar-50.png",
36
+ "html_url": "http://localhost:3000/groups/2/users/1"
37
+ },
38
+ "html_url": "http://localhost:3000/groups/2/discussion_topics/43",
39
+ "url": "http://localhost:3000/groups/2/discussion_topics/43",
40
+ "pinned": false,
41
+ "group_category_id": null,
42
+ "can_group": true,
43
+ "locked_for_user": false
44
+ }
metadata CHANGED
@@ -1,46 +1,52 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bearcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15
4
+ version: 0.9.16
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Nathan Mills, Jake Sorce
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-06-18 00:00:00.000000000 Z
12
+ date: 2014-07-31 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rake
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - '>='
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - '>='
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: bundler
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - '>='
35
+ - - ! '>='
32
36
  - !ruby/object:Gem::Version
33
37
  version: 1.0.0
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - '>='
43
+ - - ! '>='
39
44
  - !ruby/object:Gem::Version
40
45
  version: 1.0.0
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -55,29 +62,33 @@ dependencies:
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: webmock
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - '>='
67
+ - - ! '>='
60
68
  - !ruby/object:Gem::Version
61
69
  version: '0'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - '>='
75
+ - - ! '>='
67
76
  - !ruby/object:Gem::Version
68
77
  version: '0'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: footrest
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - '>='
83
+ - - ! '>='
74
84
  - !ruby/object:Gem::Version
75
85
  version: 0.2.2
76
86
  type: :runtime
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - '>='
91
+ - - ! '>='
81
92
  - !ruby/object:Gem::Version
82
93
  version: 0.2.2
83
94
  description: Ruby interface for interacting with the canvas API
@@ -98,6 +109,7 @@ files:
98
109
  - lib/bearcat/client/conferences.rb
99
110
  - lib/bearcat/client/conversations.rb
100
111
  - lib/bearcat/client/courses.rb
112
+ - lib/bearcat/client/discussions.rb
101
113
  - lib/bearcat/client/enrollments.rb
102
114
  - lib/bearcat/client/groups.rb
103
115
  - lib/bearcat/client/modules.rb
@@ -106,6 +118,7 @@ files:
106
118
  - lib/bearcat/client/outcomes.rb
107
119
  - lib/bearcat/client/reports.rb
108
120
  - lib/bearcat/client/sections.rb
121
+ - lib/bearcat/client/sis_imports.rb
109
122
  - lib/bearcat/client/submissions.rb
110
123
  - lib/bearcat/client/users.rb
111
124
  - lib/bearcat/client.rb
@@ -118,6 +131,7 @@ files:
118
131
  - spec/bearcat/client/conferences_spec.rb
119
132
  - spec/bearcat/client/conversations_spec.rb
120
133
  - spec/bearcat/client/courses_spec.rb
134
+ - spec/bearcat/client/discussions_spec.rb
121
135
  - spec/bearcat/client/enrollments_spec.rb
122
136
  - spec/bearcat/client/groups_spec.rb
123
137
  - spec/bearcat/client/modules_spec.rb
@@ -149,6 +163,7 @@ files:
149
163
  - spec/fixtures/course_groups.json
150
164
  - spec/fixtures/course_sections.json
151
165
  - spec/fixtures/course_students.json
166
+ - spec/fixtures/create_group_discussion.json
152
167
  - spec/fixtures/create_outcome_in_group.json
153
168
  - spec/fixtures/create_section.json
154
169
  - spec/fixtures/created_assignment.json
@@ -189,26 +204,27 @@ files:
189
204
  - spec/helper.rb
190
205
  homepage:
191
206
  licenses: []
192
- metadata: {}
193
207
  post_install_message:
194
208
  rdoc_options: []
195
209
  require_paths:
196
210
  - lib
197
211
  required_ruby_version: !ruby/object:Gem::Requirement
212
+ none: false
198
213
  requirements:
199
- - - '>='
214
+ - - ! '>='
200
215
  - !ruby/object:Gem::Version
201
216
  version: '0'
202
217
  required_rubygems_version: !ruby/object:Gem::Requirement
218
+ none: false
203
219
  requirements:
204
- - - '>='
220
+ - - ! '>='
205
221
  - !ruby/object:Gem::Version
206
222
  version: '0'
207
223
  requirements: []
208
224
  rubyforge_project:
209
- rubygems_version: 2.0.14
225
+ rubygems_version: 1.8.23
210
226
  signing_key:
211
- specification_version: 4
227
+ specification_version: 3
212
228
  summary: Canvas API
213
229
  test_files:
214
230
  - spec/bearcat/client/accounts_spec.rb
@@ -218,6 +234,7 @@ test_files:
218
234
  - spec/bearcat/client/conferences_spec.rb
219
235
  - spec/bearcat/client/conversations_spec.rb
220
236
  - spec/bearcat/client/courses_spec.rb
237
+ - spec/bearcat/client/discussions_spec.rb
221
238
  - spec/bearcat/client/enrollments_spec.rb
222
239
  - spec/bearcat/client/groups_spec.rb
223
240
  - spec/bearcat/client/modules_spec.rb
@@ -249,6 +266,7 @@ test_files:
249
266
  - spec/fixtures/course_groups.json
250
267
  - spec/fixtures/course_sections.json
251
268
  - spec/fixtures/course_students.json
269
+ - spec/fixtures/create_group_discussion.json
252
270
  - spec/fixtures/create_outcome_in_group.json
253
271
  - spec/fixtures/create_section.json
254
272
  - spec/fixtures/created_assignment.json
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: bb7b01c358bf88f7022d0d757bc836833e42b647
4
- data.tar.gz: 2692cb4f5e9edd485b40df6b10e9fecf7dd0781d
5
- SHA512:
6
- metadata.gz: f14f32fb6750344a9858d42565155a00ec8699241d941d316fb58be597bd4292d3e530ec59ed8227b9d2b48cf06e2b5fc6e16cd71a18a82af9596c6fc9dc660d
7
- data.tar.gz: 3a0e046b1e5b384798a2e9e44623feed69d9cb44dc30ed3dde77ed6ecd08550c9275f052b71c48616f0aba3bdb641b36749b2af260302ab4e4ac3a3dd97e6d94